'Creates a volume from a snapshot.'

def create_volume_from_snapshot(self, volume, snapshot):

    LOG.info('create_volume_from_snapshot,    volume    id:    %(vid)s,    snap    id:    %(sid)s,    Enter    method.', {'vid': volume['id'], 'sid': snapshot['id']})
    (element_path, metadata) = self.common.create_volume_from_snapshot(volume, snapshot)
    v_metadata = volume.get('volume_metadata')
    if v_metadata:
        for data in v_metadata:
            metadata[data['key']] = data['value']
    else:
        v_metadata = volume.get('metadata', {})
        metadata.update(v_metadata)
    LOG.info('create_volume_from_snapshot,    info:    %s,    Exit    method.', metadata)
    return {'provider_location': six.text_type(element_path), 'metadata': metadata}
