vsphere

package
v1.8.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VsphereVMProviderName = "vsphere"
)

Variables

View Source
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 GetAdditionalResourcesForBackup added in v1.8.6

func GetAdditionalResourcesForBackup(
	vmCtx context.VirtualMachineContextA2,
	k8sClient ctrlclient.Client) ([]ctrlclient.Object, error)

GetAdditionalResourcesForBackup returns a list of Kubernetes client objects that are relevant for VM backup (e.g. bootstrap referenced resources).

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(ctx goctx.Context, raw json.RawMessage) (*types.VirtualMachineConfigSpec, error)

func GetVirtualMachineBootstrap

func GetVirtualMachineBootstrap(
	vmCtx context.VirtualMachineContextA2,
	k8sClient ctrlclient.Client) (vmlifecycle.BootstrapData, error)

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.

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.

type VersionedOVFEnvelope

type VersionedOVFEnvelope struct {
	OvfEnvelope    *ovf.Envelope
	ContentVersion string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL