Bug 1247269 - RFE: add virt-install --transient option
RFE: add virt-install --transient option
Product: Virtualization Tools
Classification: Community
Component: virt-manager (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Cole Robinson
Depends On:
  Show dependency treegraph
Reported: 2015-07-27 12:50 EDT by Brian Lane
Modified: 2016-06-17 12:26 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-06-17 12:26:41 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Brian Lane 2015-07-27 12:50:25 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.
Comment 1 Cole Robinson 2015-08-10 13:47:08 EDT
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)
Comment 2 Cole Robinson 2015-11-02 14:52:36 EST
Repurposing this bug to track adding a --transient option
Comment 3 Cole Robinson 2016-06-17 12:26:41 EDT
Upstream now:

commit 246e3c9c591ffc54ce5591aa93cc178c060d8af9
Author: Richard W.M. Jones <rjones@redhat.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

Note You need to log in before you can comment on or make changes to this bug.