LGTM, thanks On Wed, Jan 20, 2016 at 5:37 PM, Dimitris Aragiorgis <[email protected]> wrote:
> Commit ff74b60 closes instance disks on the source node before > doing a failover. In case the node is offline this is not possible. > This patch proceeds with the failover in case the source node > is offline or the --ingore-consistency flag is set. Reduce also > some config lookups for the node's name. > > This fixes Issue #1162. > > Signed-off-by: Dimitris Aragiorgis <[email protected]> > --- > lib/cmdlib/instance_migration.py | 22 +++++++++++++++------- > 1 file changed, 15 insertions(+), 7 deletions(-) > > diff --git a/lib/cmdlib/instance_migration.py > b/lib/cmdlib/instance_migration.py > index ca64afb..b93b334 100644 > --- a/lib/cmdlib/instance_migration.py > +++ b/lib/cmdlib/instance_migration.py > @@ -539,27 +539,35 @@ class TLMigrateInstance(Tasklet): > else: > mode = "in shared mode" > > + node_name = self.cfg.GetNodeName(node_uuid) > + > self.feedback_fn("* opening instance disks on node %s %s" % > - (self.cfg.GetNodeName(node_uuid), mode)) > + (node_name, mode)) > > disks = self.cfg.GetInstanceDisks(self.instance.uuid) > result = self.rpc.call_blockdev_open(node_uuid, self.instance.name, > (disks, self.instance), > exclusive) > - result.Raise("Cannot open disks on node %s" % > - self.cfg.GetNodeName(node_uuid)) > + result.Raise("Cannot open instance disks on node %s" % node_name) > > def _CloseInstanceDisks(self, node_uuid): > """Close instance disks. > > """ > - self.feedback_fn("* closing instance disks on node %s" % > - self.cfg.GetNodeName(node_uuid)) > + node_name = self.cfg.GetNodeName(node_uuid) > + > + self.feedback_fn("* closing instance disks on node %s" % node_name) > > disks = self.cfg.GetInstanceDisks(self.instance.uuid) > result = self.rpc.call_blockdev_close(node_uuid, self.instance.name, > (disks, self.instance)) > - result.Raise("Cannot close instance disks on node %s" % > - self.cfg.GetNodeName(node_uuid)) > + msg = result.fail_msg > + if msg: > + if result.offline or self.ignore_consistency: > + self.lu.LogWarning("Could not close instance disks on node %s," > + " proceeding anyway" % node_name) > + else: > + raise errors.OpExecError("Cannot close instance disks on node %s: > %s" % > + (node_name, msg)) > > def _GoStandalone(self): > """Disconnect from the network. > -- > 1.7.10.4 > > Hrvoje Ribicic Ganeti Engineering Google Germany GmbH Dienerstr. 12, 80331, München Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank. This e-mail is confidential. If you are not the right addressee please do not forward it, please inform the sender, and please erase this e-mail including any attachments. Thanks.
