Commit 7b3d70d4 authored by Guido Trotter's avatar Guido Trotter
Browse files

Fix migrate/failover -n for ext mirror storage



This fixes issue 396.

- Fix a wrong comment that mentions drbd8 when actually the code acts
  only on externally mirrored instances.
- Fix a wrong assert that requires failover/migrate to acquire the NAL
  on externally mirrored instances: this is the case only when a
  iallocator is used, not if a node is manually specified.

Extra qa should be added, but this can only be done if an externally
mirrored instance or a diskless instance is tested. It is easier to add
it on the master branch, where we have diskless instances support.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent fa84c8a4
......@@ -8162,8 +8162,8 @@ def _ExpandNamesForMigration(lu):
lu.needed_locks[locking.LEVEL_NODE_RES] = []
lu.recalculate_locks[locking.LEVEL_NODE_RES] = constants.LOCKS_REPLACE
 
# The node allocation lock is actually only needed for replicated instances
# (e.g. DRBD8) and if an iallocator is used.
# The node allocation lock is actually only needed for externally replicated
# instances (e.g. sharedfile or RBD) and if an iallocator is used.
lu.needed_locks[locking.LEVEL_NODE_ALLOC] = []
 
 
......@@ -8671,11 +8671,10 @@ class TLMigrateInstance(Tasklet):
errors.ECODE_STATE)
 
if instance.disk_template in constants.DTS_EXT_MIRROR:
assert locking.NAL in self.lu.owned_locks(locking.LEVEL_NODE_ALLOC)
_CheckIAllocatorOrNode(self.lu, "iallocator", "target_node")
 
if self.lu.op.iallocator:
assert locking.NAL in self.lu.owned_locks(locking.LEVEL_NODE_ALLOC)
self._RunAllocator()
else:
# We set set self.target_node as it is required by
......
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