Enabling Xen Guest Save and Migration

Enabling Xen Migration

By default guest domain migration is disabled in the Xen configuration. A number of changes are necessary, therefore, prior to performing a migration. The required settings are located in the /etc/xen/xend-config.sxp configuration file and the necessary changes need to be implemented on both the source and target host systems. The first modification involves setting the xend_relocation_server value to yes:

(xend-relocation-server yes)

Secondly, the xend-relocation-hosts-allow value must be changed to define the hosts from which relocation requests will be accepted. This can be a list of hostnames or IP addresses including wildcards. An empty value may also be specified (somewhat insecurely) to accept connections from any host. The following example allows migration requests only from a host with an IP address of 192.168.2.20:

(xend-relocation-hosts-allow '192.168.2.20')

Finally, the xend-relocation-address and xend-relocation-port settings on the source and destination systems must match. Leaving these values commented out with ‘#’ characters so that the default value is used is also a viable option as shown below:

#(xend-port            8000)
#(xend-relocation-port 8002)

“xm save” or “xm migrate” shows error

Reference: http://xen.1045712.n5.nabble.com/Xen-unstable-save-error-td2516380.html

If you are Xen user, all of you must know that XM commands are not disposable.

So when “xm save” or “xm migrate” does not work, you’re gonna go crazy.

If your Xen was installed from sources, Xenstore should be installed manually in “YourXenDirectory/tools/xenstore/”, by typing “make install”.

Without this process, if you type “xm save” command, then you are going to have an error log like below:

[2010-06-21 13:02:14 4333] DEBUG (XendCheckpoint:124) [xc_save]:
/usr/lib64/xen/bin/xc_save 56 1 0 0 4
[2010-06-21 13:02:14 4333] INFO (XendCheckpoint:408)
/usr/lib64/xen/bin/xc_save: symbol lookup error:
/usr/lib64/xen/bin/xc_save: undefined symbol: xs_suspend_evtchn_port
[2010-06-21 13:02:14 4333] ERROR (XendCheckpoint:178) Save failed on
domain rhel5-32fv-stubdom (1) – resuming.
Traceback (most recent call last):
File “usr/lib64/python2.4/site-packages/xen/xend/XendCheckpoint.py”,
line 146, in save
forkHelper(cmd, fd, saveInputHandler, False)
File “usr/lib64/python2.4/site-packages/xen/xend/XendCheckpoint.py”,
line 394, in forkHelper
raise XendError(“%s failed: popen failed” % string.join(cmd))
XendError: /usr/lib64/xen/bin/xc_save 56 1 0 0 4 failed: popen failed
[2010-06-21 13:02:14 4333] DEBUG (XendDomainInfo:3131)
XendDomainInfo.resumeDomain(1)

After you install Xenstore manually, then libxenstore.so and other files will be included in /usr/lib, and everything is gonna be fine! 🙂