Simplify the Cinder LVM backend

Remove the unnecessary option in the  group_vars/all.yml file.

* removed some cinder.conf options like volume_backend_name,
  iscsi_helper, iscsi_protocol etc. these value can be configured by
  custom cinder.conf file, no need export as global variables.
* remove meaningless iscsi_ip_addess, which is not used in LVM driver
* force start iscsi relate when enable_cinder_backend_lvm is yes

TrivialFix
Change-Id: Ifcbfdad15e4d68bc5f20fc77e0315a09983ef022
This commit is contained in:
Jeffrey Zhang 2016-07-23 22:48:54 +08:00
parent 4196603f85
commit 1b0e701402
9 changed files with 34 additions and 50 deletions

View File

@ -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

View File

@ -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 }}"

View File

@ -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 }}"

View File

@ -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

View File

@ -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]

View File

@ -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/"

View File

@ -59,7 +59,7 @@
roles:
- { role: iscsi,
tags: iscsi,
when: enable_iscsi | bool }
when: enable_cinder_backend_lvm | bool }
- hosts:
- multipathd

View File

@ -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

View File

@ -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