From e507094eef9a7b4a54a04faade8aa95a36fa6d93 Mon Sep 17 00:00:00 2001 From: Bob Ball Date: Fri, 22 Mar 2013 10:23:22 +0000 Subject: Enable live block migration when using iSCSI volumes Fix for bug 1160323. DocImpact Depends on a version of XAPI supporting relax-xsm-sr-check. Currently no release versions support this, so the change at https://github.com/xen-org/xen-api/pull/1116 would need to be applied to the source to enable this. XenServer 6.2 is expected to support this mode, and possibly some future hotfixes for XenServer 6.1. It also depends on a configuration change which must be documented and added to devstack: * Set "relax-xsm-sr-check = true" in /etc/xapi.conf This commit makes the following changes: * Attach the SR on the destination host prior to migrate * Returns the SR-ref from the pre_migrate call (API change) * Populates the XS VDI map with the sr-ref on the destination host * Removes the connection to the SR from the source host post-migrate * Added plugin to determine if iSCSI block migration is enabled Associated tempest test at https://review.openstack.org/#/c/26478/ Change-Id: I917d9cf094190d636f4b9e14f6c8e728ff85af0e Fixes: bug 1160323 --- .../contrib/rpmbuild/SPECS/openstack-xen-plugins.spec | 1 + .../xenserver/xenapi/etc/xapi.d/plugins/config_file | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100755 plugins/xenserver/xenapi/etc/xapi.d/plugins/config_file (limited to 'plugins') diff --git a/plugins/xenserver/xenapi/contrib/rpmbuild/SPECS/openstack-xen-plugins.spec b/plugins/xenserver/xenapi/contrib/rpmbuild/SPECS/openstack-xen-plugins.spec index 66c13967e..b93c7b071 100644 --- a/plugins/xenserver/xenapi/contrib/rpmbuild/SPECS/openstack-xen-plugins.spec +++ b/plugins/xenserver/xenapi/contrib/rpmbuild/SPECS/openstack-xen-plugins.spec @@ -31,6 +31,7 @@ rm -rf $RPM_BUILD_ROOT /etc/xapi.d/plugins/agent /etc/xapi.d/plugins/bandwidth /etc/xapi.d/plugins/bittorrent +/etc/xapi.d/plugins/config_file /etc/xapi.d/plugins/glance /etc/xapi.d/plugins/kernel /etc/xapi.d/plugins/migration diff --git a/plugins/xenserver/xenapi/etc/xapi.d/plugins/config_file b/plugins/xenserver/xenapi/etc/xapi.d/plugins/config_file new file mode 100755 index 000000000..417c477b4 --- /dev/null +++ b/plugins/xenserver/xenapi/etc/xapi.d/plugins/config_file @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +import XenAPIPlugin + + +def get_val(session, args): + config_key = args['key'] + config_file = open('/etc/xapi.conf') + try: + for line in config_file: + split = line.split('=') + if (len(split) == 2) and (split[0].strip() == config_key): + return split[1].strip() + return "" + finally: + config_file.close() + +if __name__ == '__main__': + XenAPIPlugin.dispatch({"get_val": get_val}) -- cgit