Commit 38156f68 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix per-vg checks in instance disk conversion

Since we now have just two possibilities (plaint to drbd or drbd to
plain), we can assume (+an assert) that we come from LVM and access
directly logical_id[0] for the VG on which it is stored.
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarGuido Trotter <>
parent 6180d6bb
......@@ -9264,7 +9264,10 @@ class LUSetInstanceParams(LogicalUnit):
self.op.remote_node, errors.ECODE_STATE)
_CheckNodeOnline(self, self.op.remote_node)
_CheckNodeNotDrained(self, self.op.remote_node)
disks = [{"size": d.size, "vg":} for d in instance.disks]
# FIXME: here we assume that the old instance type is DT_PLAIN
assert instance.disk_template == constants.DT_PLAIN
disks = [{"size": d.size, "vg": d.logical_id[0]}
for d in instance.disks]
required = _ComputeDiskSizePerVG(self.op.disk_template, disks)
_CheckNodesFreeDiskPerVG(self, [self.op.remote_node], required)
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