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/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: