[libvirt-users] KVM guest creation - no manual interference

Hi I've looking for a way to create KVM virtual machines completely automated without the need to interact with guest operating system during installation. With ubuntu-vm-builder is possible create the guest, list packages to be installed and scripts to be run. Is there a way to do something like it with libvirt? Thanks! __ Lucas Arbiza email: lucas.arbiza@gmail.com celular: +55 (55) 9152 7561 <http://br.linkedin.com/in/lucasarbiza> <http://www.google.com/profiles/lucas.arbiza>

On Friday 10 Sep 2010 15:16:14 Lucas Arbiza wrote:
Hi
I've looking for a way to create KVM virtual machines completely automated without the need to interact with guest operating system during installation.
With ubuntu-vm-builder is possible create the guest, list packages to be installed and scripts to be run. Is there a way to do something like it with libvirt?
Thanks!
I wrote Cucumber-VHost for exactly this purpose. We use Cucumber-VHost and puppet as well as cobbler and Hudson to completely automate the build and testing of our configuration files. Cucumber-VHost creates a virtual machine based on it's definition in cobbler and a plain english script invoked by Rake. More details are on my blog at http://www.threedrunkensysadsonthe.net/ and in GitHub: http://github.com/proffalken/cucumber-vhost HTH, M.

On Fri, Sep 10, 2010 at 11:16:14AM -0300, Lucas Arbiza wrote:
I've looking for a way to create KVM virtual machines completely automated without the need to interact with guest operating system during installation.
With ubuntu-vm-builder is possible create the guest, list packages to be installed and scripts to be run. Is there a way to do something like it with libvirt?
I've (just today) achieved this using virt-manager, built on top of libvirt, for centos guests at least, defining a mirror URI for the kernel and initrd images, and a kickstart URL, having written a kickstart script for anaconda and stored it on a webserver ahead of time. <http://virt-manager.et.redhat.com/> virt-manager is packaged in Debian/Ubuntu too. I haven't built any Debian/Ubuntu VMs yet, but I would basically do the same thing but using debconf preseeding for automated Debian installations. -- Jon Dowland

On Fri, Sep 10, 2010 at 11:51 AM, Jon Dowland <jon+libvirt-users@alcopop.org> wrote:
On Fri, Sep 10, 2010 at 11:16:14AM -0300, Lucas Arbiza wrote:
I've looking for a way to create KVM virtual machines completely automated without the need to interact with guest operating system during installation.
With ubuntu-vm-builder is possible create the guest, list packages to be installed and scripts to be run. Is there a way to do something like it with libvirt?
I experimented only briefly with vmbuilder, so I'm no expert. But if what you're asking is how to create libvirt-managed VMs using vmbuilder, I think this page gives you what you need to get started: https://help.ubuntu.com/10.04/serverguide/C/jeos-and-vmbuilder.html
I haven't built any Debian/Ubuntu VMs yet, but I would basically do the same thing but using debconf preseeding for automated Debian installations.
This is what I've done to automate installation of our Ubuntu VMs. I've been using command-line tools rather than virt-manager, so I'm using virt-install to create the VM. By telling virt-install where to look for certain information, I can initiate a fully automatic Ubuntu install. The key arguments to virt-install are these: --location=http://us.archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/ --extra-args="url=http://127.0.0.1/custom.seed" The first one tells virt-install where to find the Ubuntu installer. (You might want to use a local mirror rather than ubuntu.com for anything more than testing.) Pointing directly to the installer rather than at an Ubuntu CD image lets you skip the prompt that you get upon booting the CD before launching the installer. The "extra-args" argument is passed along to the installer, and tells the installer where to look for the debconf preseed file. You'll need to tune that preseed file to exactly what you want. Ubuntu has some good docs to help with that: https://help.ubuntu.com/10.04/installation-guide/amd64/appendix-preseed.html -- Brian P.S. For anyone interested, I've posted the wrapper script I've written to encapsulate the many arguments I pass to virt-install every time: http://robergb.pastebin.com/VkXH2DH3 And here's my preseed file: http://robergb.pastebin.com/9GvHbAyu I welcome any suggestions for improvements.

Thank you for the answers. I'm reading about and studying your suggestions and I will experiment it. After all I will post in this thread my conclusions. More suggestions are welcome. Thank you a lot! __ Lucas Arbiza email: lucas.arbiza@gmail.com celular: +55 (55) 9152 7561 <http://br.linkedin.com/in/lucasarbiza> <http://www.google.com/profiles/lucas.arbiza>
participants (4)
-
Brian Roberg
-
Jon Dowland
-
Lucas Arbiza
-
Matt Wallace