("success", None, "Whether the migration succeeded or not"),
("live", None, "Whether the user requested a live migration or not"),
], None, "Finalize the instance migration on the source node"),
+ ("instance_start", SINGLE, TMO_NORMAL, [
+ ("instance_hvp_bep", "self._InstDictHvpBep(%s)", None),
+ ("startup_paused", None, None),
+ ], None, "Starts an instance"),
+ ("instance_os_add", SINGLE, TMO_1DAY, [
+ ("instance_osp", "self._InstDictOsp(%s)", None),
+ ("reinstall", None, None),
+ ("debug", None, None),
+ ], None, "Starts an instance"),
]
_IMPEXP_CALLS = [
_StartInstanceDisks(self, instance, force)
- result = self.rpc.call_instance_start(node_current, instance,
- self.op.hvparams, self.op.beparams,
- self.op.startup_paused)
+ result = \
+ self.rpc.call_instance_start(node_current,
+ (instance, self.op.hvparams,
+ self.op.beparams),
+ self.op.startup_paused)
msg = result.fail_msg
if msg:
_ShutdownInstanceDisks(self, instance)
self.LogInfo("Instance %s was already stopped, starting now",
instance.name)
_StartInstanceDisks(self, instance, ignore_secondaries)
- result = self.rpc.call_instance_start(node_current, instance,
- None, None, False)
+ result = self.rpc.call_instance_start(node_current,
+ (instance, None, None), False)
msg = result.fail_msg
if msg:
_ShutdownInstanceDisks(self, instance)
try:
feedback_fn("Running the instance OS create scripts...")
# FIXME: pass debug option from opcode to backend
- result = self.rpc.call_instance_os_add(inst.primary_node, inst, True,
- self.op.debug_level,
- osparams=self.os_inst)
+ result = self.rpc.call_instance_os_add(inst.primary_node,
+ (inst, self.os_inst), True,
+ self.op.debug_level)
result.Raise("Could not install OS for instance %s on node %s" %
(inst.name, inst.primary_node))
finally:
_ShutdownInstanceDisks(self, instance)
raise errors.OpExecError("Can't activate the instance's disks")
- result = self.rpc.call_instance_start(target_node, instance,
- None, None, False)
+ result = self.rpc.call_instance_start(target_node,
+ (instance, None, None), False)
msg = result.fail_msg
if msg:
_ShutdownInstanceDisks(self, instance)
self.feedback_fn("* starting the instance on the target node %s" %
target_node)
- result = self.rpc.call_instance_start(target_node, instance, None, None,
+ result = self.rpc.call_instance_start(target_node, (instance, None, None),
False)
msg = result.fail_msg
if msg:
feedback_fn("* running the instance OS create scripts...")
# FIXME: pass debug option from opcode to backend
os_add_result = \
- self.rpc.call_instance_os_add(pnode_name, iobj, False,
+ self.rpc.call_instance_os_add(pnode_name, (iobj, None), False,
self.op.debug_level)
if pause_sync:
feedback_fn("* resuming disk sync")
self.cfg.Update(iobj, feedback_fn)
logging.info("Starting instance %s on node %s", instance, pnode_name)
feedback_fn("* starting instance...")
- result = self.rpc.call_instance_start(pnode_name, iobj,
- None, None, False)
+ result = self.rpc.call_instance_start(pnode_name, (iobj, None, None),
+ False)
result.Raise("Could not start instance")
return list(iobj.all_nodes)
not self.op.remove_instance):
assert not activate_disks
feedback_fn("Starting instance %s" % instance.name)
- result = self.rpc.call_instance_start(src_node, instance,
- None, None, False)
+ result = self.rpc.call_instance_start(src_node,
+ (instance, None, None), False)
msg = result.fail_msg
if msg:
feedback_fn("Failed to start instance: %s" % msg)
nic['nicparams'])
return idict
+ def _InstDictHvpBep(self, (instance, hvp, bep)):
+ """Wrapper for L{_InstDict}.
+
+ """
+ return self._InstDict(instance, hvp=hvp, bep=bep)
+
+ def _InstDictOsp(self, (instance, osparams)):
+ """Wrapper for L{_InstDict}.
+
+ """
+ return self._InstDict(instance, osp=osparams)
+
def _MultiNodeCall(self, node_list, procedure, args, read_timeout=None):
"""Helper for making a multi-node call
# Begin RPC calls
#
- @_RpcTimeout(_TMO_NORMAL)
- def call_instance_start(self, node, instance, hvp, bep, startup_paused):
- """Starts an instance.
-
- This is a single-node call.
-
- """
- idict = self._InstDict(instance, hvp=hvp, bep=bep)
- return self._SingleNodeCall(node, "instance_start", [idict, startup_paused])
-
- @_RpcTimeout(_TMO_1DAY)
- def call_instance_os_add(self, node, inst, reinstall, debug, osparams=None):
- """Installs an OS on the given instance.
-
- This is a single-node call.
-
- """
- return self._SingleNodeCall(node, "instance_os_add",
- [self._InstDict(inst, osp=osparams),
- reinstall, debug])
-
@classmethod
@_RpcTimeout(_TMO_NORMAL)
def call_upload_file(cls, node_list, file_name, address_list=None):