An HTTP API (previously known as the "mariner installer") to provision and control the deployment process of Ceph clusters.
The service allows you to install and configure ceph via a RestFul API that accepts and returns JSON responses along with meaningful error codes and messages.
Most if not all requests should use canonicalized URLs (they end with a trailing slash).
It follows these concepts:
GET
operations are read-only operations. They will not trigger any behavior.POST
requests will create resources or trigger a specific behavior, like installing operations on a given host.
This service is intended to be installed by a system package manager (like yum or apt) and ideally all requirements and dependencies should be taken care of. This is the list of the current services and system dependencies needed:
System requirements:
- RabbitMQ
- Ansible
Application requirements:
- pecan
- celery
- sqlalchemy
- gunicorn
- notario
- pecan-notario
The default for the /api/*/install
endpoints is to install the latest upstream stable version of ceph. If you'd like to install the latest Red Hat Ceph Storage ensure that the node being provisioned is correctly entitled and that the redhat_storage
option is set to True
in the json body you send to the install endpoint.
The parent endpoint for any API interaction is /api/
. The service provides a setup script as well that can be used to ensure a remote node can comply with certain requirements like: a deployment user, ssh keys, and sudo permissions.
GET
: Generates a BASH script to be downloaded assetup.sh
. This script should be executed with super user privileges on the remote node as it will perform the following actions:- create an
ansible
user - ensure that the
ansible
user can use sudo without a password prompt - remove the
requiretty
from/etc/sudoers
if set, so that SSH connections allow non-interactive sessions from usingsudo
- retrieve the SSH key that will be used for provisioning (see
provisioning_key
) - append the provisioning key onto
$HOME/ansible/.ssh/authorized_keys
- create an
This endpoint will serve the public SSH key from the user that is running the service assuming the location of: $HOME/.ssh/id_rsa.pub
. If this file does not exist the service will proceed to create one while processing the request.
GET
: Will return the current status of the service.
200: All components of the system are operational Body: {}
500: System Error Body: {"message": "Sample Error message"}
A task is created when any of the following endpoints are used and can be used to track the progress of the operation, like installing or configuring a monitor.
* GET
: Returns a list of all available tasks. Responses: ^^^^^^^^^^ 200: Available tasks Body :
[
{'command': 'command arguments flags sample',
'ended': '2016-01-27T15:03:23.438172',
'endpoint': '/api/rgw/configure',
'id': '2207bde6-4346-4a83-984a-40a5c00056c1',
'started': '2016-01-27T15:03:22.638173',
'stderr': 'command stderr',
'stdout': 'command stdout',
'succeeded': True,
}
]
500: System Error Body: {"message": "Sample Error message"}
* GET
: Distinct task metadata Responses: ^^^^^^^^^^ 200: All components of the system are operational Body :
{'command': 'command arguments flags sample',
'ended': '2016-01-27T15:03:23.438172',
'endpoint': '/api/rgw/configure',
'id': '2207bde6-4346-4a83-984a-40a5c00056c1',
'started': '2016-01-27T15:03:22.638173',
'stderr': 'command stderr',
'stdout': 'command stdout'
}
404: Task is not available Body: {"message": "2207bde6-4346-4a83-984a-40a5c00056c1 is not available"}
500: System Error Body: {"message": "Sample Error message"}
* POST
: Start the installation process for monitor(s) Body :
{
'hosts': ['mon1.example.com', 'mon2.example.com', 'mon3.example.com'],
'redhat_storage': False
}
* POST
: Configure monitor(s) Body :
[
{'address': '192.168.1.1', 'hostname': 'mon1.example.com'},
{'address': '192.168.1.2', 'hostname': 'mon2.example.com'}
]
* POST
: Start the installation process for monitor(s) Body :
{
'hosts': ['osd1.example.com', 'osd2.example.com'],
'redhat_storage': False
}
* POST
: Configure OSD(s) Body :
[
{
'devices': ['/dev/sdb'],
'hostname': 'osd1.example.com',
'journal_collocate': True
},
{
'devices': ['/dev/sdc', '/dev/sdb'],
'hostname': 'osd2.example.com',
'journal': '/dev/sdd'
}
]
journal_collocate
will use the same device as the OSD for the journal. This is not ideal and might incur in a performance penalty.
* POST
: Start the installation process for monitor(s) Body :
{
'hosts': ['rgw1.example.com', 'rgw2.example.com'],
'redhat_storage': False
}
* POST
: Configure OSD(s) name
is optional, will default to rgw.$short-hostname
, using the examples below, that would be rgw.node1
and rgw.node2
. It is allowed to specify a name
to alter this default behavior.
Body :
[
{
'name': 'main',
'hostname': 'rgw1.example.com',
},
{
'hostname': 'rgw2.example.com',
}
]
* POST
: Start the installation process for calamari Body :
{
'host': ['calamari.example.com'],
'redhat_storage': False
}
# TODO