Bug 507405 - virsh: renaming of guests creates a copy
Summary: virsh: renaming of guests creates a copy
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 11
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Daniel Veillard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: F11VirtTarget
TreeView+ depends on / blocked
 
Reported: 2009-06-22 16:42 UTC by Julian G
Modified: 2013-04-29 16:11 UTC (History)
11 users (show)

Fixed In Version: 0.6.2-14.fc11
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-08-15 08:30:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Julian G 2009-06-22 16:42:28 UTC
Description of problem:
Changing a guests name using virsh edit creates a copy of it.

Version-Release number of selected component (if applicable):
Fedora 11 x86_64 libvirt-0.6.2

Steps to Reproduce:
1. virsh edit somehost
2. Edit name inside of <name>somehost</name>
3. virsh list --all
4. Now you should have 2 guests with the same UUID - one with the old name, one with the new one

Comment 1 Daniel Berrangé 2009-07-30 16:50:42 UTC
The latest libvirt now has proper UUID/name uniqueness checking and complains suitably if you edit the 'name', but leave the UUID alone.


# virsh edit openfiler23
error: operation failed: domain 'openfiler23' is already defined with uuid 7699653a-0b6c-d8b1-6c37-8e39d219cd3f

Comment 2 Daniel Berrangé 2009-07-30 16:52:52 UTC
Opps, shouldn't have closed this one, since its against F11, not rawhide.

Comment 3 Daniel Berrangé 2009-08-04 15:19:07 UTC
Upstream fix was

commit 54ebbde1e18ec831ff2fddb44ec27ed5dde7874a
Author: Daniel P. Berrange <berrange>
Date:   Fri May 8 10:11:14 2009 +0000

    Improve name & UUID uniqueness checking in QEMU driver

Comment 4 Daniel Berrangé 2009-08-05 16:08:12 UTC
Built fix into libvirt-0.6.2-14.fc11

Comment 5 Fedora Update System 2009-08-05 16:12:49 UTC
libvirt-0.6.2-14.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/libvirt-0.6.2-14.fc11

Comment 6 Fedora Update System 2009-08-07 05:00:31 UTC
libvirt-0.6.2-14.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update libvirt'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-8333

Comment 7 Julian G 2009-08-08 17:30:12 UTC
after the upgrade i'm completely unable to rename a guest.

virsh edit Drupal-Testing      // changed name; save and quit editor
Fehler: operation failed: domain 'Drupal-Testing' is already defined with uuid 352617c1-d0f3-a1c1-add5-7d4a429be183

Comment 8 Daniel Berrangé 2009-08-10 08:42:52 UTC
Yes, that is the intended fix, renaming is not supported in libvirt.

Comment 9 Fedora Update System 2009-08-15 08:29:51 UTC
libvirt-0.6.2-14.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Claudemir F.Franco 2010-10-25 13:35:50 UTC
Hi, people!

I'm using FC13 with libvirt-0.8.2, but the problem still persist! I tried rename my VM using the following steps:

1) virsh edit win-xp
2) change the attribute : "name" in xml the my VM.

After save the XML VM windows I recevied the following message:

error: operation failed: domain 'win-xp' is already defined with uuid 0f318195-9fbd-cedc-6683-6c8f876e957e

Sorry, maybe I'm making a mistake in the procedure.

Version my packages libvirt...

[root@dellbook2 qemu]# rpm -qa |grep -i libvirt
libvirt-client-0.8.2-1.fc13.x86_64
libvirt-python-0.8.2-1.fc13.x86_64
libvirt-0.8.2-1.fc13.x86_64
[root@dellbook2 qemu]# 

[]'s

Claudemir.

Comment 11 Chris Lalancette 2010-10-25 18:17:43 UTC
(In reply to comment #10)
> Hi, people!
> 
> I'm using FC13 with libvirt-0.8.2, but the problem still persist! I tried
> rename my VM using the following steps:
> 
> 1) virsh edit win-xp
> 2) change the attribute : "name" in xml the my VM.
> 
> After save the XML VM windows I recevied the following message:
> 
> error: operation failed: domain 'win-xp' is already defined with uuid
> 0f318195-9fbd-cedc-6683-6c8f876e957e

No, that is exactly the expected behavior.  virsh edit does not support changing the name or UUID.  If you want to change either of those, you'll need to:

virsh dumpxml $DOMAIN > domain.xml
virsh undefine $DOMAIN
<edit domain.xml>
virsh define domain.xml

Chris Lalancette

Comment 12 Claudemir F.Franco 2010-10-26 20:02:34 UTC
Hi Chris,

This worked.  Pardon my ignorance!!!  ;o)

Thanks for the tips..

Claudemir.


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