saltext.vmware.states.esxi#
- saltext.vmware.states.esxi.role_present(name, privilege_ids, esxi_host_name=None, service_instance=None)[source]#
Ensure role is present on service instance, which may be an ESXi host or vCenter instance.
- role_name
Role to create/update on service instance. (required).
- privilege_ids
List of privileges for the role. (required). Refer: https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.security.doc/GUID-ED56F3C4-77D0-49E3-88B6-B99B8B437B62.html Example: [‘Folder.Create’, ‘Folder.Delete’].
- esxi_host_name
Connect to this ESXi host using your pillar’s service_instance credentials. (optional).
- service_instance
Use this vCenter service connection instance instead of creating a new one. (optional).
- saltext.vmware.states.esxi.role_absent(name, esxi_host_name=None, service_instance=None)[source]#
Ensure role is absent on service instance, which may be an ESXi host or vCenter instance.
- role_name
Role to delete on service instance. (required).
- esxi_host_name
Connect to this ESXi host using your pillar’s service_instance credentials. (optional).
- service_instance
Use this vCenter service connection instance instead of creating a new one. (optional).
- saltext.vmware.states.esxi.vmkernel_adapter_present(name, port_group_name, dvswitch_name=None, vswitch_name=None, enable_fault_tolerance=None, enable_management_traffic=None, enable_provisioning=None, enable_replication=None, enable_replication_nfc=None, enable_vmotion=None, enable_vsan=None, mtu=1500, network_default_gateway=None, network_ip_address=None, network_subnet_mask=None, network_tcp_ip_stack='default', network_type='static', datacenter_name=None, cluster_name=None, host_name=None, service_instance=None)[source]#
Ensure VMKernel Adapter exists on matching ESXi hosts.
- name
The name of the VMKernel interface to update. (required).
- port_group_name
The name of the port group for the VMKernel interface. (required).
- dvswitch_name
The name of the vSphere Distributed Switch (vDS) where to update the VMKernel interface.
- vswitch_name
The name of the vSwitch where to update the VMKernel interface.
- enable_fault_tolerance
Enable Fault Tolerance traffic on the VMKernel adapter. Valid values: True, False.
- enable_management_traffic
Enable Management traffic on the VMKernel adapter. Valid values: True, False.
- enable_provisioning
Enable Provisioning traffic on the VMKernel adapter. Valid values: True, False.
- enable_replication
Enable vSphere Replication traffic on the VMKernel adapter. Valid values: True, False.
- enable_replication_nfc
Enable vSphere Replication NFC traffic on the VMKernel adapter. Valid values: True, False.
- enable_vmotion
Enable vMotion traffic on the VMKernel adapter. Valid values: True, False.
- enable_vsan
Enable VSAN traffic on the VMKernel adapter. Valid values: True, False.
- mtu
The MTU for the VMKernel interface.
- network_default_gateway
Default gateway (Override default gateway for this adapter).
- network_type
Type of IP assignment. Valid values: “static”, “dhcp”.
- network_ip_address
Static IP address. Required if type = ‘static’.
- network_subnet_mask
Static netmask required. Required if type = ‘static’.
- network_tcp_ip_stack
The TCP/IP stack for the VMKernel interface. Valid values: “default”, “provisioning”, “vmotion”, “vxlan”.
- datacenter_name
Filter by this datacenter name (required when cluster is specified)
- cluster_name
Filter by this cluster name (optional)
- host_name
Filter by this ESXi hostname (optional)
- service_instance
Use this vCenter service connection instance instead of creating a new one. (optional).
Save Adapter: vmware_esxi.vmkernel_adapter_present: - name: vmk1 - port_group_name: portgroup1 - dvsswitch_name: vswitch1
- saltext.vmware.states.esxi.vmkernel_adapter_absent(name, datacenter_name=None, cluster_name=None, host_name=None, service_instance=None)[source]#
Ensure VMKernel Adapter exists on matching ESXi hosts.
- name
The name of the VMKernel interface to update. (required).
- datacenter_name
Filter by this datacenter name (required when cluster is specified)
- cluster_name
Filter by this cluster name (optional)
- host_name
Filter by this ESXi hostname (optional)
- service_instance
Use this vCenter service connection instance instead of creating a new one. (optional).
Delete Adapter: vmware_esxi.vmkernel_adapter_absent: - name: vmk1
- saltext.vmware.states.esxi.user_present(name, password, description=None, datacenter_name=None, cluster_name=None, host_name=None, service_instance=None)[source]#
Add local users_by_host on matching ESXi hosts.
- name
User to create on matching ESXi hosts. (required).
- password
Password for the users_by_host. (required).
- description
Description of the users_by_host. (optional).
- datacenter_name
Filter by this datacenter name (required when cluster is specified)
- cluster_name
Filter by this cluster name (optional)
- host_name
Filter by this ESXi hostname (optional)
- service_instance
Use this vCenter service connection instance instead of creating a new one. (optional).
Create User: vmware_esxi.user_present: - name: local_user - password: secret
- saltext.vmware.states.esxi.user_absent(name, datacenter_name=None, cluster_name=None, host_name=None, service_instance=None)[source]#
Remove local users_by_host on matching ESXi hosts.
- name
User to create on matching ESXi hosts. (required).
- datacenter_name
Filter by this datacenter name (required when cluster is specified)
- cluster_name
Filter by this cluster name (optional)
- host_name
Filter by this ESXi hostname (optional)
- service_instance
Use this vCenter service connection instance instead of creating a new one. (optional).
Remove User: vmware_esxi.user_absent: - name: local_user
- saltext.vmware.states.esxi.maintenance_mode(name, enter_maintenance_mode, timeout=0, evacuate_powered_off_vms=False, maintenance_spec=None, service_instance=None)[source]#
Put host into or out of maintenance mode.
- name
Host IP or HostSystem/ManagedObjectReference (required).
- enter_maintenance_mode
If True, put host into maintenance mode. If False, put host out of maintenance mode.
- timeout
If value is greater than 0 then task will timeout if not completed with in window (optional).
- evacuate_powered_off_vms
- Only supported by VirtualCenter (optional).
If True, for DRS will fail unless all powered-off VMs have been manually registered. If False, task will successed with powered-off VMs. Only relevant if enter_maintenance_mode must be True.
- maintenance_spec
- HostMaintenanceSpec (optional).
Only relevant if enter_maintenance_mode must be True.
- service_instance
Use this vCenter service connection instance instead of creating a new one (optional).
salt '*' vmware_esxi.maintenance_mode '192.0.2.117'
Maintenance Mode: vmware_esxi.maintenance_mode: - host: '192.0.2.117' - enter_maintenance_mode: true
- saltext.vmware.states.esxi.lockdown_mode(name, enter_lockdown_mode, datacenter_name=None, cluster_name=None, get_all_hosts=False, service_instance=None)[source]#
Pust a hosts into or out of lockdown.
- name
IP of single host or list of host_names. If wanting to get a cluster just past an empty list (required).
- enter_lockdown_mode
If True, put host into lockdown mode. If False, put host out of lockdown mode (required)
- datacenter_name
The datacenter name. Default is None (optional).
- host_names
The host_names to be retrieved. Default is None (optional).
- cluster_name
The cluster name - used to restrict the hosts retrieved. Only used if the datacenter is set. This argument is optional (optional).
- get_all_hosts
Specifies whether to retrieve all hosts in the container. Default value is False (optional).
- service_instance
The Service Instance Object from which to obtain the hosts (optional).
salt '*' vmware_esxi.lockdown_mode '192.0.2.117'
Lockdown Mode: vmware_esxi.lockdown_mode: - host: '192.0.2.117' - enter_lockdown_mode: true