Failed: can't get Volume Group information from /dev/sda1

Bug #1922742 reported by Dan Watkins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
High
Unassigned

Bug Description

When running tests in LXD VMs (LXD containers don't perform disk setup, as they don't have their own disks), I see:

2021-04-06 14:31:24,084 - helpers.py[DEBUG]: Running config-growpart using lock (<cloudinit.helpers.DummyLock object at 0x7f11232ef490>)
2021-04-06 14:31:24,084 - cc_growpart.py[DEBUG]: No 'growpart' entry in cfg. Using default: {'mode': 'auto', 'devices': ['/'], 'ignore_growroot_disabled': False}
2021-04-06 14:31:24,084 - subp.py[DEBUG]: Running command ['growpart', '--help'] with allowed return codes [0] (shell=False, capture=True)
2021-04-06 14:31:24,092 - util.py[DEBUG]: Reading from /proc/503/mountinfo (quiet=False)
2021-04-06 14:31:24,092 - util.py[DEBUG]: Read 3726 bytes from /proc/503/mountinfo
2021-04-06 14:31:24,093 - subp.py[DEBUG]: Running command ['lvm', 'lvs', '/dev/sda1', '--options=vgname', '--noheadings'] with allowed return codes [0] (shell=False, capture=True)
2021-04-06 14:31:24,138 - util.py[WARNING]: Failed: can't get Volume Group information from /dev/sda1
2021-04-06 14:31:24,138 - util.py[DEBUG]: Failed: can't get Volume Group information from /dev/sda1
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cloudinit/config/cc_growpart.py", line 125, in get_pvs_for_lv
    (out, _err) = subp.subp(["lvm", "lvs", devpath, "--options=vgname",
  File "/usr/lib/python3/dist-packages/cloudinit/subp.py", line 293, in subp
    raise ProcessExecutionError(stdout=out, stderr=err,
cloudinit.subp.ProcessExecutionError: Unexpected error while running command.
Command: ['lvm', 'lvs', '/dev/sda1', '--options=vgname', '--noheadings']
Exit code: 5
Reason: -
Stdout:
Stderr: Volume group "sda1" not found
          Cannot process volume group sda1
2021-04-06 14:31:24,140 - util.py[DEBUG]: resize_devices took 0.048 seconds
2021-04-06 14:31:24,140 - handlers.py[DEBUG]: finish: init-network/config-growpart: FAIL: running config-growpart with frequency always
2021-04-06 14:31:24,140 - util.py[WARNING]: Running module growpart (<module 'cloudinit.config.cc_growpart' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_growpart.py'>) failed
2021-04-06 14:31:24,142 - util.py[DEBUG]: Running module growpart (<module 'cloudinit.config.cc_growpart' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_growpart.py'>) failed
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cloudinit/config/cc_growpart.py", line 125, in get_pvs_for_lv
    (out, _err) = subp.subp(["lvm", "lvs", devpath, "--options=vgname",
  File "/usr/lib/python3/dist-packages/cloudinit/subp.py", line 293, in subp
    raise ProcessExecutionError(stdout=out, stderr=err,
cloudinit.subp.ProcessExecutionError: Unexpected error while running command.
Command: ['lvm', 'lvs', '/dev/sda1', '--options=vgname', '--noheadings']
Exit code: 5
Reason: -
Stdout:
Stderr: Volume group "sda1" not found
          Cannot process volume group sda1

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 884, in _run_modules
    ran, _r = cc.run(run_name, mod.handle, func_args,
  File "/usr/lib/python3/dist-packages/cloudinit/cloud.py", line 54, in run
    return self._runners.run(name, functor, args, freq, clear_on_fail)
  File "/usr/lib/python3/dist-packages/cloudinit/helpers.py", line 185, in run
    results = functor(*args)
  File "/usr/lib/python3/dist-packages/cloudinit/config/cc_growpart.py", line 434, in handle
    resized = util.log_time(logfunc=log.debug, msg="resize_devices",
  File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 2348, in log_time
    ret = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/cloudinit/config/cc_growpart.py", line 358, in resize_devices
    disk, ptnum = device_part_info(blockdev, is_lvm)
  File "/usr/lib/python3/dist-packages/cloudinit/config/cc_growpart.py", line 273, in device_part_info
    lvm_rpath = get_pvs_for_lv(devpath)
  File "/usr/lib/python3/dist-packages/cloudinit/config/cc_growpart.py", line 132, in get_pvs_for_lv
    raise ResizeFailedException(e) from e
cloudinit.config.cc_growpart.ResizeFailedException: Unexpected error while running command.
Command: ['lvm', 'lvs', '/dev/sda1', '--options=vgname', '--noheadings']
Exit code: 5
Reason: -
Stdout:
Stderr: Volume group "sda1" not found
          Cannot process volume group sda1

Revision history for this message
Dan Watkins (oddbloke) wrote :
Revision history for this message
Dan Watkins (oddbloke) wrote :

Yep, a quick bisect confirms it.

James Falcon (falcojr)
Changed in cloud-init:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Dan Watkins (oddbloke) wrote :
Changed in cloud-init:
status: Triaged → Fix Committed
Revision history for this message
James Falcon (falcojr) wrote : Fixed in cloud-init version 21.2.

This bug is believed to be fixed in cloud-init in version 21.2. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers