Commit 2945fd2d authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

TLReplaceDisks: Refuse changing secondary for specific disks



We move all disks anyway.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 4c98b915
......@@ -5883,10 +5883,11 @@ class TLReplaceDisks(Tasklet):
raise errors.OpPrereqError("The specified node is already the"
" secondary node of the instance.")
if self.mode == constants.REPLACE_DISK_AUTO:
if self.disks:
raise errors.OpPrereqError("Cannot specify disks to be replaced")
if self.disks and self.mode in (constants.REPLACE_DISK_AUTO,
constants.REPLACE_DISK_CHG):
raise errors.OpPrereqError("Cannot specify disks to be replaced")
if self.mode == constants.REPLACE_DISK_AUTO:
faulty_primary = self._FindFaultyDisks(self.instance.primary_node)
faulty_secondary = self._FindFaultyDisks(secondary_node)
......
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