Determining StorageDomain path
by agl@us.ibm.com
I have created a LOCALFS Storage Domain and I would like to use the VDSM API to
query the location of this storage on the filesystem. For example, if I created
the storage domain as:
s.createStorageDomain(LOCALFS_DOMAIN, sdUUID, "my local domain", path,
DATA_DOMAIN, 0)
How can I query to receive path back?
Unfortunately what would seem to be the obvious call:
s.getStorageDomainInfo(sd)
{'status': {'message': 'OK', 'code': 0}, 'info': {'uuid':
'24862862-f29b-40a6-8698-976dcfc42023', 'pool':
['dec54678-1c25-4234-9631-c3b7da8b0ef4'], 'lver': 6, 'version': '0', 'role':
'Master', 'remotePath': '', 'spm_id': 1, 'type': 'LOCALFS', 'class': 'Data',
'master_ver': 1, 'name': 'my local domain'}}
does not contain the information. Is it supposed to be in remotePath?
--
Adam Litke <agl(a)us.ibm.com>
IBM Linux Technology Center
12 years, 9 months
getStoragePoolInfo() for non-connected pools
by agl@us.ibm.com
Using the vdscli python module, I would like to be able to enumerate all
of the known storage pools and present their metadata to the user. Such
enumeration would make it easier for a user to select which storage pool
to connect to.
I am currently enumerating the storage pool UUIDs by looping through the
list of known storage domains and gathering the referenced spUUIDs:
domains = self.vdsmConn.getStorageDomainsList()
for sdUUID in domains:
ret = self.getStorageDomainInfo(sdUUID)
vdsOK(ret)
pools |= ret['info']['pool']
return list(pools)
This seems like a clumbsy way to do this but I did not see a
getStoragePoolsList() akin to getStorageDomainList(). Is there a better
way to use the API to collect known storage pools?
Once I have the list of storage pools, I thought to collect information
about them using getStoragePoolInfo(spUUID). However, this function
seems to be arbitrarily limited to the currently connected storage pool.
Is there a good reason for this or could we make it work for all
storage pools?
Thanks!
--
Adam Litke
IBM Linux Technology Center
12 years, 9 months