Bases: object
Bases: object
Constructs and returns a DatastorePath.
paths – list of path components, for constructing a path relative to the root directory of the datastore
a DatastorePath object
Constructs and returns a DatastoreURL.
scheme – scheme of the URL (http, https).
server – hostname or ip
rel_path – relative path of the file on the datastore
datacenter_name – (optional) datacenter name
a DatastoreURL object
Get a list of usable (accessible, mounted, read-writable) hosts where the datastore is mounted.
session: session
list of HostSystem managed object references
Get datastore summary.
datastore – Reference to the datastore
‘summary’ property of the datastore
Check if a datastore is usable as per the given mount info.
The datastore is considered to be usable for a host only if it is writable, mounted and accessible.
mount_info – HostMountInfo data object
True if datastore is usable
Bases: object
Class for representing a directory or file path in a vSphere datatore.
This provides various helper methods to access components and useful variants of the datastore path.
Example usage:
DatastorePath(“datastore1”, “_base/foo”, “foo.vmdk”) creates an object that describes the “[datastore1] _base/foo/foo.vmdk” datastore file path to a virtual disk.
Note:
Datastore path representations always uses forward slash as separator (hence the use of the posixpath module).
Datastore names are enclosed in square brackets.
Path part of datastore path is relative to the root directory of the datastore, and is always separated from the [ds_name] part with a single space.
Join one or more path components intelligently into a datastore path.
If any component is an absolute path, all previous components are thrown away, and joining continues. The return value is the concatenation of the paths with exactly one slash (‘/’) inserted between components, unless p is empty.
A datastore path
Constructs a DatastorePath object given a datastore path string.
Bases: object
Class for representing a URL to HTTP access a file in a datastore.
This provides various helper methods to access components and useful variants of the datastore URL.
Returns a datastore object for a given reference.
session – a vmware api session object
ds_ref – managed object reference of a datastore
a datastore object
Return reference and name of the specified datastore cluster.
ds_val – datastore cluster name or datastore cluster moid
tuple of dastastore cluster moref and datastore cluster name
Returns a key which identifies the most recommended datastore from the specified datastore cluster where the specified VM can be cloned to.
Returns SDRS recommendation key for creating a VM.
Check if Storage DRS is enabled for the given datastore cluster.
session – VMwareAPISession object
dsc_ref – datastore cluster moref
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.