Creating a pool
Understand how to use the RESTful plug-in to create a pool.
Creating a pool using the curl command
On the command line, run the following command:
echo -En '{"name": "NAME", "pg_num": NUMBER}' | curl --request POST --data @- --silent --user USER 'https://CEPH_MANAGER:8080/api/pool'Replace:- NAME with the name of the new pool.
- NUMBER with the number of the placement groups.
- USER with the username.
- CEPH_MANAGER with the IP address or short hostname of the node with the
active
ceph-mgrinstance.
Enter the user’s password when prompted.
Note: If using a self-signed certificate, use the
--insecure
option.
echo -En '{"name": "NAME", "pg_num": NUMBER}' | curl --request POST --data @- --silent --insecure --user USER 'https://CEPH_MANAGER:8080/api/pool'Creating a pool using Python
In the Python interpreter, enter the following:
$ python
>> import requests
>> result = requests.post('https://CEPH_MANAGER:8080/api/pool', json={"NAME": NUMBER}, auth=("USER", "PASSWORD"))
>> print result.json()Replace:- CEPH_MANAGER with the IP address or short hostname of the node with the
active
ceph-mgrinstance. - NAME with the name of the new pool.
- NUMBER with the number of the placement groups.
- USER with the username.
- PASSWORD with the user’s password.
Note: If using a self-signed certificate, use
verify=False.$ python
>> import requests
>> result = requests.post('https://CEPH_MANAGER:8080/api/pool', json={"NAME": NUMBER}, auth=("USER", "PASSWORD"), verify=False)
>> print result.json()