Setting Up Cloud-Init

To setup cloudinit on a newly installed Ubuntu Server you must do the following after the basic installation.

Configure a CDROM drive with Cloud-Init:

$ qm set 9000 --ide2 local-lvm:cloudinit

Set the bootdisk parameter to whatever disk you have as disk 0 ONLY (speeds up booting)

Your Cloud-Init modules will most likely be the following:

cloud_config_modules:
snap
snap_config
ubuntu-advantage
disable-ec2-metadata
byobu

cloud_final_modules:
snappy
fan
landscape
lxd
puppet
chef
m-collective 
saltminion
rightscale-userdata
rm /etc/machine-id
touch /etc/machine-id
rm /var/lib/dbus/machine-id
ln -s /etc/machine-id /var/lib/dbus/machine-id
rm -r /var/lib/cloud/seed/nocloud-net

After cloning the VM you’ll be able to change the following parameters:

  • Hostname (from Proxmox “OPTIONS” tab, change the VM name)
  • Change the IP and gateway from Cloud-Init Drive
  • Change Domain and DNS from Cloud-Init Drive