3 ms·
virt-builder can usually build out a disk image in 15-60 seconds if the template has already been downloaded and you're running on baremetal. Might be 120 seco
by rwmj 6y ago
virt-builder can usually build out a disk image in 15-60 seconds if the template has already been downloaded and you're running on baremetal. Might be 120 seconds if you have to use nested KVM or TCG.
$ virt-builder fedora-33
[ 1.5] Downloading: http://builder.libguestfs.org/fedora-33.xz
[ 2.3] Planning how to build this image
[ 2.3] Uncompressing
[ 8.6] Opening the new disk
[ 13.8] Setting a random seed
[ 13.8] Setting passwords
virt-builder: Setting random password of root to mZbPJw9d1ZHgowBk
[ 14.8] Finishing off
Output file: fedora-33.img
Output size: 6.0G
Output format: raw
Total usable space: 6.0G
Free space: 4.7G (79%)
By the way, interesting virt-builder factoid: It uses a STRIPS-based planner to optimize the order of steps when building the image, so it doesn't waste time doing multiple copies.
https://en.wikipedia.org/wiki/Stanford_Research_Institute_Problem_Solver https://en.wikipedia.org/wiki/Stanford_Research_Institute_Pr...
https://github.com/rwmjones/guestfs-tools/blob/0cffcbb7848af85e6839c459e4b60adf51afb813/builder/builder.ml#L339-L599 https://github.com/rwmjones/guestfs-tools/blob/0cffcbb7848af...
https://github.com/libguestfs/libguestfs-common/blob/74bc5c5c5cb4f9519f8deca5c33cb7f434bf3620/mltools/planner.mli https://github.com/libguestfs/libguestfs-common/blob/74bc5c5...
https://github.com/libguestfs/libguestfs-common/blob/74bc5c5c5cb4f9519f8deca5c33cb7f434bf3620/mltools/planner.ml https://github.com/libguestfs/libguestfs-common/blob/74bc5c5...