Bug 504262

Summary: Xen driver does not check for duplicated UUID, different name between two guests during define.
Product: Red Hat Enterprise Linux 5 Reporter: Nan Zhang <nzhang>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 5.4CC: berrange, hbrock, jialiu, llim, virt-maint, xen-maint, yoyzhang
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-30 08:11:16 UTC Type: ---
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
patch to fix the issue none

Description Nan Zhang 2009-06-05 08:19:09 UTC
Description of problem:
Using 'virsh edit' a guest domain. On Xen, it's only copy a new config file but not saved to original config file. On KVM, it's not allowed.

Version-Release number of selected component (if applicable):
RHEL-5.4
libvirt 0.6.3-5.el5

How reproducible:
Alway

Steps to Reproduce:
Xen:
# virsh list --all
 Id Name            State
-----------------------------
  0 Domain-0        running
  - foo             shut off

# virsh edit foo  (Edit domain name as 'foo1')

# virsh list --all
 Id Name            State
-----------------------------
  0 Domain-0        running
  - foo             shut off
  - foo1            shut off

KVM:
# virsh list --all
 Id Name            State
-----------------------------
  - demo            shut off

# virsh edit demo  (Edit domain name as 'demo1')
error: operation failed: domain 'demo' is already defined with uuid 9cc9875a-b591-bfad-b0c1-106964cf483c

Actual results:
Cannot be saved.

Expected results:
Guest domain name will be changed to new name. 

Additional info:

Comment 1 Nan Zhang 2009-06-05 08:24:44 UTC
On Xen, 'virsh edit' a guest domain, add the following in 'devices' section, also cannot be saved.

      <serial type='file'>
        <source path='/var/log/serial.log'/>
        <target port='1'/>
      </serial>

Comment 2 Daniel Berrangé 2009-06-05 09:41:06 UTC
Changing the '<name>' field during 'virsh edit' is *not* intended to work. So in fact the bug is in Xen for allowing this. It should refuse it just like KVM does.

Comment 5 Daniel Berrangé 2009-06-29 21:45:49 UTC
I'm fairly sure this needs to be in libvirt component. The code being impacted here is the libvirt code for writing directly into /etc/xen, since the RHEL-5 vintage XenD does not provide APIs for this.

Comment 7 Daniel Veillard 2009-11-17 11:29:29 UTC
Created attachment 369862 [details]
patch to fix the issue

Comment 8 Daniel Veillard 2009-11-17 11:30:21 UTC
Also posted and ACK'ed upstream:

https://www.redhat.com/archives/libvir-list/2009-November/msg00593.html

Daniel

Comment 9 Daniel Veillard 2009-11-25 16:08:00 UTC
libvirt-0.6.3-22.el5 has been built in dist-5E-qu-candidate with
the fixes,

Daniel

Comment 11 Nan Zhang 2009-12-17 10:10:11 UTC
Verified with libvirt 0.6.3-25.el5 on RHEL-5.4, it's already fixed. But I found an error, is it another bug?


[root@dhcp-66-70-85 ~]# virsh list --all
libnuma: Warning: /sys not mounted or no numa system. Assuming one node: No such file or directory
 Id Name                 State
----------------------------------
  0 Domain-0             running
  - demo                 shut off
  - foo                  shut off
  - rhel5u3fv            shut off
  - test                 shut off
  - winxp                shut off
  - xentest              shut off

[root@dhcp-66-70-85 ~]# virsh edit foo
libnuma: Warning: /sys not mounted or no numa system. Assuming one node: No such file or directory
error: operation failed: domain 'foo' is already defined with uuid aff181be-0df7-f761-66bf-c542136f3192

Comment 16 errata-xmlrpc 2010-03-30 08:11:16 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0205.html