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

Added support for PV grow #1229

Conversation

japokorn
Copy link
Contributor

Storage role requires support for a case when PV has to be resized to fill all available space when its device's size changes (usually on VM).

A new flag grow_to_fill was added, which marks the device for size expansion (all available space it taken).
Proper size is determined by LVM, avoiding inaccurate size calculations in blivet.

@japokorn japokorn marked this pull request as ready for review April 25, 2024 13:02
@japokorn japokorn requested a review from vojtechtrefny April 25, 2024 13:02
@japokorn japokorn marked this pull request as draft April 25, 2024 13:08
Copy link
Member

@vojtechtrefny vojtechtrefny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me in general, but it needs a test.

@japokorn japokorn force-pushed the 3.9-devel-sr_pv_resize_support branch 3 times, most recently from f9eb277 to 835c49a Compare April 26, 2024 15:13
@japokorn
Copy link
Contributor Author

  • Added missing tests.
  • Replaced blockdev.lvm.pvresize(self.pv.device) with blockdev.lvm.pvresize(self.pv.device, 0)
  • Made grow_to_fill a property that cannot be set unless the device is resizable (raises DeviceFormatError)
  • Added condition to formats/__init__.py that will prevent bypassing of resize when new size is the same as old one if device is type lvmpv with grow_to_fill set to True
  • pylint and pep8 fixes

@japokorn japokorn marked this pull request as ready for review April 26, 2024 15:46
@@ -107,6 +110,17 @@ def __repr__(self):
"pe_start": self.pe_start, "data_alignment": self.data_alignment})
return s

@property
def grow_to_fill(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a docstring here explaining how this works, e.g. what target size needs to be set to make this work and that ActionResizeFormat still needs to be created and executed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Added docstring.

Storage role requires support for a case when PV has to be resized to
fill all available space when its device's size changes (usually on VM).

A new flag 'grow_to_fill' was added, which marks the device for size
expansion (all available space it taken).
Proper size is determined by LVM, avoiding inaccurate size
calculations in blivet.
@japokorn japokorn force-pushed the 3.9-devel-sr_pv_resize_support branch from 835c49a to 9290cdf Compare May 7, 2024 12:23
@vojtechtrefny vojtechtrefny merged commit 0674fe7 into storaged-project:3.10-devel May 7, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants