Libvirt allows definition of several domains with the same UUID

Bug #394353 reported by Yann Hamon
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Libvirt allows the user to create several domains with the same UUID, and gets very confused when dealing with those vms after this.

If you define two domains A and B with the same UUID, killing A can kill B, and vice versa. Experienced with Hardy's libvirt.

Revision history for this message
Chuck Short (zulcss) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please answer these questions:
1. Is this reproducible?
2. If so, what specific steps should we take to recreate this bug? Be as detailed as possible.
This will help us to find and resolve the problem.

Changed in libvirt (Ubuntu):
status: New → Incomplete
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Yann-

Can you reproduce this issue with the backport of libvirt to hardy?

:-Dustin

Changed in libvirt (Ubuntu):
importance: Undecided → Low
Revision history for this message
Yann Hamon (yannh) wrote :
Download full text (3.3 KiB)

I think I reported this using the backport - and I can reproduce under karmic. I think this might be the bug "virsh kill might kill the wrong vm" . Look how the following undefines the wrong VM:

yann@mandragor:/etc/libvirt/qemu$ virsh dumpxml karmic
Connecting to uri: qemu:///system
<domain type='kvm'>
  <name>karmic</name>
  <uuid>a4947deb-fed4-197e-4156-b033c65aebda</uuid>
  <memory>1048576</memory>
  <currentMemory>1048576</currentMemory>
  <vcpu>2</vcpu>
  <os>
    <type arch='x86_64' machine='pc'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <source file='/home/yann/karmic.qcow2'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <disk type='file' device='cdrom'>
      <target dev='hdc' bus='ide'/>
      <readonly/>
    </disk>
    <interface type='network'>
      <mac address='54:52:00:7c:2d:2a'/>
      <source network='default'/>
      <target dev='vnet0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/3'/>
      <target port='0'/>
    </serial>
    <console type='pty' tty='/dev/pts/3'>
      <source path='/dev/pts/3'/>
      <target port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/>
  </devices>
</domain>

yann@mandragor:/etc/libvirt/qemu$ virsh dumpxml karmic2
Connecting to uri: qemu:///system
<domain type='kvm'>
  <name>karmic</name>
  <uuid>a4947deb-fed4-197e-4156-b033c65aebda</uuid>
  <memory>1048576</memory>
  <currentMemory>1048576</currentMemory>
  <vcpu>2</vcpu>
  <os>
    <type arch='x86_64' machine='pc'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <source file='/home/yann/karmic.qcow2'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <disk type='file' device='cdrom'>
      <target dev='hdc' bus='ide'/>
      <readonly/>
    </disk>
    <interface type='network'>
      <mac address='54:52:00:7c:2d:2a'/>
      <source network='default'/>
      <target dev='vnet0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/3'/>
      <target port='0'/>
    </serial>
    <console type='pty' tty='/dev/pts/3'>
      <source path='/dev/pts/3'/>
      <target port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' keymap='en-us'/>
  </devices>
</domain>

yann@mandragor:/etc/libvirt/qemu$ virsh list --all
Connecting to uri: qemu:///system
 Id Name State
----------------------------------
  - karmic shut off
  - karmic2 shut off

yann@mandragor:/etc/libvirt/qemu$ virsh undefine karmic2
Connecting to uri: qemu:///system
Domain karmic2 has been undefined

yann@mandragor:/etc/libvi...

Read more...

Revision history for this message
Yann Hamon (yannh) wrote :

BTW to reproduce, just create a new XML file copying the one from a vm that already exist, and forget to change the UUID :)

Revision history for this message
Chuck Short (zulcss) wrote :

Thanks for the follow up.

Regards
chuck

Changed in libvirt (Ubuntu):
importance: Low → Medium
status: Incomplete → Triaged
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

This appears to be fixed in Lucid:

virsh # define /tmp/foo.xml
Domain foo defined from /tmp/foo.xml

virsh # list --all
 Id Name State
----------------------------------
  - foo shut off

virsh # define /tmp/foo.xml
Domain foo defined from /tmp/foo.xml

virsh # list --all
 Id Name State
----------------------------------
  - foo shut off

Changed in libvirt (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.