Implements operations on volumes residing on VMware datastores.
Bases: object
Encapsulate various controller types.
Get the disk controller type based on the given adapter type.
| Parameters: | adapter_type – disk adapter type | 
|---|---|
| Returns: | controller type corresponding to the given adapter type | 
| Raises: | InvalidAdapterTypeException | 
Check if the given controller is a SCSI controller.
| Parameters: | controller_type – controller type | 
|---|---|
| Returns: | True if the controller is a SCSI controller | 
Bases: cinder.volume.drivers.vmware.volumeops.VirtualDiskPath
Paths of files in a non-monolithic disk with a single flat extent.
Get datastore file path of the flat extent.
Get absolute file path of the flat extent.
Bases: cinder.volume.drivers.vmware.volumeops.VirtualDiskPath
Paths of file comprising a monolithic sparse disk.
Bases: object
Manages volume operations.
Attach an existing virtual disk to the backing VM.
| Parameters: | 
  | 
|---|
Cancel retrieval of results if necessary.
| Parameters: | retrieve_result – Result from RetrievePropertiesEx | 
|---|
Change storage profile of the backing VM.
The current profile is removed if the new profile is None.
Clone backing.
If the clone_type is ‘full’, then a full clone of the source volume backing will be created. Else, if it is ‘linked’, then a linked clone of the source volume backing will be created.
| Parameters: | 
  | 
|---|
Continue retrieval of results if necessary.
| Parameters: | retrieve_result – Result from RetrievePropertiesEx | 
|---|
Copy contents of the src vmdk file to dest vmdk file.
| Parameters: | 
  | 
|---|
Create backing for the volume.
Creates a VM with one VMDK based on the given inputs.
| Parameters: | 
  | 
|---|---|
| Returns: | Reference to the created backing entity  | 
Create disk-less volume backing.
This type of backing is useful for creating volume from image. The downloaded image from the image service can be copied to a virtual disk of desired provisioning type and added to the backing VM.
| Parameters: | 
  | 
|---|---|
| Returns: | Reference to the created backing entity  | 
Creates a datastore folder.
This method returns silently if the folder already exists.
| Parameters: | 
  | 
|---|
Create descriptor for a single flat extent virtual disk.
To create the descriptor, we create a virtual disk and delete its flat extent.
| Parameters: | 
  | 
|---|
Creates child folder with given name under the given parent folder.
The method first checks if a child folder already exists, if it does, then it returns a moref for the folder, else it creates one and then return the moref.
| Parameters: | 
  | 
|---|---|
| Returns: | Reference to the child folder with input name if it already exists, else create one and return the reference  | 
Create snapshot of the backing with given name and description.
| Parameters: | 
  | 
|---|---|
| Returns: | Created snapshot entity reference  | 
Create virtual disk with the given settings.
| Parameters: | 
  | 
|---|
Create and return a VM inventory folder.
This method caches references to inventory folders returned.
| Parameters: | 
  | 
|---|
Delete the backing.
| Parameters: | backing – Managed object reference to the backing | 
|---|
Delete file or folder on the datastore.
| Parameters: | file_path – Datastore path of the file or folder | 
|---|
Delete a given snapshot from volume backing.
| Parameters: | 
  | 
|---|
Delete given vmdk files.
| Parameters: | 
  | 
|---|
Detach the given disk from backing.
Extend the virtual disk to the requested size.
| Parameters: | 
  | 
|---|
is zeroed out
Get the backing based on name.
| Parameters: | name – Name of the backing | 
|---|---|
| Returns: | Managed object reference to the backing | 
Get hosts in the given cluster.
| Parameters: | cluster – cluster reference | 
|---|---|
| Returns: | references to hosts in the cluster | 
Get references to given clusters.
| Parameters: | names – list of cluster names | 
|---|---|
| Returns: | Dictionary of cluster names to references | 
Get all the hosts to which the datastore is connected and usable.
The datastore is considered to be usable for a host only if it is writable, mounted and accessible.
| Parameters: | datastore – Reference to the datastore entity | 
|---|---|
| Returns: | List of managed object references of all connected hosts | 
Return spec for creating backing with a single disk.
| Parameters: | 
  | 
|---|---|
| Returns: | spec for creation  | 
Get datastore where the backing resides.
| Parameters: | backing – Reference to the backing | 
|---|---|
| Returns: | Datastore reference to which the backing belongs | 
Get parent datacenter up the hierarchy via ‘parent’ property.
| Parameters: | child – Reference of the child entity | 
|---|---|
| Returns: | Parent Datacenter of the param child entity | 
Get the disk device of the VM which corresponds to the given path.
| Parameters: | 
  | 
