resourcepool

package
v0.0.0-...-26687db Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

Create creates a ResourcePool.

func DefaultDevices

func DefaultDevices(client *govmomi.Client, pool *object.ResourcePool, guest string) (object.VirtualDeviceList, error)

DefaultDevices loads a default VirtualDeviceList for a supplied pool and guest ID (guest OS type).

func Delete

func Delete(rp *object.ResourcePool) error

Delete destroys a ResourcePool.

func FromID

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

FromID locates a ResourcePool by its managed object reference ID.

func FromPathOrDefault

func FromPathOrDefault(client *govmomi.Client, name string, dc *object.Datacenter) (*object.ResourcePool, error)

FromPathOrDefault returns a ResourcePool via its supplied path.

func HasChildren

func HasChildren(rp *object.ResourcePool) (bool, error)

HasChildren checks to see if a resource pool has any child items (virtual machines, vApps, or resource pools) and returns true if that is the case. This is useful when checking to see if a resource pool is safe to delete. Destroying a resource pool in vSphere destroys *all* children if at all possible, so extra verification is necessary to prevent accidental removal.

func List

func List(client *govmomi.Client) ([]*object.ResourcePool, error)

func MoveIntoResourcePool

func MoveIntoResourcePool(p *object.ResourcePool, c types.ManagedObjectReference) error

MoveIntoResourcePool moves a virtual machine, resource pool, or vApp into the specified ResourcePool.

func OSFamily

func OSFamily(client *govmomi.Client, pool *object.ResourcePool, guest string) (string, error)

OSFamily uses the resource pool's environment browser to get the OS family for a specific guest ID.

func Properties

func Properties(obj *object.ResourcePool) (*mo.ResourcePool, error)

Properties returns the ResourcePool managed object from its higher-level object.

func Update

func Update(rp *object.ResourcePool, name string, spec *types.ResourceConfigSpec) error

Update updates a ResourcePool.

func ValidateHost

func ValidateHost(client *govmomi.Client, pool *object.ResourcePool, host *object.HostSystem) error

ValidateHost checks to see if a HostSystem is a member of a ResourcePool through cluster membership, or if the HostSystem ID matches the ID of a standalone host ComputeResource. An error is returned if it is not a member of the cluster to which the resource pool belongs, or if there was some sort of other error with checking.

This is used as an extra validation before a VM creation happens, or vMotion to a specific host is attempted.

Types

This section is empty.

Jump to

Keyboard shortcuts

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