From b352ab5b968792ab1f806bfb1188eace0d0af899 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Wed, 24 Oct 2007 14:23:41 +0000
Subject: [PATCH] Fix a disk handling bug triggered by failover

This leaves an instance's disks configured for the primary node as after
disk activation we want to start the instance anyway. As such,
_GatherBlockDevs in backend.py will need the disks configured for the
primary.

Reviewed-by: imsnah
---
 lib/cmdlib.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index e316e7e38..0ef884628 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -1836,6 +1836,12 @@ def _AssembleInstanceDisks(instance, cfg, ignore_secondaries=False):
     device_info.append((instance.primary_node, inst_disk.iv_name,
                         master_result))
 
+  # leave the disks configured for the primary node
+  # this is a workaround that would be fixed better by
+  # improving the logical/physical id handling
+  for disk in instance.disks:
+    cfg.SetDiskID(disk, instance.primary_node)
+
   return disks_ok, device_info
 
 
-- 
GitLab