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_profile_id(profile_name)

Get vCenter profile ID for the given profile name.

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

Check if the datastore is compliant with given profile.

Parameters:
  • datastore – datastore to check the compliance
  • profile_name – profile to check the compliance against
Returns:

True if the datastore is compliant; False otherwise

Raises:

ProfileNotFoundException

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.

Parameters:
  • req – selection requirements
  • hosts – list of hosts to consider
Returns:

(host, resourcePool, summary)

class DatastoreType

Bases: object

Supported datastore types.

NFS = ‘nfs’
VMFS = ‘vmfs’
VSAN = ‘vsan’
VVOL = ‘vvol’
static get_all_types()