Documentation ¶
Index ¶
- func DatastorePathFromString(p string) (*object.DatastorePath, bool)
- func Delete(client *govmomi.Client, name string, dc *object.Datacenter) error
- func FromPath(client *govmomi.Client, p string, dc *object.Datacenter) (*object.VirtualDiskInfo, error)
- func IsVmdkDatastorePath(p string) bool
- func Move(client *govmomi.Client, srcPath string, srcDC *object.Datacenter, ...) (string, error)
- func QueryDiskType(client *govmomi.Client, name string, dc *object.Datacenter) (types.VirtualDiskType, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DatastorePathFromString ¶
func DatastorePathFromString(p string) (*object.DatastorePath, bool)
DatastorePathFromString is a convenience method that returns a fully-populated DatastorePath from a string containing a datastore path. A flag indicating a successful parsing is also returned.
func FromPath ¶ added in v1.22.0
func FromPath(client *govmomi.Client, p string, dc *object.Datacenter) (*object.VirtualDiskInfo, error)
FromPath loads a datastore from its path.
func IsVmdkDatastorePath ¶
IsVmdkDatastorePath ensures that a string can be parsed as a datastore path pointing to a virtual disk. This only checks the validity of the path, not whether or not the file exists.
func Move ¶
func Move(client *govmomi.Client, srcPath string, srcDC *object.Datacenter, dstPath string, dstDC *object.Datacenter) (string, error)
Move moves a virtual disk from one location to another. The move is not forced.
srcPath needs to be a datastore path (ie: "[datastore1] vm/vm.vmdk"), however the destination path (dstPath) can be a simple path - if it is, the source datastore is used and dstDC is ignored. Further, if dstPath has no directory, the directory of srcPath is used. dstDC can be nil if the destination datastore is in the same datacenter.
The new datastore path is returned along with any error, to avoid the need to re-calculate the path separately.
func QueryDiskType ¶
func QueryDiskType(client *govmomi.Client, name string, dc *object.Datacenter) (types.VirtualDiskType, error)
QueryDiskType queries the disk type of the specified virtual disk.
Types ¶
This section is empty.