Commit 88aa7f66 authored by Doug Dumitru's avatar Doug Dumitru Committed by Iustin Pop
Browse files

Fix for multiple VGs - PlainToDrbd and replace-disks



Converting an instance from 'plain' to 'drbd'.  The old code would
create the drbd volumes in the default VG and then the renames would
fail.  This fix pulls the plain VG names from the existing volumes and
places it into the new disk template.

Running 'replace-disks' has a similar issue with the new disks going
into the wrong VG and then the rename failing.

Their might be a similar issue with 'recreate-disks', but I actually
have no idea what recreate-disks does, so did not look into it.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 437c3e77
......@@ -8286,7 +8286,6 @@ class TLReplaceDisks(Tasklet):
(node_name, self.instance.name))
def _CreateNewStorage(self, node_name):
vgname = self.cfg.GetVGName()
iv_names = {}
for idx, dev in enumerate(self.instance.disks):
......@@ -8300,6 +8299,7 @@ class TLReplaceDisks(Tasklet):
lv_names = [".disk%d_%s" % (idx, suffix) for suffix in ["data", "meta"]]
names = _GenerateUniqueNames(self.lu, lv_names)
vgname = dev.children[0].logical_id[0]
lv_data = objects.Disk(dev_type=constants.LD_LV, size=dev.size,
logical_id=(vgname, names[0]))
lv_meta = objects.Disk(dev_type=constants.LD_LV, size=128,
......@@ -9443,7 +9443,8 @@ class LUInstanceSetParams(LogicalUnit):
snode = self.op.remote_node
# create a fake disk info for _GenerateDiskTemplate
disk_info = [{"size": d.size, "mode": d.mode} for d in instance.disks]
disk_info = [{"size": d.size, "mode": d.mode,
"vg": d.logical_id[0]} for d in instance.disks]
new_disks = _GenerateDiskTemplate(self, self.op.disk_template,
instance.name, pnode, [snode],
disk_info, None, None, 0, feedback_fn)
......
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