Documentation ¶
Index ¶
- func ApplyDRSConfiguration(client *govmomi.Client, pod *object.StoragePod, ...) error
- func CloneVM(client *govmomi.Client, src *object.VirtualMachine, fo *object.Folder, ...) (*object.VirtualMachine, error)
- func Create(f *object.Folder, name string) (*object.StoragePod, error)
- func CreateVM(client *govmomi.Client, fo *object.Folder, spec types.VirtualMachineConfigSpec, ...) (*object.VirtualMachine, error)
- func Delete(pod *object.StoragePod) error
- func FromID(client *govmomi.Client, id string) (*object.StoragePod, error)
- func FromPath(client *govmomi.Client, name string, dc *object.Datacenter) (*object.StoragePod, error)
- func HasChildren(pod *object.StoragePod) (bool, error)
- func HasDiskCreationOperations(dc []types.BaseVirtualDeviceConfigSpec) bool
- func IsMember(pod *object.StoragePod, ds *object.Datastore) (bool, error)
- func List(client *govmomi.Client) ([]*object.StoragePod, error)
- func MoveToFolder(client *govmomi.Client, pod *object.StoragePod, relative string) error
- func Properties(pod *object.StoragePod) (*mo.StoragePod, error)
- func ReconfigureVM(client *govmomi.Client, vm *object.VirtualMachine, ...) error
- func RelocateVM(client *govmomi.Client, vm *object.VirtualMachine, ...) error
- func Rename(pod *object.StoragePod, name string) error
- func StorageDRSEnabled(pod *object.StoragePod) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyDRSConfiguration ¶
func ApplyDRSConfiguration(client *govmomi.Client, pod *object.StoragePod, spec types.StorageDrsConfigSpec) error
ApplyDRSConfiguration takes a types.StorageDrsConfigSpec and applies it against the specified StoragePod.
func CloneVM ¶
func CloneVM( client *govmomi.Client, src *object.VirtualMachine, fo *object.Folder, name string, spec types.VirtualMachineCloneSpec, timeout int, pod *object.StoragePod, ) (*object.VirtualMachine, error)
CloneVM clones a virtual machine to a datastore cluster via the StorageResourceManager API. It mimics our helper in the virtualmachine package in functionality, returning a VM helper object on success.
func Create ¶
Create creates a StoragePod from a supplied folder. The resulting StoragePod is returned.
func CreateVM ¶
func CreateVM( client *govmomi.Client, fo *object.Folder, spec types.VirtualMachineConfigSpec, pool *object.ResourcePool, host *object.HostSystem, pod *object.StoragePod, timeout time.Duration, ) (*object.VirtualMachine, error)
CreateVM creates a virtual machine on a datastore cluster via the StorageResourceManager API. It mimics our helper in the virtualmachine package in functionality, returning a VM helper object on success.
func FromPath ¶
func FromPath(client *govmomi.Client, name string, dc *object.Datacenter) (*object.StoragePod, error)
FromPath loads a StoragePod from its path. The datacenter is optional if the path is specific enough to not require it.
func HasChildren ¶
func HasChildren(pod *object.StoragePod) (bool, error)
HasChildren checks to see if a datastore cluster has any child items (datastores) and returns true if that is the case. This is useful when checking to see if a datastore cluster is safe to delete - destroying a datastore cluster in vSphere destroys *all* children if at all possible (including removing datastores), so extra verification is necessary to prevent accidental removal.
func HasDiskCreationOperations ¶
func HasDiskCreationOperations(dc []types.BaseVirtualDeviceConfigSpec) bool
HasDiskCreationOperations is an exported function that checks a list of device changes to see if there are any disk creation operations. This should be used to check if ReconfigureVM should be done through the Storage DRS API, as a Reconfig operation done through SDRS without new disk operations will fail.
func IsMember ¶
IsMember checks to see if a datastore is a member of the datastore cluster in question.
This is a pretty basic operation that checks that the parent of the datastore is the StoragePod.
func MoveToFolder ¶
MoveToFolder is a complex method that moves a StoragePod to a given relative datastore folder path. "Relative" here means relative to a datacenter, which is discovered from the current StoragePod path.
func Properties ¶
func Properties(pod *object.StoragePod) (*mo.StoragePod, error)
Properties is a convenience method that wraps fetching the StoragePod MO from its higher-level object.
func ReconfigureVM ¶
func ReconfigureVM( client *govmomi.Client, vm *object.VirtualMachine, spec types.VirtualMachineConfigSpec, pod *object.StoragePod, ) error
ReconfigureVM reconfigures a virtual machine via the StorageResourceManager API, applying any disk modifications that will require going through Storage DRS. It mimics our helper in the virtualmachine package in functionality.
Note that this function will fail if there are no new disks in the spec, check this first before using this function. If no disk create operations are necessary, use the regular Reconfigure function in the virtualmachine helper package.
func RelocateVM ¶
func RelocateVM( client *govmomi.Client, vm *object.VirtualMachine, spec types.VirtualMachineRelocateSpec, timeout int, pod *object.StoragePod, ) error
RelocateVM migrates a virtual machine to a datastore cluster via the StorageResourceManager API. It mimics our helper in the virtualmachine package in functionality.
func StorageDRSEnabled ¶
func StorageDRSEnabled(pod *object.StoragePod) (bool, error)
StorageDRSEnabled checks a StoragePod to see if Storage DRS is enabled.
Types ¶
This section is empty.