vmware_dvswitch - Create or remove a distributed vSwitch

New in version 2.0.

Synopsis

  • Create or remove a distributed vSwitch

Requirements (on host that executes module)

  • python >= 2.6
  • PyVmomi

Options

parameter required default choices comments
datacenter_name
yes
The name of the datacenter that will contain the dvSwitch
discovery_operation
no
  • both
  • none
  • advertise
  • listen
Select the discovery operation
discovery_proto
yes
  • cdp
  • lldp
Link discovery protocol between Cisco and Link Layer discovery
hostname
yes
The hostname or IP address of the vSphere vCenter.
mtu
yes
The switch maximum transmission unit
password
yes
The password of the vSphere vCenter.
aliases: pass, pwd
state
no present
  • present
  • absent
Create or remove dvSwitch
switch_name
yes
The name of the switch to create or remove
uplink_quantity
yes
Quantity of uplink per ESXi host added to the switch
username
yes
The username of the vSphere vCenter.
aliases: user, admin
validate_certs
no True
  • True
  • False
Allows connection when SSL certificates are not valid. Set to false when certificates are not trusted.

Examples

- name: Create dvswitch
  local_action:
    module: vmware_dvswitch
    hostname: vcenter_ip_or_hostname
    username: vcenter_username
    password: vcenter_password
    datacenter_name: datacenter
    switch_name: dvSwitch
    mtu: 9000
    uplink_quantity: 2
    discovery_proto: lldp
    discovery_operation: both
    state: present

Notes

Note

  • Tested on vSphere 5.5

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.4/vmware_dvswitch_module.html