See https://bugzilla.redhat.com/show_bug.cgi?id=1212841
Currently is not possible to add new partitions to disk with an existing LVM VG. 'findActiveDevicesOnActionDisks' should disallow only actions involving changes on the disklabel not adding new partitions.
From: Vojtech Trefny vtrefny@redhat.com
LVMPhysicalVolume format should be True (active) if exists and if has an existing VG.
Signed-off-by: Vojtech Trefny vtrefny@redhat.com --- blivet/formats/lvmpv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/blivet/formats/lvmpv.py b/blivet/formats/lvmpv.py index 3c9e5c0..346083c 100644 --- a/blivet/formats/lvmpv.py +++ b/blivet/formats/lvmpv.py @@ -125,7 +125,7 @@ def _destroy(self, **kwargs): def status(self): # XXX hack return (self.exists and self.vgName and - os.path.isdir("/dev/mapper/%s" % self.vgName)) + os.path.isdir("/dev/%s" % self.vgName))
register_device_format(LVMPhysicalVolume)
This is definitely a fix for what this check tried to do, but I think it should check if the VG is active, not just existing.
The /dev/$vgname directory only exists when one or more of the LVs are active.
The /dev/$vgname directory only exists when one or more of the LVs are active.
I know, I just thought one can have an active VG with no active LVs which is not the case. This check is correct then.
From: Vojtech Trefny vtrefny@redhat.com
Parted doesn't allow changing disklabel when there is an active partition on the disk. Current implementation of findActiveDevicesOnActionDisks doesn't allow adding new partitions when there is an existing active device other than another partition (eg. VG). New version checks only actions that actually changes the disklabel and checks status of formats of devices on the disk with changes.
Signed-off-by: Vojtech Trefny vtrefny@redhat.com --- blivet/actionlist.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/blivet/actionlist.py b/blivet/actionlist.py index be182c8..8940e6d 100644 --- a/blivet/actionlist.py +++ b/blivet/actionlist.py @@ -247,18 +247,14 @@ def _findActiveDevicesOnActionDisks(self, devices=None): disks = [] for action in self._actions: disk = None - if action.isDevice and isinstance(action.device, PartitionDevice): - disk = action.device.disk - elif action.isFormat and action.format.type == "disklabel": + if action.isFormat and action.format.type == "disklabel": disk = action.device
if disk is not None and disk not in disks: disks.append(disk)
active = (dev for dev in devices - if (dev.status and - (not dev.isDisk and - not isinstance(dev, PartitionDevice)))) + if (dev.format.status and not dev.isDisk)) devices = [a.name for a in active if any(d in disks for d in a.disks)] return devices
...other than another partition (eg. VG).
Should be *PV* instead of *VG*?
In reply to line 257 of blivet/actionlist.py:
This has to catch active formats and also active devices other than partitions and disks. Member formats of md arrays, for example, are never active. I think you'll want to add the format status check to the existing check rather than replacing it.
anaconda-patches@lists.fedorahosted.org