Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Growpart fails on FreeBSD with MBR/Slices #4103

Closed
ubuntu-server-builder opened this issue May 12, 2023 · 2 comments
Closed

Growpart fails on FreeBSD with MBR/Slices #4103

ubuntu-server-builder opened this issue May 12, 2023 · 2 comments
Labels
launchpad Migrated from Launchpad

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #2016350

Launchpad details
affected_projects = []
assignee = minagalic
assignee_name = Mina Galić
date_closed = None
date_created = 2023-04-15T00:10:44.850753+00:00
date_fix_committed = 2023-05-11T19:32:31.312115+00:00
date_fix_released = None
id = 2016350
importance = undecided
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/2016350
milestone = None
owner = loth
owner_name = Tyler Wilson
private = False
status = fix_committed
submitter = loth
submitter_name = Tyler Wilson
tags = []
duplicates = []

Launchpad user Tyler Wilson(loth) wrote on 2023-04-15T00:10:44.850753+00:00

A VM with slices and/or MBR will have a slice named /dev/da0s1a and makes growpart fail on its partition detection;

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/cloudinit/config/modules.py", line 246, in _run_modules
    ran, _r = cc.run(
  File "/usr/local/lib/python3.9/site-packages/cloudinit/cloud.py", line 67, in run
    return self._runners.run(name, functor, args, freq, clear_on_fail)
  File "/usr/local/lib/python3.9/site-packages/cloudinit/helpers.py", line 185, in run
    results = functor(*args)
  File "/usr/local/lib/python3.9/site-packages/cloudinit/config/cc_growpart.py", line 613, in handle
    resized = util.log_time(
  File "/usr/local/lib/python3.9/site-packages/cloudinit/util.py", line 2721, in log_time
    ret = func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/cloudinit/config/cc_growpart.py", line 526, in resize_devices
    (disk, ptnum) = device_part_info(blockdev)
  File "/usr/local/lib/python3.9/site-packages/cloudinit/config/cc_growpart.py", line 273, in device_part_info
    return (m.group(1), m.group(2))
AttributeError: 'NoneType' object has no attribute 'group'

It seems the regex needs to be modified to support MBR disks, if we want to support them.

@ubuntu-server-builder ubuntu-server-builder added the launchpad Migrated from Launchpad label May 12, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Brett Holman(holmanb) wrote on 2023-04-19T15:47:36.071569+00:00

Thanks, Tyler, for filing this bug.

It looks like fixing this issue involves figuring out what the resize invocation should look like.

On FreeBSD, if I understand correctly, gpart is used to resize the disk. I'm curious what that invocation should look like.

Maybe something like this?

gpart resize -i a /dev/da0s1

Could you please confirm that the above works, or provide an example command that works with MBR+slices?

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Mina Galić(minagalic) wrote on 2023-05-09T14:45:20.621898+00:00

I've written a very simple patch for this now, if you wanna give it a test drive: #2168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
launchpad Migrated from Launchpad
Projects
None yet
Development

No branches or pull requests

1 participant