placement

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPlacementRelocateSpec

func CheckPlacementRelocateSpec(spec *types.VirtualMachineRelocateSpec) error

Types

type Recommendation

type Recommendation struct {
	PoolMoRef types.ManagedObjectReference
	HostMoRef *types.ManagedObjectReference
}

Recommendation is the info about a placement recommendation.

func ClusterPlaceVMForCreate

func ClusterPlaceVMForCreate(
	vmCtx context.VirtualMachineContextA2,
	vcClient *vim25.Client,
	resourcePoolsMoRefs []types.ManagedObjectReference,
	configSpec *types.VirtualMachineConfigSpec,
	needsHost bool) ([]Recommendation, error)

ClusterPlaceVMForCreate determines the suitable cluster placement among the specified ResourcePools.

func MakePlacementDecision

func MakePlacementDecision(recommendations map[string][]Recommendation) (string, Recommendation)

MakePlacementDecision selects one of the recommendations for placement.

func PlaceVMForCreate

func PlaceVMForCreate(
	ctx goctx.Context,
	cluster *object.ClusterComputeResource,
	configSpec *types.VirtualMachineConfigSpec) ([]Recommendation, error)

PlaceVMForCreate determines the suitable placement candidates in the cluster.

type Result

type Result struct {
	ZonePlacement            bool
	InstanceStoragePlacement bool
	ZoneName                 string
	HostMoRef                *types.ManagedObjectReference
	PoolMoRef                types.ManagedObjectReference
}

func Placement

func Placement(
	vmCtx context.VirtualMachineContextA2,
	client ctrlclient.Client,
	vcClient *vim25.Client,
	configSpec *types.VirtualMachineConfigSpec,
	childRPName string) (*Result, error)

Placement determines if the VM needs placement, and if so, determines where to place the VM and updates the Labels and Annotations with the placement decision.

Jump to

Keyboard shortcuts

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