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
This commit is contained in:
Vladislav Belogrudov 2016-09-06 16:48:01 +03:00
parent ff648fbca3
commit da8ce56cc6

View File

@ -23,9 +23,9 @@
- "kolla_logs:/var/log/kolla/" - "kolla_logs:/var/log/kolla/"
when: inventory_hostname in groups['cinder-scheduler'] when: inventory_hostname in groups['cinder-scheduler']
- name: Prepare volumes list - name: Prepare volumes list for cinder-volume
set_fact: set_fact:
mounts: cinder_volume_mounts:
- "{{ node_config_directory }}/cinder-volume/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/cinder-volume/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"
- "/dev/:/dev/" - "/dev/:/dev/"
@ -42,9 +42,20 @@
image: "{{ cinder_volume_image_full }}" image: "{{ cinder_volume_image_full }}"
privileged: True privileged: True
ipc_mode: "host" ipc_mode: "host"
volumes: '{{ mounts | reject("equalto", "") | list}}' volumes: '{{ cinder_volume_mounts | reject("equalto", "") | list}}'
when: inventory_hostname in groups['cinder-volume'] 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 - name: Starting cinder-backup container
kolla_docker: kolla_docker:
action: "start_container" action: "start_container"
@ -52,9 +63,5 @@
name: "cinder_backup" name: "cinder_backup"
image: "{{ cinder_backup_image_full }}" image: "{{ cinder_backup_image_full }}"
privileged: True privileged: True
volumes: volumes: '{{ cinder_backup_mounts | reject("equalto", "") | list}}'
- "{{ node_config_directory }}/cinder-backup/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "/dev/mapper/:/dev/mapper/"
- "kolla_logs:/var/log/kolla/"
when: inventory_hostname in groups['cinder-backup'] when: inventory_hostname in groups['cinder-backup']