-
Notifications
You must be signed in to change notification settings - Fork 15
/
06-cloud-config.txt
60 lines (43 loc) · 1.42 KB
/
06-cloud-config.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Create a cloud-config file to change the default user password.
# http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/cloudinit/config/cc_set_passwords.py
cat >> password-user-data <<EOF
#cloud-config
ssh_pwauth: True
password: passw0rd
chpasswd:
expire: False
EOF
# Boot an instance with the user-data
nova boot --image ubuntu1604 --flavor m1.summit --user-data password-user-data mycloudconfiginstance
# View the console log of the instance
nova console-log mycloudconfiginstance
# Get VNC console
nova get-vnc-console mycloudconfiginstance novnc
# Open the URL in your browser.
# username: ubuntu
# password: passw0rd
# View the configuration file for cloud-init
cat /etc/cloud/cloud.cfg
# View the datasources file
cat /etc/cloud/cloud.cfg.d/90_dpkg.cfg
# View the cloud-init log files
cat /var/log/cloud-init.log
# View all block devices
sudo blkid
# Mount the ConfigDrive
sudo mount /dev/sr0 /mnt
# List contents of the ConfigDrive
ls /mnt/openstack/latest
# View the meta-data
cat /mnt/openstack/latest/meta_data.json | python3 -m json.tool
# View the user-data.
cat /mnt/openstack/latest/user_data
# View the network-data
cat /mnt/openstack/latest/network_data.json | python3 -m json.tool
# View the vendor-data
cat /mnt/openstack/latest/vendor_data.json | python3 -m json.tool
# Log out of instance
exit
######!!!From Your SSH Session!!!######
# Delete the instance
nova delete mycloudconfiginstance