vim_dvs

vSphere Distributed Virtual Switch (VDS) lifecycle via SOAP.

VDS objects can’t be created through vCenter REST in VCF 9.x; the canonical path is Folder.CreateDVS_Task with a vim.DistributedVirtualSwitch.CreateSpec. Reconfigure uses DistributedVirtualSwitch.ReconfigureDvs_Task.

A VDS is conceptually a switch + a set of uplink ports + a member list of ESXi hosts. Each host attaches with a HostMemberConfigSpec mapping its physical NICs to the switch’s uplinks.

saltext.vcf.clients.vim_dvs.list_(opts, profile=None)[source]

Return a list of {moid, name, uuid, version, num_ports, max_mtu, hosts} dicts.

saltext.vcf.clients.vim_dvs.create(opts, name, datacenter, *, version=None, num_uplinks=4, max_mtu=1500, description='', profile=None)[source]

Create a VDS in datacenter’s networkFolder.

version defaults to vCenter’s latest supported (omit for auto).

saltext.vcf.clients.vim_dvs.reconfigure(opts, name_or_id, *, max_mtu=None, description=None, profile=None)[source]

Update VDS config fields. Only non-None fields are applied.

saltext.vcf.clients.vim_dvs.add_host(opts, dvs_name_or_id, host_name_or_id, *, pnic_devices=None, profile=None)[source]

Attach host to the DVS, optionally pinning pnic_devices (e.g. ["vmnic0"]) to uplinks.