'Resize volume.'

@proxy._trace_time
def extend_volume(self, volume, new_size):

    volume_size = float(volume['size'])
    wanted_size = float(new_size)
    if (wanted_size == volume_size):
        return
    shrink = ('yes' if (wanted_size < volume_size) else 'no')
    size = storage.gigabytes_to_blocks(wanted_size)
    try:
        self._call_xiv_xcli('vol_resize', vol=volume['name'], size_blocks=size, shrink_volume=shrink)
    except errors.XCLIError as e:
        error = (_('Fatal    error    in    vol_resize:    %(details)s') % {'details': self._get_code_and_status_or_message(e)})
        LOG.error(error)
        raise self._get_exception()(error)
