'Creates a volume from a snapshot.'

def create_volume_from_snapshot(self, volume, snapshot):

    vol_size = volume['size']
    snap_size = snapshot['volume_size']
    (volume_name, fss_metadata) = self.proxy.create_volume_from_snapshot(volume, snapshot)
    if (vol_size != snap_size):
        try:
            extend_volume_name = self.proxy._get_fss_volume_name(volume)
            self.proxy.extend_vdev(extend_volume_name, snap_size, vol_size)
        except rest_proxy.FSSHTTPError as err:
            with excutils.save_and_reraise_exception() as ctxt:
                ctxt.reraise = False
                LOG.error('Resizing    %(id)s    failed    with    message:    %(msg)s.    Cleaning    volume.', {'id': volume['id'], 'msg': err.reason})
    if (type(volume['metadata']) is dict):
        fss_metadata.update(volume['metadata'])
    if volume['consistencygroup_id']:
        self.proxy._add_volume_to_consistency_group(volume['consistencygroup_id'], volume_name)
    return {'metadata': fss_metadata}
