]> git.proxmox.com Git - ceph.git/blob - ceph/doc/mgr/dashboard.rst
import ceph 14.2.5
[ceph.git] / ceph / doc / mgr / dashboard.rst
1 .. _mgr-dashboard:
2
3 Ceph Dashboard
4 ==============
5
6 Overview
7 --------
8
9 The Ceph Dashboard is a built-in web-based Ceph management and monitoring
10 application to administer various aspects and objects of the cluster. It is
11 implemented as a :ref:`ceph-manager-daemon` module.
12
13 The original Ceph Dashboard that was shipped with Ceph Luminous started
14 out as a simple read-only view into various run-time information and performance
15 data of a Ceph cluster. It used a very simple architecture to achieve the
16 original goal. However, there was a growing demand for adding more web-based
17 management capabilities, to make it easier to administer Ceph for users that
18 prefer a WebUI over using the command line.
19
20 The new :term:`Ceph Dashboard` module is a replacement of the previous one and
21 adds a built-in web based monitoring and administration application to the Ceph
22 Manager. The architecture and functionality of this new plugin is derived from
23 and inspired by the `openATTIC Ceph management and monitoring tool
24 <https://openattic.org/>`_. The development is actively driven by the team
25 behind openATTIC at `SUSE <https://www.suse.com/>`_, with a lot of support from
26 companies like `Red Hat <https://redhat.com/>`_ and other members of the Ceph
27 community.
28
29 The dashboard module's backend code uses the CherryPy framework and a custom
30 REST API implementation. The WebUI implementation is based on
31 Angular/TypeScript, merging both functionality from the original dashboard as
32 well as adding new functionality originally developed for the standalone version
33 of openATTIC. The Ceph Dashboard module is implemented as a web
34 application that visualizes information and statistics about the Ceph cluster
35 using a web server hosted by ``ceph-mgr``.
36
37 Feature Overview
38 ^^^^^^^^^^^^^^^^
39
40 The dashboard provides the following features:
41
42 * **Multi-User and Role Management**: The dashboard supports multiple user
43 accounts with different permissions (roles). The user accounts and roles
44 can be modified on both the command line and via the WebUI.
45 See :ref:`dashboard-user-role-management` for details.
46 * **Single Sign-On (SSO)**: the dashboard supports authentication
47 via an external identity provider using the SAML 2.0 protocol. See
48 :ref:`dashboard-sso-support` for details.
49 * **SSL/TLS support**: All HTTP communication between the web browser and the
50 dashboard is secured via SSL. A self-signed certificate can be created with
51 a built-in command, but it's also possible to import custom certificates
52 signed and issued by a CA. See :ref:`dashboard-ssl-tls-support` for details.
53 * **Auditing**: the dashboard backend can be configured to log all PUT, POST
54 and DELETE API requests in the Ceph audit log. See :ref:`dashboard-auditing`
55 for instructions on how to enable this feature.
56 * **Internationalization (I18N)**: the dashboard can be used in different
57 languages that can be selected at run-time.
58
59 Currently, Ceph Dashboard is capable of monitoring and managing the following
60 aspects of your Ceph cluster:
61
62 * **Overall cluster health**: Display overall cluster status, performance
63 and capacity metrics.
64 * **Embedded Grafana Dashboards**: Ceph Dashboard is capable of embedding
65 `Grafana <https://grafana.com>`_ dashboards in many locations, to display
66 additional information and performance metrics gathered by the
67 :ref:`mgr-prometheus`. See :ref:`dashboard-grafana` for details on how to
68 configure this functionality.
69 * **Cluster logs**: Display the latest updates to the cluster's event and
70 audit log files. Log entries can be filtered by priority, date or keyword.
71 * **Hosts**: Display a list of all hosts associated to the cluster, which
72 services are running and which version of Ceph is installed.
73 * **Performance counters**: Display detailed service-specific statistics for
74 each running service.
75 * **Monitors**: List all MONs, their quorum status, open sessions.
76 * **Configuration Editor**: Display all available configuration options,
77 their description, type and default values and edit the current values.
78 * **Pools**: List all Ceph pools and their details (e.g. applications,
79 placement groups, replication size, EC profile, CRUSH ruleset, etc.)
80 * **OSDs**: List all OSDs, their status and usage statistics as well as
81 detailed information like attributes (OSD map), metadata, performance
82 counters and usage histograms for read/write operations. Mark OSDs
83 up/down/out, purge and reweight OSDs, perform scrub operations, modify
84 various scrub-related configuration options, select different profiles to
85 adjust the level of backfilling activity.
86 * **iSCSI**: List all hosts that run the TCMU runner service, display all
87 images and their performance characteristics (read/write ops, traffic).
88 Create, modify and delete iSCSI targets (via ``ceph-iscsi``). See
89 :ref:`dashboard-iscsi-management` for instructions on how to configure this
90 feature.
91 * **RBD**: List all RBD images and their properties (size, objects, features).
92 Create, copy, modify and delete RBD images. Define various I/O or bandwidth
93 limitation settings on a global, per-pool or per-image level. Create, delete
94 and rollback snapshots of selected images, protect/unprotect these snapshots
95 against modification. Copy or clone snapshots, flatten cloned images.
96 * **RBD mirroring**: Enable and configure RBD mirroring to a remote Ceph server.
97 Lists all active sync daemons and their status, pools and RBD images including
98 their synchronization state.
99 * **CephFS**: List all active filesystem clients and associated pools,
100 including their usage statistics.
101 * **Object Gateway**: List all active object gateways and their performance
102 counters. Display and manage (add/edit/delete) object gateway users and their
103 details (e.g. quotas) as well as the users' buckets and their details (e.g.
104 owner, quotas). See :ref:`dashboard-enabling-object-gateway` for configuration
105 instructions.
106 * **NFS**: Manage NFS exports of CephFS filesystems and RGW S3 buckets via NFS
107 Ganesha. See :ref:`dashboard-nfs-ganesha-management` for details on how to
108 enable this functionality.
109 * **Ceph Manager Modules**: Enable and disable all Ceph Manager modules, change
110 the module-specific configuration settings.
111
112
113 Supported Browsers
114 ^^^^^^^^^^^^^^^^^^
115
116 Ceph Dashboard is primarily tested and developed using the following web
117 browsers:
118
119 +----------------------------------------------+----------+
120 | Browser | Versions |
121 +==============================================+==========+
122 | `Chrome <https://www.google.com/chrome/>`_ | 68+ |
123 +----------------------------------------------+----------+
124 | `Firefox <http://www.mozilla.org/firefox/>`_ | 61+ |
125 +----------------------------------------------+----------+
126
127 While Ceph Dashboard might work in older browsers, we cannot guarantee it and
128 recommend you to update your browser to the latest version.
129
130 Enabling
131 --------
132
133 If you have installed ``ceph-mgr-dashboard`` from distribution packages, the
134 package management system should have taken care of installing all the required
135 dependencies.
136
137 If you're installing Ceph from source and want to start the dashboard from your
138 development environment, please see the files ``README.rst`` and ``HACKING.rst``
139 in directory ``src/pybind/mgr/dashboard`` of the source code.
140
141 Within a running Ceph cluster, the Ceph Dashboard is enabled with::
142
143 $ ceph mgr module enable dashboard
144
145 Configuration
146 -------------
147
148 .. _dashboard-ssl-tls-support:
149
150 SSL/TLS Support
151 ^^^^^^^^^^^^^^^
152
153 All HTTP connections to the dashboard are secured with SSL/TLS by default.
154
155 To get the dashboard up and running quickly, you can generate and install a
156 self-signed certificate using the following built-in command::
157
158 $ ceph dashboard create-self-signed-cert
159
160 Note that most web browsers will complain about such self-signed certificates
161 and require explicit confirmation before establishing a secure connection to the
162 dashboard.
163
164 To properly secure a deployment and to remove the certificate warning, a
165 certificate that is issued by a certificate authority (CA) should be used.
166
167 For example, a key pair can be generated with a command similar to::
168
169 $ openssl req -new -nodes -x509 \
170 -subj "/O=IT/CN=ceph-mgr-dashboard" -days 3650 \
171 -keyout dashboard.key -out dashboard.crt -extensions v3_ca
172
173 The ``dashboard.crt`` file should then be signed by a CA. Once that is done, you
174 can enable it for all Ceph manager instances by running the following commands::
175
176 $ ceph dashboard set-ssl-certificate -i dashboard.crt
177 $ ceph dashboard set-ssl-certificate-key -i dashboard.key
178
179 If different certificates are desired for each manager instance for some reason,
180 the name of the instance can be included as follows (where ``$name`` is the name
181 of the ``ceph-mgr`` instance, usually the hostname)::
182
183 $ ceph dashboard set-ssl-certificate $name -i dashboard.crt
184 $ ceph dashboard set-ssl-certificate-key $name -i dashboard.key
185
186 SSL can also be disabled by setting this configuration value::
187
188 $ ceph config set mgr mgr/dashboard/ssl false
189
190 This might be useful if the dashboard will be running behind a proxy which does
191 not support SSL for its upstream servers or other situations where SSL is not
192 wanted or required.
193
194 .. warning::
195
196 Use caution when disabling SSL as usernames and passwords will be sent to the
197 dashboard unencrypted.
198
199
200 .. note::
201
202 You need to restart the Ceph manager processes manually after changing the SSL
203 certificate and key. This can be accomplished by either running ``ceph mgr
204 fail mgr`` or by disabling and re-enabling the dashboard module (which also
205 triggers the manager to respawn itself)::
206
207 $ ceph mgr module disable dashboard
208 $ ceph mgr module enable dashboard
209
210 Host Name and Port
211 ^^^^^^^^^^^^^^^^^^
212
213 Like most web applications, dashboard binds to a TCP/IP address and TCP port.
214
215 By default, the ``ceph-mgr`` daemon hosting the dashboard (i.e., the currently
216 active manager) will bind to TCP port 8443 or 8080 when SSL is disabled.
217
218 If no specific address has been configured, the web app will bind to ``::``,
219 which corresponds to all available IPv4 and IPv6 addresses.
220
221 These defaults can be changed via the configuration key facility on a
222 cluster-wide level (so they apply to all manager instances) as follows::
223
224 $ ceph config set mgr mgr/dashboard/server_addr $IP
225 $ ceph config set mgr mgr/dashboard/server_port $PORT
226 $ ceph config set mgr mgr/dashboard/ssl_server_port $PORT
227
228 Since each ``ceph-mgr`` hosts its own instance of dashboard, it may also be
229 necessary to configure them separately. The IP address and port for a specific
230 manager instance can be changed with the following commands::
231
232 $ ceph config set mgr mgr/dashboard/$name/server_addr $IP
233 $ ceph config set mgr mgr/dashboard/$name/server_port $PORT
234 $ ceph config set mgr mgr/dashboard/$name/ssl_server_port $PORT
235
236 Replace ``$name`` with the ID of the ceph-mgr instance hosting the dashboard web
237 app.
238
239 .. note::
240
241 The command ``ceph mgr services`` will show you all endpoints that are
242 currently configured. Look for the ``dashboard`` key to obtain the URL for
243 accessing the dashboard.
244
245 Username and Password
246 ^^^^^^^^^^^^^^^^^^^^^
247
248 In order to be able to log in, you need to create a user account and associate
249 it with at least one role. We provide a set of predefined *system roles* that
250 you can use. For more details please refer to the `User and Role Management`_
251 section.
252
253 To create a user with the administrator role you can use the following
254 commands::
255
256 $ ceph dashboard ac-user-create <username> <password> administrator
257
258 .. _dashboard-enabling-object-gateway:
259
260 Enabling the Object Gateway Management Frontend
261 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
262
263 To use the Object Gateway management functionality of the dashboard, you will
264 need to provide the login credentials of a user with the ``system`` flag
265 enabled.
266
267 If you do not have a user which shall be used for providing those credentials,
268 you will also need to create one::
269
270 $ radosgw-admin user create --uid=<user_id> --display-name=<display_name> \
271 --system
272
273 Take note of the keys ``access_key`` and ``secret_key`` in the output of this
274 command.
275
276 The credentials of an existing user can also be obtained by using
277 `radosgw-admin`::
278
279 $ radosgw-admin user info --uid=<user_id>
280
281 Finally, provide the credentials to the dashboard::
282
283 $ ceph dashboard set-rgw-api-access-key <access_key>
284 $ ceph dashboard set-rgw-api-secret-key <secret_key>
285
286 In a typical default configuration with a single RGW endpoint, this is all you
287 have to do to get the Object Gateway management functionality working. The
288 dashboard will try to automatically determine the host and port of the Object
289 Gateway by obtaining this information from the Ceph Manager's service map.
290
291 If multiple zones are used, it will automatically determine the host within the
292 master zone group and master zone. This should be sufficient for most setups,
293 but in some circumstances you might want to set the host and port manually::
294
295 $ ceph dashboard set-rgw-api-host <host>
296 $ ceph dashboard set-rgw-api-port <port>
297
298 In addition to the settings mentioned so far, the following settings do also
299 exist and you may find yourself in the situation that you have to use them::
300
301 $ ceph dashboard set-rgw-api-scheme <scheme> # http or https
302 $ ceph dashboard set-rgw-api-admin-resource <admin_resource>
303 $ ceph dashboard set-rgw-api-user-id <user_id>
304
305 If you are using a self-signed certificate in your Object Gateway setup, then
306 you should disable certificate verification in the dashboard to avoid refused
307 connections, e.g. caused by certificates signed by unknown CA or not matching
308 the host name::
309
310 $ ceph dashboard set-rgw-api-ssl-verify False
311
312 If the Object Gateway takes too long to process requests and the dashboard runs
313 into timeouts, then you can set the timeout value to your needs::
314
315 $ ceph dashboard set-rest-requests-timeout <seconds>
316
317 The default value is 45 seconds.
318
319 .. _dashboard-iscsi-management:
320
321 Enabling iSCSI Management
322 ^^^^^^^^^^^^^^^^^^^^^^^^^
323
324 The Ceph Dashboard can manage iSCSI targets using the REST API provided by the
325 `rbd-target-api` service of the :ref:`ceph-iscsi`. Please make sure that it's
326 installed and enabled on the iSCSI gateways.
327
328 .. note::
329 The iSCSI management functionality of Ceph Dashboard depends on the latest
330 version 3 of the `ceph-iscsi <https://github.com/ceph/ceph-iscsi>`_ project.
331 Make sure that your operating system provides the correct version, otherwise
332 the dashboard won't enable the management features.
333
334 If ceph-iscsi REST API is configured in HTTPS mode and its using a self-signed
335 certificate, then you need to configure the dashboard to avoid SSL certificate
336 verification when accessing ceph-iscsi API.
337
338 To disable API SSL verification run the following commmand::
339
340 $ ceph dashboard set-iscsi-api-ssl-verification false
341
342 The available iSCSI gateways must be defined using the following commands::
343
344 $ ceph dashboard iscsi-gateway-list
345 $ ceph dashboard iscsi-gateway-add <scheme>://<username>:<password>@<host>[:port]
346 $ ceph dashboard iscsi-gateway-rm <gateway_name>
347
348
349 .. _dashboard-grafana:
350
351 Enabling the Embedding of Grafana Dashboards
352 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
353
354 Grafana and Prometheus are likely going to be bundled and installed by some
355 orchestration tools along Ceph in the near future, but currently, you will have
356 to install and configure both manually. After you have installed Prometheus and
357 Grafana on your preferred hosts, proceed with the following steps.
358
359 #. Enable the Ceph Exporter which comes as Ceph Manager module by running::
360
361 $ ceph mgr module enable prometheus
362
363 More details can be found in the documentation of the :ref:`mgr-prometheus`.
364
365 #. Add the corresponding scrape configuration to Prometheus. This may look
366 like::
367
368 global:
369 scrape_interval: 5s
370
371 scrape_configs:
372 - job_name: 'prometheus'
373 static_configs:
374 - targets: ['localhost:9090']
375 - job_name: 'ceph'
376 static_configs:
377 - targets: ['localhost:9283']
378 - job_name: 'node-exporter'
379 static_configs:
380 - targets: ['localhost:9100']
381
382 #. Add Prometheus as data source to Grafana
383
384 #. Install the `vonage-status-panel and grafana-piechart-panel` plugins using::
385
386 grafana-cli plugins install vonage-status-panel
387 grafana-cli plugins install grafana-piechart-panel
388
389 #. Add the Dashboards to Grafana:
390
391 Dashboards can be added to Grafana by importing dashboard jsons.
392 Following command can be used for downloading json files::
393
394 wget https://raw.githubusercontent.com/ceph/ceph/master/monitoring/grafana/dashboards/<Dashboard-name>.json
395
396 You can find all the dashboard jsons `here <https://github.com/ceph/ceph/tree/
397 master/monitoring/grafana/dashboards>`_ .
398
399 For Example, for ceph-cluster overview you can use::
400
401 wget https://raw.githubusercontent.com/ceph/ceph/master/monitoring/grafana/dashboards/ceph-cluster.json
402
403 #. Configure Grafana in `/etc/grafana/grafana.ini` to adapt anonymous mode::
404
405 [auth.anonymous]
406 enabled = true
407 org_name = Main Org.
408 org_role = Viewer
409
410 After you have set up Grafana and Prometheus, you will need to configure the
411 connection information that the Ceph Dashboard will use to access Grafana.
412
413 You need to tell the dashboard on which url Grafana instance is running/deployed::
414
415 $ ceph dashboard set-grafana-api-url <grafana-server-url> # default: ''
416
417 The format of url is : `<protocol>:<IP-address>:<port>`
418
419 .. note::
420 Ceph Dashboard embeds the Grafana dashboards via ``iframe`` HTML elements.
421 If Grafana is configured without SSL/TLS support, most browsers will block the
422 embedding of insecure content into a secured web page, if the SSL support in
423 the dashboard has been enabled (which is the default configuration). If you
424 can't see the embedded Grafana dashboards after enabling them as outlined
425 above, check your browser's documentation on how to unblock mixed content.
426 Alternatively, consider enabling SSL/TLS support in Grafana.
427
428 You can directly access Grafana Instance as well to monitor your cluster.
429
430 .. _dashboard-sso-support:
431
432 Enabling Single Sign-On (SSO)
433 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
434
435 The Ceph Dashboard supports external authentication of users via the
436 `SAML 2.0 <https://en.wikipedia.org/wiki/SAML_2.0>`_ protocol. You need to create
437 the user accounts and associate them with the desired roles first, as authorization
438 is still performed by the Dashboard. However, the authentication process can be
439 performed by an existing Identity Provider (IdP).
440
441 .. note::
442 Ceph Dashboard SSO support relies on onelogin's
443 `python-saml <https://pypi.org/project/python-saml/>`_ library.
444 Please ensure that this library is installed on your system, either by using
445 your distribution's package management or via Python's `pip` installer.
446
447 To configure SSO on Ceph Dashboard, you should use the following command::
448
449 $ ceph dashboard sso setup saml2 <ceph_dashboard_base_url> <idp_metadata> {<idp_username_attribute>} {<idp_entity_id>} {<sp_x_509_cert>} {<sp_private_key>}
450
451 Parameters:
452
453 * **<ceph_dashboard_base_url>**: Base URL where Ceph Dashboard is accessible (e.g., `https://cephdashboard.local`)
454 * **<idp_metadata>**: URL, file path or content of the IdP metadata XML (e.g., `https://myidp/metadata`)
455 * **<idp_username_attribute>** *(optional)*: Attribute that should be used to get the username from the authentication response. Defaults to `uid`.
456 * **<idp_entity_id>** *(optional)*: Use this when more than one entity id exists on the IdP metadata.
457 * **<sp_x_509_cert> / <sp_private_key>** *(optional)*: File path or content of the certificate that should be used by Ceph Dashboard (Service Provider) for signing and encryption.
458
459 .. note::
460 The issuer value of SAML requests will follow this pattern: **<ceph_dashboard_base_url>**/auth/saml2/metadata
461
462 To display the current SAML 2.0 configuration, use the following command::
463
464 $ ceph dashboard sso show saml2
465
466 .. note::
467 For more information about `onelogin_settings`, please check the `onelogin documentation <https://github.com/onelogin/python-saml>`_.
468
469 To disable SSO::
470
471 $ ceph dashboard sso disable
472
473 To check if SSO is enabled::
474
475 $ ceph dashboard sso status
476
477 To enable SSO::
478
479 $ ceph dashboard sso enable saml2
480
481 Enabling Prometheus Alerting
482 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
483
484 Using Prometheus for monitoring, you have to define `alerting rules
485 <https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules>`_.
486 To manage them you need to use the `Alertmanager
487 <https://prometheus.io/docs/alerting/alertmanager>`_.
488 If you are not using the Alertmanager yet, please `install it
489 <https://github.com/prometheus/alertmanager#install>`_ as it's mandatory in
490 order to receive and manage alerts from Prometheus.
491
492 The Alertmanager capabilities can be consumed by the dashboard in three different
493 ways:
494
495 #. Use the notification receiver of the dashboard.
496
497 #. Use the Prometheus Alertmanager API.
498
499 #. Use both sources simultaneously.
500
501 All three methods are going to notify you about alerts. You won't be notified
502 twice if you use both sources, but you need to consume at least the Alertmanager API
503 in order to manage silences.
504
505 #. Use the notification receiver of the dashboard:
506
507 This allows you to get notifications as `configured
508 <https://prometheus.io/docs/alerting/configuration/>`_ from the Alertmanager.
509 You will get notified inside the dashboard once a notification is send out,
510 but you are not able to manage alerts.
511
512 Add the dashboard receiver and the new route to your Alertmanager configuration.
513 This should look like::
514
515 route:
516 receiver: 'ceph-dashboard'
517 ...
518 receivers:
519 - name: 'ceph-dashboard'
520 webhook_configs:
521 - url: '<url-to-dashboard>/api/prometheus_receiver'
522
523
524 Please make sure that the Alertmanager considers your SSL certificate in terms
525 of the dashboard as valid. For more information about the correct
526 configuration checkout the `<http_config> documentation
527 <https://prometheus.io/docs/alerting/configuration/#%3Chttp_config%3E>`_.
528
529 #. Use the API of Prometheus and the Alertmanager
530
531 This allows you to manage alerts and silences. You will see all alerts and silences
532 the Alertmanager currently knows of in the corresponding listing.
533 Both can be found in the *Cluster* submenu.
534
535 Alerts can be sorted by name, job, severity, state and start time.
536 Unfortunately it's not possible to know when an alert
537 was sent out through a notification by the Alertmanager based on your
538 configuration, that's why the dashboard will notify the user on any visible
539 change to an alert and will notify the changed alert.
540
541 Silences can be sorted by id, creator, status, start, updated and end time.
542 Silences can be created in various ways, it's also possible to expire them.
543
544 #. Create from scratch
545
546 #. Based on a selected alert
547
548 #. Recreate from expired silence
549
550 #. Update a silence (which will recreate and expire it (default Alertmanager behaviour))
551
552 To use it, specify the host and port of the Alertmanager server::
553
554 $ ceph dashboard set-alertmanager-api-host <alertmanager-host:port> # default: ''
555
556 For example::
557
558 $ ceph dashboard set-alertmanager-api-host 'http://localhost:9093'
559
560 To be able to show what a silence will match beforehand, you have to add the host
561 and port of the Prometheus server::
562
563 $ ceph dashboard set-prometheus-api-host <prometheus-host:port> # default: ''
564
565 For example::
566
567 $ ceph dashboard set-prometheus-api-host 'http://localhost:9090'
568
569 After setting up the hosts, you have to refresh your the dashboard in your browser window.
570
571 #. Use both methods
572
573 The different behaviors of both methods are configured in a way that they
574 should not disturb each other through annoying duplicated notifications
575 popping up.
576
577 Accessing the Dashboard
578 ^^^^^^^^^^^^^^^^^^^^^^^
579
580 You can now access the dashboard using your (JavaScript-enabled) web browser, by
581 pointing it to any of the host names or IP addresses and the selected TCP port
582 where a manager instance is running: e.g., ``httpS://<$IP>:<$PORT>/``.
583
584 You should then be greeted by the dashboard login page, requesting your
585 previously defined username and password. Select the **Keep me logged in**
586 checkbox if you want to skip the username/password request when accessing the
587 dashboard in the future.
588
589 .. _dashboard-user-role-management:
590
591 User and Role Management
592 ------------------------
593
594 User Accounts
595 ^^^^^^^^^^^^^
596
597 Ceph Dashboard supports managing multiple user accounts. Each user account
598 consists of a username, a password (stored in encrypted form using ``bcrypt``),
599 an optional name, and an optional email address.
600
601 User accounts are stored in MON's configuration database, and are globally
602 shared across all ceph-mgr instances.
603
604 We provide a set of CLI commands to manage user accounts:
605
606 - *Show User(s)*::
607
608 $ ceph dashboard ac-user-show [<username>]
609
610 - *Create User*::
611
612 $ ceph dashboard ac-user-create <username> [<password>] [<rolename>] [<name>] [<email>]
613
614 - *Delete User*::
615
616 $ ceph dashboard ac-user-delete <username>
617
618 - *Change Password*::
619
620 $ ceph dashboard ac-user-set-password <username> <password>
621
622 - *Modify User (name, and email)*::
623
624 $ ceph dashboard ac-user-set-info <username> <name> <email>
625
626
627 User Roles and Permissions
628 ^^^^^^^^^^^^^^^^^^^^^^^^^^
629
630 User accounts are also associated with a set of roles that define which
631 dashboard functionality can be accessed by the user.
632
633 The Dashboard functionality/modules are grouped within a *security scope*.
634 Security scopes are predefined and static. The current available security
635 scopes are:
636
637 - **hosts**: includes all features related to the ``Hosts`` menu
638 entry.
639 - **config-opt**: includes all features related to management of Ceph
640 configuration options.
641 - **pool**: includes all features related to pool management.
642 - **osd**: includes all features related to OSD management.
643 - **monitor**: includes all features related to Monitor management.
644 - **rbd-image**: includes all features related to RBD image
645 management.
646 - **rbd-mirroring**: includes all features related to RBD-Mirroring
647 management.
648 - **iscsi**: includes all features related to iSCSI management.
649 - **rgw**: includes all features related to Rados Gateway management.
650 - **cephfs**: includes all features related to CephFS management.
651 - **manager**: include all features related to Ceph Manager
652 management.
653 - **log**: include all features related to Ceph logs management.
654 - **grafana**: include all features related to Grafana proxy.
655 - **prometheus**: include all features related to Prometheus alert management.
656 - **dashboard-settings**: allows to change dashboard settings.
657
658 A *role* specifies a set of mappings between a *security scope* and a set of
659 *permissions*. There are four types of permissions:
660
661 - **read**
662 - **create**
663 - **update**
664 - **delete**
665
666 See below for an example of a role specification based on a Python dictionary::
667
668 # example of a role
669 {
670 'role': 'my_new_role',
671 'description': 'My new role',
672 'scopes_permissions': {
673 'pool': ['read', 'create'],
674 'rbd-image': ['read', 'create', 'update', 'delete']
675 }
676 }
677
678 The above role dictates that a user has *read* and *create* permissions for
679 features related to pool management, and has full permissions for
680 features related to RBD image management.
681
682 The Dashboard already provides a set of predefined roles that we call
683 *system roles*, and can be used right away in a fresh Ceph Dashboard
684 installation.
685
686 The list of system roles are:
687
688 - **administrator**: provides full permissions for all security scopes.
689 - **read-only**: provides *read* permission for all security scopes except
690 the dashboard settings.
691 - **block-manager**: provides full permissions for *rbd-image*,
692 *rbd-mirroring*, and *iscsi* scopes.
693 - **rgw-manager**: provides full permissions for the *rgw* scope
694 - **cluster-manager**: provides full permissions for the *hosts*, *osd*,
695 *monitor*, *manager*, and *config-opt* scopes.
696 - **pool-manager**: provides full permissions for the *pool* scope.
697 - **cephfs-manager**: provides full permissions for the *cephfs* scope.
698
699 The list of currently available roles can be retrieved by the following
700 command::
701
702 $ ceph dashboard ac-role-show [<rolename>]
703
704 It is also possible to create new roles using CLI commands. The available
705 commands to manage roles are the following:
706
707 - *Create Role*::
708
709 $ ceph dashboard ac-role-create <rolename> [<description>]
710
711 - *Delete Role*::
712
713 $ ceph dashboard ac-role-delete <rolename>
714
715 - *Add Scope Permissions to Role*::
716
717 $ ceph dashboard ac-role-add-scope-perms <rolename> <scopename> <permission> [<permission>...]
718
719 - *Delete Scope Permission from Role*::
720
721 $ ceph dashboard ac-role-del-perms <rolename> <scopename>
722
723 To associate roles to users, the following CLI commands are available:
724
725 - *Set User Roles*::
726
727 $ ceph dashboard ac-user-set-roles <username> <rolename> [<rolename>...]
728
729 - *Add Roles To User*::
730
731 $ ceph dashboard ac-user-add-roles <username> <rolename> [<rolename>...]
732
733 - *Delete Roles from User*::
734
735 $ ceph dashboard ac-user-del-roles <username> <rolename> [<rolename>...]
736
737
738 Example of User and Custom Role Creation
739 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
740
741 In this section we show a full example of the commands that need to be used
742 in order to create a user account, that should be able to manage RBD images,
743 view and create Ceph pools, and have read-only access to any other scopes.
744
745 1. *Create the user*::
746
747 $ ceph dashboard ac-user-create bob mypassword
748
749 2. *Create role and specify scope permissions*::
750
751 $ ceph dashboard ac-role-create rbd/pool-manager
752 $ ceph dashboard ac-role-add-scope-perms rbd/pool-manager rbd-image read create update delete
753 $ ceph dashboard ac-role-add-scope-perms rbd/pool-manager pool read create
754
755 3. *Associate roles to user*::
756
757 $ ceph dashboard ac-user-set-roles bob rbd/pool-manager read-only
758
759
760 Proxy Configuration
761 -------------------
762
763 In a Ceph cluster with multiple ceph-mgr instances, only the dashboard running
764 on the currently active ceph-mgr daemon will serve incoming requests. Accessing
765 the dashboard's TCP port on any of the other ceph-mgr instances that are
766 currently on standby will perform a HTTP redirect (303) to the currently active
767 manager's dashboard URL. This way, you can point your browser to any of the
768 ceph-mgr instances in order to access the dashboard.
769
770 If you want to establish a fixed URL to reach the dashboard or if you don't want
771 to allow direct connections to the manager nodes, you could set up a proxy that
772 automatically forwards incoming requests to the currently active ceph-mgr
773 instance.
774
775 Configuring a URL Prefix
776 ^^^^^^^^^^^^^^^^^^^^^^^^
777
778 If you are accessing the dashboard via a reverse proxy configuration,
779 you may wish to service it under a URL prefix. To get the dashboard
780 to use hyperlinks that include your prefix, you can set the
781 ``url_prefix`` setting:
782
783 ::
784
785 ceph config set mgr mgr/dashboard/url_prefix $PREFIX
786
787 so you can access the dashboard at ``http://$IP:$PORT/$PREFIX/``.
788
789 Disable the redirection
790 ^^^^^^^^^^^^^^^^^^^^^^^
791
792 If the dashboard is behind a load-balancing proxy like `HAProxy <https://www.haproxy.org/>`_
793 you might want to disable the redirection behaviour to prevent situations that
794 internal (unresolvable) URL's are published to the frontend client. Use the
795 following command to get the dashboard to respond with a HTTP error (500 by default)
796 instead of redirecting to the active dashboard::
797
798 $ ceph config set mgr mgr/dashboard/standby_behaviour "error"
799
800 To reset the setting to the default redirection behaviour, use the following command::
801
802 $ ceph config set mgr mgr/dashboard/standby_behaviour "redirect"
803
804 Configure the error status code
805 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
806
807 When the redirection behaviour is disabled, then you want to customize the HTTP status
808 code of standby dashboards. To do so you need to run the command::
809
810 $ ceph config set mgr mgr/dashboard/standby_error_status_code 503
811
812 HAProxy example configuration
813 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
814
815 Below you will find an example configuration for SSL/TLS pass through using
816 `HAProxy <https://www.haproxy.org/>`_.
817
818 Please note that the configuration works under the following conditions.
819 If the dashboard fails over, the front-end client might receive a HTTP redirect
820 (303) response and will be redirected to an unresolvable host. This happens when
821 the failover occurs during two HAProxy health checks. In this situation the
822 previously active dashboard node will now respond with a 303 which points to
823 the new active node. To prevent that situation you should consider to disable
824 the redirection behaviour on standby nodes.
825
826 ::
827
828 defaults
829 log global
830 option log-health-checks
831 timeout connect 5s
832 timeout client 50s
833 timeout server 450s
834
835 frontend dashboard_front
836 mode http
837 bind *:80
838 option httplog
839 redirect scheme https code 301 if !{ ssl_fc }
840
841 frontend dashboard_front_ssl
842 mode tcp
843 bind *:443
844 option tcplog
845 default_backend dashboard_back_ssl
846
847 backend dashboard_back_ssl
848 mode tcp
849 option httpchk GET /
850 http-check expect status 200
851 server x <HOST>:<PORT> check-ssl check verify none
852 server y <HOST>:<PORT> check-ssl check verify none
853 server z <HOST>:<PORT> check-ssl check verify none
854
855 .. _dashboard-auditing:
856
857 Auditing API Requests
858 ---------------------
859
860 The REST API is capable of logging PUT, POST and DELETE requests to the Ceph
861 audit log. This feature is disabled by default, but can be enabled with the
862 following command::
863
864 $ ceph dashboard set-audit-api-enabled <true|false>
865
866 If enabled, the following parameters are logged per each request:
867
868 * from - The origin of the request, e.g. https://[::1]:44410
869 * path - The REST API path, e.g. /api/auth
870 * method - e.g. PUT, POST or DELETE
871 * user - The name of the user, otherwise 'None'
872
873 The logging of the request payload (the arguments and their values) is enabled
874 by default. Execute the following command to disable this behaviour::
875
876 $ ceph dashboard set-audit-api-log-payload <true|false>
877
878 A log entry may look like this::
879
880 2018-10-22 15:27:01.302514 mgr.x [INF] [DASHBOARD] from='https://[::ffff:127.0.0.1]:37022' path='/api/rgw/user/klaus' method='PUT' user='admin' params='{"max_buckets": "1000", "display_name": "Klaus Mustermann", "uid": "klaus", "suspended": "0", "email": "klaus.mustermann@ceph.com"}'
881
882 .. _dashboard-nfs-ganesha-management:
883
884 NFS-Ganesha Management
885 ----------------------
886
887 Ceph Dashboard can manage `NFS Ganesha <http://nfs-ganesha.github.io/>`_ exports that use
888 CephFS or RadosGW as their backstore.
889
890 To enable this feature in Ceph Dashboard there are some assumptions that need
891 to be met regarding the way NFS-Ganesha services are configured.
892
893 The dashboard manages NFS-Ganesha config files stored in RADOS objects on the Ceph Cluster.
894 NFS-Ganesha must store part of their configuration in the Ceph cluster.
895
896 These configuration files must follow some conventions.
897 conventions.
898 Each export block must be stored in its own RADOS object named
899 ``export-<id>``, where ``<id>`` must match the ``Export_ID`` attribute of the
900 export configuration. Then, for each NFS-Ganesha service daemon there should
901 exist a RADOS object named ``conf-<daemon_id>``, where ``<daemon_id>`` is an
902 arbitrary string that should uniquely identify the daemon instance (e.g., the
903 hostname where the daemon is running).
904 Each ``conf-<daemon_id>`` object contains the RADOS URLs to the exports that
905 the NFS-Ganesha daemon should serve. These URLs are of the form::
906
907 %url rados://<pool_name>[/<namespace>]/export-<id>
908
909 Both the ``conf-<daemon_id>`` and ``export-<id>`` objects must be stored in the
910 same RADOS pool/namespace.
911
912
913 Configuring NFS-Ganesha in the Dashboard
914 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
915
916 To enable the management of NFS-Ganesha exports in Ceph Dashboard, we only
917 need to tell the Dashboard, in which RADOS pool and namespace the
918 configuration objects are stored. Then, Ceph Dashboard can access the objects
919 by following the naming convention described above.
920
921 The Dashboard command to configure the NFS-Ganesha configuration objects
922 location is::
923
924 $ ceph dashboard set-ganesha-clusters-rados-pool-namespace <pool_name>[/<namespace>]
925
926 After running the above command, Ceph Dashboard is able to find the NFS-Ganesha
927 configuration objects and we can start manage the exports through the Web UI.
928
929
930 Support for Multiple NFS-Ganesha Clusters
931 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
932
933 Ceph Dashboard also supports the management of NFS-Ganesha exports belonging
934 to different NFS-Ganesha clusters. An NFS-Ganesha cluster is a group of
935 NFS-Ganesha service daemons sharing the same exports. Different NFS-Ganesha
936 clusters are independent and don't share the exports configuration between each
937 other.
938
939 Each NFS-Ganesha cluster should store its configuration objects in a
940 different RADOS pool/namespace to isolate the configuration from each other.
941
942 To specify the locations of the configuration of each NFS-Ganesha cluster we
943 can use the same command as above but with a different value pattern::
944
945 $ ceph dashboard set-ganesha-clusters-rados-pool-namespace <cluster_id>:<pool_name>[/<namespace>](,<cluster_id>:<pool_name>[/<namespace>])*
946
947 The ``<cluster_id>`` is an arbitrary string that should uniquely identify the
948 NFS-Ganesha cluster.
949
950 When configuring the Ceph Dashboard with multiple NFS-Ganesha clusters, the
951 Web UI will automatically allow to choose to which cluster an export belongs.
952
953
954 Plug-ins
955 --------
956
957 Dashboard Plug-ins allow to extend the functionality of the dashboard in a modular
958 and loosely coupled approach.
959
960 .. include:: dashboard_plugins/feature_toggles.inc.rst