How do I change a vmware VM network after deployment.

24 views
Skip to first unread message

Mike Schlottman

unread,
Sep 27, 2016, 6:38:00 PM9/27/16
to Ansible Project
I cloned a vmware VM from a template.   Now I need to change the network to a different network port group.  I tried using vsphere_guest to change the network, but reconfigure only seems to work for CPU, Memory and CDROM.   Is there some other way I should do this?   Being able to set these sorts of parameters after cloning a VM is critical to me.  

  tasks:
    - vsphere_guest:
        vcenter_hostname: "{{ vcenter_hostname }}"
        username: "{{ vcenter_user }}"
        password: "{{ vcenter_pass }}"
        guest: "MYVM"
        state: reconfigured
        vm_extra_config:
          notes: This is a test VM
        vm_nic:
          nic0:
            network: QANET
            network_type: dvs
        esxi:
          datacenter: MYDATACENTER



Reply all
Reply to author
Forward
0 new messages