Commit 03e5cdd5 authored by Agata Murawska's avatar Agata Murawska
Browse files

Ignore offline node errors when removing disks



When we delete DRBD disks from some instance, we do not want to get
errors due to nodes other than that instance's primary being offline.
Signed-off-by: default avatarAgata Murawska <agatamurawska@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent d908ba61
......@@ -9015,11 +9015,12 @@ def _RemoveDisks(lu, instance, target_node=None, ignore_failures=False):
edata = device.ComputeNodeTree(instance.primary_node)
for node, disk in edata:
lu.cfg.SetDiskID(disk, node)
msg = lu.rpc.call_blockdev_remove(node, disk).fail_msg
if msg:
result = lu.rpc.call_blockdev_remove(node, disk)
if result.fail_msg:
lu.LogWarning("Could not remove disk %s on node %s,"
" continuing anyway: %s", idx, node, msg)
all_result = False
" continuing anyway: %s", idx, node, result.fail_msg)
if not (result.offline and node != instance.primary_node):
all_result = False
 
# if this is a DRBD disk, return its port to the pool
if device.dev_type in constants.LDS_DRBD:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment