Add or remove a host from distributed virtual switch
- Manage a host system from distributed virtual switch.
Note
- All modules requires API write access and hence is not supported on a free ESXi license.
- name: Add Host to dVS
community.vmware.vmware_dvs_host:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
esxi_hostname: '{{ esxi_hostname }}'
switch_name: dvSwitch
vmnics:
- vmnic0
- vmnic1
state: present
delegate_to: localhost
- name: Add vmnics to LAGs
community.vmware.vmware_dvs_host:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
esxi_hostname: '{{ esxi_hostname }}'
switch_name: dvSwitch
lag_uplinks:
- lag: lag1
vmnics:
- vmnic0
- vmnic1
- lag: lag2
vmnics:
- vmnic2
- vmnic3
state: present
delegate_to: localhost
- name: Add Host to dVS/enable learnswitch (https://labs.vmware.com/flings/learnswitch)
community.vmware.vmware_dvs_host:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
esxi_hostname: '{{ esxi_hostname }}'
switch_name: dvSwitch
vendor_specific_config:
- key: com.vmware.netoverlay.layer1
value: learnswitch
vmnics:
- vmnic0
- vmnic1
state: present
delegate_to: localhost
- Joseph Callen (@jcpowermac)
- Abhijeet Kasurde (@Akasurde)
- Joseph Andreatta (@vmwjoseph)