private void assignLogserver(DeployState deployState, NodesSpecification nodesSpecification, Admin admin) {
        if (nodesSpecification.minResources().nodes() > 1)
            throw new IllegalArgumentException("You can only request a single log server");

        Collection<HostResource> hosts = List.of();
        if (nodesSpecification.isDedicated())
            hosts = allocateHosts(admin.hostSystem(), "logserver", nodesSpecification);
        else if (containerModels.iterator().hasNext())
            hosts = sortedContainerHostsFrom(containerModels.iterator().next(), nodesSpecification.minResources().nodes(), false);
        else
            context.getDeployLogger().logApplicationPackage(Level.INFO, "No container host available to use for running logserver");

        if (hosts.isEmpty()) return; // No log server can be created (and none is needed)

        Logserver logserver = createLogserver(deployState, admin, hosts);
        if (nodesSpecification.isDedicated() || deployState.isHosted() && deployState.getProperties().applicationId().instance().isTester())
            createContainerOnLogserverHost(deployState, admin, logserver.getHostResource());
    }
Builds the admin model from a version 4 XML tag, or as a default when an admin 3 tag or no admin tag is used.

@author bratseth
config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminV4Builder.java