Fixes for snapshots 53/60053/3
authorTim Rozet <trozet@redhat.com>
Fri, 20 Jul 2018 14:34:39 +0000 (10:34 -0400)
committerTim Rozet <trozet@redhat.com>
Sat, 21 Jul 2018 02:46:08 +0000 (22:46 -0400)
With deploying snapshots with a new ODL, we currently bring down the
docker container and bring up the tar.gz distro of ODL on the Overcloud
host itself (not rebuilding/using container). Therefore we need java
installed so that ODL can run on the host. In the future this may
change, but it works well and keeps things simple for now.

Additionally, there was a change upstream to make the opendaylight
container docker restart policy "unless-stopped" which means it will
no longer restart automatically when docker is stopped/started.
Therefore on first snapshot bring up (without the previously mentioned
ODL reinstallation) the container does not start, and snapshot
deployment fails. This patch includes a change to the restart policy to
always restart it.

Change-Id: Icc712ba147e578a28e371313154ae3190676f0dc
Signed-off-by: Tim Rozet <trozet@redhat.com>
apex/builders/overcloud_builder.py
apex/tests/test_apex_overcloud_builder.py
lib/ansible/playbooks/post_deploy_overcloud.yml

index d2a3100..d6f03eb 100644 (file)
@@ -42,7 +42,8 @@ def inject_opendaylight(odl_version, image, tmp_dir, uc_ip,
         {con.VIRT_UPLOAD: "{}:/etc/puppet/modules/".format(archive)},
         {con.VIRT_RUN_CMD: 'rm -rf /etc/puppet/modules/opendaylight'},
         {con.VIRT_RUN_CMD: "cd /etc/puppet/modules/ && tar xvf "
-                           "puppet-opendaylight.tar"}
+                           "puppet-opendaylight.tar"},
+        {con.VIRT_INSTALL: "java-1.8.0-openjdk"}
     ]
     if docker_tag:
         docker_cmds = [
index 46b5f87..8bed3d7 100644 (file)
@@ -43,6 +43,7 @@ class TestOvercloudBuilder(unittest.TestCase):
             {con.VIRT_RUN_CMD: 'rm -rf /etc/puppet/modules/opendaylight'},
             {con.VIRT_RUN_CMD: "cd /etc/puppet/modules/ && tar xvf "
                                "puppet-opendaylight.tar"},
+            {con.VIRT_INSTALL: "java-1.8.0-openjdk"},
             {con.VIRT_INSTALL: 'opendaylight'}
         ]
         oc_builder.inject_opendaylight(con.DEFAULT_ODL_VERSION, 'dummy.qcow2',
@@ -65,6 +66,7 @@ class TestOvercloudBuilder(unittest.TestCase):
             {con.VIRT_RUN_CMD: 'rm -rf /etc/puppet/modules/opendaylight'},
             {con.VIRT_RUN_CMD: "cd /etc/puppet/modules/ && tar xvf "
                                "puppet-opendaylight.tar"},
+            {con.VIRT_INSTALL: "java-1.8.0-openjdk"},
         ]
         oc_builder.inject_opendaylight('oxygen', 'dummy.qcow2',
                                        '/dummytmp/', uc_ip='192.0.2.2',
index af743b2..212d2cf 100644 (file)
@@ -69,3 +69,9 @@
       when:
         - "'compute' in ansible_hostname"
         - os_version == 'pike'
+    - name: Update ODL container restart policy to always
+      shell: "docker update --restart=always opendaylight_api"
+      become: yes
+      when:
+        - sdn == 'opendaylight'
+        - "'controller' in ansible_hostname"