# switch to new master configuration and if needed primary mode
for rd in bdevs:
- rd.ReAttachNet(multimaster)
+ try:
+ rd.ReAttachNet(multimaster)
+ except errors.BlockDeviceError, err:
+ return (False, "Can't change network configuration: %s" % str(err))
# wait until the disks are connected; we need to retry the re-attach
# if the device becomes standalone, as this might happen if the one
# node disconnects and reconnects in a different mode before the
notyet = True
if stats.is_standalone:
# peer had different config info and this node became standalone
- rd.ReAttachNet(multimaster)
+ try:
+ rd.ReAttachNet(multimaster)
+ except errors.BlockDeviceError, err:
+ return (False, "Can't change network configuration: %s" % str(err))
if not notyet:
break
time.sleep(5)
" aborting migrate." % dev.iv_name)
feedback_fn("* ensuring the target is in secondary mode")
+ for disk in instance.disks:
+ self.cfg.SetDiskID(disk, target_node)
result = rpc.call_blockdev_close(target_node, instance.name,
instance.disks)
if not result or not result[0]:
self.cfg.Update(instance)
feedback_fn("* changing the instance's disks on source node to secondary")
+ for disk in instance.disks:
+ self.cfg.SetDiskID(disk, source_node)
result = rpc.call_blockdev_close(source_node, instance.name,
instance.disks)
if not result or not result[0]: