Chapter 2. Questions and Answers


2.1. Getting Information

This section describes how to use the RESTful plug-in to view information about the cluster, Monitors, OSDs, pools, hosts, and requests:

This section describes how to use the RESTful plug-in to view cluster configuration options and their values.

The curl Command

On the command line, use:

curl --silent --user <user> 'https://<ceph-mgr>:8003/config/cluster'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --silent --insecure --user <user> 'https://<ceph-mgr>:8003/config/cluster'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/config/cluster', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/config/cluster', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap
Web Browser

In the web browser, enter:

https://<ceph-mgr>:8003/config/cluster
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user name and password when prompted.

Additional Resources

This section describes how to view a particular cluster option and its value.

The curl Command

On the command line, use:

curl --silent --user <user> 'https://<ceph-mgr>:8003/config/cluster/<argument>'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <argument> with the configuration option you want to view

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --silent --insecure --user <user> 'https://<ceph-mgr>:8003/config/cluster/<argument>'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/config/cluster/<argument>', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <argument> with the configuration option you want to view
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/config/cluster/<argument>', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap
Web Browser

In the web browser, enter:

https://<ceph-mgr>:8003/config/cluster/<argument>
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <argument> with the configuration option you want to view

Enter the user name and password when prompted.

Additional Resources

This section describes how to view all configuration options and their values for OSDs.

The curl Command

On the command line, use:

curl --silent --user <user> 'https://<ceph-mgr>:8003/config/osd'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --silent --insecure --user <user> 'https://<ceph-mgr>:8003/config/osd'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/config/osd', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/config/osd', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap
Web Browser

In the web browser, enter:

https://<ceph-mgr>:8003/config/osd
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user name and password when prompted.

Additional Resources

2.1.4. How Can I View CRUSH Rules?

This section describes how to view CRUSH rules.

The curl Command

On the command line, use:

curl --silent --user <user> 'https://<ceph-mgr>:8003/crush/rule'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --silent --insecure --user <user> 'https://<ceph-mgr>:8003/crush/rule'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/crush/rule', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/crush/rule', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap
Web Browser

In the web browser, enter:

https://<ceph-mgr>:8003/crush/rule
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user name and password when prompted.

Additional Resources
  • The CRUSH Rules section in the Administration Guide for Red Hat Ceph Storage 3

2.1.5. How Can I View Information about Monitors?

This section describes how to view information about a particular Monitor, such as:

  • IP address
  • Name
  • Quorum status
The curl Command

On the command line, use:

curl --silent --user <user> 'https://<ceph-mgr>:8003/mon'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --silent --insecure --user <user> 'https://<ceph-mgr>:8003/mon'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/mon', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/mon', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap
Web Browser

In the web browser, enter:

https://<ceph-mgr>:8003/mon
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user name and password when prompted.

This section describes how to view information about a particular Monitor, such as:

  • IP address
  • Name
  • Quorum status
The curl Command

On the command line, use:

curl --silent --user <user> 'https://<ceph-mgr>:8003/mon/<name>'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <name> with the short host name of the Monitor

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --silent --insecure --user <user> 'https://<ceph-mgr>:8003/mon/<name>'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/mon/<name>', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <name> with the short host name of the Monitor
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/mon/<name>', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap
Web Browser

In the web browser, enter:

https://<ceph-mgr>:8003/mon/<name>
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <name> with the short host name of the Monitor

Enter the user name and password when prompted.

2.1.7. How Can I View Information about OSDs?

This section describes how to view information about OSDs, such as:

  • IP address
  • Its pools
  • Affinity
  • Weight
The curl Command

On the command line, use:

curl --silent --user <user> 'https://<ceph-mgr>:8003/osd'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --silent --insecure --user <user> 'https://<ceph-mgr>:8003/osd'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/osd/', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/osd/', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap
Web Browser

In the web browser, enter:

https://<ceph-mgr>:8003/osd
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user name and password when prompted.

This section describes how to view information about a particular OSD, such as:

  • IP address
  • Its pools
  • Affinity
  • Weight
The curl Command

On the command line, use:

curl --silent --user <user> 'https://<ceph-mgr>:8003/osd/<id>'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID of the OSD listed in the osd field

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --silent --insecure --user <user> 'https://<ceph-mgr>:8003/osd/<id>'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/osd/<id>', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID of the OSD listed in the osd field
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/osd/<id>', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap
Web Browser

In the web browser, enter:

https://<ceph-mgr>:8003/osd/<id>
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID of the OSD listed in the osd field

Enter the user name and password when prompted.

This section describes how to use the RESTful plug-in to view what processes, such as scrubbing or deep scrubbing, can be scheduled on an OSD.

The curl Command

On the command line, use:

