virtualdisk

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2017 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

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 Delete

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

Delete deletes the virtual disk at the specified datastore path.

func IsVmdkDatastorePath

func IsVmdkDatastorePath(p string) bool

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.

Jump to

Keyboard shortcuts

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