Documentation ¶
Index ¶
- func BackupVirtualMachine(opts BackupVirtualMachineOptions) error
- func CPUQuantityToMhz(q resource.Quantity, cpuFreqMhz uint64) int64
- func ConfigSpecFromVMClassDevices(vmClassSpec *vmopv1.VirtualMachineClassSpec) *types.VirtualMachineConfigSpec
- func CreateConfigSpec(vmCtx context.VirtualMachineContextA2, ...) *types.VirtualMachineConfigSpec
- func CreateConfigSpecForPlacement(vmCtx context.VirtualMachineContextA2, ...) *types.VirtualMachineConfigSpec
- func CreateInstanceStorageDiskDevices(isVolumes []vmopv1.VirtualMachineVolume) []vimTypes.BaseVirtualDevice
- func CreateOVF(vmCtx context.VirtualMachineContextA2, client *rest.Client, ...) (string, error)
- func CreatePCIDevicesFromConfigSpec(pciDevsFromConfigSpec []*vimTypes.VirtualPCIPassthrough) []vimTypes.BaseVirtualDevice
- func CreatePCIDevicesFromVMClass(pciDevicesFromVMClass vmopv1.VirtualDevices) []vimTypes.BaseVirtualDevice
- func CreatePCIPassThroughDevice(deviceKey int32, backingInfo vimTypes.BaseVirtualDeviceBackingInfo) vimTypes.BaseVirtualDevice
- func DecryptWebMKS(privKey *rsa.PrivateKey, ciphertext string) (string, error)
- func DeleteVirtualMachine(vmCtx context.VirtualMachineContextA2, vcVM *object.VirtualMachine) error
- func EncryptWebMKS(pubKey string, plaintext string) (string, error)
- func GetDefaultDiskProvisioningType(vmCtx context.VirtualMachineContextA2, vcClient *vcclient.Client, ...) (string, error)
- func GetExtraConfigGuestInfo(ctx context.Context, vm *object.VirtualMachine) (map[string]string, error)
- func GetGuestHeartBeatStatus(ctx context.Context, vm *object.VirtualMachine) (vmopv1.GuestHeartbeatStatus, error)
- func GetVMClusterComputeResource(ctx context.Context, vcVM *object.VirtualMachine) (*object.ClusterComputeResource, error)
- func GetWebConsoleTicket(vmCtx context.VirtualMachineContextA2, vm *object.VirtualMachine, ...) (string, error)
- func MemoryQuantityToMb(q resource.Quantity) int64
- type BackupVirtualMachineOptions
- type PVCDiskData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackupVirtualMachine ¶
func BackupVirtualMachine(opts BackupVirtualMachineOptions) error
BackupVirtualMachine backs up the required data of a VM into its ExtraConfig. Currently, the following data is backed up: - VM Kubernetes resource in YAMl. - Additional VM-relevant Kubernetes resources in YAML, separated by "---". - PVC disk data in JSON format (if DiskUUIDToPVC is not empty).
func ConfigSpecFromVMClassDevices ¶
func ConfigSpecFromVMClassDevices(vmClassSpec *vmopv1.VirtualMachineClassSpec) *types.VirtualMachineConfigSpec
ConfigSpecFromVMClassDevices creates a ConfigSpec that adds the standalone hardware devices from the VMClass if any. This ConfigSpec will be used as the class ConfigSpec to CreateConfigSpec, with the rest of the class fields - like CPU count - applied on top.
func CreateConfigSpec ¶
func CreateConfigSpec( vmCtx context.VirtualMachineContextA2, vmClassConfigSpec *types.VirtualMachineConfigSpec, vmClassSpec *vmopv1.VirtualMachineClassSpec, vmImageStatus *vmopv1.VirtualMachineImageStatus, minFreq uint64) *types.VirtualMachineConfigSpec
CreateConfigSpec returns an initial ConfigSpec that is created by overlaying the base ConfigSpec with VM Class spec and other arguments. TODO: We eventually need to de-dupe much of this with the ConfigSpec manipulation that's later done in the "update" pre-power on path. That operates on a ConfigInfo so we'd need to populate that from the config we build here.
func CreateConfigSpecForPlacement ¶
func CreateConfigSpecForPlacement( vmCtx context.VirtualMachineContextA2, baseConfigSpec *types.VirtualMachineConfigSpec, storageClassesToIDs map[string]string) *types.VirtualMachineConfigSpec
CreateConfigSpecForPlacement creates a ConfigSpec that is suitable for Placement. baseConfigSpec will likely be - or at least derived from - the ConfigSpec returned by CreateConfigSpec above.
func CreateInstanceStorageDiskDevices ¶
func CreateInstanceStorageDiskDevices(isVolumes []vmopv1.VirtualMachineVolume) []vimTypes.BaseVirtualDevice
func CreateOVF ¶
func CreateOVF( vmCtx context.VirtualMachineContextA2, client *rest.Client, vmPubReq *vmopv1.VirtualMachinePublishRequest, cl *imgregv1a1.ContentLibrary, actID string) (string, error)
func CreatePCIDevicesFromConfigSpec ¶
func CreatePCIDevicesFromConfigSpec(pciDevsFromConfigSpec []*vimTypes.VirtualPCIPassthrough) []vimTypes.BaseVirtualDevice
CreatePCIDevicesFromConfigSpec creates vim25 VirtualDevices from the specified list of PCI devices from the VM Class ConfigSpec.
func CreatePCIDevicesFromVMClass ¶
func CreatePCIDevicesFromVMClass(pciDevicesFromVMClass vmopv1.VirtualDevices) []vimTypes.BaseVirtualDevice
CreatePCIDevicesFromVMClass creates vim25 VirtualDevices from the specified list of PCI devices from VM Class spec.
func CreatePCIPassThroughDevice ¶
func CreatePCIPassThroughDevice(deviceKey int32, backingInfo vimTypes.BaseVirtualDeviceBackingInfo) vimTypes.BaseVirtualDevice
func DecryptWebMKS ¶
func DecryptWebMKS(privKey *rsa.PrivateKey, ciphertext string) (string, error)
func DeleteVirtualMachine ¶
func DeleteVirtualMachine( vmCtx context.VirtualMachineContextA2, vcVM *object.VirtualMachine) error
func GetDefaultDiskProvisioningType ¶
func GetDefaultDiskProvisioningType( vmCtx context.VirtualMachineContextA2, vcClient *vcclient.Client, storageProfileID string) (string, error)
GetDefaultDiskProvisioningType gets the default disk provisioning type specified for the VM.
func GetExtraConfigGuestInfo ¶
func GetGuestHeartBeatStatus ¶
func GetGuestHeartBeatStatus( ctx context.Context, vm *object.VirtualMachine) (vmopv1.GuestHeartbeatStatus, error)
func GetVMClusterComputeResource ¶
func GetVMClusterComputeResource( ctx context.Context, vcVM *object.VirtualMachine) (*object.ClusterComputeResource, error)
GetVMClusterComputeResource returns the VM's ClusterComputeResource.
func GetWebConsoleTicket ¶
func GetWebConsoleTicket( vmCtx context.VirtualMachineContextA2, vm *object.VirtualMachine, pubKey string) (string, error)
func MemoryQuantityToMb ¶
Types ¶
type BackupVirtualMachineOptions ¶ added in v1.8.6
type BackupVirtualMachineOptions struct { VMCtx context.VirtualMachineContextA2 VcVM *object.VirtualMachine DiskUUIDToPVC map[string]corev1.PersistentVolumeClaim AdditionalResources []client.Object }
BackupVirtualMachineOptions contains the options for BackupVirtualMachine.
type PVCDiskData ¶ added in v1.8.6
type PVCDiskData struct { // Filename contains the datastore path to the virtual disk. FileName string // PVCName is the name of the PVC backed by the virtual disk. PVCName string // AccessMode is the access modes of the PVC backed by the virtual disk. AccessModes []corev1.PersistentVolumeAccessMode }
PVCDiskData contains the data of a disk attached to VM backed by a PVC.