curl --silent --user <user> 'https://<ceph-mgr>:8003/osd/<id>/command'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID of the OSD listed in the osd field

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --silent --insecure --user <user> 'https://<ceph-mgr>:8003/osd/<id>/command'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/osd/<id>/command', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID of the OSD listed in the osd field
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/osd/<id>/command', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap
Web Browser

In the web browser, enter:

https://<ceph-mgr>:8003/osd/<id>/command
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID of the OSD listed in the osd field

Enter the user name and password when prompted.

2.1.10. How Can I View Information About Pools?

This section describes how to view information about pools, such as:

  • Flags
  • Size
  • Number of placement groups
The curl Command

On the command line, use:

curl --silent --user <user> 'https://<ceph-mgr>:8003/pool'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --silent --insecure --user <user> 'https://<ceph-mgr>:8003/pool'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/pool', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/pool', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap
Web Browser

In the web browser, enter:

https://<ceph-mgr>:8003/pool
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user name and password when prompted.

This section describes how to view information about a particular pool, such as:

  • Flags
  • Size
  • Number of placement groups
The curl Command

On the command line, use:

curl --silent --user <user> 'https://<ceph-mgr>:8003/pool/<id>'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID the pool listed in the pool field

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --silent --insecure --user <user> 'https://<ceph-mgr>:8003/config/cluster'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/pool/<id>', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID the pool listed in the pool field
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/pool/<id>', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap
Web Browser

In the web browser, enter:

https://<ceph-mgr>:8003/pool/<id>
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID the pool listed in the pool field

Enter the user name and password when prompted.

2.1.12. How Can I View Information About Requests?

This section describes how view information about requests.

The curl Command

On the command line, use:

curl --silent --user <user> 'https://<ceph-mgr>:8003/request'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --silent --insecure --user <user> 'https://<ceph-mgr>:8003/request'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/request', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/request', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap
Web Browser

In the web browser, enter:

https://<ceph-mgr>:8003/request
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user name and password when prompted.

This section describes how to view information about a particular request.

The curl Command

On the command line, use:

curl --silent --user <user> 'https://<ceph-mgr>:8003/request/<id>'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID of the request listed in the id field

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --silent --insecure --user <user> 'https://<ceph-mgr>:8003/request/<id>'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/request/<id>', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID of the request listed in the id field
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/request/<id>', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap
Web Browser

In the web browser, enter:

https://<ceph-mgr>:8003/request/<id>
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID of the request listed in the id field

Enter the user name and password when prompted.

2.1.14. How Can I View Information About Hosts?

This section describes how to view information about hosts, such as:

  • Host names
  • Ceph daemons and their IDs
  • Ceph version
The curl Command

On the command line, use:

curl --silent --user <user> 'https://<ceph-mgr>:8003/server'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --silent --insecure --user <user> 'https://<ceph-mgr>:8003/server'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/server', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/server', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap
Web Browser

In the web browser, enter:

https://<ceph-mgr>:8003/server
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user name and password when prompted.

This section describes how to view information about a particular host, such as:

  • Host names
  • Ceph daemons and their IDs
  • Ceph version
The curl Command

On the command line, use:

