diff options
author | Jon Bratseth <bratseth@oath.com> | 2019-05-28 12:52:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-28 12:52:05 +0200 |
commit | e175be05cfc0e72586cfe1540b2bb6887b5edaf0 (patch) | |
tree | 96c8cf193c3d5911d0baf0230e98d75347df86be /node-repository | |
parent | 3a5332d332784f591199bd571136a7260abd3d81 (diff) | |
parent | 7f244686bfc513b488c1da548c036303d32eec20 (diff) |
Merge pull request #9586 from vespa-engine/bratseth/default-node-capacity
Bratseth/default node capacity
Diffstat (limited to 'node-repository')
29 files changed, 236 insertions, 270 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java index f93354333a1..bedfbc5bdc1 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/NodeRepository.java @@ -569,7 +569,7 @@ public class NodeRepository extends AbstractComponent { * @return List of all the nodes that have been removed */ public List<Node> removeRecursively(String hostname) { - Node node = getNode(hostname).orElseThrow(() -> new NotFoundException("No node with hostname \"" + hostname + '"')); + Node node = getNode(hostname).orElseThrow(() -> new NotFoundException("No node with hostname '" + hostname + "'")); return removeRecursively(node, false); } diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/CapacityPolicies.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/CapacityPolicies.java index 7c2c061b62f..f2b90b93abb 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/CapacityPolicies.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/CapacityPolicies.java @@ -5,6 +5,7 @@ import com.yahoo.config.provision.Capacity; import com.yahoo.config.provision.ClusterSpec; import com.yahoo.config.provision.Environment; import com.yahoo.config.provision.NodeResources; +import com.yahoo.config.provision.RegionName; import com.yahoo.config.provision.SystemName; import com.yahoo.config.provision.Zone; @@ -61,19 +62,18 @@ public class CapacityPolicies { if (requestedResources.isPresent() && ! requestedResources.get().allocateByLegacyName()) return requestedResources.get(); - NodeResources defaultResources = NodeResources.fromLegacyName(zone.defaultFlavor(cluster.type())); if (requestedResources.isEmpty()) - return defaultResources; + return defaultNodeResources(cluster.type()); // Flavor is specified and is allocateByLegacyName: Handle legacy flavor specs if (zone.system() == SystemName.cd) - return flavors.exists(requestedResources.get().legacyName().get()) ? requestedResources.get() : defaultResources; + return flavors.exists(requestedResources.get().legacyName().get()) ? requestedResources.get() + : defaultNodeResources(cluster.type()); else { switch (zone.environment()) { - case dev: case test: case staging: return defaultResources; + case dev: case test: case staging: return defaultNodeResources(cluster.type()); default: - // Check existence of the legacy specified flavor - flavors.getFlavorOrThrow(requestedResources.get().legacyName().get()); + flavors.getFlavorOrThrow(requestedResources.get().legacyName().get()); // verify existence // Return this spec containing the legacy flavor name, not the flavor's capacity object // which describes the flavors capacity, as the point of legacy allocation is to match // by name, not by resources @@ -82,6 +82,16 @@ public class CapacityPolicies { } } + private NodeResources defaultNodeResources(ClusterSpec.Type clusterType) { + if (clusterType == ClusterSpec.Type.admin) + return new NodeResources(0.5, 3, 50); + + if (zone.system() == SystemName.cd && zone.environment().isTest()) + new NodeResources(4, 4, 50); + + return new NodeResources(2, 8, 50); + } + /** * Whether or not the nodes requested can share physical host with other applications. * A security feature which only makes sense for prod. diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockNodeRepository.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockNodeRepository.java index c9409937d46..9edf368fa9c 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockNodeRepository.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockNodeRepository.java @@ -69,11 +69,11 @@ public class MockNodeRepository extends NodeRepository { // Regular nodes nodes.add(createNode("node1", "host1.yahoo.com", ipConfig(1), Optional.empty(), Optional.empty(), - flavors.getFlavorOrThrow("default"), NodeType.tenant)); + new Flavor(new NodeResources(2, 8, 50)), NodeType.tenant)); nodes.add(createNode("node2", "host2.yahoo.com", ipConfig(2), Optional.empty(), Optional.empty(), - flavors.getFlavorOrThrow("default"), NodeType.tenant)); + new Flavor(new NodeResources(2, 8, 50)), NodeType.tenant)); nodes.add(createNode("node3", "host3.yahoo.com", ipConfig(3), Optional.empty(), Optional.empty(), - flavors.getFlavorOrThrow("expensive"), NodeType.tenant)); + new Flavor(new NodeResources(0.5, 48, 500)), NodeType.tenant)); Node node4 = createNode("node4", "host4.yahoo.com", ipConfig(4), Optional.of("dockerhost1.yahoo.com"), Optional.empty(), new Flavor(new NodeResources(1, 1, 100)), NodeType.tenant); node4 = node4.with(node4.status() @@ -89,14 +89,14 @@ public class MockNodeRepository extends NodeRepository { nodes.add(createNode("node6", "host6.yahoo.com", ipConfig(6), Optional.empty(), Optional.empty(), - flavors.getFlavorOrThrow("default"), NodeType.tenant)); + new Flavor(new NodeResources(2, 8, 50)), NodeType.tenant)); Node node7 = createNode("node7", "host7.yahoo.com", ipConfig(7), Optional.empty(), Optional.empty(), - flavors.getFlavorOrThrow("default"), NodeType.tenant); + new Flavor(new NodeResources(2, 8, 50)), NodeType.tenant); nodes.add(node7); // 8, 9, 11 and 12 are added by web service calls Node node10 = createNode("node10", "host10.yahoo.com", ipConfig(10), Optional.of("parent1.yahoo.com"), Optional.empty(), - flavors.getFlavorOrThrow("default"), NodeType.tenant); + new Flavor(new NodeResources(2, 8, 50)), NodeType.tenant); Status node10newStatus = node10.status(); node10newStatus = node10newStatus .withVespaVersion(Version.fromString("5.104.142")) @@ -104,15 +104,8 @@ public class MockNodeRepository extends NodeRepository { node10 = node10.with(node10newStatus); nodes.add(node10); - Node node13 = createNode("node13", "host13.yahoo.com", ipConfig(13), Optional.empty(), Optional.empty(), - flavors.getFlavorOrThrow("large"), NodeType.tenant); - Node node14 = createNode("node14", "host14.yahoo.com", ipConfig(14), Optional.empty(), Optional.empty(), - flavors.getFlavorOrThrow("large"), NodeType.tenant); - nodes.add(node13); - nodes.add(node14); - Node node55 = createNode("node55", "host55.yahoo.com", ipConfig(55), Optional.empty(), Optional.empty(), - flavors.getFlavorOrThrow("default"), NodeType.tenant); + new Flavor(new NodeResources(2, 8, 50)), NodeType.tenant); nodes.add(node55.with(node55.status().withWantToRetire(true).withWantToDeprovision(true))); /* Setup docker hosts (two of these will be reserved for spares */ @@ -151,20 +144,19 @@ public class MockNodeRepository extends NodeRepository { Set.of(RotationName.from("us-cluster"))); activate(provisioner.prepare(zoneApp, zoneCluster, Capacity.fromRequiredNodeType(NodeType.host), 1, null), zoneApp, provisioner); - ApplicationId app1 = ApplicationId.from(TenantName.from("tenant1"), ApplicationName.from("application1"), InstanceName.from("instance1")); ClusterSpec cluster1 = ClusterSpec.request(ClusterSpec.Type.container, ClusterSpec.Id.from("id1"), Version.fromString("6.42"), false, Collections.emptySet()); - provisioner.prepare(app1, cluster1, Capacity.fromNodeCount(2), 1, null); + provisioner.prepare(app1, cluster1, Capacity.fromCount(2, new NodeResources(2, 8, 50)), 1, null); ApplicationId app2 = ApplicationId.from(TenantName.from("tenant2"), ApplicationName.from("application2"), InstanceName.from("instance2")); ClusterSpec cluster2 = ClusterSpec.request(ClusterSpec.Type.content, ClusterSpec.Id.from("id2"), Version.fromString("6.42"), false, Collections.emptySet()); - activate(provisioner.prepare(app2, cluster2, Capacity.fromNodeCount(2), 1, null), app2, provisioner); + activate(provisioner.prepare(app2, cluster2, Capacity.fromCount(2, new NodeResources(2, 8, 50)), 1, null), app2, provisioner); ApplicationId app3 = ApplicationId.from(TenantName.from("tenant3"), ApplicationName.from("application3"), InstanceName.from("instance3")); ClusterSpec cluster3 = ClusterSpec.request(ClusterSpec.Type.content, @@ -173,12 +165,19 @@ public class MockNodeRepository extends NodeRepository { false, Collections.emptySet()); activate(provisioner.prepare(app3, cluster3, Capacity.fromCount(2, new NodeResources(1, 1, 100), false, true), 1, null), app3, provisioner); + List<Node> largeNodes = new ArrayList<>(); + largeNodes.add(createNode("node13", "host13.yahoo.com", ipConfig(13), Optional.empty(), Optional.empty(), + new Flavor(new NodeResources(10, 48, 500)), NodeType.tenant)); + largeNodes.add(createNode("node14", "host14.yahoo.com", ipConfig(14), Optional.empty(), Optional.empty(), + new Flavor(new NodeResources(10, 48, 500)), NodeType.tenant)); + addNodes(largeNodes); + setReady(largeNodes, Agent.system, getClass().getSimpleName()); ApplicationId app4 = ApplicationId.from(TenantName.from("tenant4"), ApplicationName.from("application4"), InstanceName.from("instance4")); ClusterSpec cluster4 = ClusterSpec.request(ClusterSpec.Type.container, ClusterSpec.Id.from("id4"), Version.fromString("6.42"), false, Collections.emptySet()); - activate(provisioner.prepare(app4, cluster4, Capacity.fromNodeCount(2, Optional.of("large"), false, true), 1, null), app4, provisioner); + activate(provisioner.prepare(app4, cluster4, Capacity.fromCount(2, new NodeResources(10, 48, 500), false, true), 1, null), app4, provisioner); } private void activate(List<HostSpec> hosts, ApplicationId application, NodeRepositoryProvisioner provisioner) { diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/InactiveAndFailedExpirerTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/InactiveAndFailedExpirerTest.java index 6710363d4de..bf078e0cddc 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/InactiveAndFailedExpirerTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/InactiveAndFailedExpirerTest.java @@ -9,6 +9,7 @@ import com.yahoo.config.provision.ClusterSpec; import com.yahoo.config.provision.Environment; import com.yahoo.config.provision.HostSpec; import com.yahoo.config.provision.InstanceName; +import com.yahoo.config.provision.NodeResources; import com.yahoo.config.provision.NodeType; import com.yahoo.config.provision.RegionName; import com.yahoo.config.provision.TenantName; @@ -42,17 +43,20 @@ import static org.mockito.Mockito.mock; */ public class InactiveAndFailedExpirerTest { - private final ApplicationId applicationId = ApplicationId.from(TenantName.from("foo"), ApplicationName.from("bar"), - InstanceName.from("fuz")); + private final NodeResources nodeResources = new NodeResources(2, 8, 50); + + private final ApplicationId applicationId = ApplicationId.from(TenantName.from("foo"), + ApplicationName.from("bar"), + InstanceName.from("fuz")); @Test public void inactive_and_failed_times_out() { ProvisioningTester tester = new ProvisioningTester.Builder().zone(new Zone(Environment.prod, RegionName.from("us-east"))).build(); - List<Node> nodes = tester.makeReadyNodes(2, "default"); + List<Node> nodes = tester.makeReadyNodes(2, nodeResources); // Allocate then deallocate 2 nodes ClusterSpec cluster = ClusterSpec.request(ClusterSpec.Type.content, ClusterSpec.Id.from("test"), Version.fromString("6.42"), false, Collections.emptySet()); - List<HostSpec> preparedNodes = tester.prepare(applicationId, cluster, Capacity.fromNodeCount(2), 1); + List<HostSpec> preparedNodes = tester.prepare(applicationId, cluster, Capacity.fromCount(2, nodeResources), 1); tester.activate(applicationId, new HashSet<>(preparedNodes)); assertEquals(2, tester.getNodes(applicationId, Node.State.active).size()); tester.deactivate(applicationId); @@ -86,14 +90,14 @@ public class InactiveAndFailedExpirerTest { @Test public void reboot_generation_is_increased_when_node_moves_to_dirty() { ProvisioningTester tester = new ProvisioningTester.Builder().zone(new Zone(Environment.prod, RegionName.from("us-east"))).build(); - List<Node> nodes = tester.makeReadyNodes(2, "default"); + List<Node> nodes = tester.makeReadyNodes(2, nodeResources); // Allocate and deallocate a single node ClusterSpec cluster = ClusterSpec.request(ClusterSpec.Type.content, ClusterSpec.Id.from("test"), Version.fromString("6.42"), false, Collections.emptySet()); - List<HostSpec> preparedNodes = tester.prepare(applicationId, cluster, Capacity.fromNodeCount(2), 1); + List<HostSpec> preparedNodes = tester.prepare(applicationId, cluster, Capacity.fromCount(2, nodeResources), 1); tester.activate(applicationId, new HashSet<>(preparedNodes)); assertEquals(2, tester.getNodes(applicationId, Node.State.active).size()); tester.deactivate(applicationId); @@ -120,16 +124,18 @@ public class InactiveAndFailedExpirerTest { ProvisioningTester tester = new ProvisioningTester.Builder().zone(new Zone(Environment.prod, RegionName.from("us-east"))).build(); ClusterSpec cluster = ClusterSpec.request(ClusterSpec.Type.content, ClusterSpec.Id.from("test"), Version.fromString("6.42"), false, Collections.emptySet()); - tester.makeReadyNodes(5, "default"); + tester.makeReadyNodes(5, nodeResources); // Allocate two nodes { - List<HostSpec> hostSpecs = tester.prepare(applicationId, cluster, Capacity.fromNodeCount(2), 1); + List<HostSpec> hostSpecs = tester.prepare(applicationId, + cluster, + Capacity.fromCount(2, nodeResources), + 1); tester.activate(applicationId, new HashSet<>(hostSpecs)); assertEquals(2, tester.getNodes(applicationId, Node.State.active).size()); } - // Flag one node for retirement and redeploy { Node toRetire = tester.getNodes(applicationId, Node.State.active).asList().get(0); @@ -146,9 +152,9 @@ public class InactiveAndFailedExpirerTest { Collections.singletonMap( applicationId, new MockDeployer.ApplicationContext(applicationId, cluster, - Capacity.fromNodeCount(2, - Optional.of("default"), - false, true), + Capacity.fromCount(2, + nodeResources, + false, true), 1) ) ); @@ -172,9 +178,9 @@ public class InactiveAndFailedExpirerTest { // Allocate then deallocate a node ProvisioningTester tester = new ProvisioningTester.Builder().zone(new Zone(Environment.prod, RegionName.from("us-east"))).build(); - tester.makeReadyNodes(1, "default"); + tester.makeReadyNodes(1, nodeResources); ClusterSpec cluster = ClusterSpec.request(ClusterSpec.Type.content, ClusterSpec.Id.from("test"), Version.fromString("6.42"), false, Collections.emptySet()); - List<HostSpec> preparedNodes = tester.prepare(testerId, cluster, Capacity.fromNodeCount(2), 1); + List<HostSpec> preparedNodes = tester.prepare(testerId, cluster, Capacity.fromCount(2, nodeResources), 1); tester.activate(testerId, new HashSet<>(preparedNodes)); assertEquals(1, tester.getNodes(testerId, Node.State.active).size()); tester.deactivate(testerId); diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeFailTester.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeFailTester.java index 2438b5e1893..9e57ae6dcd6 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeFailTester.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeFailTester.java @@ -57,6 +57,8 @@ import static org.junit.Assert.assertEquals; */ public class NodeFailTester { + public static final NodeResources nodeResources = new NodeResources(2, 8, 50); + // Immutable components public static final ApplicationId nodeAdminApp = ApplicationId.from(TenantName.from("hosted-vespa"), ApplicationName.from("routing"), InstanceName.from("default")); public static final ApplicationId app1 = ApplicationId.from(TenantName.from("foo1"), ApplicationName.from("bar"), InstanceName.from("fuz")); @@ -100,7 +102,7 @@ public class NodeFailTester { public static NodeFailTester withTwoApplications(ConfigserverConfig configserverConfig) { NodeFailTester tester = new NodeFailTester(configserverConfig); - tester.createReadyNodes(16); + tester.createReadyNodes(16, nodeResources); tester.createHostNodes(3); // Create applications @@ -114,8 +116,8 @@ public class NodeFailTester { assertEquals(wantedNodesApp2, tester.nodeRepository.getNodes(app2, Node.State.active).size()); Map<ApplicationId, MockDeployer.ApplicationContext> apps = new HashMap<>(); - apps.put(app1, new MockDeployer.ApplicationContext(app1, clusterApp1, Capacity.fromNodeCount(wantedNodesApp1, Optional.of("default"), false, true), 1)); - apps.put(app2, new MockDeployer.ApplicationContext(app2, clusterApp2, Capacity.fromNodeCount(wantedNodesApp2, Optional.of("default"), false, true), 1)); + apps.put(app1, new MockDeployer.ApplicationContext(app1, clusterApp1, Capacity.fromCount(wantedNodesApp1, nodeResources, false, true), 1)); + apps.put(app2, new MockDeployer.ApplicationContext(app2, clusterApp2, Capacity.fromCount(wantedNodesApp2, nodeResources, false, true), 1)); tester.deployer = new MockDeployer(tester.provisioner, tester.clock(), apps); tester.serviceMonitor = new ServiceMonitorStub(apps, tester.nodeRepository); tester.metric = new MetricsReporterTest.TestMetric(); @@ -227,6 +229,10 @@ public class NodeFailTester { return createReadyNodes(count, 0); } + public List<Node> createReadyNodes(int count, NodeResources resources) { + return createReadyNodes(count, 0, resources); + } + public List<Node> createReadyNodes(int count, NodeType nodeType) { return createReadyNodes(count, 0, Optional.empty(), nodeFlavors.getFlavorOrThrow("default"), nodeType); } @@ -239,6 +245,14 @@ public class NodeFailTester { return createReadyNodes(count, startIndex, Optional.empty(), nodeFlavors.getFlavorOrThrow(flavor), NodeType.tenant); } + public List<Node> createReadyNodes(int count, int startIndex, NodeResources resources) { + return createReadyNodes(count, startIndex, Optional.empty(), new Flavor(resources), NodeType.tenant); + } + + public List<Node> createReadyNodes(int count, int startIndex, Flavor flavor) { + return createReadyNodes(count, startIndex, Optional.empty(), flavor, NodeType.tenant); + } + private List<Node> createReadyNodes(int count, int startIndex, Optional<String> parentHostname, Flavor flavor, NodeType nodeType) { List<Node> nodes = new ArrayList<>(count); for (int i = startIndex; i < startIndex + count; i++) @@ -261,6 +275,7 @@ public class NodeFailTester { private void activate(ApplicationId applicationId, ClusterSpec cluster, int nodeCount) { activate(applicationId, cluster, Capacity.fromNodeCount(nodeCount)); } + private void activate(ApplicationId applicationId, ClusterSpec cluster, Capacity capacity) { List<HostSpec> hosts = provisioner.prepare(applicationId, cluster, capacity, 1, null); NestedTransaction transaction = new NestedTransaction().add(new CuratorTransaction(curator)); diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeFailerTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeFailerTest.java index 07e5db305b6..a8b0d0becd4 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeFailerTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/NodeFailerTest.java @@ -3,6 +3,7 @@ package com.yahoo.vespa.hosted.provision.maintenance; import com.yahoo.cloud.config.ConfigserverConfig; import com.yahoo.config.provision.Flavor; +import com.yahoo.config.provision.NodeResources; import com.yahoo.config.provision.NodeType; import com.yahoo.vespa.applicationmodel.ServiceInstance; import com.yahoo.vespa.applicationmodel.ServiceStatus; @@ -282,7 +283,7 @@ public class NodeFailerTest { } // A new node is available - tester.createReadyNodes(1, 16); + tester.createReadyNodes(1, 16, NodeFailTester.nodeResources); tester.clock.advance(Duration.ofDays(1)); tester.allNodesMakeAConfigRequestExcept(); tester.failer.run(); @@ -302,7 +303,8 @@ public class NodeFailerTest { NodeFailTester tester = NodeFailTester.withTwoApplications(); // Add ready docker node - tester.createReadyNodes(1, 16, "docker"); + NodeResources newNodeResources = new NodeResources(3,4,5); + tester.createReadyNodes(1, 16, newNodeResources); // For a day all nodes work so nothing happens for (int minutes = 0, interval = 30; minutes < 24 * 60; minutes += interval) { @@ -316,9 +318,9 @@ public class NodeFailerTest { // Two ready nodes and a ready docker node die, but only 2 of those are failed out tester.clock.advance(Duration.ofMinutes(180)); - Node dockerNode = ready.stream().filter(node -> node.flavor().getType() == Flavor.Type.DOCKER_CONTAINER).findFirst().get(); + Node dockerNode = ready.stream().filter(node -> node.flavor().resources().equals(newNodeResources)).findFirst().get(); List<Node> otherNodes = ready.stream() - .filter(node -> node.flavor().getType() != Flavor.Type.DOCKER_CONTAINER) + .filter(node -> ! node.flavor().resources().equals(newNodeResources)) .collect(Collectors.toList()); tester.allNodesMakeAConfigRequestExcept(otherNodes.get(0), otherNodes.get(2), dockerNode); tester.failer.run(); diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/OperatorChangeApplicationMaintainerTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/OperatorChangeApplicationMaintainerTest.java index a3d651519ea..cd136360b0d 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/OperatorChangeApplicationMaintainerTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/OperatorChangeApplicationMaintainerTest.java @@ -8,9 +8,11 @@ import com.yahoo.config.provision.Capacity; import com.yahoo.config.provision.ClusterSpec; import com.yahoo.config.provision.DockerImage; import com.yahoo.config.provision.Environment; +import com.yahoo.config.provision.Flavor; import com.yahoo.config.provision.HostSpec; import com.yahoo.config.provision.InstanceName; import com.yahoo.config.provision.NodeFlavors; +import com.yahoo.config.provision.NodeResources; import com.yahoo.config.provision.NodeType; import com.yahoo.config.provision.RegionName; import com.yahoo.config.provision.TenantName; @@ -63,7 +65,7 @@ public class OperatorChangeApplicationMaintainerTest { true); this.fixture = new Fixture(zone, nodeRepository, nodeFlavors, curator); - createReadyNodes(15, nodeRepository, nodeFlavors); + createReadyNodes(15, this.fixture.nodeResources, nodeRepository); createHostNodes(2, nodeRepository, nodeFlavors); // Create applications @@ -91,9 +93,16 @@ public class OperatorChangeApplicationMaintainerTest { } private void createReadyNodes(int count, NodeRepository nodeRepository, NodeFlavors nodeFlavors) { + createReadyNodes(count, nodeFlavors.getFlavorOrThrow("default"), nodeRepository); + } + private void createReadyNodes(int count, NodeResources resources, NodeRepository nodeRepository) { + createReadyNodes(count, new Flavor(resources), nodeRepository); + } + + private void createReadyNodes(int count, Flavor flavor, NodeRepository nodeRepository) { List<Node> nodes = new ArrayList<>(count); for (int i = 0; i < count; i++) - nodes.add(nodeRepository.createNode("node" + i, "host" + i, Optional.empty(), nodeFlavors.getFlavorOrThrow("default"), NodeType.tenant)); + nodes.add(nodeRepository.createNode("node" + i, "host" + i, Optional.empty(), flavor, NodeType.tenant)); nodes = nodeRepository.addNodes(nodes); nodes = nodeRepository.setDirty(nodes, Agent.system, getClass().getSimpleName()); nodeRepository.setReady(nodes, Agent.system, getClass().getSimpleName()); @@ -110,6 +119,7 @@ public class OperatorChangeApplicationMaintainerTest { private class Fixture { + final NodeResources nodeResources = new NodeResources(2, 8, 50); final NodeRepository nodeRepository; final NodeRepositoryProvisioner provisioner; final Curator curator; @@ -136,14 +146,14 @@ public class OperatorChangeApplicationMaintainerTest { Map<ApplicationId, MockDeployer.ApplicationContext> apps = new HashMap<>(); apps.put(app1, new MockDeployer.ApplicationContext(app1, clusterApp1, - Capacity.fromNodeCount(wantedNodesApp1, Optional.of("default"), false, true), 1)); + Capacity.fromCount(wantedNodesApp1, nodeResources), 1)); apps.put(app2, new MockDeployer.ApplicationContext(app2, clusterApp2, - Capacity.fromNodeCount(wantedNodesApp2, Optional.of("default"), false, true), 1)); + Capacity.fromCount(wantedNodesApp2, nodeResources), 1)); this.deployer = new MockDeployer(provisioner, nodeRepository.clock(), apps); } private void activate(ApplicationId applicationId, ClusterSpec cluster, int nodeCount, NodeRepositoryProvisioner provisioner) { - List<HostSpec> hosts = provisioner.prepare(applicationId, cluster, Capacity.fromNodeCount(nodeCount), 1, null); + List<HostSpec> hosts = provisioner.prepare(applicationId, cluster, Capacity.fromCount(nodeCount, nodeResources), 1, null); NestedTransaction transaction = new NestedTransaction().add(new CuratorTransaction(curator)); provisioner.activate(transaction, applicationId, hosts); transaction.commit(); diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/PeriodicApplicationMaintainerTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/PeriodicApplicationMaintainerTest.java index 1835ca9968c..49a14dc3777 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/PeriodicApplicationMaintainerTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/PeriodicApplicationMaintainerTest.java @@ -9,9 +9,11 @@ import com.yahoo.config.provision.ClusterSpec; import com.yahoo.config.provision.Deployer; import com.yahoo.config.provision.DockerImage; import com.yahoo.config.provision.Environment; +import com.yahoo.config.provision.Flavor; import com.yahoo.config.provision.HostSpec; import com.yahoo.config.provision.InstanceName; import com.yahoo.config.provision.NodeFlavors; +import com.yahoo.config.provision.NodeResources; import com.yahoo.config.provision.NodeType; import com.yahoo.config.provision.RegionName; import com.yahoo.config.provision.TenantName; @@ -69,7 +71,7 @@ public class PeriodicApplicationMaintainerTest { true); this.fixture = new Fixture(zone, nodeRepository, nodeFlavors, curator); - createReadyNodes(15, nodeRepository, nodeFlavors); + createReadyNodes(15, fixture.nodeResources, nodeRepository); createHostNodes(2, nodeRepository, nodeFlavors); } @@ -213,10 +215,14 @@ public class PeriodicApplicationMaintainerTest { } } - private void createReadyNodes(int count, NodeRepository nodeRepository, NodeFlavors nodeFlavors) { + private void createReadyNodes(int count, NodeResources nodeResources, NodeRepository nodeRepository) { + createReadyNodes(count, new Flavor(nodeResources), nodeRepository); + } + + private void createReadyNodes(int count, Flavor flavor, NodeRepository nodeRepository) { List<Node> nodes = new ArrayList<>(count); for (int i = 0; i < count; i++) - nodes.add(nodeRepository.createNode("node" + i, "host" + i, Optional.empty(), nodeFlavors.getFlavorOrThrow("default"), NodeType.tenant)); + nodes.add(nodeRepository.createNode("node" + i, "host" + i, Optional.empty(), flavor, NodeType.tenant)); nodes = nodeRepository.addNodes(nodes); nodes = nodeRepository.setDirty(nodes, Agent.system, getClass().getSimpleName()); nodeRepository.setReady(nodes, Agent.system, getClass().getSimpleName()); @@ -233,6 +239,7 @@ public class PeriodicApplicationMaintainerTest { private class Fixture { + final NodeResources nodeResources = new NodeResources(2, 8, 50); final NodeRepository nodeRepository; final NodeRepositoryProvisioner provisioner; final Curator curator; @@ -254,9 +261,9 @@ public class PeriodicApplicationMaintainerTest { Map<ApplicationId, MockDeployer.ApplicationContext> apps = new HashMap<>(); apps.put(app1, new MockDeployer.ApplicationContext(app1, clusterApp1, - Capacity.fromNodeCount(wantedNodesApp1, Optional.of("default"), false, true), 1)); + Capacity.fromCount(wantedNodesApp1, nodeResources), 1)); apps.put(app2, new MockDeployer.ApplicationContext(app2, clusterApp2, - Capacity.fromNodeCount(wantedNodesApp2, Optional.of("default"), false, true), 1)); + Capacity.fromCount(wantedNodesApp2, nodeResources), 1)); this.deployer = new MockDeployer(provisioner, nodeRepository.clock(), apps); this.maintainer = new TestablePeriodicApplicationMaintainer(deployer, nodeRepository, Duration.ofDays(1), // Long duration to prevent scheduled runs during test Duration.ofMinutes(30)); @@ -270,7 +277,7 @@ public class PeriodicApplicationMaintainerTest { } private void activate(ApplicationId applicationId, ClusterSpec cluster, int nodeCount, NodeRepositoryProvisioner provisioner) { - List<HostSpec> hosts = provisioner.prepare(applicationId, cluster, Capacity.fromNodeCount(nodeCount), 1, null); + List<HostSpec> hosts = provisioner.prepare(applicationId, cluster, Capacity.fromCount(nodeCount, nodeResources), 1, null); NestedTransaction transaction = new NestedTransaction().add(new CuratorTransaction(curator)); provisioner.activate(transaction, applicationId, hosts); transaction.commit(); diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/ReservationExpirerTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/ReservationExpirerTest.java index 64267557f64..491f506c3eb 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/ReservationExpirerTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/ReservationExpirerTest.java @@ -6,7 +6,9 @@ import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.Capacity; import com.yahoo.config.provision.ClusterSpec; import com.yahoo.config.provision.DockerImage; +import com.yahoo.config.provision.Flavor; import com.yahoo.config.provision.NodeFlavors; +import com.yahoo.config.provision.NodeResources; import com.yahoo.config.provision.NodeType; import com.yahoo.config.provision.Zone; import com.yahoo.test.ManualClock; @@ -50,8 +52,8 @@ public class ReservationExpirerTest { NodeRepositoryProvisioner provisioner = new NodeRepositoryProvisioner(nodeRepository, flavors, Zone.defaultZone(), new MockProvisionServiceProvider(), new InMemoryFlagSource()); List<Node> nodes = new ArrayList<>(2); - nodes.add(nodeRepository.createNode(UUID.randomUUID().toString(), UUID.randomUUID().toString(), Optional.empty(), flavors.getFlavorOrThrow("default"), NodeType.tenant)); - nodes.add(nodeRepository.createNode(UUID.randomUUID().toString(), UUID.randomUUID().toString(), Optional.empty(), flavors.getFlavorOrThrow("default"), NodeType.tenant)); + nodes.add(nodeRepository.createNode(UUID.randomUUID().toString(), UUID.randomUUID().toString(), Optional.empty(), new Flavor(new NodeResources(2, 8, 50)), NodeType.tenant)); + nodes.add(nodeRepository.createNode(UUID.randomUUID().toString(), UUID.randomUUID().toString(), Optional.empty(), new Flavor(new NodeResources(2, 8, 50)), NodeType.tenant)); nodes.add(nodeRepository.createNode(UUID.randomUUID().toString(), UUID.randomUUID().toString(), Optional.empty(), flavors.getFlavorOrThrow("default"), NodeType.host)); nodes = nodeRepository.addNodes(nodes); nodes = nodeRepository.setDirty(nodes, Agent.system, getClass().getSimpleName()); @@ -61,7 +63,7 @@ public class ReservationExpirerTest { nodeRepository.setReady(nodes, Agent.system, getClass().getSimpleName()); ApplicationId applicationId = new ApplicationId.Builder().tenant("foo").applicationName("bar").instanceName("fuz").build(); ClusterSpec cluster = ClusterSpec.request(ClusterSpec.Type.content, ClusterSpec.Id.from("test"), Version.fromString("6.42"), false, Collections.emptySet()); - provisioner.prepare(applicationId, cluster, Capacity.fromNodeCount(2), 1, null); + provisioner.prepare(applicationId, cluster, Capacity.fromCount(2, new NodeResources(2, 8, 50)), 1, null); assertEquals(2, nodeRepository.getNodes(NodeType.tenant, Node.State.reserved).size()); // Reservation times out diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/RetiredExpirerTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/RetiredExpirerTest.java index 2f7e61f49c9..e37a139700f 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/RetiredExpirerTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/maintenance/RetiredExpirerTest.java @@ -9,9 +9,11 @@ import com.yahoo.config.provision.ClusterSpec; import com.yahoo.config.provision.Deployer; import com.yahoo.config.provision.DockerImage; import com.yahoo.config.provision.Environment; +import com.yahoo.config.provision.Flavor; import com.yahoo.config.provision.HostSpec; import com.yahoo.config.provision.InstanceName; import com.yahoo.config.provision.NodeFlavors; +import com.yahoo.config.provision.NodeResources; import com.yahoo.config.provision.NodeType; import com.yahoo.config.provision.RegionName; import com.yahoo.config.provision.TenantName; @@ -55,6 +57,8 @@ import static org.mockito.Mockito.verify; */ public class RetiredExpirerTest { + private final NodeResources nodeResources = new NodeResources(2, 8, 50); + private Curator curator = new MockCurator(); private final ManualClock clock = new ManualClock(); private final Zone zone = new Zone(Environment.prod, RegionName.from("us-east")); @@ -75,7 +79,7 @@ public class RetiredExpirerTest { @Test public void ensure_retired_nodes_time_out() { - createReadyNodes(7, nodeRepository, nodeFlavors); + createReadyNodes(7, nodeResources, nodeRepository); createHostNodes(4, nodeRepository, nodeFlavors); ApplicationId applicationId = ApplicationId.from(TenantName.from("foo"), ApplicationName.from("bar"), InstanceName.from("fuz")); @@ -95,7 +99,7 @@ public class RetiredExpirerTest { MockDeployer deployer = new MockDeployer(provisioner, clock, - Collections.singletonMap(applicationId, new MockDeployer.ApplicationContext(applicationId, cluster, Capacity.fromNodeCount(wantedNodes, Optional.of("default"), false, true), 1))); + Collections.singletonMap(applicationId, new MockDeployer.ApplicationContext(applicationId, cluster, Capacity.fromCount(wantedNodes, nodeResources), 1))); createRetiredExpirer(deployer).run(); assertEquals(3, nodeRepository.getNodes(applicationId, Node.State.active).size()); assertEquals(4, nodeRepository.getNodes(applicationId, Node.State.inactive).size()); @@ -108,7 +112,7 @@ public class RetiredExpirerTest { @Test public void ensure_retired_groups_time_out() { - createReadyNodes(8, nodeRepository, nodeFlavors); + createReadyNodes(8, nodeResources, nodeRepository); createHostNodes(4, nodeRepository, nodeFlavors); ApplicationId applicationId = ApplicationId.from(TenantName.from("foo"), ApplicationName.from("bar"), InstanceName.from("fuz")); @@ -124,7 +128,7 @@ public class RetiredExpirerTest { MockDeployer deployer = new MockDeployer(provisioner, clock, - Collections.singletonMap(applicationId, new MockDeployer.ApplicationContext(applicationId, cluster, Capacity.fromNodeCount(2, Optional.of("default"), false, true), 1))); + Collections.singletonMap(applicationId, new MockDeployer.ApplicationContext(applicationId, cluster, Capacity.fromCount(2, nodeResources), 1))); createRetiredExpirer(deployer).run(); assertEquals(2, nodeRepository.getNodes(applicationId, Node.State.active).size()); assertEquals(6, nodeRepository.getNodes(applicationId, Node.State.inactive).size()); @@ -137,7 +141,7 @@ public class RetiredExpirerTest { @Test public void ensure_early_inactivation() throws OrchestrationException { - createReadyNodes(7, nodeRepository, nodeFlavors); + createReadyNodes(7, nodeResources, nodeRepository); createHostNodes(4, nodeRepository, nodeFlavors); ApplicationId applicationId = ApplicationId.from(TenantName.from("foo"), ApplicationName.from("bar"), InstanceName.from("fuz")); @@ -158,8 +162,7 @@ public class RetiredExpirerTest { clock, Collections.singletonMap( applicationId, - new MockDeployer.ApplicationContext(applicationId, cluster, Capacity.fromNodeCount(wantedNodes, Optional.of("default"), false, true), 1))); - + new MockDeployer.ApplicationContext(applicationId, cluster, Capacity.fromCount(wantedNodes, nodeResources), 1))); // Allow the 1st and 3rd retired nodes permission to inactivate doNothing() @@ -195,16 +198,24 @@ public class RetiredExpirerTest { } private void activate(ApplicationId applicationId, ClusterSpec cluster, int nodes, int groups, NodeRepositoryProvisioner provisioner) { - List<HostSpec> hosts = provisioner.prepare(applicationId, cluster, Capacity.fromNodeCount(nodes), groups, null); + List<HostSpec> hosts = provisioner.prepare(applicationId, cluster, Capacity.fromCount(nodes, nodeResources), groups, null); NestedTransaction transaction = new NestedTransaction().add(new CuratorTransaction(curator)); provisioner.activate(transaction, applicationId, hosts); transaction.commit(); } + private void createReadyNodes(int count, NodeResources nodeResources, NodeRepository nodeRepository) { + createReadyNodes(count, new Flavor(nodeResources), nodeRepository); + } + private void createReadyNodes(int count, NodeRepository nodeRepository, NodeFlavors nodeFlavors) { + createReadyNodes(count, nodeFlavors.getFlavorOrThrow("default"), nodeRepository); + } + + private void createReadyNodes(int count, Flavor flavor, NodeRepository nodeRepository) { List<Node> nodes = new ArrayList<>(count); for (int i = 0; i < count; i++) - nodes.add(nodeRepository.createNode("node" + i, "node" + i, Optional.empty(), nodeFlavors.getFlavorOrThrow("default"), NodeType.tenant)); + nodes.add(nodeRepository.createNode("node" + i, "node" + i, Optional.empty(), flavor, NodeType.tenant)); nodes = nodeRepository.addNodes(nodes); nodes = nodeRepository.setDirty(nodes, Agent.system, getClass().getSimpleName()); nodeRepository.setReady(nodes, Agent.system, getClass().getSimpleName()); diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/AclProvisioningTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/AclProvisioningTest.java index cb2f5286b97..f5205332e26 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/AclProvisioningTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/AclProvisioningTest.java @@ -34,6 +34,8 @@ import static org.junit.Assert.assertFalse; */ public class AclProvisioningTest { + private final NodeResources nodeResources = new NodeResources(2, 8, 50); + private ProvisioningTester tester = new ProvisioningTester.Builder().build(); @Test @@ -68,7 +70,7 @@ public class AclProvisioningTest { List<Node> configServers = tester.makeConfigServers(3, "default", Version.fromString("6.123.456")); // Populate repo - tester.makeReadyNodes(10, "default"); + tester.makeReadyNodes(10, nodeResources); List<Node> proxyNodes = tester.makeReadyNodes(3, "default", NodeType.proxy); // Allocate 2 nodes to an application @@ -88,7 +90,7 @@ public class AclProvisioningTest { List<Node> configServers = tester.makeConfigServers(3, "default", Version.fromString("6.123.456")); // Populate repo - tester.makeReadyNodes(10, "default"); + tester.makeReadyNodes(10, nodeResources); List<Node> proxyNodes = tester.makeReadyNodes(3, "default", NodeType.proxy); // Allocate 2 nodes @@ -167,7 +169,7 @@ public class AclProvisioningTest { @Test public void trusted_nodes_for_application_with_load_balancer() { // Populate repo - tester.makeReadyNodes(10, "default"); + tester.makeReadyNodes(10, nodeResources); // Allocate 2 nodes List<Node> activeNodes = deploy(2); @@ -193,7 +195,7 @@ public class AclProvisioningTest { } private List<Node> deploy(ApplicationId application, int nodeCount) { - return deploy(application, Capacity.fromNodeCount(nodeCount)); + return deploy(application, Capacity.fromCount(nodeCount, nodeResources)); } private List<Node> deploy(ApplicationId application, Capacity capacity) { diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java index 3620b424fa6..0d1f334c66d 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java @@ -292,31 +292,6 @@ public class ProvisioningTest { } @Test - public void application_deployment_multiple_flavors_default_per_type() { - ConfigserverConfig.Builder config = new ConfigserverConfig.Builder(); - config.environment("prod"); - config.region("us-east"); - config.defaultFlavor("not-used"); - config.defaultContainerFlavor("small"); - config.defaultContentFlavor("large"); - ProvisioningTester tester = new ProvisioningTester.Builder() - .zone(new Zone(new ConfigserverConfig(config), new NodeFlavors(new FlavorsConfig.Builder().build()))).build(); - - ApplicationId application1 = tester.makeApplicationId(); - - tester.makeReadyNodes(10, "small"); - tester.makeReadyNodes(9, "large"); - - // deploy - SystemState state1 = prepare(application1, 2, 3, 4, 5, null, tester); - tester.activate(application1, state1.allHosts); - assertEquals("'small' nodes are used for containers", - 2 + 3, tester.getNodes(application1, Node.State.active).flavor("small").size()); - assertEquals("'large' nodes are used for content", - 4 + 5, tester.getNodes(application1, Node.State.active).flavor("large").size()); - } - - @Test public void application_deployment_multiple_flavors_with_replacement() { ProvisioningTester tester = new ProvisioningTester.Builder().zone(new Zone(Environment.prod, RegionName.from("us-east"))).build(); @@ -871,7 +846,7 @@ public class ProvisioningTest { allHosts.addAll(content0); allHosts.addAll(content1); - Function<Integer, Capacity> capacity = count -> Capacity.fromNodeCount(count, Optional.empty(), required, true); + Function<Integer, Capacity> capacity = count -> Capacity.fromCount(count, Optional.empty(), required, true); int expectedContainer0Size = tester.capacityPolicies().decideSize(capacity.apply(container0Size), containerCluster0.type()); int expectedContainer1Size = tester.capacityPolicies().decideSize(capacity.apply(container1Size), containerCluster1.type()); int expectedContent0Size = tester.capacityPolicies().decideSize(capacity.apply(content0Size), contentCluster0.type()); diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTester.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTester.java index e1ba3291bd3..c8051c3bdee 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTester.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTester.java @@ -227,9 +227,16 @@ public class ProvisioningTester { return makeReadyNodes(n, flavor, NodeType.tenant); } + public List<Node> makeReadyNodes(int n, NodeResources resources) { + return makeReadyNodes(n, resources, NodeType.tenant); + } + public List<Node> makeReadyNodes(int n, String flavor, NodeType type) { return makeReadyNodes(n, asFlavor(flavor, type), type); } + public List<Node> makeReadyNodes(int n, NodeResources resources, NodeType type) { + return makeReadyNodes(n, new Flavor(resources), type, 0); + } public List<Node> makeReadyNodes(int n, Flavor flavor, NodeType type) { return makeReadyNodes(n, flavor, type, 0); } diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java index bab6f0c9338..3fbfc7c2487 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/RestApiTest.java @@ -359,15 +359,6 @@ public class RestApiTest { } @Test - public void setting_node_to_ready_will_reset_certain_fields() throws Exception { - final String hostname = "host55.yahoo.com"; - assertResponse(new Request("http://localhost:8080/nodes/v2/state/ready/" + hostname, - new byte[0], Request.Method.PUT), - "{\"message\":\"Moved " + hostname + " to ready\"}"); - assertFile(new Request("http://localhost:8080/nodes/v2/node/" + hostname), "node55-after-changes.json"); - } - - @Test public void acl_request_by_tenant_node() throws Exception { String hostname = "foo.yahoo.com"; assertResponse(new Request("http://localhost:8080/nodes/v2/node", @@ -411,7 +402,7 @@ public class RestApiTest { assertResponse(new Request("http://localhost:8080/nodes/v2/state/ready/host1.yahoo.com", new byte[0], Request.Method.PUT), 400, - "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Can not set failed node host1.yahoo.com allocated to tenant1.application1.instance1 as 'container/id1/0/0' ready. It is not provisioned or dirty.\"}"); + "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Cannot make host1.yahoo.com available for new allocation, must be in state dirty, but was in failed\"}"); // (... while dirty then ready works (the ready move will be initiated by node maintenance)) assertResponse(new Request("http://localhost:8080/nodes/v2/state/dirty/host1.yahoo.com", @@ -427,7 +418,7 @@ public class RestApiTest { "{\"message\":\"Moved host2.yahoo.com to parked\"}"); assertResponse(new Request("http://localhost:8080/nodes/v2/state/ready/host2.yahoo.com", new byte[0], Request.Method.PUT), - 400, "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Can not set parked node host2.yahoo.com allocated to tenant2.application2.instance2 as 'content/id2/0/0' ready. It is not provisioned or dirty.\"}"); + 400, "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Cannot make host2.yahoo.com available for new allocation, must be in state dirty, but was in parked\"}"); // (... while dirty then ready works (the ready move will be initiated by node maintenance)) assertResponse(new Request("http://localhost:8080/nodes/v2/state/dirty/host2.yahoo.com", new byte[0], Request.Method.PUT), @@ -436,10 +427,10 @@ public class RestApiTest { new byte[0], Request.Method.PUT), "{\"message\":\"Moved host2.yahoo.com to ready\"}"); - // Attempt to DELETE a node which is not put in a deletable state first + // Attempt to DELETE a node which has been removed assertResponse(new Request("http://localhost:8080/nodes/v2/node/host2.yahoo.com", new byte[0], Request.Method.DELETE), - 400, "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Failed to delete host2.yahoo.com: Node host2.yahoo.com can only be removed from following states: provisioned, failed, parked\"}"); + 404, "{\"error-code\":\"NOT_FOUND\",\"message\":\"No node with hostname 'host2.yahoo.com'\"}"); // Attempt to DELETE allocated node assertResponse(new Request("http://localhost:8080/nodes/v2/node/host4.yahoo.com", @@ -456,10 +447,10 @@ public class RestApiTest { Utf8.toBytes("{\"flavor\": 1}"), Request.Method.PATCH), 400, "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Could not set field 'flavor': Expected a STRING value, got a LONG\"}"); - // Attempt to set unallocated node active + // Attempt to set nonexisting node to active assertResponse(new Request("http://localhost:8080/nodes/v2/state/active/host2.yahoo.com", - new byte[0], Request.Method.PUT), 400, - "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Could not set host2.yahoo.com active. It has no allocation.\"}"); + new byte[0], Request.Method.PUT), 404, + "{\"error-code\":\"NOT_FOUND\",\"message\":\"Could not move host2.yahoo.com to active: Node not found\"}"); // Attempt to POST duplicate nodes assertResponse(new Request("http://localhost:8080/nodes/v2/node", @@ -525,13 +516,6 @@ public class RestApiTest { } @Test - public void test_disallow_setting_currentDockerImage_for_non_docker_node() throws IOException { - assertResponse(new Request("http://localhost:8080/nodes/v2/node/host1.yahoo.com", - Utf8.toBytes("{\"currentDockerImage\": \"ignored-image-name:4443/vespa/ci:6.45.0\"}"), Request.Method.PATCH), - 400, "{\"error-code\":\"BAD_REQUEST\",\"message\":\"Could not set field 'currentDockerImage': Docker image can only be set for docker containers\"}"); - } - - @Test public void test_node_patch_to_remove_docker_ready_fields() throws Exception { assertResponse(new Request("http://localhost:8080/nodes/v2/node/host5.yahoo.com", Utf8.toBytes("{" + diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node1.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node1.json index 51855e17e8f..bb3a6b6b672 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node1.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node1.json @@ -5,15 +5,14 @@ "type": "tenant", "hostname": "host1.yahoo.com", "openStackId": "node1", - "flavor": "default", - "canonicalFlavor": "default", - "minDiskAvailableGb": 400.0, - "minMainMemoryAvailableGb": 16.0, - "description": "Flavor-name-is-default", + "flavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "canonicalFlavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "minDiskAvailableGb": 50.0, + "minMainMemoryAvailableGb": 8.0, "minCpuCores": 2.0, "fastDisk": true, - "bandwidth": 0.0, - "environment": "BARE_METAL", + "bandwidth": 1.0, + "environment": "DOCKER_CONTAINER", "owner": { "tenant": "tenant1", "application": "application1", diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node10.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node10.json index 73d39d133fc..6fc53c49e0b 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node10.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node10.json @@ -6,15 +6,14 @@ "hostname": "host10.yahoo.com", "parentHostname": "parent1.yahoo.com", "openStackId": "node10", - "flavor": "default", - "canonicalFlavor": "default", - "minDiskAvailableGb": 400.0, - "minMainMemoryAvailableGb": 16.0, - "description": "Flavor-name-is-default", + "flavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "canonicalFlavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "minDiskAvailableGb": 50.0, + "minMainMemoryAvailableGb": 8.0, "minCpuCores": 2.0, "fastDisk": true, - "bandwidth": 0.0, - "environment": "BARE_METAL", + "bandwidth": 1.0, + "environment": "DOCKER_CONTAINER", "owner": { "tenant": "tenant1", "application": "application1", diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node13.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node13.json index 6e073bdac2b..e792aa518d4 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node13.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node13.json @@ -5,15 +5,14 @@ "type": "tenant", "hostname": "host13.yahoo.com", "openStackId": "node13", - "flavor": "large", - "canonicalFlavor": "large", - "minDiskAvailableGb": 1600.0, - "minMainMemoryAvailableGb": 32.0, - "description": "Flavor-name-is-large", - "minCpuCores": 4.0, + "flavor": "[vcpu: 10.0, memory: 48.0 Gb, disk 500.0 Gb]", + "canonicalFlavor": "[vcpu: 10.0, memory: 48.0 Gb, disk 500.0 Gb]", + "minDiskAvailableGb": 500.0, + "minMainMemoryAvailableGb": 48.0, + "minCpuCores": 10.0, "fastDisk": true, - "bandwidth": 0.0, - "environment": "BARE_METAL", + "bandwidth": 1.0, + "environment": "DOCKER_CONTAINER", "owner": { "tenant": "tenant4", "application": "application4", @@ -31,7 +30,7 @@ "wantedDockerImage": "docker-registry.domain.tld:8080/dist/vespa:6.42.0", "wantedVespaVersion": "6.42.0", "allowedToBeDown": false, - "rebootGeneration": 1, + "rebootGeneration": 0, "currentRebootGeneration": 0, "failCount": 0, "hardwareFailure": false, @@ -39,11 +38,6 @@ "wantToDeprovision": false, "history": [ { - "event": "provisioned", - "at": 123, - "agent": "system" - }, - { "event": "readied", "at": 123, "agent": "system" diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node14.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node14.json index 411bbd50aba..aca98bb36fe 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node14.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node14.json @@ -5,15 +5,14 @@ "type": "tenant", "hostname": "host14.yahoo.com", "openStackId": "node14", - "flavor": "large", - "canonicalFlavor": "large", - "minDiskAvailableGb": 1600.0, - "minMainMemoryAvailableGb": 32.0, - "description": "Flavor-name-is-large", - "minCpuCores": 4.0, + "flavor": "[vcpu: 10.0, memory: 48.0 Gb, disk 500.0 Gb]", + "canonicalFlavor": "[vcpu: 10.0, memory: 48.0 Gb, disk 500.0 Gb]", + "minDiskAvailableGb": 500.0, + "minMainMemoryAvailableGb": 48.0, + "minCpuCores": 10.0, "fastDisk": true, - "bandwidth": 0.0, - "environment": "BARE_METAL", + "bandwidth": 1.0, + "environment": "DOCKER_CONTAINER", "owner": { "tenant": "tenant4", "application": "application4", @@ -31,7 +30,7 @@ "wantedDockerImage": "docker-registry.domain.tld:8080/dist/vespa:6.42.0", "wantedVespaVersion": "6.42.0", "allowedToBeDown": false, - "rebootGeneration": 1, + "rebootGeneration": 0, "currentRebootGeneration": 0, "failCount": 0, "hardwareFailure": false, @@ -39,11 +38,6 @@ "wantToDeprovision": false, "history": [ { - "event": "provisioned", - "at": 123, - "agent": "system" - }, - { "event": "readied", "at": 123, "agent": "system" diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node2.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node2.json index b564efc6eab..8d2f6da9d79 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node2.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node2.json @@ -5,15 +5,14 @@ "type": "tenant", "hostname": "host2.yahoo.com", "openStackId": "node2", - "flavor": "default", - "canonicalFlavor": "default", - "minDiskAvailableGb": 400.0, - "minMainMemoryAvailableGb": 16.0, - "description": "Flavor-name-is-default", + "flavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "canonicalFlavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "minDiskAvailableGb": 50.0, + "minMainMemoryAvailableGb": 8.0, "minCpuCores": 2.0, "fastDisk": true, - "bandwidth": 0.0, - "environment": "BARE_METAL", + "bandwidth": 1.0, + "environment": "DOCKER_CONTAINER", "owner": { "tenant": "tenant2", "application": "application2", diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node3.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node3.json index 90c835fd80b..ec15ccc107e 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node3.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node3.json @@ -5,16 +5,14 @@ "type": "tenant", "hostname": "host3.yahoo.com", "openStackId": "node3", - "flavor": "expensive", - "canonicalFlavor": "default", + "flavor": "[vcpu: 0.5, memory: 48.0 Gb, disk 500.0 Gb]", + "canonicalFlavor": "[vcpu: 0.5, memory: 48.0 Gb, disk 500.0 Gb]", "minDiskAvailableGb": 500.0, - "minMainMemoryAvailableGb": 12.0, - "description": "Flavor-name-is-expensive", - "minCpuCores": 6.0, - "cost": 200, + "minMainMemoryAvailableGb": 48.0, + "minCpuCores": 0.5, "fastDisk": true, - "bandwidth":0.0, - "environment": "BARE_METAL", + "bandwidth":1.0, + "environment": "DOCKER_CONTAINER", "rebootGeneration": 1, "currentRebootGeneration": 0, "failCount": 0, diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55-after-changes.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55-after-changes.json deleted file mode 100644 index 9b6a5634471..00000000000 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55-after-changes.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "url": "http://localhost:8080/nodes/v2/node/host55.yahoo.com", - "id": "host55.yahoo.com", - "state": "ready", - "type": "tenant", - "hostname": "host55.yahoo.com", - "openStackId": "node55", - "flavor": "default", - "canonicalFlavor": "default", - "minDiskAvailableGb": 400.0, - "minMainMemoryAvailableGb": 16.0, - "description": "Flavor-name-is-default", - "minCpuCores": 2.0, - "fastDisk": true, - "bandwidth": 0.0, - "environment": "BARE_METAL", - "rebootGeneration": 1, - "currentRebootGeneration": 0, - "failCount": 0, - "hardwareFailure": false, - "wantToRetire": false, - "wantToDeprovision": false, - "history": [ - { - "event": "provisioned", - "at": 123, - "agent": "system" - }, - { - "event": "readied", - "at": 123, - "agent": "operator" - } - ], - "ipAddresses": [ - "127.0.55.1", - "::55:1" - ], - "additionalIpAddresses": [] -} diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55.json index 857ad231cbe..2c8d3625b87 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node55.json @@ -5,15 +5,14 @@ "type": "tenant", "hostname": "host55.yahoo.com", "openStackId": "node55", - "flavor": "default", - "canonicalFlavor": "default", - "minDiskAvailableGb": 400.0, - "minMainMemoryAvailableGb": 16.0, - "description": "Flavor-name-is-default", + "flavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "canonicalFlavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "minDiskAvailableGb": 50.0, + "minMainMemoryAvailableGb": 8.0, "minCpuCores": 2.0, "fastDisk": true, - "bandwidth":0.0, - "environment": "BARE_METAL", + "bandwidth":1.0, + "environment": "DOCKER_CONTAINER", "rebootGeneration": 1, "currentRebootGeneration": 0, "failCount": 0, diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-after-changes.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-after-changes.json index 4e6684f9ccd..283bae47da1 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-after-changes.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-after-changes.json @@ -5,15 +5,14 @@ "type": "tenant", "hostname": "host6.yahoo.com", "openStackId": "node6", - "flavor": "default", - "canonicalFlavor": "default", - "minDiskAvailableGb": 400.0, - "minMainMemoryAvailableGb": 16.0, - "description": "Flavor-name-is-default", + "flavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "canonicalFlavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "minDiskAvailableGb": 50.0, + "minMainMemoryAvailableGb": 8.0, "minCpuCores": 2.0, "fastDisk": true, - "bandwidth": 0.0, - "environment": "BARE_METAL", + "bandwidth": 1.0, + "environment": "DOCKER_CONTAINER", "owner": { "tenant": "tenant2", "application": "application2", diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-2.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-2.json index 9e63da8cd5d..415f1094e33 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-2.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-2.json @@ -5,15 +5,14 @@ "type": "tenant", "hostname": "host6.yahoo.com", "openStackId": "node6", - "flavor": "default", - "canonicalFlavor": "default", - "minDiskAvailableGb": 400.0, - "minMainMemoryAvailableGb": 16.0, - "description": "Flavor-name-is-default", + "flavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "canonicalFlavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "minDiskAvailableGb": 50.0, + "minMainMemoryAvailableGb": 8.0, "minCpuCores": 2.0, "fastDisk": true, - "bandwidth": 0.0, - "environment": "BARE_METAL", + "bandwidth": 1.0, + "environment": "DOCKER_CONTAINER", "owner": { "tenant": "tenant2", "application": "application2", diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-3.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-3.json index 55d804ba094..fdd3199b230 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-3.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports-3.json @@ -5,15 +5,14 @@ "type": "tenant", "hostname": "host6.yahoo.com", "openStackId": "node6", - "flavor": "default", - "canonicalFlavor": "default", - "minDiskAvailableGb": 400.0, - "minMainMemoryAvailableGb": 16.0, - "description": "Flavor-name-is-default", + "flavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "canonicalFlavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "minDiskAvailableGb": 50.0, + "minMainMemoryAvailableGb": 8.0, "minCpuCores": 2.0, "fastDisk": true, - "bandwidth": 0.0, - "environment": "BARE_METAL", + "bandwidth": 1.0, + "environment": "DOCKER_CONTAINER", "owner": { "tenant": "tenant2", "application": "application2", diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports.json index 3d430082f11..1dcf068c275 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6-reports.json @@ -5,15 +5,14 @@ "type": "tenant", "hostname": "host6.yahoo.com", "openStackId": "node6", - "flavor": "default", - "canonicalFlavor": "default", - "minDiskAvailableGb": 400.0, - "minMainMemoryAvailableGb": 16.0, - "description": "Flavor-name-is-default", + "flavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "canonicalFlavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "minDiskAvailableGb": 50.0, + "minMainMemoryAvailableGb": 8.0, "minCpuCores": 2.0, "fastDisk": true, - "bandwidth": 0.0, - "environment": "BARE_METAL", + "bandwidth": 1.0, + "environment": "DOCKER_CONTAINER", "owner": { "tenant": "tenant2", "application": "application2", diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6.json index dbec9c1a1f8..d6d9ebb4b1d 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node6.json @@ -5,15 +5,14 @@ "type": "tenant", "hostname": "host6.yahoo.com", "openStackId": "node6", - "flavor": "default", - "canonicalFlavor": "default", - "minDiskAvailableGb": 400.0, - "minMainMemoryAvailableGb": 16.0, - "description": "Flavor-name-is-default", + "flavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "canonicalFlavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "minDiskAvailableGb": 50.0, + "minMainMemoryAvailableGb": 8.0, "minCpuCores": 2.0, "fastDisk": true, - "bandwidth": 0.0, - "environment": "BARE_METAL", + "bandwidth": 1.0, + "environment": "DOCKER_CONTAINER", "owner": { "tenant": "tenant2", "application": "application2", diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node7.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node7.json index 4e17f571ef3..a884b02e092 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node7.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/node7.json @@ -5,15 +5,14 @@ "type": "tenant", "hostname": "host7.yahoo.com", "openStackId": "node7", - "flavor": "default", - "canonicalFlavor": "default", - "minDiskAvailableGb": 400.0, - "minMainMemoryAvailableGb": 16.0, - "description": "Flavor-name-is-default", + "flavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "canonicalFlavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "minDiskAvailableGb": 50.0, + "minMainMemoryAvailableGb": 8.0, "minCpuCores": 2.0, "fastDisk": true, - "bandwidth":0.0, - "environment": "BARE_METAL", + "bandwidth":1.0, + "environment": "DOCKER_CONTAINER", "rebootGeneration": 0, "currentRebootGeneration": 0, "failCount": 0, diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/parent1.json b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/parent1.json index afe0fc5f2e1..9823ffcc14f 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/parent1.json +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/restapi/v2/responses/parent1.json @@ -5,8 +5,8 @@ "type": "host", "hostname": "parent1.yahoo.com", "openStackId": "parent1", - "flavor": "default", - "canonicalFlavor": "default", + "flavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", + "canonicalFlavor": "[vcpu: 2.0, memory: 8.0 Gb, disk 50.0 Gb]", "minDiskAvailableGb": 400.0, "minMainMemoryAvailableGb": 16.0, "description": "Flavor-name-is-default", |