Red Hat Bugzilla – Bug 963161
generated UUIDs are not compliant with RFC4122
Last modified: 2014-06-17 20:00:15 EDT
This bug is also occurred in rhel7.
+++ This bug was initially created as a clone of Bug #949969 +++
Created attachment 733169 [details]
Description of problem:
Libvirt mentions in documentation that UUIDs for guests must be RFC 4122 compliant but it does not follow this requirement itself. I have posted patch upstream that ensures that each UUID generated by libvirt during guest creation is RFC 4122 version 4 (pseudo)randomly generated.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. create guest (virt-manager, virt-install...)
2. grep "<uuid>" /etc/libvirt/qemu/g1.xml
A is version defined in 4.1.3 of RFC
Msb0 Msb1 Msb2 Msb3 Version Description
0 1 0 0 4 The randomly or pseudo-
randomly generated version
specified in this document.
B is variant defined in 4.1.1 of RFC
Msb0 Msb1 Msb2 Description
1 0 x The variant specified in this document.
Upstream patch modified for RHEL 6.4 libvirt attached.
--- Additional comment from Jiri Denemark on 2013-04-09 11:59:29 EDT ---
This is now fixed upstream by v1.0.4-97-g396c4d3:
Author: Milos Vyletel <email@example.com>
Date: Mon Apr 8 14:10:54 2013 -0400
Generate RFC4122 compliant UUIDs
Even though http://libvirt.org/formatdomain.html#elementsMetadata
states that it requires RFC4122 compliance UUIDs that are generated
by virUUIDGenerate() are not. Following patch modifies generated
UUIDs to conform to rules described in RFC.
Signed-off-by: Milos Vyletel <firstname.lastname@example.org>
(In reply to comment #0)
> This bug is also occurred in rhel7.
Have you actually tested it? If so what were the steps and what was the result? The bug is supposed to be fixed in 1.0.5, i.e., in the current rhel7 package.
Yeah, I have tried on rhel7 and found the UUID isn't compliant with RFC4122, then clone it from rhel6.
Here is the steps:
1. new one VM via virt-manager
2. #virsh dumpxml b|grep uuid
I attached the log for your reference.
(In reply to comment #2)
> (In reply to comment #0)
> > This bug is also occurred in rhel7.
> > version:
> > libvirt-1.0.5-2.el7.x86_64
> Have you actually tested it? If so what were the steps and what was the
> result? The bug is supposed to be fixed in 1.0.5, i.e., in the current rhel7
Created attachment 748591 [details]
Can you retest with just virsh? You can use the following steps if you already have domain "b" defined:
1. virsh dumpxml b | grep -v '<uuid>' >b.xml
2. virsh undefine b
3. virsh define b.xml
4. virsh dumpxml | grep uuid
Also virt-manager logs generated when you created a new VM with it would be helpful too.
If just virsh, the uuid seems correct.
# virsh dumpxml b | grep -v '<uuid>' >b.xml
# virsh undefine b
Domain b has been undefined
# virsh define b.xml
Domain b defined from b.xml
# virsh dumpxml b|grep uuid
If use the virt-manager, the uuid didn't compliant with RFC4122.
Update the virt-manager log for your reference.
(In reply to comment #5)
> Can you retest with just virsh? You can use the following steps if you
> already have domain "b" defined:
> 1. virsh dumpxml b | grep -v '<uuid>' >b.xml
> 2. virsh undefine b
> 3. virsh define b.xml
> 4. virsh dumpxml | grep uuid
> Also virt-manager logs generated when you created a new VM with it would be
> helpful too.
Created attachment 748725 [details]
1. New one VM "c" via virt-manager
2. # virsh dumpxml c|grep uuid
Attached is the virt-manager log while new VM "c".
OK, the bad UUID is generated by virt-manager. I'm not sure why virt-manager puts <uuid> element into the XML.
Patch proposed upstream:
Moving to POST:
Author: Martin Kletzander <email@example.com>
Date: Mon May 20 18:00:13 2013 +0200
Generate valid UUIDs according to RFC4122
The bug is not fixed according to the follwoing steps:
# rpm -qa libvirt virt-manager
1. New a domain N with virt-manager
2. check the uuid of the domain
# virsh dumpxml N | grep uuid
Use virt-manager to install a new guest,check it's uuid.
# virsh dumpxml test | grep uuid
Checked several guests,the uuid met the variant specification,so move the bug to VERIFIED.
This request was resolved in Red Hat Enterprise Linux 7.0.
Contact your manager or support representative in case you have further questions about the request.