Documentation ¶
Index ¶
- func Create(f *object.Folder, name string, spec types.ClusterConfigSpecEx) (*object.ClusterComputeResource, error)
- func Delete(cluster *object.ClusterComputeResource) error
- func FromID(client *govmomi.Client, id string) (*object.ClusterComputeResource, error)
- func FromPath(client *govmomi.Client, name string, dc *object.Datacenter) (*object.ClusterComputeResource, error)
- func HasChildren(cluster *object.ClusterComputeResource) (bool, error)
- func IsMember(cluster *object.ClusterComputeResource, host *object.HostSystem) (bool, error)
- func MoveHostsInto(cluster *object.ClusterComputeResource, hosts []*object.HostSystem) error
- func MoveHostsOutOf(cluster *object.ClusterComputeResource, hosts []*object.HostSystem, ...) error
- func MoveToFolder(client *govmomi.Client, cluster *object.ClusterComputeResource, ...) error
- func Properties(cluster *object.ClusterComputeResource) (*mo.ClusterComputeResource, error)
- func Reconfigure(cluster *object.ClusterComputeResource, spec *types.ClusterConfigSpecEx) error
- func Rename(cluster *object.ClusterComputeResource, name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(f *object.Folder, name string, spec types.ClusterConfigSpecEx) (*object.ClusterComputeResource, error)
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 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 ¶
func Properties(cluster *object.ClusterComputeResource) (*mo.ClusterComputeResource, error)
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.
Types ¶
This section is empty.