private void retire(Node node) {
        ApplicationId owner = node.allocation().get().owner();
        try (MaintenanceDeployment deployment = new MaintenanceDeployment(owner, deployer, metric, nodeRepository())) {
            if (!deployment.isValid()) return;
            if (!markWantToRetire(node.hostname())) return;
            log.log(Level.INFO, String.format("Redeploying %s to move %s from over-committed host",
                                              owner, node.hostname()));
            deployment.activate();
        }
    }
Mark node for retirement and redeploy its application
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/SpareCapacityMaintainer.java