Skip to content

Commit

Permalink
Plugin for adding NFS Gateways to the cluster
Browse files Browse the repository at this point in the history
Change-Id: Ia364ddc78a426c47a6563ffd797cccee47a6b500
  • Loading branch information
9seconds committed Apr 11, 2017
1 parent ca0e2ee commit e618b41
Show file tree
Hide file tree
Showing 15 changed files with 476 additions and 1 deletion.
19 changes: 19 additions & 0 deletions backend/common/decapod_common/configs/ceph-ansible-defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,22 @@ radosgw:
dns_s3website_name: your.subdomain.tld

restapi_port: 5000

nfs:
ganesha:
export_id: 20134
pseudo_path: /cephfile
protocols: "3,4"
access_type: "RW"
log_file: /var/log/ganesha.log
ceph:
export_id: 20134
pseudo_path: /cephobject
protocols: "3,4"
access_type: RW
rgw:
export_id: 20134
pseudo_path: /ceph
protocols: "3,4"
access_type: RW
user: cephnfs
16 changes: 15 additions & 1 deletion backend/common/decapod_common/playbook_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,21 @@ def get_ceph_ansible_common_settings(cls, cluster, servers, *,
"ceph_version_verify_packagename": config["ceph_version_verify_packagename"], # NOQA
"ceph_version_verify": verify_ceph_version,
"ceph_restapi_port": config["restapi_port"],
"journal_size": config["journal"]["size"]
"journal_size": config["journal"]["size"],
"ceph_nfs_export_id": config["nfs"]["ganesha"]["export_id"],
"ceph_nfs_pseudo_path": config["nfs"]["ganesha"]["pseudo_path"],
"ceph_nfs_protocols": config["nfs"]["ganesha"]["protocols"],
"ceph_nfs_access_type": config["nfs"]["ganesha"]["access_type"],
"ceph_nfs_log_file": config["nfs"]["ganesha"]["log_file"],
"ceph_nfs_ceph_export_id": config["nfs"]["ceph"]["export_id"],
"ceph_nfs_ceph_pseudo_path": config["nfs"]["ceph"]["pseudo_path"],
"ceph_nfs_ceph_protocols": config["nfs"]["ceph"]["protocols"],
"ceph_nfs_ceph_access_type": config["nfs"]["ceph"]["access_type"],
"ceph_nfs_rgw_export_id": config["nfs"]["rgw"]["export_id"],
"ceph_nfs_rgw_pseudo_path": config["nfs"]["rgw"]["pseudo_path"],
"ceph_nfs_rgw_protocols": config["nfs"]["rgw"]["protocols"],
"ceph_nfs_rgw_access_type": config["nfs"]["rgw"]["access_type"],
"ceph_nfs_rgw_user": config["nfs"]["rgw"]["user"]
}
result["ceph_stable_release_uca"] = result["ceph_stable_distro_source"]

