session

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: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var VMUpdatePropertiesSelector = []string{
	"config",
	"guest",
	"summary",
}

VMUpdatePropertiesSelector is the VM properties fetched at the start of UpdateVirtualMachine() when we are It must be a super set of vmlifecycle.vmStatusPropertiesSelector[] since we may pass the properties collected here to vmlifecycle.UpdateStatus() to avoid a second fetch of the VM properties.

Functions

func UpdateConfigSpecAnnotation

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

func UpdateConfigSpecCPUAllocation

func UpdateConfigSpecCPUAllocation(
	config *vimTypes.VirtualMachineConfigInfo,
	configSpec *vimTypes.VirtualMachineConfigSpec,
	vmClassSpec *vmopv1.VirtualMachineClassSpec,
	minCPUFreq uint64)

func UpdateConfigSpecChangeBlockTracking

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

func UpdateConfigSpecExtraConfig

func UpdateConfigSpecExtraConfig(
	ctx goctx.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 UpdateConfigSpecManagedBy

func UpdateConfigSpecManagedBy(
	config *vimTypes.VirtualMachineConfigInfo,
	configSpec *vimTypes.VirtualMachineConfigSpec)

func UpdateConfigSpecMemoryAllocation

func UpdateConfigSpecMemoryAllocation(
	config *vimTypes.VirtualMachineConfigInfo,
	configSpec *vimTypes.VirtualMachineConfigSpec,
	vmClassSpec *vmopv1.VirtualMachineClassSpec)

func UpdateEthCardDeviceChanges

func UpdateEthCardDeviceChanges(
	ctx goctx.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.

Types

type Session

type Session struct {
	Client    *client.Client
	K8sClient ctrlruntime.Client
	Finder    *find.Finder

	// Fields only used during Update
	Cluster *object.ClusterComputeResource
}

func (*Session) UpdateVirtualMachine

func (s *Session) UpdateVirtualMachine(
	vmCtx context.VirtualMachineContextA2,
	vcVM *object.VirtualMachine,
	getUpdateArgsFn func() (*VMUpdateArgs, error)) error

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