Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 5804  / 1 Year ago, mon, february 6, 2023, 1:49:26

I'm trying to find the best-practice, modern way of doing what I used to do with python-vm-builder (aka ubuntu-vm-builder).



I want a scripted, repeatable way to start from something like ubuntu-core (aka the artist formerly known as JeOS), add some packages, define first-run scripts, etc.



What I'm after is something akin to spinning a custom ISO (although it wont be an ISO, it will be an "installed" system). The result needs to be a kernel, initrd image, and rootfs that is suitable for a diskless PXE boot with NFS.



What tools are used to create say the Ubuntu netboot image (or any Ubuntu images for that matter)? Are they flexible enough for my needs?



How about the tools used to create the fresh-install environments used for the Ubuntu integration testing? Would they be appropriate?



Note that at run time the rootfs will be mounted read-only, so I'm not looking to manage an instance over time. I'm looking to re-spin an automated install at each new Ubuntu release, and periodically in the 6 months between.


More From » vmbuilder

 Answers
6

You can use an official cloud image directly, and then create a small ISO image using cloud-localds (from the cloud-utils package) to use as a "nocloud" data source to cloud-init.



Then you can use cloud-init userdata (example) as a single mechanism to add packages and to run your own first run scripts across cloud providers that provide official Ubuntu Cloud images as well as on your local VMs.



If you run cloud-localds with no parameters, it will display example usage to configure and run a VM using kvm directly.



To run the VM some other way, just supply a cloud image (eg. downloaded from https://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img for 12.04) as the first disk, and present the ISO image output from cloud-localds as a CD-ROM.



More information is in Scott Moser's blog post.


[#32298] Monday, February 6, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tatoethin

Total Points: 377
Total Questions: 110
Total Answers: 98

Location: Saudi Arabia
Member since Sat, Aug 20, 2022
2 Years ago
;