'Lookup a dataset\'s ID based on name in metadata.
If it does not exist use the hashing mechanism until that is
removed in FLOC-2963.
:param name: The name of the volume, stored as ``"name"`` field in
dataset metadata.
:return: ``Deferred`` firing with dataset ID as ``UUID``, or
errbacks with ``_NotFound`` if no dataset was found.'

def _dataset_id_for_name(self, name):

    listing = self._flocker_client.list_datasets_configuration()
    def got_configured(configured):
        for dataset in configured:
            if (dataset.metadata.get(NAME_FIELD) == name):
                return dataset.dataset_id
        raise NOT_FOUND_RESPONSE
    listing.addCallback(got_configured)
    return listing
