def get_storage_profile_spec(session, storage_policy):
 profile_id = pbm.get_profile_id_by_name(session, storage_policy)
 if profile_id:
  client_factory = session.vim.client.factory
  storage_profile_spec = client_factory.create('ns0:VirtualMachineDefinedProfileSpec')
  storage_profile_spec.profileId = profile_id.uniqueId
  return storage_profile_spec

def get_storage_profile_spec ( session , storage_policy ) : profile_id = pbm . get_profile_id_by_name ( session , storage_policy ) if profile_id : client_factory = session . vim . client . factory storage_profile_spec = client_factory . create ( 'ns0:VirtualMachineDefinedProfileSpec' ) storage_profile_spec . profileId = profile_id . uniqueId return storage_profile_spec
gets the vm profile spec configured for storage policy .