# vmware\_guest module with disk extra parameter

**URL:** <https://forum.ansible.com/t/vmware-guest-module-with-disk-extra-parameter/36543>\
**Category:** Ansible Project\
**Created:** [April 19, 2022, 7:51pm UTC](https://forum.ansible.com/t/vmware-guest-module-with-disk-extra-parameter/36543 "2022-04-19T19:51:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_S](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@Daniel\_S](https://forum.ansible.com/u/Daniel_S)\
**Post date:** [April 19, 2022, 7:51pm UTC](https://forum.ansible.com/t/vmware-guest-module-with-disk-extra-parameter/36543/1 "2022-04-19T19:51:59Z")

</div>

Hello everyone, i was using ansible 2.10.3, and all was working as well.

I’ve tried to upgrade my project to ansible 4.10.0, but i’m facing this issue.

I have the fallowing message:

{  
“msg”: “Unsupported parameters for (vmware\_guest) module: disk.lvnames, disk.vgname. Supported parameters include: state, linked\_clone, resource\_pool, cdrom, customization, wait\_for\_customization, datacenter, convert, guest\_id, is\_template, snapshot\_src, wait\_for\_ip\_address, nvdimm, customvalues, esxi\_hostname, port, use\_instance\_uuid, delete\_from\_inventory, password (pass, pwd), networks, template (template\_src), advanced\_settings, datastore, name\_match, wait\_for\_ip\_address\_timeout, proxy\_host, validate\_certs, cluster, hardware, wait\_for\_customization\_timeout, username (admin, user), state\_change\_timeout, proxy\_port, vapp\_properties, name, disk, annotation (notes), customization\_spec, uuid, force, folder, hostname.”,  
“invocation”: {  
“module\_args”: {  
“hostname”: "_**",  
“username”: "**__",  
“password”: “VALUE\_SPECIFIED\_IN\_NO\_LOG\_PARAMETER”,  
“datacenter”: "_**",  
“cluster”: "**_",  
“resource\_pool”: "_\*\* ",  
“validate\_certs”: true,  
“uuid”: “none”,  
“folder”: " \*\*\* ",  
“name”: " \*\*\* ",  
“guest\_id”: “\*\*\*”,  
“disk”: [  
{  
“datastore”: " \*\*\* ",  
“size\_gb”: 20,  
“type”: “thick”,  
“autoselect\_datastore”: null,  
“controller\_number”: null,  
“controller\_type”: null,  
“disk\_mode”: null,  
“filename”: null,  
“size”: null,  
“size\_kb”: null,  
“size\_mb”: null,  
“size\_tb”: null,  
“unit\_number”: null  
},  
{  
“datastore”: " \*\*\* ",  
“lvnames”: ,  
“size\_gb”: 30,  
“type”: “thick”,  
“vgname”: “data\_vg”,  
“autoselect\_datastore”: null,  
“controller\_number”: null,  
“controller\_type”: null,  
“disk\_mode”: null,  
“filename”: null,  
“size”: null,  
“size\_kb”: null,  
“size\_mb”: null,  
“size\_tb”: null,  
“unit\_number”: null  
}  
],  
“cdrom”: {  
“type”: “iso”,

…  
}

This extra params (lvnames et vgname) are used by another role on my collection.

is there a way (simple or not) to achieve this?

Thanks for your help.

Cheers

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [April 20, 2022, 3:00am UTC](https://forum.ansible.com/t/vmware-guest-module-with-disk-extra-parameter/36543/2 "2022-04-20T03:00:26Z")

</div>

The closest thing I’ve come up with is, when you pass the “disk:” value in your module invocation, (assuming your variable name is “disk”), do this:

```auto
  disk: |
          {%- for disc in disk -%}
          {{ disc | dict2items | list | rejectattr('key', 'in', ['lvnames', 'vgname']) | list | items2dict }},
          {%- endfor -%}

```

It’s not pretty, and I’m not proud of it, but it seems to work at least in a debug task with your data.  
This should be a lot easier.

---

<div class="post-metadata">

**Author:** ![Daniel\_S](https://avatars.discourse-cdn.com/v4/letter/d/7bcc69/32.png) [@Daniel\_S](https://forum.ansible.com/u/Daniel_S)\
**Post date:** [April 22, 2022, 1:19pm UTC](https://forum.ansible.com/t/vmware-guest-module-with-disk-extra-parameter/36543/3 "2022-04-22T13:19:28Z")

</div>

Hi Uto,

Thanks for your feedback,

i do it with this way:

{%- for disc in server.disk -%}  
{%- if disc.vgname is defined -%}  
{%- do disc.pop(‘vgname’) -%}  
{%- do disc.pop(‘lvnames’) -%}  
{%- endif -%}  
{%- endfor -%}

all working now.

Thanks for putting me on the right track

Cheers
