Updated the Openstack syncroniser to shutdown VM's before deletion. We've seen VM's get stuck in the ERROR state in Nova when they were forcibly deleted rather than shutdown; seemed to be as a result of not releasing resources but we've never found the exact root cause. Contributed by BT and DTU for the NGPaaS EU project
Change-Id: I7cd291fea726c3154f1edfe33d11e5dc006d9ba1
diff --git a/Dockerfile.synchronizer b/Dockerfile.synchronizer
index abc79f6..6c06124 100644
--- a/Dockerfile.synchronizer
+++ b/Dockerfile.synchronizer
@@ -14,7 +14,7 @@
# xosproject/openstack-synchronizer
-FROM xosproject/xos-synchronizer-base:2.1.9
+FROM xosproject/xos-synchronizer-base:2.1.18
COPY xos/synchronizer /opt/xos/synchronizers/openstack
COPY VERSION /opt/xos/synchronizers/openstack/
diff --git a/VERSION b/VERSION
index 7dea76e..6d7de6e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.0.1
+1.0.2
diff --git a/xos/synchronizer/steps/sync_instances.yaml b/xos/synchronizer/steps/sync_instances.yaml
index 70d4824..c445fb6 100644
--- a/xos/synchronizer/steps/sync_instances.yaml
+++ b/xos/synchronizer/steps/sync_instances.yaml
@@ -17,6 +17,20 @@
connection: local
tasks:
+ {% if delete -%}
+ - os_server_actions:
+ server: "{{ name }}"
+ auth:
+ auth_url: "{{ endpoint }}"
+ username: "{{ admin_user }}"
+ password: "{{ admin_password }}"
+ project_name: "{{ project_name }}"
+ {% if domain -%}
+ project_domain_name: "{{ domain }}"
+ user_domain_name: "{{ domain }}"
+ {%- endif %}
+ action: stop
+ {%- endif %}
- os_server:
name: "{{ name }}"
auth: