# Create Lower size LV. If Volume Group has less space.

**URL:** <https://forum.ansible.com/t/create-lower-size-lv-if-volume-group-has-less-space/34531>\
**Category:** Ansible Project\
**Created:** [January 28, 2021, 7:49pm UTC](https://forum.ansible.com/t/create-lower-size-lv-if-volume-group-has-less-space/34531 "2021-01-28T19:49:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aris\_Aguirre](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@Aris\_Aguirre](https://forum.ansible.com/u/Aris_Aguirre)\
**Post date:** [January 28, 2021, 7:49pm UTC](https://forum.ansible.com/t/create-lower-size-lv-if-volume-group-has-less-space/34531/1 "2021-01-28T19:49:36Z")

</div>

I have a playbook below. But it only works on the nodes that has 800G (SDB) or the Volume Group has 800G free space. I am expecting that i Volume Group(vgaris) exist and only has 300G, it will still create 100G of lvaris.

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [January 28, 2021, 8:54pm UTC](https://forum.ansible.com/t/create-lower-size-lv-if-volume-group-has-less-space/34531/2 "2021-01-28T20:54:45Z")

</div>

> I have a playbook below. But it only works on the nodes that has 800G (SDB) or the Volume Group has 800G free space. I am expecting that i Volume Group(vgaris) exist and only has 300G, it will still create 100G of lvaris.

Where does your expectation come from?  
Because your lvol task has an explicit size parameter.  
And the docs on  
[https://docs.ansible.com/ansible/latest/collections/community/general/lvol\_module.html#parameter-size](https://docs.ansible.com/ansible/latest/collections/community/general/lvol_module.html#parameter-size)  
mention no defaults.

If you need anything 'clever' you'd have to add that yourself to the playbook.  
This usually is done by registering the output from one task, and  
using that in the subsequent task(s) - with any  
manipulation/transformation of it in between of course.

---

<div class="post-metadata">

**Author:** ![Aris\_Aguirre](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@Aris\_Aguirre](https://forum.ansible.com/u/Aris_Aguirre)\
**Post date:** [January 28, 2021, 10:27pm UTC](https://forum.ansible.com/t/create-lower-size-lv-if-volume-group-has-less-space/34531/3 "2021-01-28T22:27:43Z")

</div>

Lets put it this way. If the vgaris has 80G, it will just create the lvaris 60G with no problem. But if the vgaris has only 50G, then it cant create the 60G but will create a 40G lvaris.  
Thanks

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [January 29, 2021, 6:55am UTC](https://forum.ansible.com/t/create-lower-size-lv-if-volume-group-has-less-space/34531/4 "2021-01-29T06:55:36Z")

</div>

Is this an observation or a question?

---

<div class="post-metadata">

**Author:** ![Aris\_Aguirre](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@Aris\_Aguirre](https://forum.ansible.com/u/Aris_Aguirre)\
**Post date:** [January 29, 2021, 4:12pm UTC](https://forum.ansible.com/t/create-lower-size-lv-if-volume-group-has-less-space/34531/5 "2021-01-29T16:12:01Z")

</div>

Just an observation, I fixed it via block and rescue.
