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

Allow resize in present state implement #57659


Copy link

What does this PR do?

If the size specified in a lvm.lv_present state is different than the logical volume actual size, the logical volume will be increased to the new specified size.

What issues does this PR fix or reference?

Fixes: #55265

Previous Behavior

Changing the parameter "size" in a lvm.lv_present state for an existent logical volume have no effect.

New Behavior

If you change "size" or "extents" parameter for an existent volume now it will be increased to the new value.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

  • Tests written/updated


Commits signed with GPG?


piterpunk added 3 commits June 12, 2020 16:11
- One of the advantages of LVM is the dynamic resizing of the
  logical volumes. While the module lvm already have an lvm.lvresize,
  there is no way to determine in a state to change a logical volume
  to a desired size.
- This commit changes state lvm.lv_present  to check if parameters
  size or extents are the same of the existing logical volume and,
  if not, calls lvm.lvresize to change it.
- Also, added a test to check if parameters size *and* extents are
  present in the state and return an error. You can't specify both
  at the same time.
Now it tests for three situations:

  - Do Nothing: new size = old size
  - Resize: new size > old size
  - Return Error: new size < old size
@piterpunk piterpunk requested a review from a team as a code owner June 12, 2020 22:22
@ghost ghost requested review from dwoz and removed request for a team June 12, 2020 22:22
Copy link

waynew commented Jun 17, 2020

re-run centos8-py3 ubuntu1804-py3

Copy link

waynew commented Jun 17, 2020

re-run ubuntu1804-py3

Copy link

waynew commented Jun 18, 2020

@dwoz looks like failing tests were just flaky

dwoz approved these changes Jul 29, 2020
@dwoz dwoz merged commit 014b97a into saltstack:master Jul 29, 2020
26 checks passed
@sagetherage sagetherage added the Magnesium Mg release after Na prior to Al label Sep 14, 2020
@piterpunk piterpunk deleted the allow-resize-in-lvm.lv_present-state_Implement-Issue-55265 branch September 29, 2020 21:16
Copy link

Which release is required for this PR #57659 to be available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Magnesium Mg release after Na prior to Al
None yet

Successfully merging this pull request may close these issues.

lvm.lv_present state allow resize
5 participants