Expand Down
3 changes: 3 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ services:
- ./backend/monitoring/decapod_monitoring:/usr/local/lib/python2.7/dist-packages/decapod_monitoring:ro
- ./plugins/alerts/emails/decapod_plugin_alerts_emails:/usr/local/lib/python3.5/dist-packages/decapod_plugin_alerts_emails:ro
- ./plugins/playbook/add_mon/decapod_plugin_playbook_add_mon:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_mon:ro
- ./plugins/playbook/add_nfs/decapod_plugin_playbook_add_nfs:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_nfs:ro
- ./plugins/playbook/add_osd/decapod_plugin_playbook_add_osd:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_osd:ro
- ./plugins/playbook/add_restapi/decapod_plugin_playbook_add_restapi:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_restapi:ro
- ./plugins/playbook/add_rgw/decapod_plugin_playbook_add_rgw:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_rgw:ro
Expand All @@ -57,6 +58,7 @@ services:
- ./backend/docker/decapod_docker:/usr/local/lib/python3.5/dist-packages/decapod_docker:ro
- ./plugins/alerts/emails/decapod_plugin_alerts_emails:/usr/local/lib/python3.5/dist-packages/decapod_plugin_alerts_emails:ro
- ./plugins/playbook/add_mon/decapod_plugin_playbook_add_mon:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_mon:ro
- ./plugins/playbook/add_nfs/decapod_plugin_playbook_add_nfs:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_nfs:ro
- ./plugins/playbook/add_osd/decapod_plugin_playbook_add_osd:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_osd:ro
- ./plugins/playbook/add_restapi/decapod_plugin_playbook_add_restapi:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_restapi:ro
- ./plugins/playbook/add_rgw/decapod_plugin_playbook_add_rgw:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_rgw:ro
Expand All @@ -82,6 +84,7 @@ services:
- ./backend/docker/decapod_docker:/usr/local/lib/python3.5/dist-packages/decapod_docker:ro
- ./plugins/alerts/emails/decapod_plugin_alerts_emails:/usr/local/lib/python3.5/dist-packages/decapod_plugin_alerts_emails:ro
- ./plugins/playbook/add_mon/decapod_plugin_playbook_add_mon:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_mon:ro
- ./plugins/playbook/add_nfs/decapod_plugin_playbook_add_nfs:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_nfs:ro
- ./plugins/playbook/add_osd/decapod_plugin_playbook_add_osd:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_osd:ro
- ./plugins/playbook/add_restapi/decapod_plugin_playbook_add_restapi:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_restapi:ro
- ./plugins/playbook/add_rgw/decapod_plugin_playbook_add_rgw:/usr/local/lib/python3.5/dist-packages/decapod_plugin_playbook_add_rgw:ro
Expand Down
1 change: 1 addition & 0 deletions docs/source/playbook-plugins.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The section contains the following topics:
playbook-plugins/plugin-add-restapi.rst
playbook-plugins/plugin-remove-restapi.rst
playbook-plugins/plugin-purge-cluster.rst
playbook-plugins/plugin-add-nfs.rst
playbook-plugins/plugin-telegraf-integration.rst
playbook-plugins/plugin-purge-telegraf.rst
playbook-plugins/plugin-cinder-integration.rst
Expand Down
119 changes: 119 additions & 0 deletions docs/source/playbook-plugins/add-nfs/example-config.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
.. _plugin_add_nfs_config:

=====================
Configuration example
=====================

The following is an example of the *Add NFS Gateway host* plugin
configuration:

.. code-block:: json
{
"global_vars": {
"ceph_nfs_access_type": "RW",
"ceph_nfs_ceph_access_type": "RW",
"ceph_nfs_ceph_export_id": 20134,
"ceph_nfs_ceph_protocols": "3,4",
"ceph_nfs_ceph_pseudo_path": "/cephobject",
"ceph_nfs_export_id": 20134,
"ceph_nfs_log_file": "/var/log/ganesha.log",
"ceph_nfs_protocols": "3,4",
"ceph_nfs_pseudo_path": "/cephfile",
"ceph_nfs_rgw_access_type": "RW",
"ceph_nfs_rgw_export_id": 20134,
"ceph_nfs_rgw_protocols": "3,4",
"ceph_nfs_rgw_pseudo_path": "/ceph",
"ceph_nfs_rgw_user": "cephnfs",
"ceph_restapi_port": 5000,
"ceph_stable": true,
"ceph_stable_distro_source": "jewel-xenial",
"ceph_stable_release": "jewel",
"ceph_stable_release_uca": "jewel-xenial",
"ceph_stable_repo": "http://mirror.fuel-infra.org/decapod/ceph/jewel-xenial",
"ceph_stable_repo_key": "AF94F6A6A254F5F0",
"ceph_stable_repo_keyserver": "hkp://keyserver.ubuntu.com:80",
"ceph_version_verify": true,
"ceph_version_verify_packagename": "ceph-common",
"cluster": "ceph",
"cluster_network": "10.0.0.0/24",
"copy_admin_key": true,
"dmcrypt_dedicated_journal": false,
"dmcrypt_journal_collocation": false,
"fsid": "f67298e8-f85f-440f-95f2-8e38772923c0",
"journal_collocation": true,
"journal_size": 512,
"max_open_files": 131072,
"nfs_file_gw": true,
"nfs_obj_gw": false,
"os_tuning_params": [
{
"name": "fs.file-max",
"value": 26234859
},
{
"name": "kernel.pid_max",
"value": 4194303
}
],
"public_network": "10.0.0.0/24",
"radosgw_civetweb_num_threads": 50,
"radosgw_civetweb_port": 8080,
"radosgw_dns_s3website_name": "your.subdomain.tld",
"radosgw_static_website": false,
"radosgw_usage_log": false,
"radosgw_usage_log_flush_threshold": 1024,
"radosgw_usage_log_tick_interval": 30,
"radosgw_usage_max_shards": 32,
"radosgw_usage_max_user_shards": 1,
"raw_multi_journal": false
},
"inventory": {
"_meta": {
"hostvars": {
"10.0.0.20": {
"ansible_user": "ansible",
"devices": [
"/dev/sdc",
"/dev/sda",
"/dev/sdb"
],
"monitor_address": "10.0.0.20"
},
"10.0.0.21": {
"ansible_user": "ansible",
"devices": [
"/dev/sdc",
"/dev/sda",
"/dev/sdb"
],
"monitor_address": "10.0.0.21"
},
"10.0.0.22": {
"ansible_user": "ansible",
"devices": [
"/dev/sdc",
"/dev/sda",
"/dev/sdb"
],
"monitor_address": "10.0.0.22"
}
}
},
"already_deployed": [
"10.0.0.22",
"10.0.0.20",
"10.0.0.21"
],
"mons": [
"10.0.0.20",
"10.0.0.21",
"10.0.0.22"
],
"nfss": [
"10.0.0.21",
"10.0.0.22",
"10.0.0.20"
]
}
}
49 changes: 49 additions & 0 deletions docs/source/playbook-plugins/add-nfs/overview.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
.. _plugin_add_nfs_overview:

