'Create an ``AttachedVolume`` given a volume dictionary.
:param UUID node_uuid: The node where the volume should be.
:param dict volume: Parameters for specific volume passed to creation
endpoint.
:return AttachedVolume: Corresponding instance.'

def _get_attached_volume(self, node_uuid, volume):

    deployment = self.persistence_service.get()
    instances = list(manifestations_from_deployment(deployment, volume[u'dataset_id']))
    if (not any((m for (m, _) in instances if (not m.dataset.deleted)))):
        raise DATASET_NOT_FOUND
    if (not any((n for (_, n) in instances if (n.uuid == node_uuid)))):
        raise DATASET_ON_DIFFERENT_NODE
    if any((app for app in deployment.applications() if (app.volume and (app.volume.manifestation.dataset_id == volume[u'dataset_id'])))):
        raise DATASET_IN_USE
    return AttachedVolume(manifestation=[m for (m, node) in instances if ((node.uuid == node_uuid) and m.primary)][0], mountpoint=FilePath(volume[u'mountpoint'].encode('utf-8')))
