Esempio n. 1
0
 def get_lun_id(self, volume):
     """Retrieves the LUN ID of volume."""
     if volume.provider_location:
         return int(utils.extract_provider_location(volume.provider_location, "id"))
     else:
         # In some cases, cinder will not update volume info in DB with
         # provider_location returned by us. We need to retrieve the id
         # from array. For example, cinder backup-create doesn't use the
         # provider_location returned from create_cloned_volume.
         lun = self.get_lun(name=volume.name)
         return lun.lun_id
Esempio n. 2
0
 def get_lun_id(self, volume):
     """Retrieves the LUN ID of volume."""
     if volume.provider_location:
         return int(utils.extract_provider_location(
             volume.provider_location, 'id'))
     else:
         # In some cases, cinder will not update volume info in DB with
         # provider_location returned by us. We need to retrieve the id
         # from array. For example, cinder backup-create doesn't use the
         # provider_location returned from create_cloned_volume.
         lun = self.get_lun(name=volume.name)
         return lun.lun_id