# Clone created form template with vmware\_guest gets same IP

**URL:** <https://forum.ansible.com/t/clone-created-form-template-with-vmware-guest-gets-same-ip/31695>\
**Category:** AWX Project\
**Tags:** ubuntu\
**Created:** [November 20, 2019, 7:27pm UTC](https://forum.ansible.com/t/clone-created-form-template-with-vmware-guest-gets-same-ip/31695 "2019-11-20T19:27:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Nanboe](https://avatars.discourse-cdn.com/v4/letter/d/9d8465/32.png) [@Daniel\_Nanboe](https://forum.ansible.com/u/Daniel_Nanboe)\
**Post date:** [November 20, 2019, 7:27pm UTC](https://forum.ansible.com/t/clone-created-form-template-with-vmware-guest-gets-same-ip/31695/1 "2019-11-20T19:27:28Z")

</div>

I create an ubuntu 18.04 clone vm from an template using ansible and vmware\_guest.

All is fine except that all the machines that I create get the same IP address as the first one. The mac address is different but I think is something related to the machine-id [https://unix.stackexchange.com/questions/402999/it-is-ok-to-change-etc-machine-id](https://unix.stackexchange.com/questions/402999/it-is-ok-to-change-etc-machine-id)

I am not sure how to solve this at creation as I need the ip address to add it to an inventory yml in the same playbook.

Daniel

---

<div class="post-metadata">

**Author:** ![dan\_linder](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dan_linder/32/3833_2.png) [@dan\_linder](https://forum.ansible.com/u/dan_linder)\
**Post date:** [November 21, 2019, 1:40pm UTC](https://forum.ansible.com/t/clone-created-form-template-with-vmware-guest-gets-same-ip/31695/2 "2019-11-21T13:40:16Z")

</div>

Have you used the [“networks” parameter](https://docs.ansible.com/ansible/latest/modules/vmware_guest_module.html#examples) within the vmware\_guest module? It lets you set the guest VM IP address/netmask, and other common networking settings:

```auto
  - name: Create a virtual machine on given ESXi hostname
    vmware_guest:
      hostname: "{{ vcenter_hostname }}"
      username: "{{ vcenter_username }}"
      password: "{{ vcenter_password }}"
    networks:
    - name: VM Network
      mac: aa:bb:dd:aa:00:14
      ip: 10.10.10.100
      netmask: 255.255.255.0
      device_type: vmxnet3

```
