Detection of LVM physical volume which is not part of a VG

Bug #1317980 reported by Andreas Hasenack
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Charm Helpers
Fix Released
Undecided
Andreas Hasenack

Bug Description

I have a case where swift-storage was deployed to a machine with two disks where /dev/sdb was *previously* part of an LVM group. Now it's not, but pvdisplay doesn't error:

# pvdisplay /dev/sdb
  "/dev/sdb" is a new physical volume of "465.76 GiB"
  --- NEW Physical volume ---
  PV Name /dev/sdb
  VG Name
  PV Size 465.76 GiB
  Allocatable NO
  PE Size 0
  Total PE 0
  Free PE 0
  Allocated PE 0
  PV UUID SBvNiL-msiR-OpWe-r57P-ag3H-GHxN-1BpQyi

Note the "VG Name". It's not part of any, but is_lvm_physical_volume() correctly returns "true".

list_lvm_volume_group(), however, fails parsing that output, returning "Name":

2014-05-09 16:36:13 INFO install Processing triggers for ureadahead (0.100.0-16) ...
2014-05-09 16:36:14 INFO install Volume group "Name" not found
2014-05-09 16:36:14 INFO install <open file '/proc/partitions', mode 'r' at 0x7ffde27a2db0>
2014-05-09 16:36:14 INFO install Traceback (most recent call last):
2014-05-09 16:36:14 INFO install File "/var/lib/juju/agents/unit-swift-storage-0/charm/hooks/install", line 91, in <module>
2014-05-09 16:36:14 INFO install main()
2014-05-09 16:36:14 INFO install File "/var/lib/juju/agents/unit-swift-storage-0/charm/hooks/install", line 85, in main
2014-05-09 16:36:14 INFO install hooks.execute(sys.argv)
2014-05-09 16:36:14 INFO install File "/var/lib/juju/agents/unit-swift-storage-0/charm/hooks/charmhelpers/core/hookenv.py", line 381, in execute
2014-05-09 16:36:14 INFO install self._hooks[hook_name]()
2014-05-09 16:36:14 INFO install File "/var/lib/juju/agents/unit-swift-storage-0/charm/hooks/install", line 45, in install
2014-05-09 16:36:14 INFO install setup_storage()
2014-05-09 16:36:14 INFO install File "/var/lib/juju/agents/unit-swift-storage-0/charm/hooks/swift_storage_utils.py", line 178, in setup_storage
2014-05-09 16:36:14 INFO install clean_storage(dev)
2014-05-09 16:36:14 INFO install File "/var/lib/juju/agents/unit-swift-storage-0/charm/hooks/misc_utils.py", line 81, in clean_storage
2014-05-09 16:36:14 INFO install deactivate_lvm_volume_group(block_device)
2014-05-09 16:36:14 INFO install File "/var/lib/juju/agents/unit-swift-storage-0/charm/hooks/charmhelpers/contrib/storage/linux/lvm.py", line 22, in deactivate_lvm_volume_group
2014-05-09 16:36:14 INFO install check_call(cmd)
2014-05-09 16:36:14 INFO install File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
2014-05-09 16:36:14 INFO install raise CalledProcessError(retcode, cmd)
2014-05-09 16:36:14 INFO install subprocess.CalledProcessError: Command '['vgchange', '-an', 'Name']' returned non-zero exit status 5

Tags: landscape

Related branches

tags: added: landscape
Changed in charm-helpers:
assignee: nobody → Andreas Hasenack (ahasenack)
status: New → In Progress
Changed in charm-helpers:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.