session

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReconfigure            = pkgerr.NoRequeueNoErr("reconfigured vm")
	ErrUpgradeHardwareVersion = pkgerr.NoRequeueNoErr("upgraded hardware version")
)

Functions

func UpdateConfigSpecAnnotation

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

func UpdateConfigSpecChangeBlockTracking

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

func UpdateConfigSpecExtraConfig

func UpdateConfigSpecExtraConfig(
	ctx context.Context,
	config *vimtypes.VirtualMachineConfigInfo,
	configSpec *vimtypes.VirtualMachineConfigSpec,
	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 UpdateHardwareConfigSpec

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

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

	BootstrapData  vmlifecycle.BootstrapData
	ResourcePolicy *vmopv1.VirtualMachineSetResourcePolicy
	NetworkResults network.NetworkInterfaceResults
}

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 network.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