From da8ce56cc6a87d190639cfb4955eb4d24d76d28b Mon Sep 17 00:00:00 2001 From: Vladislav Belogrudov Date: Tue, 6 Sep 2016 16:48:01 +0300 Subject: [PATCH] Cinder-backup fails while backing up iSCSI volumes Cinder backup needs access to the same volumes as cinder volume service when saving/restoring iSCSI disks Change-Id: Ib1956cbd57e8959bad520b8d4c6d792a449ecf22 Closes-Bug: #1614460 --- ansible/roles/cinder/tasks/start.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/ansible/roles/cinder/tasks/start.yml b/ansible/roles/cinder/tasks/start.yml index d80eee31c6..3358503280 100644 --- a/ansible/roles/cinder/tasks/start.yml +++ b/ansible/roles/cinder/tasks/start.yml @@ -23,9 +23,9 @@ - "kolla_logs:/var/log/kolla/" when: inventory_hostname in groups['cinder-scheduler'] -- name: Prepare volumes list +- name: Prepare volumes list for cinder-volume set_fact: - mounts: + cinder_volume_mounts: - "{{ node_config_directory }}/cinder-volume/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "/dev/:/dev/" @@ -42,9 +42,20 @@ image: "{{ cinder_volume_image_full }}" privileged: True ipc_mode: "host" - volumes: '{{ mounts | reject("equalto", "") | list}}' + volumes: '{{ cinder_volume_mounts | reject("equalto", "") | list}}' when: inventory_hostname in groups['cinder-volume'] +- name: Prepare volumes list for cinder-backup + set_fact: + cinder_backup_mounts: + - "{{ node_config_directory }}/cinder-backup/:{{ container_config_directory }}/:ro" + - "/etc/localtime:/etc/localtime:ro" + - "/dev/:/dev/" + - "/run/:/run/" + - "{% if enable_cinder_backend_lvm | bool %}cinder:/var/lib/cinder{% endif %}" + - "{% if enable_cinder_backend_lvm | bool %}iscsi_info:/etc/iscsi{% endif %}" + - "kolla_logs:/var/log/kolla/" + - name: Starting cinder-backup container kolla_docker: action: "start_container" @@ -52,9 +63,5 @@ name: "cinder_backup" image: "{{ cinder_backup_image_full }}" privileged: True - volumes: - - "{{ node_config_directory }}/cinder-backup/:{{ container_config_directory }}/:ro" - - "/etc/localtime:/etc/localtime:ro" - - "/dev/mapper/:/dev/mapper/" - - "kolla_logs:/var/log/kolla/" + volumes: '{{ cinder_backup_mounts | reject("equalto", "") | list}}' when: inventory_hostname in groups['cinder-backup']