Skip to content

esxi/dvs-mappings

Defines any additional command line options to pass to ansible for playbooks

This data structure defines how the DVS switches should be created in a VMware ESXi cluster.

This Param data structure defines the configurations of the Distributed Virtual Switches and Portgroups. In addition, you must add the Param esxi/dvs-memberships to each vSphere ESXi node with the DVS switches to add to that node.

Supported DVS configuration values are as follows:

  • mtu = From 1000 to 9999
  • version = one of 6.5.0, 6.6.0, 7.0.0
  • discovery = one of cdp or lldp

For Portgroups on a DVS, the following values are supported:

  • type = one of ephemeral, earlyBinding, or lateBinding
  • ports = 0 for elastic, or from 1 to 60,000
  • vlans = empty or 0 for none, or VLAN tag ID from 1 to 4096
  • migrate.portgroup = standard switch portgroup name to migrate during DVS creation (eg Management Network)
  • migrate.vswitch = standard vswitch name to migrate during DVS creation (eg vSwitch0)
  • migrate.vmk = VMK interface to migrate (eg vmk0)
  • migrate.vms_to_migrate = An array of VM names to migrate from the Standard to Distributed vSwitch

Portgroup values type, ports, and vlans can optionally be left empty. If they are, they will default to the Portgroup version based default values.

The migrate options will allow migrating the specified Standard Virtual Switch portgroup specified, to the DVS Portgroup. If they are not specified, no portgroup migrations will be made.

Example in YAML:

esxi/dvs-mappings:
  dvs01:
    mtu: 9000
    version: 7.0.0
    discovery: lldp
    vmnic: vmnic1
    portgroups:
      pg_internal:
        migrate:
          portgroup: "Management Network"
          vswitch: "vSwitch0"
          vmk: "vmk0"
          vms_to_migrate:
            - "vm01"
            - "vm02"
        type: ephemeral
        ports: 16
        vlan: 10
      pg_external:
        type: ephemeral
        ports: 8
        vlan: 0
  dvs02:
    mtu: 1534
    version: 7.0.0
    discovery: cdp
    vmnic: vmnic2

Example in JSON:

"dvs01": {
  "mtu": 9000,
  "version": "7.0.0",
  "discovery": "lldp",
  "vmnic": "vmnic1",
  "portgroups": {
    "pg_external": {
      "type": "ephemeral",
      "vlan": 10
      "ports": 8
    },
    "pg_internal": {
      "migrate": {
        "portgroup": "Management Network",
        "vmk": "vmk0",
        "vswitch": "vSwitch0",
        "vms_to_migrate": [
          "vm01", "vm02"
        ]
      }
      "type": "ephemeral",
      "vlan": 0,
      "ports": 16
    }
  }
},
"dvs02": {
  "mtu": 1534,
  "version": "7.0.0",
  "discovery": "cdp",
  "vmnic": "vmnic2"
}

In the above example, the dvs01 DVS will have jumbo frames, switch version set to 7.0.0, discovery packets will use the LLDP protocol, and it will map to the vmnic1 device. In addition, it will define two Portgroups, named pg_internal and pg_external; both of type ephemeral with different numbers of ports defined.

The dvs02 switch will use standard size packets, the CDP discovery protocol, the vmnic2 device, and will not map any Portgroups.

Note

You must also add the named DVS Switches (eg dvs01 and dvs02 in the above example), to the vSphere ESXi nodes that will use these switches; via the esxi/dvs-memberships Param.