Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
+++ This bug was initially created as a clone of Bug #1148373 +++
Description of problem:
Adding encryption to a BTRFS volume, by checking "encrypt" in the volume configuration dialog which also sets size policy and RAID level, fails with a RAID error: "you need at least 1 memberfor RAID level single".
Version-Release number of selected component (if applicable):
python-blivet-0.61.0.5
How reproducible:
Always
Steps to Reproduce:
1. Add a BTRFS volume
2. Open the volume configuration dialog, set size policy to maximum size, and check "encrypt"
3. Close the dialog and click "update"
Actual results:
RAID error is thrown: "you need at least 1 memberfor RAID level single"
Expected results:
Encryption should be added to BTRFS volume
Additional info:
Relevant code path starts at: blivet.devicefactory.PartitionSetFactory.configure, line 1024:
`if not member_encrypted and self.encrypted:`
* attempts to delete container parents and add encrypted container afterwards
* container.parents.remove() fails, error is thrown in blivet.devices.BTRFSVolumeDevice._removeParent: resulting number of devices would be too low for a "single" ersatz raid
* the parent that should be deleted in this case is a "non-existant BTRFS partition"
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1000031#c3
--- Additional comment from Vratislav Podzimek on 2014-10-01 06:21:01 EDT ---
David, I think this is a result of the change that implementated the hooks for adding/removing devices. It seems like there are cases where we need to inhibit/skip some checks when doing changes (reparenting a device, in this particular case).
--- Additional comment from David Lehman on 2014-10-01 12:27:17 EDT ---
That is correct. That check in BTRFSVolumeDevice._removeMember was meant to only apply to existing devices. This exposes the fact that blivet doesn't necessarily ensure that devices with RAID always have an appropriate number of members. That's separate from this, though.
I decided I like us validating member count changes against the current raid level and also validating new raid levels against current member count, so I took a different approach to fixing this. Instead of changing any device classes, I changed the device factory to unset the raid level before configuring the container's member set, thus bypassing any raid-level-specific checks until after we have finished with the member devices.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://rhn.redhat.com/errata/RHBA-2015-0313.html