fast-vm — script for defining VMs from images provided in thin LVM pool
fast-vm provides command-line interface to create virtual machines (VMs) in libvirt, based on imported disks in LVM and XML templates.
Check the videos below on how to:
user and installation guide: https://www.famera.cz/blog/fast-vm/user_guide.html
man pages:
fast-vm(8)
fast-vm-image(8)
fast-vm.conf(5)
configure-fast-vm(8)
fast-vm-net-cleanup(8)
fast-vm-list(8)
Other resource: https://www.famera.cz/blog/fast-vm/index.html
Distribution Installation method
xmllint
)losetup
to create a loopback device with LVMdhcp_release
for proper DHCP static leases releaseflock
for image locking (prevent use of not fully imported images)bash-completion
for bash completion to workpv
to show import progresscurl
to pass http(s) link for image_importlibguestfs-make-fixed-appliance
to generate system-wide libguestfs appliancesshpass
to try default password first in keydist operationcheck CONTRIBUTING.md
fast-vm is distributed under GPLv3 (or newer if it exists). Author will try to supports only the newest release.
Ondrej Famera ondrej-xa2iel8u@famera.cz
kvm
to use guestfish from hacks filesdhcp_release
to remove DHCP static reservation is not the cleanest
way of doing so, but there is no other supported way of doing this through libvirt
(TODO: make RFE/BUG into libvirt)virsh list
are not handled. For example if virsh list
is called
2 times and second time it fails, then fast-vm doesn't handle that well. Re-running command helps.
This was observed on my testing machine, but I failed to reproduce behaviour.
The logs shows following error around time when this happens
error : virHashForEach:597 : Hash operation not allowed during iteration
configure-fast-vm
as root after upgrade to migrate the metadata to new locationQ: Why is it using LVM?
A: Because LVM provides very reasonable management of block devices and writable snapshots
with thin provisioning.
Q: Why is it not using file-based disk images?
A: It takes much more space.
Q: Why not to use file-based disk images with cow (copy-on-write) image?
A: Because if you change the image, the cow images will get corrupted unless you somehow
re-export them. By using LVM this is not a concern as the LVM is keeping track of changes
and will preserve the changes stuff in snaphost so it is safe to edit base image while having
machines that are based on previous version of the base image.
Q: Why not to use BTRFS cow?
A: BTRFS is not as widely spread as LVM and it is not clear if it would be able to provide same
functionality as LVM. There is possibility that I will look at this in the future.
Q: Are there any similar projects similar to fast-vm?
A: Sure there are, below is a short list of some I run through or I was told about: