almost 8 years ago
- http://frederik.orellana.dk/booting-ubuntu-14-04-cloud-images-without-a-cloud/
- http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/doc/examples/cloud-config.txt
Steps
Deploy trusty-server-cloudimg-amd64.ova to vSphere, Change the disk size as wish.
Attach the iso or vmdk to Ubuntu VM, Power on guest
Set Up Real user-data and meta-data inside guest
sudo mkdir -p /var/lib/cloud/seed/nocloud
sudo tee /var/lib/cloud/seed/nocloud/meta-data <<EOF
instance-id: ubuntu
local-hostname: ubuntu
EOF
sudo tee /var/lib/cloud/seed/nocloud/user-data <<EOF
#cloud-config
apt_update: true
apt_upgrade: true
#apt_proxy: http://10.0.1.5:8000
apt_sources:
- source: "ppa:git-core/ppa"
packages:
- unattended-upgrades
- squid-deb-proxy-client
- vim
- ntp
- git
timezone: Asia/Taipei
password: ubuntu
chpasswd: { expire: False }
ssh_pwauth: True
runcmd:
- grep $(cat /etc/hostname) /etc/hosts || sudo echo 127.0.0.1 $(cat /etc/hostname) >> /etc/hosts
EOF
- Remove cloud-init instance, which will trigger cloud-init on next booting.
( cd /var/lib/cloud/instance && sudo rm -Rf * )
sudo shutdown -P now
Done!