From ec8a262fa6d2c7cd703ef6dfaa5b51699da47a2c Mon Sep 17 00:00:00 2001 From: valli03 Date: Thu, 14 Jun 2018 16:07:52 -0400 Subject: [PATCH] Clean up glance before moving the workload guest images to glance When the browbeat playbook is run with workloads enabled, new images will be created for the workloads and moved to glance. When the playbook is rerun, it fails because the image already exists in the same name in glance. So we need to clean up the old workload images in glance(if they exist) so the new ones are moved to glance without any errors. Change-Id: I766143c4f329a600405c705d29252fee7d22bd8c --- ansible/install/roles/workloads/tasks/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ansible/install/roles/workloads/tasks/main.yml b/ansible/install/roles/workloads/tasks/main.yml index 340419cdf..03600f3d5 100644 --- a/ansible/install/roles/workloads/tasks/main.yml +++ b/ansible/install/roles/workloads/tasks/main.yml @@ -22,6 +22,11 @@ retries: 10 with_items: "{{ workload_ids.results }}" +- name: Clean up glance + shell: source {{ overcloudrc }} ; openstack image delete {{ browbeat_workloads[item].name }} + with_items: "{{ browbeat_workloads }}" + ignore_errors: true + - name: Copy prepared workload guest into Glance shell: source {{ overcloudrc }} ; openstack server image create --wait --name {{ browbeat_workloads[item].name }} {{ browbeat_workloads[item].name }} with_items: "{{ browbeat_workloads }}"