WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH]restore name/uuid uniqueness check

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH]restore name/uuid uniqueness check
From: Zhigang Wang <zhigang.x.wang@xxxxxxxxxx>
Date: Wed, 23 Jan 2008 14:59:14 +0800
Delivery-date: Tue, 22 Jan 2008 23:00:02 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.9 (X11/20071031)
hi all,

currently, if I restore a vm when the vm is running, it will cause two running
vms with the same name/uuid (the second vm is not functional due to disk image
in use).

# xm create OVM_EL5U1_X86_64_PVM_4GB
# xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0   543     2     r-----    400.1
OVM_EL5U1_X86_64_PVM_4GB                     3   128     1     -b----     14.2
# xm save 3 /tmp/s1
# xm create OVM_EL5U1_X86_64_PVM_4GB
# xm restore /tmp/s1
# xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0   543     2     r-----    411.6
OVM_EL5U1_X86_64_PVM_4GB                     4   128     1     -b----     15.3
OVM_EL5U1_X86_64_PVM_4GB                     5   128     1     -b----      0.7
# xm log
--snip--
[2008-01-23 05:13:57 2502] DEBUG (DevController:603) hotplugStatusCallback 5.
[2008-01-23 05:13:57 2502] ERROR (XendCheckpoint:286) Device 768 (vbd) could 
not be connected.
File /share/vm/OVM_EL5U1_X86_64_PVM_4GB/system.img is loopback-mounted through 
/dev/loop0,
which is mounted in a guest domain,
and so cannot be mounted now.
Traceback (most recent call last):
 File "/usr/lib/python2.4/site-packages/xen/xend/XendCheckpoint.py", line 284, 
in restore
   dominfo.waitForDevices() # Wait for backends to set up
 File "/usr/lib/python2.4/site-packages/xen/xend/XendDomainInfo.py", line 565, 
in waitForDevices
   self.getDeviceController(devclass).waitForDevices()
 File "/usr/lib/python2.4/site-packages/xen/xend/server/DevController.py", line 
151, in waitForDevices
   return map(self.waitForDevice, self.deviceIDs())
 File "/usr/lib/python2.4/site-packages/xen/xend/server/DevController.py", line 
186, in waitForDevice
   raise VmError("Device %s (%s) could not be connected.\n%s" %
VmError: Device 768 (vbd) could not be connected.
File /share/vm/OVM_EL5U1_X86_64_PVM_4GB/system.img is loopback-mounted through 
/dev/loop0,
which is mounted in a guest domain,
and so cannot be mounted now.
--snip--

if set the disk emulation mode to 'w!', both vms will be functional, but the
filesystem will crash soon.

local live migration has this issue two.

this patch makes name/uuid uniqueness check when restore. but it will disable
local migration.

please give some advice on resolving this problem while don't break local
migration. if cannot find one, I prefer disable local migration.

thanks,

zhigang

--- xen-3.1.2.orig/tools/python/xen/xend/XendCheckpoint.py      2008-01-15 
19:19:14.000000000 +0800
+++ xen-3.1.2/tools/python/xen/xend/XendCheckpoint.py   2008-01-22 
13:27:21.000000000 +0800
@@ -170,6 +170,13 @@ def restore(xd, fd, dominfo = None, paus
 
     vmconfig = p.get_val()
 
+    domconfig = XendConfig(sxp_obj = vmconfig)
+    othervm = xd.domain_lookup_nr(domconfig["name_label"])
+    if othervm is None or othervm.domid is None:
+        othervm = xd.domain_lookup_nr(domconfig["uuid"])
+    if othervm is not None and othervm.domid is not None: 
+        raise VmError("Domain '%s' already exists with ID '%d'" % 
(domconfig["name_label"], othervm.domid))
+
     if dominfo:
         dominfo.resume()
     else:
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>