Documentation ¶
Index ¶
- Constants
- Variables
- func AddInstanceStorageVolumes(vmCtx context.VirtualMachineContextA2, vmClass *vmopv1.VirtualMachineClass) bool
- func GetAttachedDiskUUIDToPVC(vmCtx context.VirtualMachineContextA2, k8sClient ctrlclient.Client) (map[string]corev1.PersistentVolumeClaim, error)
- func GetVMClassConfigSpec(raw json.RawMessage) (*types.VirtualMachineConfigSpec, error)
- func GetVMSetResourcePolicy(vmCtx context.VirtualMachineContextA2, k8sClient ctrlclient.Client) (*vmopv1.VirtualMachineSetResourcePolicy, error)
- func GetVirtualMachineBootstrap(vmCtx context.VirtualMachineContextA2, k8sClient ctrlclient.Client) (vmlifecycle.BootstrapData, error)
- func GetVirtualMachineClass(vmCtx context.VirtualMachineContextA2, k8sClient ctrlclient.Client) (*vmopv1.VirtualMachineClass, error)
- func GetVirtualMachineImageSpecAndStatus(vmCtx context.VirtualMachineContextA2, k8sClient ctrlclient.Client) (ctrlclient.Object, *vmopv1.VirtualMachineImageSpec, ...)
- func HardwareVersionForPVCandPCIDevices(imageHWVersion int32, configSpec *types.VirtualMachineConfigSpec, hasPVC bool) int32
- func HasPVC(vmSpec vmopv1.VirtualMachineSpec) bool
- func InitOvfCacheAndLockPool(expireAfter, checkExpireInterval time.Duration, maxItems int) (*util.Cache[VersionedOVFEnvelope], *util.LockPool[string, *sync.RWMutex])
- func NewVSphereVMProviderFromClient(client ctrlruntime.Client, recorder record.Recorder) vmprovider.VirtualMachineProviderInterfaceA2
- type VMCreateArgs
- type VersionedOVFEnvelope
Constants ¶
const (
VsphereVMProviderName = "vsphere"
)
Variables ¶
var ( // SkipVMImageCLProviderCheck skips the checks that a VM Image has a Content Library item provider // since a VirtualMachineImage created for a VM template won't have either. This has been broken for // a long time but was otherwise masked on how the tests used to be organized. SkipVMImageCLProviderCheck = false )
Functions ¶
func AddInstanceStorageVolumes ¶
func AddInstanceStorageVolumes( vmCtx context.VirtualMachineContextA2, vmClass *vmopv1.VirtualMachineClass) bool
AddInstanceStorageVolumes checks if VM class is configured with instance storage volumes and appends the volumes to the VM's Spec if not already done. Return true if the VM had or now has instance storage volumes.
func GetAttachedDiskUUIDToPVC ¶
func GetAttachedDiskUUIDToPVC( vmCtx context.VirtualMachineContextA2, k8sClient ctrlclient.Client) (map[string]corev1.PersistentVolumeClaim, error)
GetAttachedDiskUUIDToPVC returns a map of disk UUID to PVC object for all attached disks by checking the VM's spec and status of volumes.
func GetVMClassConfigSpec ¶
func GetVMClassConfigSpec(raw json.RawMessage) (*types.VirtualMachineConfigSpec, error)
func GetVMSetResourcePolicy ¶
func GetVMSetResourcePolicy( vmCtx context.VirtualMachineContextA2, k8sClient ctrlclient.Client) (*vmopv1.VirtualMachineSetResourcePolicy, error)
func GetVirtualMachineBootstrap ¶
func GetVirtualMachineBootstrap( vmCtx context.VirtualMachineContextA2, k8sClient ctrlclient.Client) (vmlifecycle.BootstrapData, error)
func GetVirtualMachineClass ¶
func GetVirtualMachineClass( vmCtx context.VirtualMachineContextA2, k8sClient ctrlclient.Client) (*vmopv1.VirtualMachineClass, error)
func GetVirtualMachineImageSpecAndStatus ¶
func GetVirtualMachineImageSpecAndStatus( vmCtx context.VirtualMachineContextA2, k8sClient ctrlclient.Client) (ctrlclient.Object, *vmopv1.VirtualMachineImageSpec, *vmopv1.VirtualMachineImageStatus, error)
func HardwareVersionForPVCandPCIDevices ¶
func HardwareVersionForPVCandPCIDevices(imageHWVersion int32, configSpec *types.VirtualMachineConfigSpec, hasPVC bool) int32
HardwareVersionForPVCandPCIDevices returns a hardware version for VMs with PVCs and PCI devices(vGPUs/DDPIO devices) The hardware version is determined based on the below criteria: VMs with - Persistent Volume Claim (PVC) get the max(the image hardware version, minimum supported virtual hardware version for persistent volumes) - vGPUs/DDPIO devices get the max(the image hardware version, minimum supported virtual hardware version for PCI devices) - Both vGPU/DDPIO devices and PVCs get the max(the image hardware version, minimum supported virtual hardware version for PCI devices) - none of the above returns 0.
func HasPVC ¶
func HasPVC(vmSpec vmopv1.VirtualMachineSpec) bool
HasPVC returns true if the VirtualMachine spec has a Persistent Volume claim.
func InitOvfCacheAndLockPool ¶
func InitOvfCacheAndLockPool(expireAfter, checkExpireInterval time.Duration, maxItems int) ( *util.Cache[VersionedOVFEnvelope], *util.LockPool[string, *sync.RWMutex])
InitOvfCacheAndLockPool initializes the ovf cache and lock pool that are used to cache the ovf envelope and lock the ovf envelope when it is being downloaded.
func NewVSphereVMProviderFromClient ¶
func NewVSphereVMProviderFromClient( client ctrlruntime.Client, recorder record.Recorder) vmprovider.VirtualMachineProviderInterfaceA2
Types ¶
type VMCreateArgs ¶
type VMCreateArgs struct { vmlifecycle.CreateArgs vmlifecycle.BootstrapData VMClass *vmopv1.VirtualMachineClass ResourcePolicy *vmopv1.VirtualMachineSetResourcePolicy ImageObj ctrlclient.Object ImageSpec *vmopv1.VirtualMachineImageSpec ImageStatus *vmopv1.VirtualMachineImageStatus StorageClassesToIDs map[string]string HasInstanceStorage bool ChildResourcePoolName string ChildFolderName string ClusterMoRef types.ManagedObjectReference NetworkResults network.NetworkInterfaceResults }
VMCreateArgs contains the arguments needed to create a VM on VC.