self.op.mode = constants.REPLACE_DISK_SEC
if self.op.mode == constants.REPLACE_DISK_ALL:
- raise errors.OpPrereqError("Template 'drbd8' only allows primary or"
+ raise errors.OpPrereqError("Template 'drbd' only allows primary or"
" secondary disk replacement, not"
" both at once")
elif self.op.mode == constants.REPLACE_DISK_PRI:
if remote_node is not None:
- raise errors.OpPrereqError("Template 'drbd8' does not allow changing"
+ raise errors.OpPrereqError("Template 'drbd' does not allow changing"
" the secondary while doing a primary"
" node disk replacement")
self.tgt_node = instance.primary_node
make_option("-p", "--on-primary", dest="on_primary",
default=False, action="store_true",
help=("Replace the disk(s) on the primary"
- " node (only for the drbd8 template)")),
+ " node (only for the drbd template)")),
make_option("-s", "--on-secondary", dest="on_secondary",
default=False, action="store_true",
help=("Replace the disk(s) on the secondary"
- " node (only for the drbd8 template)")),
+ " node (only for the drbd template)")),
make_option("--disks", dest="disks", default=None,
help=("Comma-separated list of disks"
" to replace (e.g. sda) (optional,"
help="Skip instance failovers", action="store_false",
default=True)
parser.add_option("-t", "--disk-template", dest="disk_template",
- choices=("remote_raid1", "drbd8"),
+ choices=("remote_raid1", "drbd"),
default="remote_raid1",
help="Template type for network mirroring (remote_raid1"
- " or drbd8) [remote_raid1]")
+ " or drbd) [remote_raid1]")
parser.add_option("-n", "--nodes", dest="nodes", default="",
help="Comma separated list of nodes to perform"
" the burnin on (defaults to all nodes)")
if len(args) < 1 or options.os is None:
Usage()
- if options.disk_template == "plain":
- disk_template = constants.DT_PLAIN
- elif options.disk_template == "remote_raid1":
- disk_template = constants.DT_REMOTE_RAID1
- elif options.disk_template == "drbd8":
- disk_template = constants.DT_DRBD8
- else:
+ supported_disk_templates = (constants.DT_PLAIN, constants.DT_REMOTE_RAID1,
+ constants.DT_DRBD8)
+ if options.disk_template not in supported_disk_templates:
Log("Unknown disk template '%s'" % options.disk_template)
sys.exit(1)
- options.disk_template = disk_template
self.opts = options
self.instances = args