vcenter

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterMinCPUFreq

func ClusterMinCPUFreq(ctx goctx.Context, cluster *object.ClusterComputeResource) (uint64, error)

ClusterMinCPUFreq returns the minimum frequency across all the hosts in the cluster. This is needed to convert the CPU requirements specified in cores to MHz. vSphere core is assumed to be equivalent to the value of min frequency. This function is adapted from wcp schedext.

func CreateFolder

func CreateFolder(
	ctx goctx.Context,
	vimClient *vim25.Client,
	parentFolderMoID, childName string) (string, error)

CreateFolder creates the named child Folder under the parent Folder.

func CreateOrUpdateChildResourcePool

func CreateOrUpdateChildResourcePool(
	ctx goctx.Context,
	vimClient *vim25.Client,
	parentRPMoID string,
	rpSpec *vmopv1.ResourcePoolSpec) (string, error)

CreateOrUpdateChildResourcePool creates or updates the child ResourcePool under the parent ResourcePool.

func DeleteChildFolder

func DeleteChildFolder(
	ctx goctx.Context,
	vimClient *vim25.Client,
	parentFolderMoID, childName string) error

DeleteChildFolder deletes the child Folder under the parent Folder.

func DeleteChildResourcePool

func DeleteChildResourcePool(
	ctx goctx.Context,
	vimClient *vim25.Client,
	parentRPMoID, childName string) error

DeleteChildResourcePool deletes the child ResourcePool under the parent ResourcePool.

func DoesChildFolderExist

func DoesChildFolderExist(
	ctx goctx.Context,
	vimClient *vim25.Client,
	parentFolderMoID, childName string) (bool, error)

DoesChildFolderExist returns if the named child Folder exists under the parent Folder.

func DoesChildResourcePoolExist

func DoesChildResourcePoolExist(
	ctx goctx.Context,
	vimClient *vim25.Client,
	parentRPMoID, childName string) (bool, error)

DoesChildResourcePoolExist returns if the named child ResourcePool exists under the parent ResourcePool.

func GetChildFolder

func GetChildFolder(
	ctx goctx.Context,
	parentFolder *object.Folder,
	childName string) (*object.Folder, error)

GetChildFolder gets the named child Folder from the parent Folder.

func GetChildResourcePool

func GetChildResourcePool(
	ctx goctx.Context,
	parentRP *object.ResourcePool,
	childName string) (*object.ResourcePool, error)

GetChildResourcePool gets the named child ResourcePool from the parent ResourcePool.

func GetESXHostFQDN

func GetESXHostFQDN(
	ctx context.Context,
	vimClient *vim25.Client,
	hostMoID string) (string, error)

GetESXHostFQDN returns the ESX host's FQDN.

func GetFolderByMoID

func GetFolderByMoID(
	ctx goctx.Context,
	finder *find.Finder,
	folderMoID string) (*object.Folder, error)

GetFolderByMoID returns the vim Folder for the MoID.

func GetResourcePoolByMoID

func GetResourcePoolByMoID(
	ctx goctx.Context,
	finder *find.Finder,
	rpMoID string) (*object.ResourcePool, error)

GetResourcePoolByMoID returns the ResourcePool for the MoID.

func GetResourcePoolOwnerMoRef

func GetResourcePoolOwnerMoRef(
	ctx goctx.Context,
	vimClient *vim25.Client,
	rpMoID string) (types.ManagedObjectReference, error)

GetResourcePoolOwnerMoRef returns the ClusterComputeResource MoID that owns the ResourcePool.

func GetVirtualMachine

func GetVirtualMachine(
	vmCtx context.VirtualMachineContextA2,
	k8sClient ctrlclient.Client,
	vimClient *vim25.Client,
	datacenter *object.Datacenter,
	finder *find.Finder) (*object.VirtualMachine, error)

GetVirtualMachine gets the VM from VC, either by the MoID, UUID, or the inventory path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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