diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 9562236eb1..a23e90b5fb 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -197,10 +197,10 @@ enable_central_logging: "no" enable_ceph: "no" enable_ceph_rgw: "no" enable_cinder: "no" +enable_cinder_backend_lvm: "no" enable_heat: "yes" enable_horizon: "yes" enable_ironic: "no" -enable_iscsi: "no" enable_magnum: "no" enable_manila: "no" enable_mistral: "no" @@ -246,13 +246,8 @@ kibana_user: "kibana" ################################# # Cinder options ################################# -cinder_backend_iscsi: "{{ enable_iscsi }}" cinder_backend_ceph: "{{ enable_ceph }}" -cinder_volume_driver: "{{ 'lvm' if cinder_backend_iscsi }}" -cinder_volume_group: "{{ 'cinder-volumes' if cinder_backend_iscsi | bool else '' }}" -cinder_volume_backend_name: "{{ 'cinder-volumes' if cinder_backend_iscsi | bool else '' }}" -cinder_iscsi_helper: "{{ 'tgtadm' if cinder_backend_iscsi | bool else '' }}" -cinder_iscsi_protocol: "{{ 'iscsi' if cinder_backend_iscsi | bool else '' }}" + ################### # Ceph options diff --git a/ansible/roles/cinder/defaults/main.yml b/ansible/roles/cinder/defaults/main.yml index cdcdd4357e..e06b161bc5 100644 --- a/ansible/roles/cinder/defaults/main.yml +++ b/ansible/roles/cinder/defaults/main.yml @@ -59,3 +59,17 @@ cinder_logging_debug: "{{ openstack_logging_debug }}" cinder_keystone_user: "cinder" openstack_cinder_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}" + + +#################### +# Cinder +#################### +cinder_backends: + - name: "rbd-1" + driver: "ceph" + enabled: "{{ enable_ceph | bool and cinder_backend_ceph | bool }}" + - name: "lvm-1" + driver: "lvm" + enabled: "{{ enable_cinder_backend_lvm | bool }}" + +cinder_enabled_backends: "{{ cinder_backends|selectattr('enabled', 'equalto', true)|list }}" diff --git a/ansible/roles/cinder/tasks/bootstrap.yml b/ansible/roles/cinder/tasks/bootstrap.yml index 4080018b3b..f2a62dc141 100644 --- a/ansible/roles/cinder/tasks/bootstrap.yml +++ b/ansible/roles/cinder/tasks/bootstrap.yml @@ -39,17 +39,3 @@ - include: bootstrap_service.yml when: database_created - -- name: Creating cinder targets volume - kolla_docker: - action: "create_volume" - common_options: "{{ docker_common_options }}" - name: "cinder" - when: "{{ cinder_backend_iscsi | bool }}" - -- name: Creating iscsi info volume - kolla_docker: - action: "create_volume" - common_options: "{{ docker_common_options }}" - name: "iscsi_info" - when: "{{ cinder_backend_iscsi | bool }}" diff --git a/ansible/roles/cinder/tasks/start.yml b/ansible/roles/cinder/tasks/start.yml index 0047d0bba2..d80eee31c6 100644 --- a/ansible/roles/cinder/tasks/start.yml +++ b/ansible/roles/cinder/tasks/start.yml @@ -30,8 +30,8 @@ - "/etc/localtime:/etc/localtime:ro" - "/dev/:/dev/" - "/run/:/run/" - - "{% if cinder_backend_iscsi | bool %}cinder:/var/lib/cinder{% endif %}" - - "{% if cinder_backend_iscsi | bool %}iscsi_info:/etc/iscsi{% endif %}" + - "{% 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-volume container diff --git a/ansible/roles/cinder/templates/cinder.conf.j2 b/ansible/roles/cinder/templates/cinder.conf.j2 index 642225ebdd..eb39d3ccca 100644 --- a/ansible/roles/cinder/templates/cinder.conf.j2 +++ b/ansible/roles/cinder/templates/cinder.conf.j2 @@ -16,11 +16,8 @@ glance_api_version = 2 os_region_name = {{ openstack_region_name }} -{% if enable_ceph | bool and cinder_backend_ceph | bool %} -default_volume_type = rbd-1 -enabled_backends = rbd-1 -{% elif cinder_backend_iscsi | bool %} -enabled_backends = {{ cinder_volume_backend_name }} +{% if cinder_enabled_backends %} +enabled_backends = {{ cinder_enabled_backends|map(attribute='name')|join(',') }} {% endif %} {% if service_name == "cinder-backup" and enable_ceph | bool and cinder_backend_ceph | bool %} @@ -76,14 +73,13 @@ rabbit_ha_queues = true rabbit_hosts = {% for host in groups['rabbitmq'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %} -{% if cinder_backend_iscsi | bool %} -[{{ cinder_volume_backend_name }}] -volume_group = {{ cinder_volume_group }} +{% if enable_cinder_backend_lvm | bool %} +[lvm-1] +volume_group = cinder-volumes volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver -volume_backend_name = {{ cinder_volume_backend_name }} -iscsi_ip_address = {{ hostvars[groups['tgtd'][0]]['ansible_' + hostvars[groups['tgtd'][0]]['storage_interface']]['ipv4']['address'] }} -iscsi_helper = {{ cinder_iscsi_helper }} -iscsi_protocol = {{ cinder_iscsi_protocol }} +volume_backend_name = lvm-1 +iscsi_helper = tgtadm +iscsi_protocol = iscsi {% elif enable_ceph | bool and cinder_backend_ceph | bool %} [rbd-1] diff --git a/ansible/roles/nova/tasks/start_compute.yml b/ansible/roles/nova/tasks/start_compute.yml index da6cb2c788..7e79976b1b 100644 --- a/ansible/roles/nova/tasks/start_compute.yml +++ b/ansible/roles/nova/tasks/start_compute.yml @@ -29,7 +29,7 @@ - "/run:/run" - "/dev:/dev" - "kolla_logs:/var/log/kolla/" - - "{% if enable_iscsi | bool %}iscsi_info:/etc/iscsi{% endif %}" + - "{% if enable_cinder_backend_lvm | bool %}iscsi_info:/etc/iscsi{% endif %}" - "libvirtd:/var/lib/libvirt" - "nova_compute:/var/lib/nova/" diff --git a/ansible/site.yml b/ansible/site.yml index 98305cfdc3..f939c89a5f 100644 --- a/ansible/site.yml +++ b/ansible/site.yml @@ -59,7 +59,7 @@ roles: - { role: iscsi, tags: iscsi, - when: enable_iscsi | bool } + when: enable_cinder_backend_lvm | bool } - hosts: - multipathd diff --git a/doc/cinder-guide.rst b/doc/cinder-guide.rst index b9b6755c17..5a2ee94d6a 100644 --- a/doc/cinder-guide.rst +++ b/doc/cinder-guide.rst @@ -95,17 +95,11 @@ tgtd container serves as a bridge between cinder-volume process and a server hosting Logical Volume Groups (LVG). ``iscsid`` container serves as a bridge between nova-compute process and the server hosting LVG. -In order to use iSCSI as a Cinder's backend, these two parameters must be -specified in ``globals.yml``. :: +In order to use Cinder's LVM backend, a LVG named ``cinder-volumes`` should +exist on the server and following parameter must be specified in +``globals.yml``. :: - enable_iscsi: "yes" - - cinder_volume_group: << lvg_name >> - - -Where: - -- ``lvg_name`` - is a name of LVG on that server. + enable_cinder_backend_lvm: "yes" NOTE: For Ubuntu and LVM2/iSCSI diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index cd4c0815bd..7285837b9c 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -111,10 +111,10 @@ neutron_external_interface: "eth1" #enable_ceph: "no" #enable_ceph_rgw: "no" #enable_cinder: "no" +#enable_cinder_backend_lvm: "no" #enable_heat: "yes" #enable_horizon: "yes" #enable_ironic: "no" -#enable_iscsi: "no" #enable_magnum: "no" #enable_manila: "no" #enable_mistral: "no" @@ -148,8 +148,7 @@ neutron_external_interface: "eth1" # Cinder options ####################### # Enable / disable Cinder backends -cinder_backend_iscsi: "{{ enable_iscsi }}" -cinder_backend_ceph: "{{ enable_ceph }}" +#cinder_backend_ceph: "{{ enable_ceph }}" # Cinder's iSCSI backend !!!REQUIRES!!! two parameters: # 1 - IP address of the server hosting LVM Volume group