3 ms·
Others have spoken about Vagrant & Puppet. Here's another option. One tool that I love (and happily recommend) in my daily workflow of Linux Virt/Infra develop
by kashyapc 10y ago
Others have spoken about Vagrant & Puppet. Here's another option.
One tool that I love (and happily recommend) in my daily workflow of Linux Virt/Infra development is `virt-builder`[1], it is part of the libguestfs project. Once the compressed image (250MB or so) is cached, it can spin up fresh template VMs (`virt-builder --list` to check the distribution list) just under 40 seconds.
In my workflow (also with headless VMs), I have two qcow2 disk images (& several others on disk) on my devel laptop. They're built / used this way:
Build a minimal disk image:
$ virt-builder fedora-24 -o f24.qcow2 --format qcow2 --size 60G \
--root-password password:secure-pwd
Then, import it into libvirt (NB: despite the tool's name 'virt-install',
it is not installing anything here, but merely importing the disk image):
$ sudo virt-install --name dev-vm1 --ram 4096 --os-variant fedora-24 \
--disk path=./f24.qcow2,format=qcow2 --nographics --import
(The above will be QEMU, if you have hardware virt extensions, it will be a KVM guest).
You could then manipulate it with `virsh`, libvirt (Virt API through which you could manage KVM/QEMU/Xen) shell, to manage snapshots, & other guest life cycle activities.
FWIW, I wrote a bit more verbiage (which also adds a quick note about snapshot management, so you could revert to a known sane state, if something goes haywire) here[2].
You can do far more interesting things with 'virt-builder', by supplying it to install packages you need, trivially creating secure new 'clones', etc.
[1] http://libguestfs.org/virt-builder.1.html http://libguestfs.org/virt-builder.1.html
[2] https://developer.fedoraproject.org/tools/virt-builder/about.html https://developer.fedoraproject.org/tools/virt-builder/about...