Documentation ¶
Index ¶
- func Create(rp *object.ResourcePool, name string, spec *types.ResourceConfigSpec) (*object.ResourcePool, error)
- func DefaultDevices(client *govmomi.Client, pool *object.ResourcePool, guest string) (object.VirtualDeviceList, error)
- func Delete(rp *object.ResourcePool) error
- func FromID(client *govmomi.Client, id string) (*object.ResourcePool, error)
- func FromPathOrDefault(client *govmomi.Client, name string, dc *object.Datacenter) (*object.ResourcePool, error)
- func HasChildren(rp *object.ResourcePool) (bool, error)
- func MoveIntoResourcePool(p *object.ResourcePool, c types.ManagedObjectReference) error
- func OSFamily(client *govmomi.Client, pool *object.ResourcePool, guest string) (string, error)
- func Properties(obj *object.ResourcePool) (*mo.ResourcePool, error)
- func Update(rp *object.ResourcePool, name string, spec *types.ResourceConfigSpec) error
- func ValidateHost(client *govmomi.Client, pool *object.ResourcePool, host *object.HostSystem) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶ added in v1.6.0
func Create(rp *object.ResourcePool, name string, spec *types.ResourceConfigSpec) (*object.ResourcePool, error)
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 ¶ added in v1.6.0
func Delete(rp *object.ResourcePool) error
Delete destroys a ResourcePool.
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 ¶ added in v1.6.0
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 MoveIntoResourcePool ¶ added in v1.6.0
func MoveIntoResourcePool(p *object.ResourcePool, c types.ManagedObjectReference) error
MoveIntoResourcePool moves a virtual machine, resource pool, or vApp into the specified ResourcePool.
func OSFamily ¶
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 ¶ added in v1.6.0
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.