Qixiaozhen
2014-03-25 03:20:23 UTC
Hi,all
Is there any other way to get the instance of storage volume much more efficiently in the array?
If lots of volumes in the SAN, the enumeration is too inefficiency.
The code( a smi-s plugin) in LSM that the clients get the instance of Volume lists here:
def _get_class(self, class_name, gen_id, ident):
instances = self._c.EnumerateInstances(class_name)
for i in instances:
if gen_id(i) == ident:
return i
raise LsmError(ErrorNumber.INVALID_ARGUMENT,
"Unable to find class instance " + class_name +
" with signature " + ident)
def _get_volume(self, volume_id):
"""
Get a specific instance of a volume by volume id.
"""
return self._get_class("CIM_StorageVolume", self._vol_id, volume_id)
Thanks,
Qi
-----------------------------------------------------------
Xiaozhen Qi
Huawei Technologies Co.,LTD.
IT Product Line CloudOS PDU
China, Xi'an
Mobile: +86-13609283376
Email: ***@huawei.com
Is there any other way to get the instance of storage volume much more efficiently in the array?
If lots of volumes in the SAN, the enumeration is too inefficiency.
The code( a smi-s plugin) in LSM that the clients get the instance of Volume lists here:
def _get_class(self, class_name, gen_id, ident):
instances = self._c.EnumerateInstances(class_name)
for i in instances:
if gen_id(i) == ident:
return i
raise LsmError(ErrorNumber.INVALID_ARGUMENT,
"Unable to find class instance " + class_name +
" with signature " + ident)
def _get_volume(self, volume_id):
"""
Get a specific instance of a volume by volume id.
"""
return self._get_class("CIM_StorageVolume", self._vol_id, volume_id)
Thanks,
Qi
-----------------------------------------------------------
Xiaozhen Qi
Huawei Technologies Co.,LTD.
IT Product Line CloudOS PDU
China, Xi'an
Mobile: +86-13609283376
Email: ***@huawei.com