Bug 1044564

Summary: Cannot rename VM that has snapshots
Product: [Fedora] Fedora Reporter: Jeremy Harris <jeharris>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 20CC: berrange, crobinso, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-18 19:24:14 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:

Description Jeremy Harris 2013-12-18 15:02:34 UTC
Description of problem:
 Using the GUI virt-manager, on a shutdown VM, try to change the Name field in Overview/Basic_Details.  Fails with a popup error window.


Version-Release number of selected component (if applicable):
 Virtual Machine Manager 0.10.0

How reproducible:
 100%


Steps to Reproduce:
1. Create VM
2. Snapshot
3. Sutdown VM
4: Attempt to rename VM.

Actual results:
"Error changing VM configuration: Requested operation is not valid: cannot delete inactive domain with 1 snapshots"

Expected results:


Additional info:
  RHEL7-beta VM on f20 host. VM was Status: Shutoff.  VM image is qcow2 format.  A single snapshot, VM State: Running, was present.

  Error detail:Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/details.py", line 2409, in _change_config_helper
    func(*args)
  File "/usr/share/virt-manager/virtManager/domain.py", line 461, in define_name
    newname)
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 87, in _define_name_helper
    rename_cb(self, origxml, newxml)
  File "/usr/share/virt-manager/virtManager/connection.py", line 782, in rename_vm
    obj, origxml, newxml)
  File "/usr/share/virt-manager/virtManager/connection.py", line 753, in _rename_helper
    obj.delete(force=False)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1278, in delete
    self._backend.undefine()
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 1866, in undefine
    if ret == -1: raise libvirtError ('virDomainUndefine() failed', dom=self)
libvirtError: Requested operation is not valid: cannot delete inactive domain with 1 snapshots

Comment 1 Cole Robinson 2014-01-18 19:24:14 UTC
This message comes from libvirt. Right now there isn't any official rename API, so we have to undefine/delete the VM and redefine it with the new name. But all the user hidden metadata won't get transfered in that case, like managedsave data or snapshots.

The solution here is that libvirt needs to provide a rename API which handles all that stuff for us.

Duping to the pre-existing RFE

*** This bug has been marked as a duplicate of bug 558160 ***