From 7f7b730a8497048c2f9671adc4b12febeab69e5d Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Mon, 14 Jun 2010 16:37:51 +0200 Subject: [PATCH] Start instance after creating snapshots for export This restores functionality lost in commit 387794f8. Found during tests using QA scripts. An instance should be started after it has been temporarily shutdown for an export. Signed-off-by: Michael Hanselmann <hansmi@google.com> Reviewed-by: Guido Trotter <ultrotter@google.com> --- lib/cmdlib.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index b9983e4c6..3b2dd3b40 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -9229,6 +9229,17 @@ class LUExportInstance(LogicalUnit): helper.CreateSnapshots() try: + if (self.op.shutdown and instance.admin_up and + not self.remove_instance): + assert not activate_disks + feedback_fn("Starting instance %s" % instance.name) + result = self.rpc.call_instance_start(src_node, instance, None, None) + msg = result.fail_msg + if msg: + feedback_fn("Failed to start instance: %s" % msg) + _ShutdownInstanceDisks(self, instance) + raise errors.OpExecError("Could not start instance: %s" % msg) + if self.export_mode == constants.EXPORT_MODE_LOCAL: (fin_resu, dresults) = helper.LocalExport(self.dst_node) elif self.export_mode == constants.EXPORT_MODE_REMOTE: -- GitLab