vcf_vim_host_network¶
State module for standard vSwitch / port group / VMkernel adapters.
- saltext.vcf.states.vcf_vim_host_network.vswitch_present(name, host, num_ports=None, mtu=1500, pnic_devices=None, profile=None)[source]¶
Ensure a standard vSwitch name exists on host with the given config.
num_ports is a create-time hint only — ESXi 5+ auto-scales the port count internally, so passing a fixed value produces spurious drift on every apply. Omit it to skip the drift check; the creation of a new vSwitch still falls back to 128.
- saltext.vcf.states.vcf_vim_host_network.portgroup_present(name, host, vswitch, vlan_id=0, promiscuous=None, mac_changes=None, forged_transmits=None, profile=None)[source]¶
Ensure a standard port group name exists with the given config.
Security-policy args (
promiscuous/mac_changes/forged_transmits):Trueaccepts,Falserejects,None(default) inherits the vSwitch policy.Nested-VM labs typically want all three
Trueon the port group carrying nested workloads so nested MAC addresses can traverse the physical vSwitch.
- saltext.vcf.states.vcf_vim_host_network.vmkernel_present(name, host, portgroup=None, dhcp=False, ip_address=None, subnet_mask=None, mtu=1500, profile=None)[source]¶
Ensure a VMkernel name (device id, e.g.
vmk1) exists.If the device doesn’t exist, a portgroup is required to bind it to. For an existing vmkernel, drift on IP/MTU/DHCP triggers an update.