'Extend the size of the volume.'

def extend_volume(self, volume, new_size):

    volume_name = volume.get('id')
    provider_id = volume.get('provider_id')
    LOG.debug('Extending    volume    %(vol)s    to    %(size)s', {'vol': volume_name, 'size': new_size})
    if (volume is not None):
        with self._client.open_connection() as api:
            scvolume = api.find_volume(volume_name, provider_id)
            if (api.expand_volume(scvolume, new_size) is not None):
                return
    msg = (_('Unable    to    extend    volume    %s') % volume_name)
    raise exception.VolumeBackendAPIException(data=msg)