|---|---|
| Returns: | Matching disk device  | 
Get disk size of the backing.
| Parameters: | backing – backing VM reference | 
|---|---|
| Returns: | disk size in bytes | 
Get accessible datastores and resource pool of the host.
| Parameters: | host – Managed object reference of the host | 
|---|---|
| Returns: | Datastores accessible to the host and resource pool to which the host belongs to | 
Returns the managed object identified by the given inventory path.
| Parameters: | path – Inventory path | 
|---|---|
| Returns: | Reference to the managed object | 
Get name of the managed entity.
| Parameters: | entity – Reference to the entity | 
|---|---|
| Returns: | Name of the managed entity | 
Get host under which instance is present.
| Parameters: | instance – Managed object reference of the instance VM | 
|---|---|
| Returns: | Host managing the instance VM | 
Get all host from the inventory.
| Returns: | All the hosts from the inventory | 
|---|
Get path name of the backing.
| Parameters: | backing – Reference to the backing entity | 
|---|---|
| Returns: | Path name of the backing | 
Query storage profile associated with the given backing.
| Parameters: | backing – backing reference | 
|---|---|
| Returns: | profile name | 
Get snapshot of the backing with given name.
| Parameters: | 
  | 
|---|---|
| Returns: | Snapshot entity of the backing with given name  | 
Get datastore summary.
| Parameters: | datastore – Reference to the datastore | 
|---|---|
| Returns: | ‘summary’ property of the datastore | 
Get the vmdk file name of the backing.
The vmdk file path of the backing returned is of the form: “[datastore1] my_folder/my_vm.vmdk”
| Parameters: | backing – Reference to the backing | 
|---|---|
| Returns: | VMDK file path of the backing | 
Get the vmFolder.
| Parameters: | datacenter – Reference to the datacenter entity | 
|---|---|
| Returns: | vmFolder property of the datacenter | 
Check if the datastore is accessible to the given host.
| Parameters: | datastore – datastore reference | 
|---|---|
| Returns: | True if the datastore is accessible | 
Check if the given ESX host is usable.
A host is usable if it is connected to vCenter server and not in maintenance mode.
| Parameters: | host – Managed object reference to the ESX host | 
|---|---|
| Returns: | True if host is usable, False otherwise | 
Move the volume backing to the folder.
| Parameters: | 
  | 
|---|
Move the given vmdk file to another datastore location.
| Parameters: | 
  | 
|---|
Relocates backing to the input datastore and resource pool.
The implementation uses moveAllDiskBackingsAndAllowSharing disk move type.
| Parameters: | 
  | 
|---|
Rename backing VM.
| Parameters: | 
  | 
|---|
Check if the given backing contains snapshots.
Update backing VM’s disk UUID.
| Parameters: | 
  | 
|---|
Bases: object
Supported virtual disk adapter types.
Get the adapter type to be used in VirtualDiskSpec.
| Parameters: | extra_spec_adapter – adapter type in the extra_spec | 
|---|---|
| Returns: | adapter type to be used in VirtualDiskSpec | 
Check if the given adapter type is valid.
| Parameters: | adapter_type – adapter type to check | 
|---|---|
| Returns: | True if valid | 
Validate the given adapter type in extra_spec.
This method throws an instance of InvalidAdapterTypeException if the given adapter type is invalid.
| Parameters: | extra_spec_adapter_type – adapter type in extra_spec | 
|---|---|
| Raises: | InvalidAdapterTypeException | 
Bases: object
Class representing paths of files comprising a virtual disk.
Get datastore path corresponding to the given file path.
| Parameters: | 
  | 
|---|---|
| Returns: | datastore file path  | 
Get datastore file path of the virtual disk descriptor.
Get absolute file path of the virtual disk descriptor.
Bases: object
Supported virtual disk types.
Return disk type corresponding to the extra_spec disk type.
| Parameters: | extra_spec_disk_type – disk type in extra_spec | 
|---|---|
| Returns: | virtual disk type | 
| Raises: | InvalidDiskTypeException | 
Check if the given disk type in extra_spec is valid.
| Parameters: | extra_spec_disk_type – disk type in extra_spec | 
|---|---|
| Returns: | True if valid | 
Validate the given disk type in extra_spec.
This method throws an instance of InvalidDiskTypeException if the given disk type is invalid.
| Parameters: | extra_spec_disk_type – disk type in extra_spec | 
|---|---|
| Raises: | InvalidDiskTypeException | 
Split the datastore path to components.
return the datastore name, relative folder path and the file name
E.g. datastore_path = [datastore1] my_volume/my_volume.vmdk, returns (datastore1, my_volume/, my_volume.vmdk)
| Parameters: | datastore_path – Datastore path of a file | 
|---|---|
| Returns: | Parsed datastore name, relative folder path and file name |