========
Overview
========

The following table shows the general information about the *Add NFS
Gateway host* plugin:

==================== ====================
Property Value
==================== ====================
ID add_nfs
Name Add NFS Gateway Host
Required Server List Yes
==================== ====================

The following table lists the available hints for the plugin:

.. list-table::
:header-rows: 1

* - Hint
- Title
- Default value
- Description
* - ceph_version_verify
- Verify Ceph version consistency on install
- True
- Do we need to verify Ceph package consistency on install
* - file_access
- Enable NFS file access
- True
- Enable NFS Gateway for file access
* - object_access
- Enable NFS object access (nodes should be RGWs)
- False
- Enable NFS Gateway for object access. Nodes should have
a role of Rados Gateway to enable such feature.

The *Add monitor host* plugin is tightly coupled with ``ceph-ansible``
versions. The following table shows the mapping between the plugin version and
the corresponding version of ``ceph-ansible``.

============== ============================================================
Plugin version ``ceph-ansible`` version
============== ============================================================
>=1.0,<1.1 `v2.1.9 <https://github.com/ceph/ceph-ansible/tree/v2.1.9>`_
============== ============================================================
23 changes: 23 additions & 0 deletions docs/source/playbook-plugins/plugin-add-nfs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. _plugins_add_nfs:

====================
Add NFS Gateway host
====================

The *Add NFS Gateway host* playbook plugin allows you to add a new host
with OSDs to a cluster. The plugin supports all the capabilities and
roles of ``ceph-ansible``.

.. note::

The majority of configuration options described in this section match the
``ceph-ansible`` settings. For a list of supported parameters, see
`official list <https://github.com/ceph/ceph-ansible/blob/master/group_vars/osds.yml.sample>`_.

The section contains the following topics:

.. toctree::
:maxdepth: 1

add-nfs/overview.rst
add-nfs/example-config.rst
2 changes: 2 additions & 0 deletions plugins/playbook/add_nfs/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include decapod_plugin_playbook_add_nfs/config.yaml
include decapod_plugin_playbook_add_nfs/playbook.yaml
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
# Copyright (c) 2016 Mirantis Inc.
#
# 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.

# Configuration for add_nfs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
# Copyright (c) 2016 Mirantis Inc.
#
# 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.


- include: "{{ decapod_common_playbooks }}/plays/add_ceph_ansible_role.yaml"

- hosts: nfss
become: true
roles:
- ceph-nfs

0 comments on commit e618b41

Please sign in to comment.