vcf_vim_vm_devices

State module for niche VM virtual devices (vTPM, vGPU, serial).

saltext.vcf.states.vcf_vim_vm_devices.tpm_present(name, vm=None, profile=None)[source]

Ensure a vTPM device is attached to vm. VM must be powered off.

saltext.vcf.states.vcf_vim_vm_devices.tpm_absent(name, vm=None, profile=None)[source]

Ensure no vTPM device on vm.

saltext.vcf.states.vcf_vim_vm_devices.vgpu_present(name, vm, profile_name, profile=None)[source]

Ensure a vGPU with profile_name is attached to vm.

saltext.vcf.states.vcf_vim_vm_devices.vgpu_absent(name, vm, profile_name=None, profile=None)[source]

Ensure no vGPU (or no vGPU with profile_name) on vm.

saltext.vcf.states.vcf_vim_vm_devices.serial_present(name, vm, backing='network', uri=None, file_path=None, direction='server', profile=None)[source]

Ensure a matching serial port exists on vm.

saltext.vcf.states.vcf_vim_vm_devices.usb_controllers_absent(name, connected_only=True, profile=None)[source]

Ensure no VM in the inventory has a USB controller device (Broadcom KB 316384).

Fleet-wide, not single-VM scoped: scans every VM, matching the KB’s reference PowerCLI script’s Get-VM | ? {... -match "USB"} sweep, then removes any USB controller found. Under test=True this only reports which VMs/devices would be touched — no reconfiguration is issued.

When connected_only is true (default, matches the reference script), VMs that aren’t in the connected runtime state are reported but not touched — a disconnected/orphaned VM’s hardware can’t be reconfigured anyway.