storagepod

package
v1.21.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

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

func Create(f *object.Folder, name string) (*object.StoragePod, error)

Create creates a StoragePod from a supplied folder. The resulting StoragePod is returned.

func CreateVM

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 Delete

func Delete(pod *object.StoragePod) error

Delete destroys a StoragePod.

func FromID

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

FromID locates a StoragePod by its managed object reference ID.

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

func IsMember(pod *object.StoragePod, ds *object.Datastore) (bool, error)

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

func MoveToFolder(client *govmomi.Client, pod *object.StoragePod, relative string) error

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 Rename

func Rename(pod *object.StoragePod, name string) error

Rename renames a StoragePod.

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.

Jump to

Keyboard shortcuts

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