Bug 1342043

Summary: Freshly installed disk of a VM is removed after installation if the first attempt to install fails
Product: [Community] Virtualization Tools Reporter: Peter Krempa <pkrempa>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, crobinso, gscrivan, rbalakri
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-16 23:50:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
virt-manager debug log none

Description Peter Krempa 2016-06-02 10:30:57 UTC
Created attachment 1164024 [details]
virt-manager debug log

Description of problem:
A second attempt to install a VM after a failed installation results into deletion of the VM image file.


Version-Release number of selected component (if applicable):
virt-manager 1.3.2

How reproducible:
100%

Steps to Reproduce:
1. stop virtlogd
2. start installing a new (Linux) VM in virt-manager
3. select "customize before installation"
4. click "begin installation"

At this point the installation fails since libvirtd is refusing to start a VM withouth virtlogd running.

5. start virtlogd
6. click "begin installation" again
7. finish the installation of the OS and reboot

Actual results:
After the reboot the VM can't be started with following message:
2016-06-02 08:58:10.665+0000: 58443: error : virSecurityDACSetOwnershipInternal:343 : unable to set user and group to '0:0' on '/var/lib/libvirt/images/fedora23.qcow2': No such file or directory
2016-06-02 08:58:10.712+0000: 58161: error : virStorageFileGetMetadataRecurse:3114 : Cannot access storage file '/var/lib/libvirt/images/fedora23.qcow2' (as uid:0, gid:0): No such file or directory

The vm image file is removed.

Expected results:
VM disk image is not removed.

Additional info:

Comment 1 Cole Robinson 2016-06-16 23:50:22 UTC
Thanks for the report, fixed upstream now:

commit 5cd1b57852f5b9f96780b7ad54f992ce7b3cdaca
Author: Cole Robinson <crobinso>
Date:   Thu Jun 16 19:47:49 2016 -0400

    create: customize: Fix inadvertent disk removal on install fail
    
    If the first install attempt fails, then the second attempt succeeds,
    we were still removing the disk images we created as though the
    install never succeeded. We need to clear out the cached failed_guest
    value via the customize dialog callback
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1342043