Add deployed-server backwards compatible template
authorJames Slagle <jslagle@redhat.com>
Mon, 9 Jan 2017 19:40:27 +0000 (14:40 -0500)
committerJames Slagle <jslagle@redhat.com>
Tue, 10 Jan 2017 18:04:52 +0000 (13:04 -0500)
In Newton, the ctlplane port on deployed-server was called
<hostname>-ctlplane-port. When this code was refactored in
I29fbc720c3d582cbb94385e65e4b64b101f7eac9, the -port suffix was dropped
in favor of <hostname>-<network> convention, and the port resource was
created directly in deployed-server.yaml instead of in a nested stack.

Both of those changes were backwards incompatible -- making it
impossible to upgrade to the new version of deployed-server.yaml without
the ctlplane port getting deleted/recreated, which causes a change in IP
address. The IP address change causes services to be misconfigured on
upgrade attempts.

Change-Id: I45991b60a151abf3c5e4d05a3aa7246b2d25ac5a

deployed-server/ctlplane-port.yaml [new file with mode: 0644]
deployed-server/deployed-server.yaml
environments/updates/README.md
environments/updates/update-from-deployed-server-newton.yaml [new file with mode: 0644]

diff --git a/deployed-server/ctlplane-port.yaml b/deployed-server/ctlplane-port.yaml
new file mode 100644 (file)
index 0000000..7b5cdf1
--- /dev/null
@@ -0,0 +1,28 @@
+heat_template_version: ocata
+
+parameters:
+  network:
+    type: string
+    default: ctlplane
+  name:
+    type: string
+  replacement_policy:
+    type: string
+    default: AUTO
+
+resources:
+
+  ControlPlanePort:
+    type: OS::Neutron::Port
+    properties:
+      network: ctlplane
+      name:
+        list_join:
+          - '-'
+          - - {get_param: name}
+            - port
+      replacement_policy: AUTO
+
+outputs:
+  fixed_ips:
+    value: {get_attr: [ControlPlanePort, fixed_ips]}
index 3ff6361..77968f6 100644 (file)
@@ -106,7 +106,7 @@ resources:
       config: {get_resource: HostsEntryConfig}
       server: {get_resource: deployed-server}
 
-  ControlPlanePortImpl:
+  ControlPlanePort:
     type: OS::TripleO::DeployedServer::ControlPlanePort
     properties:
       network: ctlplane
@@ -123,6 +123,6 @@ outputs:
   networks:
     value:
       ctlplane:
-        - {get_attr: [ControlPlanePortImpl, fixed_ips, 0, ip_address]}
+        - {get_attr: [ControlPlanePort, fixed_ips, 0, ip_address]}
   name:
     value: {get_attr: [HostsEntryDeployment, hostname]}
index 426d732..93714ed 100644 (file)
@@ -10,3 +10,6 @@ Contents
 
 **update-from-publicvip-on-ctlplane.yaml**
   To be used if the PublicVirtualIP resource was deployed as an additional VIP on the 'ctlplane'.
+
+**update-from-deloyed-server-newton.yaml**
+  To be used when updating from the deployed-server template from Newton.
diff --git a/environments/updates/update-from-deployed-server-newton.yaml b/environments/updates/update-from-deployed-server-newton.yaml
new file mode 100644 (file)
index 0000000..6fe3a4c
--- /dev/null
@@ -0,0 +1,2 @@
+resource_registry:
+  OS::TripleO::DeployedServer::ControlPlanePort: ../../deployed-server/ctlplane-port.yaml