Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds ceph-ansible integration to OSA using the upstream roles ceph-common, ceph-mon, and ceph-osd to support deployment of a Ceph cluster for use with OSA. The integration should be considered experimental at this point, however an integrated functional testing scenario named "ceph" is added which fully exercises the ceph-ansible deployment and configures OSA to use the deployed Ceph cluster. Once this is added to the OSA gate tests for the integrated build, that should help quickly stabilize any issues that arise with this integration. Change-Id: I275708096a71f66d73be1400c8a592c598382c1d
- Loading branch information
Showing
17 changed files
with
351 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
==================================== | ||
Appendix G: Ceph-Ansible integration | ||
==================================== | ||
|
||
OpenStack-Ansible allows `Ceph storage <https://ceph.com>`_ cluster integration | ||
using the roles maintained by the `Ceph-Ansible`_ project>. Deployers can | ||
enable the ``ceph-install`` playbook by adding hosts to the | ||
``ceph-mon_hosts`` and ``ceph-osd_hosts`` groups in | ||
``openstack_user_config.yml``, and then configuring `Ceph-Ansible specific vars | ||
<https://github.com/ceph/ceph-ansible/blob/master/group_vars/all.yml.sample>`_ | ||
in the OpenStack-Ansible ``user_variables.yml`` file. | ||
|
||
.. warning:: | ||
|
||
Ceph-Ansible integration in OpenStack-Ansible should be considered | ||
experimental and for testing purposes only. | ||
|
||
.. _Ceph-Ansible: https://github.com/ceph/ceph-ansible/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,5 @@ Appendices | |
app-security.rst | ||
app-networking.rst | ||
app-advanced-config-options.rst | ||
app-ceph.rst | ||
app-resources.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# The infra nodes where the Ceph mon services will run | ||
ceph-mon_hosts: | ||
aio1: | ||
ip: 172.29.236.100 | ||
|
||
# The nodes that the Ceph OSD disks will be running on | ||
ceph-osd_hosts: | ||
aio1: | ||
ip: 172.29.236.100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
--- | ||
# Copyright 2016, Logan Vig <logan2211@gmail.com> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
- name: Install ceph mons | ||
hosts: ceph-mon | ||
max_fail_percentage: 20 | ||
user: root | ||
pre_tasks: | ||
- include: common-tasks/os-log-dir-setup.yml | ||
vars: | ||
log_dirs: | ||
- src: "/openstack/log/{{ inventory_hostname }}-ceph" | ||
dest: "/var/log/ceph" | ||
- include: common-tasks/os-lxc-container-setup.yml | ||
vars: | ||
list_of_bind_mounts: | ||
- bind_dir_path: "/var/lib/ceph" | ||
mount_path: "/openstack/{{ inventory_hostname }}" | ||
- include: common-tasks/package-cache-proxy.yml | ||
roles: | ||
- role: "ceph-mon" | ||
tags: | ||
- skip_ansible_lint | ||
- role: "rsyslog_client" | ||
rsyslog_client_log_rotate_file: ceph_log_rotate | ||
rsyslog_client_log_dir: "/var/log/ceph" | ||
rsyslog_client_config_name: "99-ceph-rsyslog-client.conf" | ||
tags: | ||
- rsyslog | ||
- role: "system_crontab_coordination" | ||
tags: | ||
- crontab | ||
vars: | ||
is_metal: "{{ properties.is_metal|default(false) }}" | ||
tags: | ||
- ceph | ||
- ceph-mon | ||
|
||
- name: Gather ceph-mon facts | ||
hosts: ceph-mon | ||
user: root | ||
gather_facts: no | ||
tasks: | ||
- name: Gather ceph-mon facts | ||
action: setup | ||
tags: | ||
- ceph-mon-facts | ||
tags: | ||
- ceph | ||
- ceph-osd | ||
|
||
- name: Install ceph osds | ||
hosts: ceph-osd | ||
max_fail_percentage: 20 | ||
user: root | ||
pre_tasks: | ||
- include: common-tasks/os-log-dir-setup.yml | ||
vars: | ||
log_dirs: | ||
- src: "/openstack/log/{{ inventory_hostname }}-ceph" | ||
dest: "/var/log/ceph" | ||
- include: common-tasks/package-cache-proxy.yml | ||
roles: | ||
- role: "ceph-osd" | ||
tags: | ||
- skip_ansible_lint | ||
- role: "rsyslog_client" | ||
rsyslog_client_log_rotate_file: ceph_log_rotate | ||
rsyslog_client_log_dir: "/var/log/ceph" | ||
rsyslog_client_config_name: "99-ceph-rsyslog-client.conf" | ||
tags: | ||
- rsyslog | ||
- role: "system_crontab_coordination" | ||
tags: | ||
- crontab | ||
tags: | ||
- ceph | ||
- ceph-osd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
# Copyright 2016, Logan Vig <logan2211@gmail.com> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
component_skel: | ||
ceph-mon: | ||
belongs_to: | ||
- ceph_all | ||
ceph-osd: | ||
belongs_to: | ||
- ceph_all | ||
|
||
container_skel: | ||
ceph-mon_container: | ||
belongs_to: | ||
- ceph-mon_containers | ||
contains: | ||
- ceph-mon | ||
properties: | ||
service_name: ceph | ||
ceph-osd_container: | ||
belongs_to: | ||
- ceph-osd_containers | ||
contains: | ||
- ceph-osd | ||
properties: | ||
is_metal: true | ||
service_name: ceph | ||
|
||
physical_skel: | ||
ceph-mon_containers: | ||
belongs_to: | ||
- all_containers | ||
ceph-mon_hosts: | ||
belongs_to: | ||
- hosts | ||
ceph-osd_containers: | ||
belongs_to: | ||
- all_containers | ||
ceph-osd_hosts: | ||
belongs_to: | ||
- hosts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
features: | ||
- Playbooks for `ceph-ansible <https://github.com/ceph/ceph-ansible/>`_ have | ||
been added to facilitate gate testing of the OpenStack-Ansible integration | ||
with Ceph clusters, and can be used to integrate the two projects so that | ||
OpenStack-Ansible can deploy and consume its own Ceph installation using | ||
ceph-ansible. This should be considered an experimental integration until | ||
further testing is been completed by deployers and the OpenStack-Ansible | ||
gate to fine tune its stability and completeness. The ceph-install playbook | ||
can be activated by adding hosts to the ``ceph-mon_hosts`` and | ||
``ceph-osd_hosts`` in the OSA inventory. A variety of ceph-ansible specific | ||
variables will likely need to be configured in ``user_variables.yml`` to | ||
configure ceph-ansible for your environment. Please reference the | ||
`ceph-ansible repo <https://github.com/ceph/ceph-ansible/blob/master/group_vars/all.yml.sample>`_ | ||
for a list of variables the project supports. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
# Copyright 2016, Logan Vig <logan2211@gmail.com> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
- name: Create sparse ceph OSD files | ||
command: truncate -s {{ bootstrap_host_loopback_ceph_size }}G /openstack/{{ item }}.img | ||
args: | ||
creates: "/openstack/{{ item }}.img" | ||
with_items: "{{ ceph_osd_images }}" | ||
register: ceph_create | ||
changed_when: false | ||
tags: | ||
- ceph-file-create | ||
|
||
- name: Create the ceph loopback device | ||
command: losetup -f /openstack/{{ item.item }}.img --show | ||
with_items: "{{ ceph_create.results }}" | ||
register: ceph_create_loopback | ||
when: not item|skipped | ||
changed_when: false | ||
tags: | ||
- skip_ansible_lint | ||
|
||
- name: Ensure that rc.local exists | ||
file: | ||
path: /etc/rc.local | ||
state: touch | ||
mode: "u+x" | ||
tags: | ||
- ceph-rc-file | ||
|
||
- name: Create ceph loopback at boot time | ||
lineinfile: | ||
dest: /etc/rc.local | ||
line: "losetup -f /openstack/{{ item }}.img" | ||
with_items: "{{ ceph_osd_images }}" | ||
|
||
# TODO(logan): Move these vars to user_variables.ceph.yml.j2 once LP #1649381 | ||
# is fixed and eliminate this task. | ||
- name: Write ceph cluster config | ||
copy: | ||
content: | | ||
--- | ||
devices: {{ ceph_create_loopback.results | map(attribute='stdout') | list | to_yaml | trim }} | ||
# The OSA ceph_client role does not support loading IPs from an inventory group, | ||
# so we have to feed it a list of IPs | ||
ceph_mons: "{% raw %}[ {% for host in groups[mon_group_name] %}'{{ hostvars[host]['ansible_host'] }}'{% if not loop.last %},{% endif %}{% endfor %} ]{% endraw %}" | ||
cinder_backends: | ||
"RBD": | ||
volume_driver: cinder.volume.drivers.rbd.RBDDriver | ||
rbd_pool: volumes | ||
rbd_ceph_conf: /etc/ceph/ceph.conf | ||
rbd_store_chunk_size: 8 | ||
volume_backend_name: rbddriver | ||
rbd_user: cinder | ||
rbd_secret_uuid: "{% raw %}{{ cinder_ceph_client_uuid }}{% endraw %}" | ||
report_discard_supported: true | ||
dest: /etc/openstack_deploy/user_ceph_aio.yml | ||
force: no | ||
become: false | ||
when: not ceph_create_loopback|skipped | ||
tags: | ||
- skip_ansible_lint |
Oops, something went wrong.