- The destination cluster generates another key and certificate,
signs and sends it to the third party, who will have to pass it to
- the API for exporting an instance (``OpExportInstance``). This
+ the API for exporting an instance (``OpBackupExport``). This
certificate is used to ensure we're sending the disk data to the
correct destination cluster.
- Once a disk can be imported, the API sends the destination
together with all necessary information to source cluster and tells
it to start the move
- - The existing API for exporting instances (``OpExportInstance``)
+ - The existing API for exporting instances (``OpBackupExport``)
will be extended to export instances to remote clusters.
#. Source cluster connects to destination cluster for each disk and
#
#
-# Copyright (C) 2006, 2007, 2010 Google Inc.
+# Copyright (C) 2006, 2007, 2010, 2011 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
raise errors.OpPrereqError("Target node must be specified",
errors.ECODE_INVAL)
- op = opcodes.OpExportInstance(instance_name=args[0],
- target_node=opts.node,
- shutdown=opts.shutdown,
- shutdown_timeout=opts.shutdown_timeout,
- remove_instance=opts.remove_instance,
- ignore_remove_failures=ignore_remove_failures)
+ op = opcodes.OpBackupExport(instance_name=args[0],
+ target_node=opts.node,
+ shutdown=opts.shutdown,
+ shutdown_timeout=opts.shutdown_timeout,
+ remove_instance=opts.remove_instance,
+ ignore_remove_failures=ignore_remove_failures)
SubmitOpCode(op, opts=opts)
return 0
return None
-class LUExportInstance(LogicalUnit):
+class LUBackupExport(LogicalUnit):
"""Export an instance to an image in the cluster.
"""
]
-class OpExportInstance(OpCode):
+class OpBackupExport(OpCode):
"""Export an instance.
For local exports, the export destination is the node name. For remote
#
#
-# Copyright (C) 2006, 2007, 2008, 2009, 2010 Google Inc.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
def _ParseExportInstanceRequest(name, data):
"""Parses a request for an instance export.
- @rtype: L{opcodes.OpExportInstance}
+ @rtype: L{opcodes.OpBackupExport}
@return: Instance export opcode
"""
destination_x509_ca = baserlib.CheckParameter(data, "destination_x509_ca",
default=None)
- return opcodes.OpExportInstance(instance_name=name,
- mode=mode,
- target_node=target_node,
- shutdown=shutdown,
- remove_instance=remove_instance,
- x509_key_name=x509_key_name,
- destination_x509_ca=destination_x509_ca)
+ return opcodes.OpBackupExport(instance_name=name,
+ mode=mode,
+ target_node=target_node,
+ shutdown=shutdown,
+ remove_instance=remove_instance,
+ x509_key_name=x509_key_name,
+ destination_x509_ca=destination_x509_ca)
class R_2_instances_name_export(baserlib.R_Generic):
"destination_x509_ca": ("x", "y", "z"),
}
op = self.Parse(name, data)
- self.assert_(isinstance(op, opcodes.OpExportInstance))
+ self.assert_(isinstance(op, opcodes.OpBackupExport))
self.assertEqual(op.instance_name, name)
self.assertEqual(op.mode, constants.EXPORT_MODE_REMOTE)
self.assertEqual(op.shutdown, True)
"shutdown": False,
}
op = self.Parse(name, data)
- self.assert_(isinstance(op, opcodes.OpExportInstance))
+ self.assert_(isinstance(op, opcodes.OpBackupExport))
self.assertEqual(op.instance_name, name)
self.assertEqual(op.mode, constants.EXPORT_MODE_LOCAL)
self.assertEqual(op.remove_instance, False)
#!/usr/bin/python
#
-# Copyright (C) 2006, 2007, 2008, 2009, 2010 Google Inc.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
import_log_msg = ("import from %s to %s, %s" %
(enode, pnode, snode))
- exp_op = opcodes.OpExportInstance(instance_name=instance,
- target_node=enode,
- mode=constants.EXPORT_MODE_LOCAL,
- shutdown=True)
+ exp_op = opcodes.OpBackupExport(instance_name=instance,
+ target_node=enode,
+ mode=constants.EXPORT_MODE_LOCAL,
+ shutdown=True)
rem_op = opcodes.OpRemoveInstance(instance_name=instance,
ignore_failures=True)
imp_dir = utils.PathJoin(constants.EXPORT_DIR, full_name)