- name: Attach a VM to a dvswitch
  vmware.vmware_rest.vcenter_vm_hardware_ethernet:
    vm: '{{ test_vm1_info.id }}'
    pci_slot_number: 4
    backing:
      type: DISTRIBUTED_PORTGROUP
      network: "{{ my_portgroup_info.dvs_portgroup_info.dvswitch1[0].key }}"
    start_connected: false
  register: vm_hardware_ethernet_1
