'Retrieves the LUN ID of volume.'

def get_lun_id(self, volume):

    if volume.provider_location:
        return int(utils.extract_provider_location(volume.provider_location, 'id'))
    else:
        lun = self.get_lun(name=volume.name)
        return lun.lun_id
