'Extend volume.'

@kaminario_logger
def extend_volume(self, volume, new_size):

    vol_name = self.get_volume_name(volume.id)
    try:
        LOG.debug('Searching    volume:    %s    in    K2.', vol_name)
        vol = self.client.search('volumes', name=vol_name).hits[0]
        vol.size = (new_size * units.Mi)
        LOG.debug('Extending    volume:    %s    in    K2.', vol_name)
        vol.save()
    except Exception as ex:
        LOG.exception('Extending    volume:    %s    failed.', vol_name)
        raise exception.KaminarioCinderDriverException(reason=ex)
