@Override
    public HostSpec allocateHost(String alias) {
        // Some special rules to allow no admin elements as well as container element without nodes.
        if (alias.equals(IMPLICIT_ADMIN_HOSTALIAS)) {
            if (hosts.asCollection().size() > 1) {
                throw new IllegalArgumentException("More than 1 host specified (" + hosts.asCollection().size() + ") and <admin> not specified");
            } else {
                return host2HostSpec(getFirstHost());
            }
        } else if (alias.equals(Container.SINGLENODE_CONTAINER_SERVICESPEC)) {
            return host2HostSpec(getFirstHost());
        }
        for (Host host : hosts.asCollection()) {
            if (host.aliases().contains(alias)) {
                return new HostSpec(host.hostname(), Optional.empty());
            }
        }
        throw new IllegalArgumentException("Unable to find host for alias '" + alias + "'");
    }
A host provisioner based on a hosts.xml file.
No state in this provisioner, i.e it does not know anything about the active
application if one exists. Pre-condition: A valid hosts file.

@author hmusum
config-model/src/main/java/com/yahoo/config/model/provision/HostsXmlProvisioner.java