I'm using a KVM/libvirt server which I manage from a web interface, where up until now I've been relying on golden images as templates, where I'd create a new VM from a template, SSH into that, and change its IP and hostname. And that's when I'd begin customizing its applications, etc.
Now, I've decided to start using configuration management, probably Puppet, and feel that anything is possible to automate, except for the actual VM creation.
What I want is a one-click button / one line command / API call, to create a VM on the server, mount the installation media, provide the networking and kickstart options necessary, and proceed to install the server according to the settings I've specified in a manifest of sorts. Of course, it would also need to enable remote management (SSH and Puppet). I don't want any console interaction with the server at all during creation and installation. After installation, I want to recieve the IP and credentials to the VM (in case of DHCP and host specific private key generation) or just a "Done" message.
I know this is doable with RHEL/CentOS and Debian by providing a kickstart/preseed file and specifying IP settings as kernel parameters (right?) but all solutions I've seen are somewhat hacky and would require lots of custom scripting to scale well, but even then I'd be stuck maintaining and extending that script. Some solutions even require modification of the installation media. I'd like something robust but small and simple. I'd rather not depend on an entire stack of enterprise software frameworks to do this relatively simple thing, since I'd manage well with just Puppet, once I got my automatic VM installation working.
I've googled and searched Reddit but although lots of products claim to do this, it's proven hard to find the "here's my one click VM deployment solution" blog posts and videos that I'd expected. I'd like to see a proof of concept before installing and evaluating each solution myself. Any suggestions will be considered, and I appreciate any help.
Edit: I was able to set up Cobbler (on a CentOS 7 VM on my KVM/QEMU server), base a Cobbler distro on the CentOS 7 DVD, create a profile based on this with the basic settings such as memory, CPU cores, DNS server, etc. I made sure the kickstart seemed allright, and proceeded to install Koan on my KVM server (which incidentally runs Debian - I haven't migrated to CentOS yet. Getting Koan to work on Debian took a surprising amount of hacking. I based the install on the Ubuntu packages, including an old version of virt-install which required some modification to the Koan source code to get to work - but it did work) and later proceeded to try an install for the first time - and it didn't work. Turns out the install couldn't run due to RAM shortage, but that took a long time to find out. I didn't get the console menu at first. With 1024 MB RAM for the VM, the install worked perfectly and I've only got a few kinks to work out before I can let Puppet take over from there.
What I'm planning on is a script which takes nothing but a profile name and a server name, picks a free IP from the pool of static IP:s I've got allocated to my VMs, SSHs to the Cobbler server and creates the Cobbler "System", SSHs to the KVM server (if I don't host the script on that server) and runs Koan to boot up the file. Then it would do something to add the newly created server to be managed by Puppet, but I haven't gotten that far yet.
It turned out to be harder than I thought, along with a few disappointments such as Koan not working remotely (I wanted to run Koan from the Cobbler server) and the kind of slow VM install. Still, this does just what I want, and with very little administrative overhead, so I'll run with this. Thanks for all advice and suggestions!
[link][34 comments]