Blame SOURCES/086-nested-containers.patch

356a11
From 786f44f9ab2731c8fc7d534689d5925cd6d3d98e Mon Sep 17 00:00:00 2001
356a11
From: Andrew Beekhof <andrew@beekhof.net>
356a11
Date: Tue, 18 Jul 2017 14:31:45 +1000
356a11
Subject: [PATCH] Fix: PE: Ensure nested container connections run on the same
356a11
 host
356a11
356a11
---
356a11
 pengine/container.c | 11 +++++++++++
356a11
 1 file changed, 11 insertions(+)
356a11
356a11
diff --git a/pengine/container.c b/pengine/container.c
356a11
index f742660..280a61a 100644
356a11
--- a/pengine/container.c
356a11
+++ b/pengine/container.c
356a11
@@ -100,11 +100,22 @@ container_color(resource_t * rsc, node_t * prefer, pe_working_set_t * data_set)
356a11
 
356a11
     for (GListPtr gIter = container_data->tuples; gIter != NULL; gIter = gIter->next) {
356a11
         container_grouping_t *tuple = (container_grouping_t *)gIter->data;
356a11
+        pe_node_t *docker_host = tuple->docker->allocated_to;
356a11
 
356a11
         CRM_ASSERT(tuple);
356a11
         if(tuple->ip) {
356a11
             tuple->ip->cmds->allocate(tuple->ip, prefer, data_set);
356a11
         }
356a11
+
356a11
+        if(tuple->remote && is_remote_node(docker_host)) {
356a11
+            /* We need 'nested' connection resources to be on the same
356a11
+             * host because pacemaker-remoted only supports a single
356a11
+             * active connection
356a11
+             */
356a11
+            rsc_colocation_new("child-remote-with-docker-remote", NULL,
356a11
+                               INFINITY, tuple->remote, docker_host->details->remote_rsc, NULL, NULL, data_set);
356a11
+        }
356a11
+
356a11
         if(tuple->remote) {
356a11
             tuple->remote->cmds->allocate(tuple->remote, prefer, data_set);
356a11
         }
356a11
-- 
356a11
1.8.3.1
356a11