saltext.vmware.modules.vswitch#

saltext.vmware.modules.vswitch.get(hostname, switch_name=None, service_instance=None)[source]#

Get the properties of all vswitches on a host, optionally filtering to one name. Returns an empty list if no matching vswitch is found.

hostname

The host name to inspect.

switch_name

The vswitch name (optional).

service_instance

Use this vCenter service connection instance instead of creating a new one (optional).

CLI Example:

salt '*' vmware_vswitch.get hostname=host1 switch_name=vSwitch1
saltext.vmware.modules.vswitch.add(switch_name, hostname, mtu=1500, nics=[], num_ports=128, service_instance=None)[source]#

Adds a vswitch to the host.

switch_name

The name of the new vswitch.

hostname

The hostname where the switch will be added.

mtu

Maximum transmission unit size in bytes (optional).

nics

List of physical nics to attach to; if used might look like [“vmnic0”] (optional).

num_ports

Number of ports to allocate on the virtual switch.

service_instance

Use this vCenter service connection instance instead of creating a new one (optional).

CLI Example:

salt '*' vmware_vswitch.add switch_name=vSwitch0 hostname=host1 mtu=1500, nics='["vmnic0", "vmnic1"]', num_ports=256
saltext.vmware.modules.vswitch.remove(switch_name, hostname, service_instance=None)[source]#

Removes a vswitch on the host.

switch_name

The name of the vswitch to be removed.

hostname

The hostname where the switch exists.

service_instance

Use this vCenter service connection instance instead of creating a new one (optional).

CLI Example:

salt '*' vmware_vswitch.remove switch_name=vSwitch0 host_name=host1