Documentation

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

                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

                This is an Extras Module

                For more information on what this means please read Extras Modules

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