constants.DT_PLAIN: "",
constants.DT_RBD: ".rbd",
constants.DT_EXT: ".ext",
+ constants.DT_FILE: ".file",
+ constants.DT_SHARED_FILE: ".sharedfile",
}
elif template_name in (constants.DT_FILE, constants.DT_SHARED_FILE):
logical_id_fn = \
lambda _, disk_index, disk: (file_driver,
- "%s/disk%d" % (file_storage_dir,
- disk_index))
+ "%s/%s" % (file_storage_dir,
+ names[idx]))
elif template_name == constants.DT_BLOCK:
logical_id_fn = \
lambda idx, disk_index, disk: (constants.BLOCKDEV_DRIVER_MANUAL,
if msg or not result.payload:
if not msg:
msg = "disk not found"
- raise errors.OpExecError("Can't find disk/%d on node %s: %s" %
- (idx, self.cfg.GetNodeName(node_uuid), msg))
+ if not self._CheckDisksActivated(self.instance):
+ extra_hint = ("\nDisks seem to be not properly activated. Try"
+ " running activate-disks on the instance before"
+ " using replace-disks.")
+ else:
+ extra_hint = ""
+ raise errors.OpExecError("Can't find disk/%d on node %s: %s%s" %
+ (idx, self.cfg.GetNodeName(node_uuid), msg,
+ extra_hint))
def _CheckDisksConsistency(self, node_uuid, on_primary, ldisk):
for idx, dev in enumerate(self.instance.disks):