ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
784 stars 1.45k forks source link

lvol.py allow state: merged for snapshots #7150

Open 101smurf opened 10 months ago

101smurf commented 10 months ago

Summary

I'm trying to write a playbook that merges an LVM snapshot. This can be achieved using the lvconvert command, but I'd rather use a module.

Issue Type

Feature Idea

Component Name

lvol

Additional Information

- name: Merge a snapshot volume of the test logical volume.
  community.general.lvol:
    vg: firefly
    lv: test
    snapshot: snap1
    state: merged

Code of Conduct

ansibullbot commented 10 months ago

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot commented 10 months ago

cc @abulimov @jhoekx @unkaputtbar112 @zigaSRC click here for bot help

101smurf commented 10 months ago

I'm aware that merging a live snapshot requires a reboot. I'm not sure if that's up to the module to implement. I also noticed some residual files remaining in /dev/mapper the first reboot after merging. Not sure if the module should fix that either.

felixfontein commented 10 months ago

It might make sense to create a new module for this, instead of trying to integrate it into the existing one, if you want extra features such as rebooting. The module could also return whether a reboot is needed and leave it up to the user to reboot.

snail59 commented 10 months ago

I'm aware that merging a live snapshot requires a reboot. I'm not sure if that's up to the module to implement. I also noticed some residual files remaining in /dev/mapper the first reboot after merging. Not sure if the module should fix that either.

I might have missed something in your case, but from my experience and according to Redhat (from 6 to 9), merging LVM snapshots does not require any reboot.

I hope this helps.

101smurf commented 10 months ago

I'm restoring a snapshot of the root partition :)

snail59 commented 10 months ago

I'm restoring a snapshot of the root partition :)

OK, you are right then :-D. In this case this is a requirement.