It all started with a Ubuntu Blog blog post about a slimmer Ubuntu server image. I play around with virtual machines at home, many based on Ubuntu’s full-size server ISO. It would take 20-25 minutes to spin up a new VM using some prebuilt preseed files I had constructed to automate user creation and SSH key copying. I knew there was a better way, and it turns out, using the pre-built Ubuntu minimal image (subsequently called cloud image), combined with cloud-init infrastructure, I was able to spin up Ubuntu Cloud Image minimal VMs in under 2 minutes.
What did it take?
Two git commits (one including some refactoring of my virtbuilder script):
- https://github.com/jforman/virthelper/commit/c994089488eb97e041de160c6a790907334fe161
- https://github.com/jforman/virthelper/commit/4053a0234cb49ac76f20716ce122fe6442359d3a
What’s the big difference?
- Full-size server ISO install: 21m10s.
- Cloud Image install: 10m57s with cloud image download. 56s when the cloud image is already locally downloaded.
Documentation:
https://gist.github.com/smoser/4756561
- https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
- https://help.ubuntu.com/community/UEC/Images
- https://cloudinit.readthedocs.io/en/latest/topics/modules.html
- https://packetpushers.net/cloud-init-demystified/
Where might you be able to find this handy automation script? https://github.com/jforman/virthelper