vim_host_network¶
Standard vSwitch + port group + VMkernel via SOAP HostNetworkSystem.
Three related surfaces all on host.configManager.networkSystem:
vSwitches —
AddVirtualSwitch/UpdateVirtualSwitch/RemoveVirtualSwitchPort groups —
AddPortGroup/UpdatePortGroup/RemovePortGroupVMkernel adapters —
AddVirtualNic/UpdateVirtualNic/RemoveVirtualNic
VMkernel traffic types (nicType) include: management, vmotion,
vsan, faultToleranceLogging, vSphereReplication, provisioning,
vSphereProvisioning, vSphereBackupNFC. Multiple types can be set
on a single vmkernel.
- saltext.vcf.clients.vim_host_network.vswitch_list(opts, host, profile=None)[source]¶
List standard vSwitches on host.
Returns an empty list when the host has no reported network config (e.g. a not-fully-initialized host, or a pure-VDS deployment).
- saltext.vcf.clients.vim_host_network.vswitch_add(opts, host, name, *, num_ports=128, mtu=1500, pnic_devices=None, profile=None)[source]¶
Create a standard vSwitch. pnic_devices (e.g.
["vmnic0"]) attach physical uplinks; omit for an internal-only vSwitch.
- saltext.vcf.clients.vim_host_network.vswitch_update(opts, host, name, *, num_ports=None, mtu=None, pnic_devices=None, profile=None)[source]¶
Update a vSwitch. Reads the existing spec, merges non-None fields, writes back.
- saltext.vcf.clients.vim_host_network.vswitch_get_teaming(opts, host, name, profile=None)[source]¶
Return the NIC teaming/failover policy on standard vSwitch name.
Returns
Nonewhen the vSwitch has no explicit teaming policy set (rare — ESXi always populates a default policy in practice).
- saltext.vcf.clients.vim_host_network.vswitch_set_teaming(opts, host, name, *, policy, reverse_policy=None, notify_switches=None, rolling_order=None, check_beacon=None, active_nic=None, standby_nic=None, profile=None)[source]¶
Set the NIC teaming/failover policy on standard vSwitch name.
policy is one of
loadbalance_ip,loadbalance_srcmac,loadbalance_srcid,failover_explicit.All other fields are optional and only sent when non-None; existing non-teaming vSwitch spec fields (numPorts, mtu, bridge) are preserved by reading and re-sending the current spec.
- saltext.vcf.clients.vim_host_network.vmkernel_add(opts, host, portgroup, *, dhcp=False, ip_address=None, subnet_mask=None, mtu=1500, mac_address=None, nic_types=None, profile=None)[source]¶
Add a VMkernel adapter on portgroup.
Returns the new vmkernel device name (e.g.
vmk1).
- saltext.vcf.clients.vim_host_network.vmkernel_migrate(opts, host, device, dst_portgroup, profile=None)[source]¶
Move VMkernel device from its current portgroup to dst_portgroup.
Preserves IP/MTU/MAC by reading the current spec, removing, and re-adding on the destination portgroup. The device name (e.g.
vmk2) may change after the migration; the new name is returned.
- saltext.vcf.clients.vim_host_network.ipv6_get(opts, host, profile=None)[source]¶
Return
{enabled}for IPv6 on host’s network config.
- saltext.vcf.clients.vim_host_network.ipv6_set(opts, host, enabled, profile=None)[source]¶
Enable or disable IPv6 on host. Reboot required to take effect.
- saltext.vcf.clients.vim_host_network.vmkernel_set_traffic_types(opts, host, device, nic_types, profile=None)[source]¶
Replace the traffic-type bitmap on a VMkernel adapter.
nic_types is a list of strings —
management,vmotion,vsan,faultToleranceLogging,vSphereReplication,provisioning,vSphereProvisioning,vSphereBackupNFC.