Bug 1247269 - RFE: add virt-install --transient option
Summary: RFE: add virt-install --transient option
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: virt-manager
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Cole Robinson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-27 16:50 UTC by Brian Lane
Modified: 2016-06-17 16:26 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-06-17 16:26:41 UTC
Embargoed:


Attachments (Terms of Use)

Description Brian Lane 2015-07-27 16:50:25 UTC
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).

eg.

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 17:47:08 UTC
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 19:52:36 UTC
Repurposing this bug to track adding a --transient option

Comment 3 Cole Robinson 2016-06-17 16:26:41 UTC
Upstream now:

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