Red Hat Bugzilla – Bug 1247269
RFE: add virt-install --transient option
Last modified: 2016-06-17 12:26:41 EDT
When using virt-install to create temporary VMs using pre-created disk images it sets up a new storage pools for the directory containing the images even though pool is not passed to --disk. This results in leftover disk pools (as shown by virsh pool-list and the files in /etc/libvirt/storage).
virt-install -n test-1 -r 1024 --disk path=/var/tmp/tmpXYZZY/disk-1.img --cdrom=/var/tmp/isos/boot.iso
Results in a new pool named tmpXYZZY and another for isos.
When not passing pool to --disk I would expect it to not use storage pools.
Since IIRC virt-manager 1.0.0 we've done this. The only reliable way for virt-manager/virt-install to determine the image format of an existing disk image is to import the parent directory and have libvirt report the info to us.
We could delete the pool afterwards... but the pool is the only supported way to delete the disk image or perform any other actions on it in the future, like cloning or resizing, so it's not obvious that we should delete the pool.
I'm assuming your usecase is livemedia tools where you just need a transient VM and don't care about any persistent config. We could probably add a virt-install option to either make the pool transient, or a --transient flag (that we should add anyways) that will also turn off permanent pool definition. I'll have to look at it.
But in reality it's probably just simpler if you delete the pool yourself in the livemedia tool, or point virt-install at a stable directory like /var/tmp (which I'm guessing is what you used to do before those past bugs you filed... that stuff is fixed now in libvirt FWIW)
Repurposing this bug to track adding a --transient option
Author: Richard W.M. Jones <email@example.com>
Date: Wed Jun 1 14:32:56 2016 +0100
virtinst: Add --transient flag.
It only sets the domain transient, it's not wired up for making transient storage pools as well, I'll need to play with that first