Giter Site home page Giter Site logo

Comments (13)

r1k0 avatar r1k0 commented on May 27, 2024

Here is a patch that removes --force by default and let the user specify it via lvreduce_options (would need update in the lvol documentation too):

root ~ # diff /usr/lib/python2.7/site-packages/ansible/modules/extras/system/lvol.py.orig /usr/lib/python2.7/site-packages/ansible/modules/extras/system/lvol.py
43a44,55
>   lvreduce_options:
>     description:
>     - Additional options to pass to C(lvreduce) when reducing the volume group.
>     default: null
>     required: false
>     version_added: "1.8.2"
>   lvextend_options:
>     description:
>     - Additional options to pass to C(lvextend) when expanding the volume group.
>     default: null
>     required: false
>     version_added: "1.8.2"
97d108
< 
103a115,116
>             lvreduce_options=dict(default=''),
>             lvextend_options=dict(default=''),
112a126,127
>     lvreduceoptions = module.params['lvreduce_options'].split()
>     lvextendoptions = module.params['lvextend_options'].split()
212c227
<                 tool = 'lvextend'
---
>                 tool = 'lvextend ' + ' '.join(lvextendoptions)
214,216c229
<                 if not force:
<                     module.fail_json(msg="Sorry, no shrinking of %s without force=yes." % (this_lv['name']))
<                 tool = 'lvreduce --force'
---
>                 tool = 'lvreduce ' + ' '.join(lvreduceoptions)
root ~ # 

tested here with:

ansible -i hosts  vsrv1942.int.belbone.be -m lvol -a "vg=system lv=pkg state=present size=2G lvreduce_options='--resizefs --force' lvextend_options='--resizefs --force'" -vvv

I didn't push a merge request because I don't expect you merge the code as-is, but rather it's to provide you guys visibility on the issue and how we worked around it.

The only downside of using --resizefs is that if the volume is mounted it needs to be unmounted prior to running:

lvreduce -y --resizefs --force -L 1G system/pkg

since --resizefs will show a question ('Do you want to unmount "/pkg"? [Y|n]') that needs manual input.

Maybe an additional option (umount=yes only required when passing --resizefs) that would input 'Y'.

But then I guess it would make better sense to have resizefs=yes option instead of what I've proposed above.

So ideally I could see something like:

ansible -i hosts  vsrv1942.int.belbone.be -m lvol -a "vg=system lv=pkg state=present size=2G force=yes resizefs=yes umount=yes" -vvv

That would result in a case of lvreduce:

  • umounting (umount=yes would provide the 'Y' input - shame lvreduce/lvextend requries manual input)
  • resize the FS
  • resize the LV

Same for lvextend but in the other way:

  • umount
  • resize the LV
  • resize the FS

Let me know your thoughts and/or if you need some support to test in a hummm prod env :)

thanks for the good work

from ansible-modules-extras.

robynbergeron avatar robynbergeron commented on May 27, 2024

[module: system/lvol.py]

from ansible-modules-extras.

robynbergeron avatar robynbergeron commented on May 27, 2024

@r1k0 Thanks for submitting this feature idea. Sorry it's taken us a while to triage it. :)

@jhoekx & @abulimov Pinging you to bring this feature request for your attention. Please note that you are under no particular obligation to add this feature.

We encourage all Ansible community members to submit pull requests to satisfy feature requests. Consult the module guidelines (http://docs.ansible.com/ansible/developing_modules.html) for more information.

from ansible-modules-extras.

Jmainguy avatar Jmainguy commented on May 27, 2024

@robynbergeron Looks like its been about 3 months since you asked the authors for review, what do we do when the authors do not respond?

from ansible-modules-extras.

abulimov avatar abulimov commented on May 27, 2024

Sorry, missed previous notification. As lvol module now supports opts argument, I think it would be far better to just pass opts not only for lvcreate, but for lvreduce/lvextend commands too. Implementing this looks trivial.

from ansible-modules-extras.

ansibot avatar ansibot commented on May 27, 2024

@jhoekx, @abulimov, ping. This issue is still waiting on your response.
click here for bot help

from ansible-modules-extras.

ansibot avatar ansibot commented on May 27, 2024

@jhoekx, @abulimov, ping. This issue is still waiting on your response.
click here for bot help

from ansible-modules-extras.

ansibot avatar ansibot commented on May 27, 2024

@jhoekx, @abulimov, ping. This issue is still waiting on your response.
click here for bot help

from ansible-modules-extras.

ansibot avatar ansibot commented on May 27, 2024

@jhoekx, @abulimov, ping. This issue is still waiting on your response.
click here for bot help

from ansible-modules-extras.

ansibot avatar ansibot commented on May 27, 2024

This repository has been locked. All new issues and pullrequests should be filed in https://github.com/ansible/ansible

Please read through the repomerge page in the dev guide. The guide contains links to tools which automatically move your issue or pullrequest to the ansible/ansible repo.

from ansible-modules-extras.

ansibot avatar ansibot commented on May 27, 2024

This issue was migrated to ansible/ansible#29194

from ansible-modules-extras.

karthi81 avatar karthi81 commented on May 27, 2024

lvol module doesn't take options for lvextend by default and ignored the previous 2GB filesystems.

  • name: lv extend and resize
    lvol:
    vg: "{{ item.0.vgname }}"
    lv: "{{ item.1.lvname }}"
    size: "{{ item.1.size }}"
    shrink: no
    with_subelements:
    - "{{ lvm_groups_extend }}"
    - lvnames

Initial File System size is 2GB
then I am trying to expand to 12GB (10GB more) but its showing 10GB only. Do you have any idea? if fix will delay, then I may need to go for shell option.

from ansible-modules-extras.

Akasurde avatar Akasurde commented on May 27, 2024

@karthi81 This repo is closed. Please open new issue here.

from ansible-modules-extras.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.