Hi,
libvirt allows you to create two guests with same name, but with
different UUIDs.
This causes some problems in the reporting though. virsh will report
that a guest is running (when it isn't). This also causes some confusion
for the dominfo call - virsh will only return info for one of the
guests. I've seen similar issues when using the virDomainLookupByName()
API.
I suspect all the issues are the same bug, but I haven't had a chance to
track down where.
Thanks!
# virsh version
Compiled against library: libvir 0.6.3
Using library: libvir 0.6.3
Using API: QEMU 0.6.3
Running hypervisor: QEMU 0.9.1
# virsh list --all
Id Name State
----------------------------------
109 demo2 running
- domU1 shut off
- test_domain shut off
# virsh dumpxml demo2
<domain type='kvm' id='109'>
<name>demo2</name>
<uuid>4dea24b3-1d52-d8f3-2516-782e98a23fa0</uuid>
<memory>131072</memory>
<currentMemory>131072</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
<clock offset='utc'/>
<on_poweroff>restart</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type='file' device='disk'>
<source file='/tmp/default-kvm-dimage'/>
<target dev='hda' bus='ide'/>
</disk>
<interface type='user'>
<mac address='24:42:53:21:52:45'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5900' autoport='yes'/>
</devices>
</domain>
# cat demo2
<domain type='kvm' id='55'>
<name>demo2</name>
<uuid>4dea24b3-1d52-d8f3-2516-782e98a23fa3</uuid>
<memory>131072</memory>
<currentMemory>131072</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
<clock offset='utc'/>
<on_poweroff>restart</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<disk type='file' device='disk'>
<source file='/tmp/default-kvm-dimage'/>
<target dev='hda' bus='ide'/>
</disk>
<interface type='user'>
<mac address='24:42:53:21:52:45'/>
</interface>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5902' autoport='yes'/>
</devices>
</domain>
# virsh define demo2
Domain demo2 defined from demo2
# virsh list --all
Id Name State
----------------------------------
109 demo2 running
- demo2 running
- domU1 shut off
- test_domain shut off
# ps -ef | grep qemu
root 11464 1 96 09:04 ? 00:02:12 /usr/bin/qemu-kvm -S -M
pc -cpu qemu32 -m 128 -smp 1 -name demo2 -uuid
4dea24b3-1d52-d8f3-2516-782e98a23fa0 -monitor pty -pidfile
/var/run/libvirt/qemu//demo2.pid -no-acpi -boot c -drive
file=/tmp/default-kvm-dimage,if=ide,index=0,boot=on -net
nic,macaddr=24:42:53:21:52:45,vlan=0 -net user,vlan=0 -serial none
-parallel none -usb -vnc 127.0.0.1:0
root 11483 27407 0 09:06 pts/1 00:00:00 grep qemu
#
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin(a)linux.vnet.ibm.com