curl --silent --user <user> 'https://<ceph-mgr>:8003/server/<hostname>'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <hostname> with the host name of the host listed in the hostname field

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --silent --insecure --user <user> 'https://<ceph-mgr>:8003/server/<hostname>'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/server/<hostname>', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <hostname> with the host name of the host listed in the hostname field
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.get('https://<ceph-mgr>:8003/server/<hostname>', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap
Web Browser

In the web browser, enter:

https://<ceph-mgr>:8003/server/<hostname>
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <hostname> with the host name of the host listed in the hostname field

Enter the user name and password when prompted.

2.2. Changing Configuration

This section describes how to use the RESTful plug-in to change OSD configuration options, state of an OSD, and information about pools:

2.2.1. How Can I Change OSD Configuration Options?

This section describes how to use the RESTful plug-in to change OSD configuration options.

The curl Command

On the command line, use:

echo -En '{"<option>": <value>}' | curl --request PATCH --data @- --silent --user <user> 'https://<ceph-mgr>:8003/config/osd'
Copy to Clipboard Toggle word wrap

Replace:

  • <option> with the option to modify; pause, noup, nodown, noout, noin, nobackfill, norecover, noscrub, nodeep-scrub
  • <value> with true or false
  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

echo -En '{'<option>': <value>}' | curl --request PATCH --data @- --silent --insecure --user <user> 'https://<ceph-mgr>:8003/config/osd'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.patch('https://<ceph-mgr>:8003/config/osd', json={"<option>": <value>}, auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <option> with the option to modify; pause, noup, nodown, noout, noin, nobackfill, norecover, noscrub, nodeep-scrub
  • <value> with True or False
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.patch('https://<ceph-mgr>:8003/config/osd', json={"<option>": <value>}, auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap

2.2.2. How Can I Change the OSD State?

This section describes how to use the RESTful plug-in to change the state of an OSD.

The curl Command

On the command line, use:

echo -En '{"<state>": <value>}' | curl --request PATCH --data @- --silent --user <user> 'https://<ceph-mgr>:8003/osd/<id>'
Copy to Clipboard Toggle word wrap

Replace:

  • <state> with the state to change (in or up)
  • <value> with true or false
  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID of the OSD listed in the osd field

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

echo -En '{"<state>": <value>}' | curl --request PATCH --data @- --silent --insecure --user <user> 'https://<ceph-mgr>:8003/osd/<id>'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.patch('https://<ceph-mgr>:8003/osd/<id>', json={"<state>": <value>}, auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <state> with the state to change (in or up)
  • <value> with True or False
  • <id> with the ID of the OSD listed in the osd field
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.patch('https://<ceph-mgr>:8003/osd/<id>', json={"<state>": <value>}, auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap

2.2.3. How Can I Reweight an OSD?

This section describes how to change the weight of an OSD.

The curl Command

On the command line, use:

echo -En '{"reweight": <value>}' | curl --request PATCH --data @- --silent --user <user> 'https://<ceph-mgr>:8003/osd/<id>'
Copy to Clipboard Toggle word wrap

Replace:

  • <value> with the new weight
  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID of the OSD listed in the osd field

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

echo -En '{"reweight": <value>}' | curl --request PATCH --data @- --silent --insecure --user <user> 'https://<ceph-mgr>:8003/osd/<id>'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.patch('https://<ceph-mgr>:8003/osd/<id>', json={"reweight": <value>}, auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <value> with the new weight
  • <id> with the ID of the OSD listed in the osd field
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.patch('https://<ceph-mgr>:8003/osd/<id>', json={"reweight": <value>}, auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap

2.2.4. How Can I Change Information for a Pool?

This section describes how to use the RESTful plug-in to change information for a particular pool.

The curl Command

On the command line, use:

echo -En '{"<option>": <value>}' | curl --request PATCH --data @- --silent --user <user> 'https://<ceph-mgr>:8003/pool/<id>'
Copy to Clipboard Toggle word wrap

Replace:

  • <option> with the option to modify
  • <value> with the new value of the option
  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID the pool listed in the pool field

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

echo -En '{"<option>": <value>}' | curl --request PATCH --data @- --silent --insecure --user <user> 'https://<ceph-mgr>:8003/pool/<id>'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.patch('https://<ceph-mgr>:8003/pool/<id>', json={"<option>": <value>}, auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID the pool listed in the pool field
  • <option> with the option to modify
  • <value> with the new value of the option
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.patch('https://<ceph-mgr>:8003/pool/<id>', json={"<option>": <value>}, auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap

2.3. Administering the Cluster

This section describes how to use the RESTful plug-in to initialize scrubbing or deep scrubbing on an OSD, create a pool or remove data from a pool, remove requests, or create a request:

This section describes how to use the RESTful API to run scheduled processes, such as scrubbing or deep scrubbing, on an OSD.

The curl Command

On the command line, use:

echo -En '{"command": "<command>"}' | curl --request POST --data @- --silent --user <user> 'https://<ceph-mgr>:8003/osd/<id>/command'
Copy to Clipboard Toggle word wrap

Replace:

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

echo -En '{"command": "<command>"}' | curl --request POST --data @- --silent --insecure --user <user> 'https://<ceph-mgr>:8003/osd/<id>/command'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.post('https://<ceph-mgr>:8003/osd/<id>/command', json={"command": "<command>"}, auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID of the OSD listed in the osd field
  • command with the process (scrub, deep-scrub, or repair) you want to start. Verify it the process is supported on the OSD. See Section 2.1.9, “How Can I Determine What Processes Can Be Scheduled on an OSD?” for details.
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.post('https://<ceph-mgr>:8003/osd/<id>/command', json={"command": "<command>"}, auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap

2.3.2. How Can I Create a New Pool?

This section describes how to use the RESTful plug-in to create a new pool.

The curl Command

On the command line, use:

echo -En '{"name": "<name>", "pg_num": <number>}' | curl --request POST --data @- --silent --user <user> 'https://<ceph-mgr>:8003/pool'
Copy to Clipboard Toggle word wrap

Replace:

  • <name> with the name of the new pool
  • <number> with the number of the placement groups
  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user’s password when prompted.

If you used 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-mgr>:8003/pool'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.post('https://<ceph-mgr>:8003/pool', json={"name": "<name>", "pg_num": <number>}, auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <name> with the name of the new pool
  • <number> with the number of the placement groups
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.post('https://<ceph-mgr>:8003/pool', json={"name": "<name>", "pg_num": <number>}, auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap

2.3.3. How Can I Remove Pools?

This section describes how to use the RESTful plug-in to remove a pool.

This request is by default forbidden. To allow it, add the following parameter to the Ceph configuration guide.

mon_allow_pool_delete = true
Copy to Clipboard Toggle word wrap
The curl Command

On the command line, use:

curl --request DELETE --silent --user <user> 'https://<ceph-mgr>:8003/pool/<id>'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID the pool listed in the pool field

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --request DELETE --silent --insecure --user <user> 'https://<ceph-mgr>:8003/pool/<id>'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.delete('https://<ceph-mgr>:8003/pool/<id>', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID the pool listed in the pool field
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.delete('https://<ceph-mgr>:8003/pool/<id>', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap

2.3.4. How Can I Remove All Finished Requests?

This section describes how to use the RESTful plug-in to remove all finished requests.

The curl Command

On the command line, use:

curl --request DELETE --silent --user <user> 'https://<ceph-mgr>:8003/request'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --request DELETE --silent --insecure --user <user> 'https://<ceph-mgr>:8003/request'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.delete('https://<ceph-mgr>:8003/request', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.delete('https://<ceph-mgr>:8003/request', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap

2.3.5. How Can I Remove a Particular Request?

This section describes how to use the RESTful plug-in to remove a particular request from the database.

The curl Command

On the command line, use:

curl --request DELETE --silent --user <user> 'https://<ceph-mgr>:8003/request/<id>'
Copy to Clipboard Toggle word wrap

Replace:

  • <user> with the user name
  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID of the request listed in the id field

Enter the user’s password when prompted.

If you used a self-signed certificate, use the --insecure option:

curl --request DELETE --silent --insecure --user <user> 'https://<ceph-mgr>:8003/request/<id>'
Copy to Clipboard Toggle word wrap
Python

In the Python interpreter, enter:

$ python
>> import requests
>> result = requests.delete('https://<ceph-mgr>:8003/request/<id>', auth=("<user>", "<password>"))
>> print result.json()
Copy to Clipboard Toggle word wrap

Replace:

  • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
  • <id> with the ID of the request listed in the id field
  • <user> with the user name
  • <password> with the user’s password

If you used a self-signed certificate, use the verify=False option:

$ python
>> import requests
>> result = requests.delete('https://<ceph-mgr>:8003/request/<id>', auth=("<user>", "<password>"), verify=False)
>> print result.json()
Copy to Clipboard Toggle word wrap

2.3.6. How Can I Execute Administrative Commands?

Use the /request endpoint with the POST method to execute an administrative command. With this approach, you can use even commands that are not directly supported by the API, but are defined in the src/mon/MonCommands.h file in the Ceph source code. This is useful, for example, when building your own application that uses the API.

Python
  1. Review src/mon/MonCommands.h and find the command you want to execute in the API, for example:

    COMMAND("osd ls " \
            "name=epoch,type=CephInt,range=0,req=false", \
            "show all OSD ids", "osd", "r", "cli,rest")
    Copy to Clipboard Toggle word wrap

    The command is osd ls. The name bit specifies the name of an argument the command has, type specifies the type of values the argument takes, range specifies the range of accepted values of the argument, and req specifies whether the argument is required or not. In this example, the argument is epoch, the type of values the argument takes is integer, the range of accepted values is 0, and the argument is optional.

  2. In the Python interpreter, enter:

    $ python
    >> import requests
    >> result = requests.post(
           'https://<ceph-mgr>:8003/request',
           json={'prefix': '<command>', <argument>:<value>},
           auth=("<user>", "<password>")
       )
    >> print result.json()
    Copy to Clipboard Toggle word wrap

    Replace:

    • <ceph-mgr> with the IP address or short host name of the node with the active ceph-mgr instance
    • <command> with the command listed in the src/mon/MonCommands.h file
    • <argument> with any arguments of the command listed in the src/mon/MonCommands.h file, if the argument is optional, you can omit it
    • <value> with the value of the argument
    • <user> with the user name
    • <password> with the user’s password

    For example, to use the osd ls epoch 0 command. Replace <command> with osd ls and <argument> with epoch and <value> with 0:

    $ python
    >> import requests
    >> result = requests.post(
           'https://ceph-node1:8003/request',
           json={'prefix': 'osd ls', 'epoch': 0},
           auth=("ceph-user", "<password>")
       )
    >> print result.json()
    Copy to Clipboard Toggle word wrap

    If you used a self-signed certificate, use the verify=False option:

    $ python
    >> import requests
    >> result = requests.post(
           'https://<ceph-mgr>:8003/request',
           json={'prefix': '<command>', <optional_argument>:<value>},
           auth=("<user>", "<password>"),
           verify=False
       )
    >> print result.json()
    Copy to Clipboard Toggle word wrap

Additional Resources

2.4. Additional Resources

Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat