LVM setup fails if 'cinder-volumes' VG exists on unconfigured device
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cinder (Juju Charms Collection) |
Fix Released
|
Medium
|
Jason Hobbs |
Bug Description
This error is triggered when a 'cinder-volumes' VG exists on a PV on a device not configured for use in the current deployment of cinder.
Say cinder is deployed a system with 3 drives; sda goes for /, sdb is configured for cinder usage, and sdc had been used for cinder in a
previous deployment, but isn't configured for use in this deployment. When the cinder charm goes through lvm setup it won't look at /dev/sdc at all, and will try to create the cinder-volumes volume group from scratch on /dev/sdb, which results in an error:
A volume group called cinder-volumes already exists.
Traceback: http://
Workaround: This issue can be avoided by always configuring cinder to use all the devices available on the system.
Ideas for a fix:
There are a few things the charm could do when it hits this case:
- Remove the existing cinder-volumes VG.
- Rename the existing cinder-volumes VG to something else.
- Incorporate the existing PV into cinder-volumes, even though charm config didn't ask for it explicitly.
I'd be happy with an option to enable removing the VG in this case, as I never want to try and recover it on a system that's been assigned to me from MAAS.
Related branches
- Corey Bryant: Approve
-
Diff: 160 lines (+88/-3)2 files modifiedhooks/cinder_utils.py (+36/-1)
unit_tests/test_cinder_utils.py (+52/-2)
Changed in cinder (Juju Charms Collection): | |
status: | New → Fix Committed |
assignee: | nobody → Jason Hobbs (jason-hobbs) |
milestone: | none → 15.07 |
importance: | Undecided → Medium |
tags: | added: openstack |
Changed in cinder (Juju Charms Collection): | |
status: | Fix Committed → Fix Released |
I think we can handle this under the existing 'overwrite' config option, if it is set to true.
vgcreate has a --force option which might work, or maybe vgremove needs to be called before creating the vg.
The code that creates the vg is create_ lvm_volume_ group() in hooks/cinder_ utils.py (which calls vgcreate).