Add -s --ssl option to xm migrate
PATCH 2/2 Add -s --ssl option to xm migrate
hi
This patch adds -s --ssl option to xm migrate. It will override xend-relocation-ssl setting in /etc/xen/xend-config.sxp.
When mix deploy xen 3.2 and xen 3.3 servers, it's convenient to have a command line option rather than modify /etc/xen/xend-config.sxp every time.
thanks,
zhigang
Add -s --ssl option to xm migrate
This patch adds -s --ssl option to xm migrate. It will override xend-relocation-ssl setting in /etc/xen/xend-config.sxp.
When mix deploy xen 3.2 and xen 3.3 servers, it's convenient to have a command line option rather than modify /etc/xen/xend-config.sxp every time.
tools/python/xen/xend/server/SrvDomain.py +2 -1
@@ -115,7 +115,8 @@ [['dom', 'int'], ['destination', 'str'], ['live', 'int'], - ['port', 'int']]) + ['port', 'int'], + ['ssl', 'int']]) return fn(req.args, {'dom': self.dom.domid}) def op_pincpu(self, _, req):
tools/python/xen/xend/XendAPI.py +2 -1
@@ -1762,9 +1762,10 @@ resource = other_config.get("resource", 0) port = other_config.get("port", 0) node = other_config.get("node", 0) + ssl = other_config.get("ssl", 0) xendom.domain_migrate(xeninfo.getDomid(), destination_url, - bool(live), resource, port, node) + bool(live), resource, port, node, ssl) return xen_api_success_void() def VM_save(self, _, vm_ref, dest, checkpoint):
tools/python/xen/xend/XendDomain.py +6 -2
@@ -1258,7 +1258,7 @@ return val - def domain_migrate(self, domid, dst, live=False, port=0, node=-1): + def domain_migrate(self, domid, dst, live=False, port=0, node=-1, ssl=None): """Start domain migration. @param domid: Domain ID or Name
@@ -1269,6 +1269,8 @@ @type port: int @keyword live: Live migration @type live: bool + @keyword ssl: use ssl connection + @type ssl: bool @rtype: None @keyword node: use node number for target @rtype: int
@@ -1294,7 +1296,9 @@ """ Make sure there's memory free for enabling shadow mode """ dominfo.checkLiveMigrateMemory() - ssl = xoptions.get_xend_relocation_ssl() + if ssl is None: + ssl = xoptions.get_xend_relocation_ssl() + if ssl: from OpenSSL import SSL from xen.web import connection
tools/python/xen/xm/migrate.py +8 -2
@@ -47,6 +47,10 @@ fn=set_int, default=-1, use="Use specified NUMA node on target.") +gopts.opt('ssl', short='s', + fn=set_true, default=None, + use="Use ssl connection for migration.") + def help(): return str(gopts)
@@ -65,11 +69,13 @@ vm_ref = get_single_vm(dom) other_config = { "port": opts.vals.port, - "node": opts.vals.node + "node": opts.vals.node, + "ssl": opts.vals.ssl } server.xenapi.VM.migrate(vm_ref, dst, bool(opts.vals.live), other_config) else: server.xend.domain.migrate(dom, dst, opts.vals.live, opts.vals.port, - opts.vals.node) + opts.vals.node, + opts.vals.ssl)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Hi Zhigang,
tools/python/xen/xend/XendAPI.py +1 -0
@@ -1762,9 +1762,10 @@ resource = other_config.get("resource", 0) port = other_config.get("port", 0) node = other_config.get("node", 0) + ssl = other_config.get("ssl", 0)
I think that the default of ssl should be "None" rather than "0". If ssl is omitted, xend_relocation_ssl option is ignored.
Best regards,
Kan
Quoted 22 lines · Zhigang Wang
hi
This patch adds -s --ssl option to xm migrate. It will override xend-relocation-ssl setting in
/etc/xen/xend-config.sxp.When mix deploy xen 3.2 and xen 3.3 servers, it's convenient to have a command
line option rather than modify/etc/xen/xend-config.sxpevery time.Signed-off-by Zhigang Wang <[email protected]>thanks,
zhigang
-------------------------------text/plain-------------------------------
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel