The oslo_vmware.pbm Module

VMware PBM service client and PBM related utility methods

PBM is used for policy based placement in VMware datastores. Refer for more details.

class oslo_vmware.pbm.Pbm(protocol='https', host='localhost', port=443, wsdl_url=None, cacert=None, insecure=True, pool_maxsize=10)

Bases: oslo_vmware.service.Service

Service class that provides access to the Storage Policy API.


Set the specified vCenter session cookie in the SOAP header

Parameters:cookie – cookie to set
oslo_vmware.pbm.convert_datastores_to_hubs(pbm_client_factory, datastores)

Convert given datastore morefs to PbmPlacementHub morefs.

  • pbm_client_factory – Factory to create PBM API input specs
  • datastores – list of datastore morefs

list of PbmPlacementHub morefs

oslo_vmware.pbm.filter_datastores_by_hubs(hubs, datastores)

Get filtered subset of datastores corresponding to the given hub list.

  • hubs – list of PbmPlacementHub morefs
  • datastores – all candidate datastores

subset of datastores corresponding to the given hub list

oslo_vmware.pbm.filter_hubs_by_profile(session, hubs, profile_id)

Filter and return hubs that match the given profile.

  • hubs – PbmPlacementHub morefs
  • profile_id – profile ID

subset of hubs that match the given profile


VimException, VimFaultException, VimAttributeException, VimSessionOverLoadException, VimConnectionException


Get all the profiles defined in VC server.

Returns:PbmProfile data objects
Raises:VimException, VimFaultException, VimAttributeException, VimSessionOverLoadException, VimConnectionException

Return PBM WSDL file location corresponding to VC version.

Parameters:vc_version – a dot-separated version string. For example, “1.2”.
Returns:the pbm wsdl file location.
oslo_vmware.pbm.get_profile_id_by_name(session, profile_name)

Get the profile UUID corresponding to the given profile name.

Parameters:profile_name – profile name whose UUID needs to be retrieved
Returns:profile UUID string or None if profile not found
Raises:VimException, VimFaultException, VimAttributeException, VimSessionOverLoadException, VimConnectionException
oslo_vmware.pbm.get_profiles(session, vm)

Query storage profiles associated with the given vm.

  • session – VMwareAPISession instance
  • vm – vm reference

profile IDs

oslo_vmware.pbm.get_profiles_by_ids(session, profile_ids)

Get storage profiles by IDs.

  • session – VMwareAPISession instance
  • profile_ids – profile IDs

profile objects

Previous topic

The oslo_vmware.objects.datastore Module

Next topic

The oslo_vmware.rw_handles Module

Project Source

This Page