session

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateConfigSpecAnnotation

func UpdateConfigSpecAnnotation(
	config *vimtypes.VirtualMachineConfigInfo,
	configSpec *vimtypes.VirtualMachineConfigSpec)

func UpdateConfigSpecChangeBlockTracking

func UpdateConfigSpecChangeBlockTracking(
	ctx context.Context,
	config *vimtypes.VirtualMachineConfigInfo,
	configSpec, classConfigSpec *vimtypes.VirtualMachineConfigSpec,
	vmSpec vmopv1.VirtualMachineSpec)

func UpdateConfigSpecExtraConfig

func UpdateConfigSpecExtraConfig(
	ctx context.Context,
	config *vimtypes.VirtualMachineConfigInfo,
	configSpec, classConfigSpec *vimtypes.VirtualMachineConfigSpec,
	vmClassSpec *vmopv1.VirtualMachineClassSpec,
	vm *vmopv1.VirtualMachine,
	globalExtraConfig map[string]string)

UpdateConfigSpecExtraConfig updates the ExtraConfig of the given ConfigSpec. At a minimum, config and configSpec must be non-nil, in which case it will just ensure MMPowerOffVMExtraConfigKey is no longer part of ExtraConfig.

func UpdateConfigSpecGuestID

func UpdateConfigSpecGuestID(
	config *vimtypes.VirtualMachineConfigInfo,
	configSpec *vimtypes.VirtualMachineConfigSpec,
	vmSpecGuestID string)

UpdateConfigSpecGuestID sets the given vmSpecGuestID in the ConfigSpec if it is not empty and different from the current GuestID in the VM's ConfigInfo.

func UpdateEthCardDeviceChanges

func UpdateEthCardDeviceChanges(
	ctx context.Context,
	expectedEthCards object.VirtualDeviceList,
	currentEthCards object.VirtualDeviceList) ([]vimtypes.BaseVirtualDeviceConfigSpec, error)

func UpdateHardwareConfigSpec

func UpdateHardwareConfigSpec(
	config *vimtypes.VirtualMachineConfigInfo,
	configSpec *vimtypes.VirtualMachineConfigSpec,
	vmClassSpec *vmopv1.VirtualMachineClassSpec)

func UpdatePCIDeviceChanges

func UpdatePCIDeviceChanges(
	expectedPciDevices object.VirtualDeviceList,
	currentPciDevices object.VirtualDeviceList) ([]vimtypes.BaseVirtualDeviceConfigSpec, error)

UpdatePCIDeviceChanges returns devices changes for PCI devices attached to a VM. There are 2 types of PCI devices processed here and in case of cloning a VM, devices listed in VMClass are considered as source of truth.

func UpdateVMGuestIDReconfiguredCondition

func UpdateVMGuestIDReconfiguredCondition(
	vm *vmopv1.VirtualMachine,
	configSpec vimtypes.VirtualMachineConfigSpec,
	taskInfo *vimtypes.TaskInfo)

UpdateVMGuestIDReconfiguredCondition deletes the VM's GuestIDReconfigured condition if the configSpec doesn't contain a guestID, or if the taskInfo does not contain an invalid guestID property error. Otherwise, it sets the condition to false with the invalid guest ID property value in the reason.

Types

type Session

type Session struct {
	Client       *pkgclient.Client
	K8sClient    ctrlclient.Client
	Finder       *find.Finder
	ClusterMoRef types.ManagedObjectReference
}

func (*Session) UpdateVirtualMachine

func (s *Session) UpdateVirtualMachine(
	vmCtx pkgctx.VirtualMachineContext,
	vcVM *object.VirtualMachine,
	getUpdateArgsFn func() (*VMUpdateArgs, error),
	getResizeArgsFn func() (*VMResizeArgs, error)) error

type VMResizeArgs

type VMResizeArgs struct {
	VMClass *vmopv1.VirtualMachineClass
	// ConfigSpec derived from the class and VM Spec.
	ConfigSpec vimtypes.VirtualMachineConfigSpec
}

VMResizeArgs contains the arguments needed to resize a VM on VC.

type VMUpdateArgs

type VMUpdateArgs struct {
	VMClass        vmopv1.VirtualMachineClass
	ResourcePolicy *vmopv1.VirtualMachineSetResourcePolicy
	MinCPUFreq     uint64
	ExtraConfig    map[string]string
	BootstrapData  vmlifecycle.BootstrapData
	ConfigSpec     vimtypes.VirtualMachineConfigSpec
	NetworkResults network2.NetworkInterfaceResults
}

VMUpdateArgs contains the arguments needed to update a VM on VC.

Jump to

Keyboard shortcuts

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