# vmware\_guest module hdd resize & networking

**URL:** <https://forum.ansible.com/t/vmware-guest-module-hdd-resize-networking/24850>\
**Category:** Ansible Project\
**Created:** [June 29, 2017, 1:45pm UTC](https://forum.ansible.com/t/vmware-guest-module-hdd-resize-networking/24850 "2017-06-29T13:45:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![El\_Duderino](https://avatars.discourse-cdn.com/v4/letter/e/b5a626/32.png) [@El\_Duderino](https://forum.ansible.com/u/El_Duderino)\
**Post date:** [June 29, 2017, 1:45pm UTC](https://forum.ansible.com/t/vmware-guest-module-hdd-resize-networking/24850/1 "2017-06-29T13:45:13Z")

</div>

Hi There,

This is my first time digging around here and I am not sure if this is a bug or if I am missing somehting. In case this is a bug I would happily open a bug report.

I have been using/testing the vmware\_guest plugin to create new VM’s from template. We have an Vsphere 6.0 environment and I am testing this with CentOS 6 and CentOS 7.

Now I know that, given I have a template which was created with lets say 16GB disk space, I am not able to create a new VM from this template with less than 16GB disk space. Thats fine.

If I create a new VM using a template, and assign lets say 32GB disk space, what is the expected outcome?

Using cfdisk I can see that the additional space is allocated, but the partition (LVM) is not resized. But I think I remember, that in the past, this was working and the partition was resized as well (I may be wrong though).

I tested this with a lot of settings now and noticed that I used the state “poweredon” all the time instead of “present”(as the docs say “If `state` is set to `present` and VM exists, ensure the VM configuration conforms to task arguments”). But even when I changed it to “present” again, this did not work either.

Tested with Ansible version 2.3.0 & 2.3.1.

Code is as follow:

> * * *
> 
> - name: Create VM  
> vmware\_guest:  
> hostname: “{{ vsphere\_hostname }}”  
> username: “{{ vsphere\_username }}”  
> password: “{{ vsphere\_password }}”  
> cluster: “{{ vsphere\_cluster }}”  
> datacenter: “{{ vsphere\_dc }}”  
> folder: “{{ vm\_folder }}”  
> name: “{{ vm\_hostname }}”  
> state: “{{ vm\_state }}”  
> validate\_certs: False  
> guest\_id: centos64Guest  
> disk:
> - size\_gb: “{{ vm\_hdd\_size }}”  
> type: thin  
> autoselect\_datastore: true  
> hardware:  
> memory\_mb: “{{ vm\_mem\_mb }}”  
> num\_cpus: “{{ vm\_num\_cpu }}”  
> scsi: paravirtual  
> template: “{{ vm\_template }}”  
> wait\_for\_ip\_address: yes

Also network settings are not getting passed through to the VM (IP, Subnet, …). I worked around this using vmware\_shell

Cheers,

Mike
