clustercomputeresource

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2018 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

Create creates a ClusterComputeResource in a supplied folder. The resulting ClusterComputeResource is returned.

func Delete

func Delete(cluster *object.ClusterComputeResource) error

Delete destroys a ClusterComputeResource.

func FromID

func FromID(client *govmomi.Client, id string) (*object.ClusterComputeResource, error)

FromID locates a cluster by its managed object reference ID.

func FromPath

func FromPath(client *govmomi.Client, name string, dc *object.Datacenter) (*object.ClusterComputeResource, error)

FromPath loads a ClusterComputeResource from its path. The datacenter is optional if the path is specific enough to not require it.

func HasChildren

func HasChildren(cluster *object.ClusterComputeResource) (bool, error)

HasChildren checks to see if a compute cluster has any child items (hosts and virtual machines) and returns true if that is the case. This is useful when checking to see if a compute cluster is safe to delete - destroying a compute cluster in vSphere destroys *all* children if at all possible (including removing hosts and virtual machines), so extra verification is necessary to prevent accidental removal.

func IsMember

func IsMember(cluster *object.ClusterComputeResource, host *object.HostSystem) (bool, error)

IsMember checks to see if a host is a member of the compute cluster in question.

This is a pretty basic operation that checks that the parent of the compute is the ClusterComputeResource.

func MoveHostsInto

func MoveHostsInto(cluster *object.ClusterComputeResource, hosts []*object.HostSystem) error

MoveHostsInto moves all of the supplied hosts into the cluster. All virtual machines are moved to the cluster's root resource pool and any resource pools on the host itself are deleted.

func MoveHostsOutOf

func MoveHostsOutOf(cluster *object.ClusterComputeResource, hosts []*object.HostSystem, timeout int) error

MoveHostsOutOf moves a supplied list of hosts out of the specified cluster. The host is moved to the root host folder for the datacenter that the cluster is in.

The host is placed into maintenance mode with evacuate flagged on, ensuring that as many VMs as possible are moved out of the host before removing it from the cluster. The effectiveness of this operation is dictated by the cluster's DRS settings, which also affects if this means that the task will block and require manual intervention. The supplied timeout is passed to the maintenance mode operations, and represents the timeout in seconds.

Individual hosts are taken out of maintenance mode after its operation is complete.

func MoveToFolder

func MoveToFolder(client *govmomi.Client, cluster *object.ClusterComputeResource, relative string) error

MoveToFolder is a complex method that moves a ClusterComputeResource to a given relative compute folder path. "Relative" here means relative to a datacenter, which is discovered from the current ClusterComputeResource path.

func Properties

Properties is a convenience method that wraps fetching the ClusterComputeResource MO from its higher-level object.

func Reconfigure

func Reconfigure(cluster *object.ClusterComputeResource, spec *types.ClusterConfigSpecEx) error

Reconfigure reconfigures a cluster. This just gets dispatched to computeresource as both methods are the same.

func Rename

func Rename(cluster *object.ClusterComputeResource, name string) error

Rename renames a ClusterComputeResource.

Types

This section is empty.

Jump to

Keyboard shortcuts

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