Created attachment 344162 [details] patch for virsh list on xen issue Description of problem: After running virsh shutdown and then virsh start on a vm virsh list does not properly report that vm. This occurs in both 0.6.1 and 0.6.3. It does not happen on 0.3.3. The issue seems to be that the new libvirt is going to xenstore before the hypervisor. When you shutdown and restart the vm the domid changes and xenstore still has the old id in it. I have created a patch to change the order it checks things back to the way it was in 0.3.3 and that has fixed the problem. I am attaching the patch for libvirt 0.6.3 Version-Release number of selected component (if applicable): This occurs in both 0.6.1 and 0.6.3. It does not happen on 0.3.3. How reproducible: Every time. Create vm, shutdown vm, start vm. Virsh list now doesn't show it. Steps to Reproduce: 1. create vm with virsh create 2. run virsh list - it properly shows up 3. shutdown vm with virsh shutdown 4. start vm with virsh start 5. run virsh list and it is now missing. you can run xm list to see that it is actually running though. Actual results: vm not listed Expected results: vm should be listed Additional info:
I don't think this patch is suitable, because it is effectively reverting a previous bugfix +Fri Nov 28 16:16:54 CET 2008 Guido Günther <agx> + + Prefer xenstore driver for listDomains, since xen HV reports ghost ids + of already shutdown domains in some xen versions + * src/proxy_internal.c, src/proxy_internal.h: declare + xenProxyListDomains non static + * src/xend_internal.c, src/xend_internal.h: declare + xenDaemonListDomains non static + * src/xen_unified.c: prefer xenStoreListDomains over + xenHypervisorListDomains for xenUnifiedListDomains + Can you provide the output of the following 3 commands, running as root: virsh list --all xm list --long xenstore-ls
actually the issue I was seeing was due to ghost ids in the xenstore and libvirt not properly ignoring them. When you shutdown a domU, the domid is just marked as cancelled in the xenstore and then when you restart it, it creates a new domid and entry into the xenstore. The libvirt code was just taking the first ones it comes to which are invalid and thus why virsh list wasn't displaying any that you stop and start. I'm using xen 3.3.1. I'm using hvm domU's and it works fine with this patch. Do we know which versions of xen he had issues with? It maybe that we should really fix the code that parses the xenstore output to handle that properly. the domU being manipulated here is the testrhel4.vmnet.com. You'll notice it doesn't show up in the virsh list --all. I'm attaching output of xen list --long and xenstore-ls xm list Name ID Mem VCPUs State Time(s) Domain-0 0 925 2 r----- 1437.4 jeffbsd6.vmnet.com 1 256 1 -b---- 1697.0 jeffrhel4.vmnet.com 2 256 1 -b---- 3151.3 testrhel1.vmnet.com 256 1 39.5 testrhel4.vmnet.com 5 256 1 -b---- 44.2 tomfreey.vmnet.com 4 256 1 -b---- 1819.6 virsh list --all Id Name State ---------------------------------- 0 Domain-0 running 1 jeffbsd6.vmnet.com idle 2 jeffrhel4.vmnet.com idle 4 tomfreey.vmnet.com idle - testrhel1.vmnet.com shut off
Created attachment 344221 [details] xenstore-ls output
Created attachment 344222 [details] xm list --long output
In the bugfix listed when xm list not showing all domains?
This is a very old bug report, I presume it's no longer valid since the code in this area has changed significantly. If anyone can still reproduce with modern libvirt, please open a new bug