The cinder.volume.drivers.vmware.datastore Module

The cinder.volume.drivers.vmware.datastore Module

Classes and utility methods for datastore selection.

class DatastoreSelector(vops, session, max_objects)

Bases: object

Class for selecting datastores which satisfy input requirements.

HARD_AFFINITY_DS_TYPE = 'hardAffinityDatastoreTypes'
HARD_ANTI_AFFINITY_DS = 'hardAntiAffinityDatastores'
PROFILE_NAME = 'storageProfileName'
SIZE_BYTES = 'sizeBytes'

Get vCenter profile ID for the given profile name.

Parameters:profile_name – profile name
Returns:vCenter profile ID
is_datastore_compliant(datastore, profile_name)

Check if the datastore is compliant with given profile.

  • datastore – datastore to check the compliance
  • profile_name – profile to check the compliance against

True if the datastore is compliant; False otherwise



select_datastore(req, hosts=None)

Selects a datastore satisfying the given requirements.

A datastore which is connected to maximum number of hosts is selected. Ties if any are broken based on space utilization– datastore with least space utilization is preferred. It returns the selected datastore’s summary along with a host and resource pool where the volume can be created.

  • req – selection requirements
  • hosts – list of hosts to consider

(host, resourcePool, summary)

class DatastoreType

Bases: object

Supported datastore types.

NFS = 'nfs'
VMFS = 'vmfs'
VSAN = 'vsan'
VVOL = 'vvol'
static get_all_types()
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.