]> git.proxmox.com Git - ceph.git/blob - ceph/doc/mgr/dashboard.rst
3f3e92520e87b21c7aeb567a7f4b2d8e0a76ab52
[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 through which you can inspect and administer various aspects
11 and resources within the cluster. It is 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 run-time information and performance
15 data of Ceph clusters. It used a very simple architecture to achieve the
16 original goal. However, there was growing demand for richer web-based
17 management capabilities, to make it easier to administer Ceph for users that
18 prefer a WebUI over the CLI.
19
20 The new :term:`Ceph Dashboard` module adds web-based monitoring and
21 administration to the Ceph Manager. The architecture and functionality of this new
22 module are derived from
23 and inspired by the `openATTIC Ceph management and monitoring tool
24 <https://openattic.org/>`_. Development is actively driven by the
25 openATTIC team at `SUSE <https://www.suse.com/>`_, with support from
26 companies including `Red Hat <https://redhat.com/>`_ and members of the Ceph
27 community.
28
29 The dashboard module's backend code uses the CherryPy framework and implements
30 a custom REST API. The WebUI implementation is based on
31 Angular/TypeScript and includes both functionality from the original dashboard
32 and new features originally developed for the standalone version
33 of openATTIC. The Ceph Dashboard module is implemented as an
34 application that provides a graphical representation of information and statistics
35 through 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). User accounts and roles
44 can be managed via both the command line and the WebUI. The dashboard
45 supports various methods to enhance password security. Password
46 complexity rules may be configured, requiring users to change their password
47 after the first login or after a configurable time period. See
48 :ref:`dashboard-user-role-management` for details.
49 * **Single Sign-On (SSO)**: The dashboard supports authentication
50 via an external identity provider using the SAML 2.0 protocol. See
51 :ref:`dashboard-sso-support` for details.
52 * **SSL/TLS support**: All HTTP communication between the web browser and the
53 dashboard is secured via SSL. A self-signed certificate can be created with
54 a built-in command, but it's also possible to import custom certificates
55 signed and issued by a CA. See :ref:`dashboard-ssl-tls-support` for details.
56 * **Auditing**: The dashboard backend can be configured to log all ``PUT``, ``POST``
57 and ``DELETE`` API requests in the Ceph audit log. See :ref:`dashboard-auditing`
58 for instructions on how to enable this feature.
59 * **Internationalization (I18N)**: The language used for dashboard text can be
60 selected at run-time.
61
62 The Ceph Dashboard offers the following monitoring and management capabilities:
63
64 * **Overall cluster health**: Display performance and capacity metrics as well
65 as cluster status.
66 * **Embedded Grafana Dashboards**: Ceph Dashboard
67 `Grafana`_ dashboards may be embedded in external applications and web pages
68 to surface information and performance metrics gathered by
69 the :ref:`mgr-prometheus` module. See
70 :ref:`dashboard-grafana` for details on how to configure this functionality.
71 * **Cluster logs**: Display the latest updates to the cluster's event and
72 audit log files. Log entries can be filtered by priority, date or keyword.
73 * **Hosts**: Display a list of all cluster hosts along with their
74 storage drives, which services are running, and which version of Ceph is
75 installed.
76 * **Performance counters**: Display detailed service-specific statistics for
77 each running service.
78 * **Monitors**: List all Mons, their quorum status, and open sessions.
79 * **Monitoring**: Enable creation, re-creation, editing, and expiration of
80 Prometheus' silences, list the alerting configuration and all
81 configured and firing alerts. Show notifications for firing alerts.
82 * **Configuration Editor**: Display all available configuration options,
83 their descriptions, types, default and currently set values. These may be edited as well.
84 * **Pools**: List Ceph pools and their details (e.g. applications,
85 pg-autoscaling, placement groups, replication size, EC profile, CRUSH
86 rules, quotas etc.)
87 * **OSDs**: List OSDs, their status and usage statistics as well as
88 detailed information like attributes (OSD map), metadata, performance
89 counters and usage histograms for read/write operations. Mark OSDs
90 up/down/out, purge and reweight OSDs, perform scrub operations, modify
91 various scrub-related configuration options, select profiles to
92 adjust the level of backfilling activity. List all drives associated with an
93 OSD. Set and change the device class of an OSD, display and sort OSDs by
94 device class. Deploy OSDs on new drives and hosts.
95 * **Device management**: List all hosts known by the orchestrator. List all
96 drives attached to a host and their properties. Display drive
97 health predictions and SMART data. Blink enclosure LEDs.
98 * **iSCSI**: List all hosts that run the TCMU runner service, display all
99 images and their performance characteristics (read/write ops, traffic).
100 Create, modify, and delete iSCSI targets (via ``ceph-iscsi``). Display the
101 iSCSI gateway status and info about active initiators.
102 See :ref:`dashboard-iscsi-management` for instructions on how to configure
103 this feature.
104 * **RBD**: List all RBD images and their properties (size, objects, features).
105 Create, copy, modify and delete RBD images (incl. snapshots) and manage RBD
106 namespaces. Define various I/O or bandwidth limitation settings on a global,
107 per-pool or per-image level. Create, delete and rollback snapshots of selected
108 images, protect/unprotect these snapshots against modification. Copy or clone
109 snapshots, flatten cloned images.
110 * **RBD mirroring**: Enable and configure RBD mirroring to a remote Ceph server.
111 List active daemons and their status, pools and RBD images including
112 sync progress.
113 * **CephFS**: List active file system clients and associated pools,
114 including usage statistics. Evict active CephFS clients. Manage CephFS
115 quotas and snapshots. Browse a CephFS directory structure.
116 * **Object Gateway**: List all active object gateways and their performance
117 counters. Display and manage (add/edit/delete) object gateway users and their
118 details (e.g. quotas) as well as the users' buckets and their details (e.g.
119 placement targets, owner, quotas, versioning, multi-factor authentication).
120 See :ref:`dashboard-enabling-object-gateway` for configuration instructions.
121 * **NFS**: Manage NFS exports of CephFS file systems and RGW S3 buckets via NFS
122 Ganesha. See :ref:`dashboard-nfs-ganesha-management` for details on how to
123 enable this functionality.
124 * **Ceph Manager Modules**: Enable and disable Ceph Manager modules, manage
125 module-specific configuration settings.
126
127 Overview of the Dashboard Landing Page
128 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
129
130 Displays overall cluster status, performance, and capacity metrics. Shows instant
131 feedback for changes in the cluster and provides easy access to subpages of the
132 dashboard.
133
134 .. _dashboard-landing-page-status:
135
136 Status
137 """"""
138
139 * **Cluster Status**: Displays overall cluster health. In case of any error it
140 displays a short description of the error and provides a link to the logs.
141 * **Hosts**: Displays the total number of hosts associated to the cluster and
142 links to a subpage that lists and describes each.
143 * **Monitors**: Displays mons and their quorum status and
144 open sessions. Links to a subpage that lists and describes each.
145 * **OSDs**: Displays object storage daemons (ceph-osds) and
146 the numbers of OSDs running (up), in service
147 (in), and out of the cluster (out). Provides links to
148 subpages providing a list of all OSDs and related management actions.
149 * **Managers**: Displays active and standby Ceph Manager
150 daemons (ceph-mgr).
151 * **Object Gateway**: Displays active object gateways (RGWs) and
152 provides links to subpages that list all object gateway daemons.
153 * **Metadata Servers**: Displays active and standby CephFS metadata
154 service daemons (ceph-mds).
155 * **iSCSI Gateways**: Display iSCSI gateways available,
156 active (up), and inactive (down). Provides a link to a subpage
157 showing a list of all iSCSI Gateways.
158
159 .. _dashboard-landing-page-capacity:
160
161 Capacity
162 """"""""
163
164 * **Raw Capacity**: Displays the capacity used out of the total
165 physical capacity provided by storage nodes (OSDs).
166 * **Objects**: Displays the number and status of RADOS objects
167 including the percentages of healthy, misplaced, degraded, and unfound
168 objects.
169 * **PG Status**: Displays the total number of placement groups and
170 their status, including the percentage clean, working,
171 warning, and unknown.
172 * **Pools**: Displays pools and links to a subpage listing details.
173 * **PGs per OSD**: Displays the number of placement groups assigned to
174 object storage daemons.
175
176 .. _dashboard-landing-page-performance:
177
178 Performance
179 """""""""""
180
181 * **Client READ/Write**: Displays an overview of
182 client input and output operations.
183 * **Client Throughput**: Displays the data transfer rates to and from Ceph clients.
184 * **Recovery throughput**: Displays rate of cluster healing and balancing operations.
185 * **Scrubbing**: Displays light and deep scrub status.
186
187 Supported Browsers
188 ^^^^^^^^^^^^^^^^^^
189
190 Ceph Dashboard is primarily tested and developed using the following web
191 browsers:
192
193 +---------------------------------------------------------------+---------------------------------------+
194 | Browser | Versions |
195 +===============================================================+=======================================+
196 | `Chrome <https://www.google.com/chrome/>`_ and | latest 2 major versions |
197 | `Chromium <https://www.chromium.org/>`_ based browsers | |
198 +---------------------------------------------------------------+---------------------------------------+
199 | `Firefox <https://www.mozilla.org/firefox/>`_ | latest 2 major versions |
200 +---------------------------------------------------------------+---------------------------------------+
201 | `Firefox ESR <https://www.mozilla.org/firefox/enterprise/>`_ | latest major version |
202 +---------------------------------------------------------------+---------------------------------------+
203
204 While Ceph Dashboard might work in older browsers, we cannot guarantee compatibility and
205 recommend keeping your browser up to date.
206
207 Enabling
208 --------
209
210 If you have installed ``ceph-mgr-dashboard`` from distribution packages, the
211 package management system should take care of installing all required
212 dependencies.
213
214 If you're building Ceph from source and want to start the dashboard from your
215 development environment, please see the files ``README.rst`` and ``HACKING.rst``
216 in the source directory ``src/pybind/mgr/dashboard``.
217
218 Within a running Ceph cluster, the Ceph Dashboard is enabled with:
219
220 .. prompt:: bash $
221
222 ceph mgr module enable dashboard
223
224 Configuration
225 -------------
226
227 .. _dashboard-ssl-tls-support:
228
229 SSL/TLS Support
230 ^^^^^^^^^^^^^^^
231
232 All HTTP connections to the dashboard are secured with SSL/TLS by default.
233
234 To get the dashboard up and running quickly, you can generate and install a
235 self-signed certificate:
236
237 .. prompt:: bash $
238
239 ceph dashboard create-self-signed-cert
240
241 Note that most web browsers will complain about self-signed certificates
242 and require explicit confirmation before establishing a secure connection to the
243 dashboard.
244
245 To properly secure a deployment and to remove the warning, a
246 certificate that is issued by a certificate authority (CA) should be used.
247
248 For example, a key pair can be generated with a command similar to:
249
250 .. prompt:: bash $
251
252 openssl req -new -nodes -x509 \
253 -subj "/O=IT/CN=ceph-mgr-dashboard" -days 3650 \
254 -keyout dashboard.key -out dashboard.crt -extensions v3_ca
255
256 The ``dashboard.crt`` file should then be signed by a CA. Once that is done, you
257 can enable it for Ceph manager instances by running the following commands:
258
259 .. prompt:: bash $
260
261 ceph dashboard set-ssl-certificate -i dashboard.crt
262 ceph dashboard set-ssl-certificate-key -i dashboard.key
263
264 If unique certificates are desired for each manager instance,
265 the name of the instance can be included as follows (where ``$name`` is the name
266 of the ``ceph-mgr`` instance, usually the hostname):
267
268 .. prompt:: bash $
269
270 ceph dashboard set-ssl-certificate $name -i dashboard.crt
271 ceph dashboard set-ssl-certificate-key $name -i dashboard.key
272
273 SSL can also be disabled by setting this configuration value:
274
275 .. prompt:: bash $
276
277 ceph config set mgr mgr/dashboard/ssl false
278
279 This might be useful if the dashboard will be running behind a proxy which does
280 not support SSL for its upstream servers or other situations where SSL is not
281 wanted or required. See :ref:`dashboard-proxy-configuration` for more details.
282
283 .. warning::
284
285 Use caution when disabling SSL as usernames and passwords will be sent to the
286 dashboard unencrypted.
287
288
289 .. note::
290
291 You must restart Ceph manager processes after changing the SSL
292 certificate and key. This can be accomplished by either running ``ceph mgr
293 fail mgr`` or by disabling and re-enabling the dashboard module (which also
294 triggers the manager to respawn itself):
295
296 .. prompt:: bash $
297
298 ceph mgr module disable dashboard
299 ceph mgr module enable dashboard
300
301 .. _dashboard-host-name-and-port:
302
303 Host Name and Port
304 ^^^^^^^^^^^^^^^^^^
305
306 Like most web applications, the dashboard binds to a TCP/IP address and TCP port.
307
308 By default, the ``ceph-mgr`` daemon hosting the dashboard (i.e., the currently
309 active manager) will bind to TCP port 8443 or 8080 when SSL is disabled.
310
311 If no specific address has been configured, the web app will bind to ``::``,
312 which corresponds to all available IPv4 and IPv6 addresses.
313
314 These defaults can be changed via the configuration key facility on a
315 cluster-wide level (so they apply to all manager instances) as follows:
316
317 .. prompt:: bash $
318
319 ceph config set mgr mgr/dashboard/server_addr $IP
320 ceph config set mgr mgr/dashboard/server_port $PORT
321 ceph config set mgr mgr/dashboard/ssl_server_port $PORT
322
323 Since each ``ceph-mgr`` hosts its own instance of the dashboard, it may be
324 necessary to configure them separately. The IP address and port for a specific
325 manager instance can be changed with the following commands:
326
327 .. prompt:: bash $
328
329 ceph config set mgr mgr/dashboard/$name/server_addr $IP
330 ceph config set mgr mgr/dashboard/$name/server_port $PORT
331 ceph config set mgr mgr/dashboard/$name/ssl_server_port $PORT
332
333 Replace ``$name`` with the ID of the ceph-mgr instance hosting the dashboard.
334
335 .. note::
336
337 The command ``ceph mgr services`` will show you all endpoints that are
338 currently configured. Look for the ``dashboard`` key to obtain the URL for
339 accessing the dashboard.
340
341 Username and Password
342 ^^^^^^^^^^^^^^^^^^^^^
343
344 In order to be able to log in, you need to create a user account and associate
345 it with at least one role. We provide a set of predefined *system roles* that
346 you can use. For more details please refer to the `User and Role Management`_
347 section.
348
349 To create a user with the administrator role you can use the following
350 commands:
351
352 .. prompt:: bash $
353
354 ceph dashboard ac-user-create <username> -i <file-containing-password> administrator
355
356 Account Lock-out
357 ^^^^^^^^^^^^^^^^
358
359 It disables a user account if a user repeatedly enters the wrong credentials
360 for multiple times. It is enabled by default to prevent brute-force or dictionary
361 attacks. The user can get or set the default number of lock-out attempts using
362 these commands respectively:
363
364 .. prompt:: bash $
365
366 ceph dashboard get-account-lockout-attempts
367 ceph dashboard set-account-lockout-attempts <value:int>
368
369 .. warning::
370
371 This feature can be disabled by setting the default number of lock-out attempts to 0.
372 However, by disabling this feature, the account is more vulnerable to brute-force or
373 dictionary based attacks. This can be disabled by:
374
375 .. prompt:: bash $
376
377 ceph dashboard set-account-lockout-attempts 0
378
379 Enable a Locked User
380 ^^^^^^^^^^^^^^^^^^^^
381
382 If a user account is disabled as a result of multiple invalid login attempts, then
383 it needs to be manually enabled by the administrator. This can be done by the following
384 command:
385
386 .. prompt:: bash $
387
388 ceph dashboard ac-user-enable <username>
389
390 Accessing the Dashboard
391 ^^^^^^^^^^^^^^^^^^^^^^^
392
393 You can now access the dashboard using your (JavaScript-enabled) web browser, by
394 pointing it to any of the host names or IP addresses and the selected TCP port
395 where a manager instance is running: e.g., ``http(s)://<$IP>:<$PORT>/``.
396
397 The dashboard page displays and requests a previously defined username and
398 password.
399
400 .. _dashboard-enabling-object-gateway:
401
402 Enabling the Object Gateway Management Frontend
403 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
404
405 When RGW is deployed with cephadm, the RGW credentials used by the
406 dashboard will be automatically configured. You can also manually force the
407 credentials to be set up with:
408
409 .. prompt:: bash $
410
411 ceph dashboard set-rgw-credentials
412
413 This will create an RGW user with uid ``dashboard`` for each realm in
414 the system.
415
416 If you've configured a custom 'admin' resource in your RGW admin API, you should set it here also:
417
418 .. prompt:: bash $
419
420 ceph dashboard set-rgw-api-admin-resource <admin_resource>
421
422 If you are using a self-signed certificate in your Object Gateway setup,
423 you should disable certificate verification in the dashboard to avoid refused
424 connections, e.g. caused by certificates signed by unknown CA or not matching
425 the host name:
426
427 .. prompt:: bash $
428
429 ceph dashboard set-rgw-api-ssl-verify False
430
431 If the Object Gateway takes too long to process requests and the dashboard runs
432 into timeouts, you can set the timeout value to your needs:
433
434 .. prompt:: bash $
435
436 ceph dashboard set-rest-requests-timeout <seconds>
437
438 The default value is 45 seconds.
439
440 .. _dashboard-iscsi-management:
441
442 Enabling iSCSI Management
443 ^^^^^^^^^^^^^^^^^^^^^^^^^
444
445 The Ceph Dashboard can manage iSCSI targets using the REST API provided by the
446 ``rbd-target-api`` service of the :ref:`ceph-iscsi`. Please make sure that it is
447 installed and enabled on the iSCSI gateways.
448
449 .. note::
450
451 The iSCSI management functionality of Ceph Dashboard depends on the latest
452 version 3 of the `ceph-iscsi <https://github.com/ceph/ceph-iscsi>`_ project.
453 Make sure that your operating system provides the correct version, otherwise
454 the dashboard will not enable the management features.
455
456 If the ``ceph-iscsi`` REST API is configured in HTTPS mode and its using a self-signed
457 certificate, you need to configure the dashboard to avoid SSL certificate
458 verification when accessing ceph-iscsi API.
459
460 To disable API SSL verification run the following command:
461
462 .. prompt:: bash $
463
464 ceph dashboard set-iscsi-api-ssl-verification false
465
466 The available iSCSI gateways must be defined using the following commands:
467
468 .. prompt:: bash $
469
470 ceph dashboard iscsi-gateway-list
471 # Gateway URL format for a new gateway: <scheme>://<username>:<password>@<host>[:port]
472 ceph dashboard iscsi-gateway-add -i <file-containing-gateway-url> [<gateway_name>]
473 ceph dashboard iscsi-gateway-rm <gateway_name>
474
475
476 .. _dashboard-grafana:
477
478 Enabling the Embedding of Grafana Dashboards
479 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
480
481 `Grafana`_ pulls data from `Prometheus <https://prometheus.io/>`_. Although
482 Grafana can use other data sources, the Grafana dashboards we provide contain
483 queries that are specific to Prometheus. Our Grafana dashboards therefore
484 require Prometheus as the data source. The Ceph :ref:`mgr-prometheus`
485 module exports its data in the Prometheus exposition format. These Grafana
486 dashboards rely on metric names from the Prometheus module and `Node exporter
487 <https://prometheus.io/docs/guides/node-exporter/>`_. The Node exporter is a
488 separate application that provides machine metrics.
489
490 .. note::
491
492 Prometheus' security model presumes that untrusted users have access to the
493 Prometheus HTTP endpoint and logs. Untrusted users have access to all the
494 (meta)data Prometheus collects that is contained in the database, plus a
495 variety of operational and debugging information.
496
497 However, Prometheus' HTTP API is limited to read-only operations.
498 Configurations can *not* be changed using the API and secrets are not
499 exposed. Moreover, Prometheus has some built-in measures to mitigate the
500 impact of denial of service attacks.
501
502 Please see `Prometheus' Security model
503 <https://prometheus.io/docs/operating/security/>` for more detailed
504 information.
505
506 Installation and Configuration using cephadm
507 """"""""""""""""""""""""""""""""""""""""""""
508
509 Grafana and Prometheus can be installed using :ref:`cephadm`. They will
510 automatically be configured by ``cephadm``. Please see
511 :ref:`mgr-cephadm-monitoring` documentation for more details on how to use
512 ``cephadm`` for installing and configuring Prometheus and Grafana.
513
514 Manual Installation and Configuration
515 """""""""""""""""""""""""""""""""""""
516
517 The following process describes how to configure Grafana and Prometheus
518 manually. After you have installed Prometheus, Grafana, and the Node exporter
519 on appropriate hosts, proceed with the following steps.
520
521 #. Enable the Ceph Exporter which comes as Ceph Manager module by running:
522
523 .. prompt:: bash $
524
525 ceph mgr module enable prometheus
526
527 More details can be found in the documentation of the :ref:`mgr-prometheus`.
528
529 #. Add the corresponding scrape configuration to Prometheus. This may look
530 like::
531
532 global:
533 scrape_interval: 5s
534
535 scrape_configs:
536 - job_name: 'prometheus'
537 static_configs:
538 - targets: ['localhost:9090']
539 - job_name: 'ceph'
540 static_configs:
541 - targets: ['localhost:9283']
542 - job_name: 'node-exporter'
543 static_configs:
544 - targets: ['localhost:9100']
545
546 .. note::
547
548 Please note that in the above example, Prometheus is configured
549 to scrape data from itself (port 9090), the Ceph manager module
550 `prometheus` (port 9283), which exports Ceph internal data, and the Node
551 Exporter (port 9100), which provides OS and hardware metrics for each host.
552
553 Depending on your configuration, you may need to change the hostname in
554 or add additional configuration entries for the Node
555 Exporter. It is unlikely that you will need to change the default TCP ports.
556
557 Moreover, you don't *need* to have more than one target for Ceph specific
558 data, provided by the `prometheus` mgr module. But it is recommended to
559 configure Prometheus to scrape Ceph specific data from all existing Ceph
560 managers. This enables a built-in high availability mechanism, so that
561 services run on a manager host will be restarted automatically on a different
562 manager host if one Ceph Manager goes down.
563
564 #. Add Prometheus as data source to Grafana `using the Grafana Web UI
565 <https://grafana.com/docs/grafana/latest/features/datasources/add-a-data-source/>`_.
566
567 #. Install the `vonage-status-panel and grafana-piechart-panel` plugins using:
568
569 .. prompt:: bash $
570
571 grafana-cli plugins install vonage-status-panel
572 grafana-cli plugins install grafana-piechart-panel
573
574 #. Add Dashboards to Grafana:
575
576 Dashboards can be added to Grafana by importing dashboard JSON files.
577 Use the following command to download the JSON files:
578
579 .. prompt:: bash $
580
581 wget https://raw.githubusercontent.com/ceph/ceph/main/monitoring/ceph-mixin/dashboards_out/<Dashboard-name>.json
582
583 You can find various dashboard JSON files `here <https://github.com/ceph/ceph/tree/
584 main/monitoring/ceph-mixin/dashboards_out>`_.
585
586 For Example, for ceph-cluster overview you can use:
587
588 .. prompt:: bash $
589
590 wget https://raw.githubusercontent.com/ceph/ceph/main/monitoring/ceph-mixin/dashboards_out/ceph-cluster.json
591
592 You may also author your own dashboards.
593
594 #. Configure anonymous mode in ``/etc/grafana/grafana.ini``::
595
596 [auth.anonymous]
597 enabled = true
598 org_name = Main Org.
599 org_role = Viewer
600
601 In newer versions of Grafana (starting with 6.2.0-beta1) a new setting named
602 ``allow_embedding`` has been introduced. This setting must be explicitly
603 set to ``true`` for the Grafana integration in Ceph Dashboard to work, as the
604 default is ``false``.
605
606 ::
607
608 [security]
609 allow_embedding = true
610
611 Enabling RBD-Image monitoring
612 """""""""""""""""""""""""""""
613
614 Monitoring of RBD images is disabled by default, as it can significantly impact
615 performance. For more information please see :ref:`prometheus-rbd-io-statistics`.
616 When disabled, the overview and details dashboards will be empty in Grafana and
617 metrics will not be visible in Prometheus.
618
619 Configuring Dashboard
620 """""""""""""""""""""
621
622 After you have set up Grafana and Prometheus, you will need to configure the
623 connection information that the Ceph Dashboard will use to access Grafana.
624
625 You need to tell the dashboard on which URL the Grafana instance is
626 running/deployed:
627
628 .. prompt:: bash $
629
630 ceph dashboard set-grafana-api-url <grafana-server-url> # default: ''
631
632 The format of the URL : `<protocol>://<IP-address>:<port>`
633
634 .. note::
635
636 The Ceph Dashboard embeds Grafana dashboards via ``iframe`` HTML elements.
637 If Grafana is configured without SSL/TLS support, most browsers will block the
638 embedding of insecure content if SSL support is
639 enabled for the dashboard (which is the default). If you
640 can't see the embedded Grafana dashboards after enabling them as outlined
641 above, check your browser's documentation on how to unblock mixed content.
642 Alternatively, consider enabling SSL/TLS support in Grafana.
643
644 If you are using a self-signed certificate for Grafana,
645 disable certificate verification in the dashboard to avoid refused connections,
646 which can be a result of certificates signed by an unknown CA or that do not
647 match the host name:
648
649 .. prompt:: bash $
650
651 ceph dashboard set-grafana-api-ssl-verify False
652
653 You can also access Grafana directly to monitor your cluster.
654
655 .. note::
656
657 Ceph Dashboard configuration information can also be unset. For example, to
658 clear the Grafana API URL we configured above:
659
660 .. prompt:: bash $
661
662 ceph dashboard reset-grafana-api-url
663
664 Alternative URL for Browsers
665 """"""""""""""""""""""""""""
666
667 The Ceph Dashboard backend requires the Grafana URL to be able to verify the
668 existence of Grafana Dashboards before the frontend even loads them. Due to the
669 nature of how Grafana is implemented in Ceph Dashboard, this means that two
670 working connections are required in order to be able to see Grafana graphs in
671 Ceph Dashboard:
672
673 - The backend (Ceph Mgr module) needs to verify the existence of the requested
674 graph. If this request succeeds, it lets the frontend know that it can safely
675 access Grafana.
676 - The frontend then requests the Grafana graphs directly from the user's
677 browser using an iframe. The Grafana instance is accessed directly without any
678 detour through Ceph Dashboard.
679
680 Now, it might be the case that your environment makes it difficult for the
681 user's browser to directly access the URL configured in Ceph Dashboard. To solve
682 this issue, a separate URL can be configured which will solely be used to tell
683 the frontend (the user's browser) which URL it should use to access Grafana.
684 This setting won't ever be changed automatically, unlike the GRAFANA_API_URL
685 which is set by :ref:`cephadm` (only if cephadm is used to deploy monitoring
686 services).
687
688 To change the URL that is returned to the frontend issue the following command:
689
690 .. prompt:: bash $
691
692 ceph dashboard set-grafana-frontend-api-url <grafana-server-url>
693
694 If no value is set for that option, it will simply fall back to the value of the
695 GRAFANA_API_URL option. If set, it will instruct the browser to use this URL to
696 access Grafana.
697
698 .. _dashboard-sso-support:
699
700 Enabling Single Sign-On (SSO)
701 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
702
703 The Ceph Dashboard supports external authentication of users via the
704 `SAML 2.0 <https://en.wikipedia.org/wiki/SAML_2.0>`_ protocol. You need to
705 first create user accounts and associate them with desired roles, as
706 authorization is performed by the Dashboard. However, the authentication
707 process can be performed by an existing Identity Provider (IdP).
708
709 .. note::
710
711 Ceph Dashboard SSO support relies on onelogin's
712 `python-saml <https://pypi.org/project/python-saml/>`_ library.
713 Please ensure that this library is installed on your system, either by using
714 your distribution's package management or via Python's `pip` installer.
715
716 To configure SSO on Ceph Dashboard, you should use the following command:
717
718 .. prompt:: bash $
719
720 ceph dashboard sso setup saml2 <ceph_dashboard_base_url> <idp_metadata> {<idp_username_attribute>} {<idp_entity_id>} {<sp_x_509_cert>} {<sp_private_key>}
721
722 Parameters:
723
724 * **<ceph_dashboard_base_url>**: Base URL where Ceph Dashboard is accessible (e.g., `https://cephdashboard.local`)
725 * **<idp_metadata>**: URL to remote (`http://`, `https://`) or local (`file://`) path or content of the IdP metadata XML (e.g., `https://myidp/metadata`, `file:///home/myuser/metadata.xml`).
726 * **<idp_username_attribute>** *(optional)*: Attribute that should be used to get the username from the authentication response. Defaults to `uid`.
727 * **<idp_entity_id>** *(optional)*: Use this when more than one entity id exists on the IdP metadata.
728 * **<sp_x_509_cert> / <sp_private_key>** *(optional)*: File path of the certificate that should be used by Ceph Dashboard (Service Provider) for signing and encryption (these file paths should be accessible from the active ceph-mgr instance).
729
730 .. note::
731
732 The issuer value of SAML requests will follow this pattern: **<ceph_dashboard_base_url>**/auth/saml2/metadata
733
734 To display the current SAML 2.0 configuration, use the following command:
735
736 .. prompt:: bash $
737
738 ceph dashboard sso show saml2
739
740 .. note::
741
742 For more information about `onelogin_settings`, please check the `onelogin documentation <https://github.com/onelogin/python-saml>`_.
743
744 To disable SSO:
745
746 .. prompt:: bash $
747
748 ceph dashboard sso disable
749
750 To check if SSO is enabled:
751
752 .. prompt:: bash $
753
754 ceph dashboard sso status
755
756 To enable SSO:
757
758 .. prompt:: bash $
759
760 ceph dashboard sso enable saml2
761
762 .. _dashboard-alerting:
763
764 Enabling Prometheus Alerting
765 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
766
767 To use Prometheus for alerting you must define `alerting rules
768 <https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules>`_.
769 These are managed by the `Alertmanager
770 <https://prometheus.io/docs/alerting/alertmanager>`_.
771 If you are not yet using the Alertmanager, `install it
772 <https://github.com/prometheus/alertmanager#install>`_ as it receives
773 and manages alerts from Prometheus.
774
775 Alertmanager capabilities can be consumed by the dashboard in three different
776 ways:
777
778 #. Use the notification receiver of the dashboard.
779
780 #. Use the Prometheus Alertmanager API.
781
782 #. Use both sources simultaneously.
783
784 All three methods notify you about alerts. You won't be notified
785 twice if you use both sources, but you need to consume at least the Alertmanager API
786 in order to manage silences.
787
788 1. Use the notification receiver of the dashboard
789
790 This allows you to get notifications as `configured
791 <https://prometheus.io/docs/alerting/configuration/>`_ from the Alertmanager.
792 You will get notified inside the dashboard once a notification is send out,
793 but you are not able to manage alerts.
794
795 Add the dashboard receiver and the new route to your Alertmanager
796 configuration. This should look like::
797
798 route:
799 receiver: 'ceph-dashboard'
800 ...
801 receivers:
802 - name: 'ceph-dashboard'
803 webhook_configs:
804 - url: '<url-to-dashboard>/api/prometheus_receiver'
805
806
807 Ensure that the Alertmanager considers your SSL certificate in terms
808 of the dashboard as valid. For more information about the correct
809 configuration checkout the `<http_config> documentation
810 <https://prometheus.io/docs/alerting/configuration/#%3Chttp_config%3E>`_.
811
812 2. Use the API of Prometheus and the Alertmanager
813
814 This allows you to manage alerts and silences and will enable the "Active
815 Alerts", "All Alerts" as well as the "Silences" tabs in the "Monitoring"
816 section of the "Cluster" menu entry.
817
818 Alerts can be sorted by name, job, severity, state and start time.
819 Unfortunately it's not possible to know when an alert was sent out through a
820 notification by the Alertmanager based on your configuration, that's why the
821 dashboard will notify the user on any visible change to an alert and will
822 notify the changed alert.
823
824 Silences can be sorted by id, creator, status, start, updated and end time.
825 Silences can be created in various ways, it's also possible to expire them.
826
827 #. Create from scratch
828
829 #. Based on a selected alert
830
831 #. Recreate from expired silence
832
833 #. Update a silence (which will recreate and expire it (default Alertmanager behaviour))
834
835 To use it, specify the host and port of the Alertmanager server:
836
837 .. prompt:: bash $
838
839 ceph dashboard set-alertmanager-api-host <alertmanager-host:port> # default: ''
840
841 For example:
842
843 .. prompt:: bash $
844
845 ceph dashboard set-alertmanager-api-host 'http://localhost:9093'
846
847 To be able to see all configured alerts, you will need to configure the URL to
848 the Prometheus API. Using this API, the UI will also help you in verifying
849 that a new silence will match a corresponding alert.
850
851
852 .. prompt:: bash $
853
854 ceph dashboard set-prometheus-api-host <prometheus-host:port> # default: ''
855
856 For example:
857
858 .. prompt:: bash $
859
860 ceph dashboard set-prometheus-api-host 'http://localhost:9090'
861
862 After setting up the hosts, refresh your browser's dashboard window or tab.
863
864 3. Use both methods
865
866 The behaviors of both methods are configured in a way that they
867 should not disturb each other, through annoying duplicated notifications
868 may pop up.
869
870 If you are using a self-signed certificate in your Prometheus or your
871 Alertmanager setup, you should disable certificate verification in the
872 dashboard to avoid refused connections caused by certificates signed by
873 an unknown CA or that do not match the host name.
874
875 - For Prometheus:
876
877 .. prompt:: bash $
878
879 ceph dashboard set-prometheus-api-ssl-verify False
880
881 - For Alertmanager:
882
883 .. prompt:: bash $
884
885 ceph dashboard set-alertmanager-api-ssl-verify False
886
887 .. _dashboard-user-role-management:
888
889 User and Role Management
890 ------------------------
891
892 Password Policy
893 ^^^^^^^^^^^^^^^
894
895 By default the password policy feature is enabled, which includes the
896 following checks:
897
898 - Is the password longer than N characters?
899 - Are the old and new password the same?
900
901 The password policy feature can be switched on or off completely:
902
903 .. prompt:: bash $
904
905 ceph dashboard set-pwd-policy-enabled <true|false>
906
907 The following individual checks can also be switched on or off:
908
909 .. prompt:: bash $
910
911 ceph dashboard set-pwd-policy-check-length-enabled <true|false>
912 ceph dashboard set-pwd-policy-check-oldpwd-enabled <true|false>
913 ceph dashboard set-pwd-policy-check-username-enabled <true|false>
914 ceph dashboard set-pwd-policy-check-exclusion-list-enabled <true|false>
915 ceph dashboard set-pwd-policy-check-complexity-enabled <true|false>
916 ceph dashboard set-pwd-policy-check-sequential-chars-enabled <true|false>
917 ceph dashboard set-pwd-policy-check-repetitive-chars-enabled <true|false>
918
919 Additionally the following options are available to configure password
920 policy.
921
922 - Minimum password length (defaults to 8):
923
924 .. prompt:: bash $
925
926 ceph dashboard set-pwd-policy-min-length <N>
927
928 - Minimum password complexity (defaults to 10):
929
930 .. prompt:: bash $
931
932 ceph dashboard set-pwd-policy-min-complexity <N>
933
934 Password complexity is calculated by classifying each character in
935 the password. The complexity count starts by 0. A character is rated by
936 the following rules in the given order.
937
938 - Increase by 1 if the character is a digit.
939 - Increase by 1 if the character is a lower case ASCII character.
940 - Increase by 2 if the character is an upper case ASCII character.
941 - Increase by 3 if the character is a special character like ``!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~``.
942 - Increase by 5 if the character has not been classified by one of the previous rules.
943
944 - A list of comma separated words that are not allowed to be used in a
945 password:
946
947 .. prompt:: bash $
948
949 ceph dashboard set-pwd-policy-exclusion-list <word>[,...]
950
951
952 User Accounts
953 ^^^^^^^^^^^^^
954
955 The Ceph Dashboard supports multiple user accounts. Each user account
956 consists of a username, a password (stored in encrypted form using ``bcrypt``),
957 an optional name, and an optional email address.
958
959 If a new user is created via the Web UI, it is possible to set an option that the
960 user must assign a new password when they log in for the first time.
961
962 User accounts are stored in the monitors' configuration database, and are
963 available to all ``ceph-mgr`` instances.
964
965 We provide a set of CLI commands to manage user accounts:
966
967 - *Show User(s)*:
968
969 .. prompt:: bash $
970
971 ceph dashboard ac-user-show [<username>]
972
973 - *Create User*:
974
975 .. prompt:: bash $
976
977 ceph dashboard ac-user-create [--enabled] [--force-password] [--pwd_update_required] <username> -i <file-containing-password> [<rolename>] [<name>] [<email>] [<pwd_expiration_date>]
978
979 To bypass password policy checks use the `force-password` option.
980 Add the option `pwd_update_required` so that a newly created user has
981 to change their password after the first login.
982
983 - *Delete User*:
984
985 .. prompt:: bash $
986
987 ceph dashboard ac-user-delete <username>
988
989 - *Change Password*:
990
991 .. prompt:: bash $
992
993 ceph dashboard ac-user-set-password [--force-password] <username> -i <file-containing-password>
994
995 - *Change Password Hash*:
996
997 .. prompt:: bash $
998
999 ceph dashboard ac-user-set-password-hash <username> -i <file-containing-password-hash>
1000
1001 The hash must be a bcrypt hash and salt, e.g. ``$2b$12$Pt3Vq/rDt2y9glTPSV.VFegiLkQeIpddtkhoFetNApYmIJOY8gau2``.
1002 This can be used to import users from an external database.
1003
1004 - *Modify User (name, and email)*:
1005
1006 .. prompt:: bash $
1007
1008 ceph dashboard ac-user-set-info <username> <name> <email>
1009
1010 - *Disable User*:
1011
1012 .. prompt:: bash $
1013
1014 ceph dashboard ac-user-disable <username>
1015
1016 - *Enable User*:
1017
1018 .. prompt:: bash $
1019
1020 ceph dashboard ac-user-enable <username>
1021
1022 User Roles and Permissions
1023 ^^^^^^^^^^^^^^^^^^^^^^^^^^
1024
1025 User accounts are associated with a set of roles that define which
1026 dashboard functionality can be accessed.
1027
1028 The Dashboard functionality/modules are grouped within a *security scope*.
1029 Security scopes are predefined and static. The current available security
1030 scopes are:
1031
1032 - **hosts**: includes all features related to the ``Hosts`` menu
1033 entry.
1034 - **config-opt**: includes all features related to management of Ceph
1035 configuration options.
1036 - **pool**: includes all features related to pool management.
1037 - **osd**: includes all features related to OSD management.
1038 - **monitor**: includes all features related to monitor management.
1039 - **rbd-image**: includes all features related to RBD image
1040 management.
1041 - **rbd-mirroring**: includes all features related to RBD mirroring
1042 management.
1043 - **iscsi**: includes all features related to iSCSI management.
1044 - **rgw**: includes all features related to RADOS Gateway (RGW) management.
1045 - **cephfs**: includes all features related to CephFS management.
1046 - **nfs-ganesha**: includes all features related to NFS Ganesha management.
1047 - **manager**: include all features related to Ceph Manager
1048 management.
1049 - **log**: include all features related to Ceph logs management.
1050 - **grafana**: include all features related to Grafana proxy.
1051 - **prometheus**: include all features related to Prometheus alert management.
1052 - **dashboard-settings**: allows to change dashboard settings.
1053
1054 A *role* specifies a set of mappings between a *security scope* and a set of
1055 *permissions*. There are four types of permissions:
1056
1057 - **read**
1058 - **create**
1059 - **update**
1060 - **delete**
1061
1062 See below for an example of a role specification, in the form of a Python dictionary::
1063
1064 # example of a role
1065 {
1066 'role': 'my_new_role',
1067 'description': 'My new role',
1068 'scopes_permissions': {
1069 'pool': ['read', 'create'],
1070 'rbd-image': ['read', 'create', 'update', 'delete']
1071 }
1072 }
1073
1074 The above role dictates that a user has *read* and *create* permissions for
1075 features related to pool management, and has full permissions for
1076 features related to RBD image management.
1077
1078 The Dashboard provides a set of predefined roles that we call
1079 *system roles*, which can be used right away by a fresh Ceph Dashboard
1080 installation.
1081
1082 The list of system roles are:
1083
1084 - **administrator**: allows full permissions for all security scopes.
1085 - **read-only**: allows *read* permission for all security scopes except
1086 dashboard settings.
1087 - **block-manager**: allows full permissions for *rbd-image*,
1088 *rbd-mirroring*, and *iscsi* scopes.
1089 - **rgw-manager**: allows full permissions for the *rgw* scope
1090 - **cluster-manager**: allows full permissions for the *hosts*, *osd*,
1091 *monitor*, *manager*, and *config-opt* scopes.
1092 - **pool-manager**: allows full permissions for the *pool* scope.
1093 - **cephfs-manager**: allows full permissions for the *cephfs* scope.
1094
1095 The list of available roles can be retrieved with the following command:
1096
1097 .. prompt:: bash $
1098
1099 ceph dashboard ac-role-show [<rolename>]
1100
1101 You can also use the CLI to create new roles. The available commands are the
1102 following:
1103
1104 - *Create Role*:
1105
1106 .. prompt:: bash $
1107
1108 ceph dashboard ac-role-create <rolename> [<description>]
1109
1110 - *Delete Role*:
1111
1112 .. prompt:: bash $
1113
1114 ceph dashboard ac-role-delete <rolename>
1115
1116 - *Add Scope Permissions to Role*:
1117
1118 .. prompt:: bash $
1119
1120 ceph dashboard ac-role-add-scope-perms <rolename> <scopename> <permission> [<permission>...]
1121
1122 - *Delete Scope Permission from Role*:
1123
1124 .. prompt:: bash $
1125
1126 ceph dashboard ac-role-del-scope-perms <rolename> <scopename>
1127
1128 To assign roles to users, the following commands are available:
1129
1130 - *Set User Roles*:
1131
1132 .. prompt:: bash $
1133
1134 ceph dashboard ac-user-set-roles <username> <rolename> [<rolename>...]
1135
1136 - *Add Roles To User*:
1137
1138 .. prompt:: bash $
1139
1140 ceph dashboard ac-user-add-roles <username> <rolename> [<rolename>...]
1141
1142 - *Delete Roles from User*:
1143
1144 .. prompt:: bash $
1145
1146 ceph dashboard ac-user-del-roles <username> <rolename> [<rolename>...]
1147
1148
1149 Example of User and Custom Role Creation
1150 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1151
1152 In this section we show a complete example of the commands that
1153 create a user account that can manage RBD images, view and create Ceph pools,
1154 and has read-only access to other scopes.
1155
1156 1. *Create the user*:
1157
1158 .. prompt:: bash $
1159
1160 ceph dashboard ac-user-create bob -i <file-containing-password>
1161
1162 2. *Create role and specify scope permissions*:
1163
1164 .. prompt:: bash $
1165
1166 ceph dashboard ac-role-create rbd/pool-manager
1167 ceph dashboard ac-role-add-scope-perms rbd/pool-manager rbd-image read create update delete
1168 ceph dashboard ac-role-add-scope-perms rbd/pool-manager pool read create
1169
1170 3. *Associate roles to user*:
1171
1172 .. prompt:: bash $
1173
1174 ceph dashboard ac-user-set-roles bob rbd/pool-manager read-only
1175
1176 .. _dashboard-proxy-configuration:
1177
1178 Proxy Configuration
1179 -------------------
1180
1181 In a Ceph cluster with multiple ``ceph-mgr`` instances, only the dashboard
1182 running on the currently active ``ceph-mgr`` daemon will serve incoming requests.
1183 Connections to the dashboard's TCP port on standby ``ceph-mgr`` instances
1184 will receive an HTTP redirect (303) to the active manager's dashboard URL.
1185 This enables you to point your browser to any ``ceph-mgr`` instance in
1186 order to access the dashboard.
1187
1188 If you want to establish a fixed URL to reach the dashboard or if you don't want
1189 to allow direct connections to the manager nodes, you could set up a proxy that
1190 automatically forwards incoming requests to the active ``ceph-mgr``
1191 instance.
1192
1193 Configuring a URL Prefix
1194 ^^^^^^^^^^^^^^^^^^^^^^^^
1195
1196 If you are accessing the dashboard via a reverse proxy,
1197 you may wish to service it under a URL prefix. To get the dashboard
1198 to use hyperlinks that include your prefix, you can set the
1199 ``url_prefix`` setting:
1200
1201 .. prompt:: bash $
1202
1203 ceph config set mgr mgr/dashboard/url_prefix $PREFIX
1204
1205 so you can access the dashboard at ``http://$IP:$PORT/$PREFIX/``.
1206
1207 Disable the redirection
1208 ^^^^^^^^^^^^^^^^^^^^^^^
1209
1210 If the dashboard is behind a load-balancing proxy like `HAProxy <https://www.haproxy.org/>`_
1211 you might want to disable redirection to prevent situations in which
1212 internal (unresolvable) URLs are published to the frontend client. Use the
1213 following command to get the dashboard to respond with an HTTP error (500 by default)
1214 instead of redirecting to the active dashboard:
1215
1216 .. prompt:: bash $
1217
1218 ceph config set mgr mgr/dashboard/standby_behaviour "error"
1219
1220 To reset the setting to default redirection, use the following command:
1221
1222 .. prompt:: bash $
1223
1224 ceph config set mgr mgr/dashboard/standby_behaviour "redirect"
1225
1226 Configure the error status code
1227 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1228
1229 When redirection is disabled, you may want to customize the HTTP status
1230 code of standby dashboards. To do so you need to run the command:
1231
1232 .. prompt:: bash $
1233
1234 ceph config set mgr mgr/dashboard/standby_error_status_code 503
1235
1236 HAProxy example configuration
1237 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1238
1239 Below you will find an example configuration for SSL/TLS passthrough using
1240 `HAProxy <https://www.haproxy.org/>`_.
1241
1242 Please note that this configuration works under the following conditions.
1243 If the dashboard fails over, the front-end client might receive a HTTP redirect
1244 (303) response and will be redirected to an unresolvable host. This happens when
1245 failover occurs between two HAProxy health checks. In this situation the
1246 previously active dashboard node will now respond with a 303 which points to
1247 the new active node. To prevent that situation you should consider disabling
1248 redirection on standby nodes.
1249
1250 ::
1251
1252 defaults
1253 log global
1254 option log-health-checks
1255 timeout connect 5s
1256 timeout client 50s
1257 timeout server 450s
1258
1259 frontend dashboard_front
1260 mode http
1261 bind *:80
1262 option httplog
1263 redirect scheme https code 301 if !{ ssl_fc }
1264
1265 frontend dashboard_front_ssl
1266 mode tcp
1267 bind *:443
1268 option tcplog
1269 default_backend dashboard_back_ssl
1270
1271 backend dashboard_back_ssl
1272 mode tcp
1273 option httpchk GET /
1274 http-check expect status 200
1275 server x <HOST>:<PORT> ssl check verify none
1276 server y <HOST>:<PORT> ssl check verify none
1277 server z <HOST>:<PORT> ssl check verify none
1278
1279 .. _dashboard-auditing:
1280
1281 Auditing API Requests
1282 ---------------------
1283
1284 The REST API can log PUT, POST and DELETE requests to the Ceph
1285 audit log. This feature is disabled by default, but can be enabled with the
1286 following command:
1287
1288 .. prompt:: bash $
1289
1290 ceph dashboard set-audit-api-enabled <true|false>
1291
1292 If enabled, the following parameters are logged per each request:
1293
1294 * from - The origin of the request, e.g. https://[::1]:44410
1295 * path - The REST API path, e.g. /api/auth
1296 * method - e.g. PUT, POST or DELETE
1297 * user - The name of the user, otherwise 'None'
1298
1299 The logging of the request payload (the arguments and their values) is enabled
1300 by default. Execute the following command to disable this behaviour:
1301
1302 .. prompt:: bash $
1303
1304 ceph dashboard set-audit-api-log-payload <true|false>
1305
1306 A log entry may look like this::
1307
1308 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"}'
1309
1310 .. _dashboard-nfs-ganesha-management:
1311
1312 NFS-Ganesha Management
1313 ----------------------
1314
1315 The dashboard requires enabling the NFS module which will be used to manage
1316 NFS clusters and NFS exports. For more information check :ref:`mgr-nfs`.
1317
1318 Plug-ins
1319 --------
1320
1321 Plug-ins extend the functionality of the Ceph Dashboard in a modular
1322 and loosely coupled fashion.
1323
1324 .. _Grafana: https://grafana.com/
1325
1326 .. include:: dashboard_plugins/feature_toggles.inc.rst
1327 .. include:: dashboard_plugins/debug.inc.rst
1328 .. include:: dashboard_plugins/motd.inc.rst
1329
1330
1331 Troubleshooting the Dashboard
1332 -----------------------------
1333
1334 Locating the Dashboard
1335 ^^^^^^^^^^^^^^^^^^^^^^
1336
1337 If you are unsure of the location of the Ceph Dashboard, run the following command:
1338
1339 .. prompt:: bash $
1340
1341 ceph mgr services | jq .dashboard
1342
1343 ::
1344
1345 "https://host:port"
1346
1347 The command returns the URL where the Ceph Dashboard is located: ``https://<host>:<port>/``
1348
1349 .. note::
1350
1351 Many Ceph tools return results in JSON format. We suggest that
1352 you install the `jq <https://stedolan.github.io/jq>`_ command-line
1353 utility to facilitate working with JSON data.
1354
1355
1356 Accessing the Dashboard
1357 ^^^^^^^^^^^^^^^^^^^^^^^
1358
1359 If you are unable to access the Ceph Dashboard, run the following
1360 commands:
1361
1362 #. Verify the Ceph Dashboard module is enabled:
1363
1364 .. prompt:: bash $
1365
1366 ceph mgr module ls | jq .enabled_modules
1367
1368 Ensure the Ceph Dashboard module is listed in the return value of the
1369 command. Example snipped output from the command above::
1370
1371 [
1372 "dashboard",
1373 "iostat",
1374 "restful"
1375 ]
1376
1377 #. If it is not listed, activate the module with the following command:
1378
1379 .. prompt:: bash $
1380
1381 ceph mgr module enable dashboard
1382
1383 #. Check the Ceph Dashboard and/or ``ceph-mgr`` log files for any errors.
1384
1385 * Check if ``ceph-mgr`` log messages are written to a file by:
1386
1387 .. prompt:: bash $
1388
1389 ceph config get mgr log_to_file
1390
1391 ::
1392
1393 true
1394
1395 * Get the location of the log file (it's ``/var/log/ceph/<cluster-name>-<daemon-name>.log``
1396 by default):
1397
1398 .. prompt:: bash $
1399
1400 ceph config get mgr log_file
1401
1402 ::
1403
1404 /var/log/ceph/$cluster-$name.log
1405
1406 #. Ensure the SSL/TSL support is configured properly:
1407
1408 * Check if the SSL/TSL support is enabled:
1409
1410 .. prompt:: bash $
1411
1412 ceph config get mgr mgr/dashboard/ssl
1413
1414 * If the command returns ``true``, verify a certificate exists by:
1415
1416 .. prompt:: bash $
1417
1418 ceph config-key get mgr/dashboard/crt
1419
1420 and:
1421
1422 .. prompt:: bash $
1423
1424 ceph config-key get mgr/dashboard/key
1425
1426 * If it doesn't return ``true``, run the following command to generate a self-signed
1427 certificate or follow the instructions outlined in
1428 :ref:`dashboard-ssl-tls-support`:
1429
1430 .. prompt:: bash $
1431
1432 ceph dashboard create-self-signed-cert
1433
1434
1435 Trouble Logging into the Dashboard
1436 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1437
1438 If you are unable to log into the Ceph Dashboard and you receive the following
1439 error, run through the procedural checks below:
1440
1441 .. image:: ../images/dashboard/invalid-credentials.png
1442 :align: center
1443
1444 #. Check that your user credentials are correct. If you are seeing the
1445 notification message above when trying to log into the Ceph Dashboard, it
1446 is likely you are using the wrong credentials. Double check your username
1447 and password, and ensure that your keyboard's caps lock is not enabled by accident.
1448
1449 #. If your user credentials are correct, but you are experiencing the same
1450 error, check that the user account exists:
1451
1452 .. prompt:: bash $
1453
1454 ceph dashboard ac-user-show <username>
1455
1456 This command returns your user data. If the user does not exist, it will
1457 print::
1458
1459 Error ENOENT: User <username> does not exist
1460
1461 #. Check if the user is enabled:
1462
1463 .. prompt:: bash $
1464
1465 ceph dashboard ac-user-show <username> | jq .enabled
1466
1467 ::
1468
1469 true
1470
1471 Check if ``enabled`` is set to ``true`` for your user. If not the user is
1472 not enabled, run:
1473
1474 .. prompt:: bash $
1475
1476 ceph dashboard ac-user-enable <username>
1477
1478 Please see :ref:`dashboard-user-role-management` for more information.
1479
1480
1481 A Dashboard Feature is Not Working
1482 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1483
1484 When an error occurs on the backend, you will usually receive an error
1485 notification on the frontend. Run through the following scenarios to debug.
1486
1487 #. Check the Ceph Dashboard and ``ceph-mgr`` logfile(s) for any errors. These can
1488 found by searching for keywords, such as *500 Internal Server Error*,
1489 followed by ``traceback``. The end of a traceback contains more details about
1490 what exact error occurred.
1491 #. Check your web browser's Javascript Console for any errors.
1492
1493
1494 Ceph Dashboard Logs
1495 ^^^^^^^^^^^^^^^^^^^
1496
1497 Dashboard Debug Flag
1498 """"""""""""""""""""
1499
1500 With this flag enabled, error traceback is included in backend responses.
1501
1502 To enable this flag via the Ceph Dashboard, navigate from *Cluster* to *Manager
1503 modules*. Select *Dashboard module* and click the edit button. Click the
1504 *debug* checkbox and update.
1505
1506 To enable it via the CLI, run the following command:
1507
1508 .. prompt:: bash $
1509
1510 ceph dashboard debug enable
1511
1512
1513 Setting Logging Level of Dashboard Module
1514 """""""""""""""""""""""""""""""""""""""""
1515
1516 Setting the logging level to debug makes the log more verbose and helpful for
1517 debugging.
1518
1519 #. Increase the logging level of manager daemons:
1520
1521 .. prompt:: bash $
1522
1523 ceph tell mgr config set debug_mgr 20
1524
1525 #. Adjust the logging level of the Ceph Dashboard module via the Dashboard or
1526 CLI:
1527
1528 * Navigate from *Cluster* to *Manager modules*. Select *Dashboard module*
1529 and click the edit button. Modify the ``log_level`` configuration.
1530 * To adjust it via the CLI, run the following command:
1531
1532 .. prompt:: bash $
1533
1534 bin/ceph config set mgr mgr/dashboard/log_level debug
1535
1536 3. High log levels can result in considerable log volume, which can
1537 easily fill up your filesystem. Set a calendar reminder for an hour, a day,
1538 or a week in the future to revert this temporary logging increase. This looks
1539 something like this:
1540
1541 .. prompt:: bash $
1542
1543 ceph config log
1544
1545 ::
1546
1547 ...
1548 --- 11 --- 2020-11-07 11:11:11.960659 --- mgr.x/dashboard/log_level = debug ---
1549 ...
1550
1551 .. prompt:: bash $
1552
1553 ceph config reset 11
1554
1555 .. _centralized-logging:
1556
1557 Enable Centralized Logging in Dashboard
1558 """""""""""""""""""""""""""""""""""""""
1559
1560 To learn more about centralized logging, see :ref:`cephadm-monitoring-centralized-logs`
1561
1562 1. Create the Loki service on any particular host using "Create Services" option.
1563
1564 2. Similarly create the Promtail service which will be by default deployed
1565 on all the running hosts.
1566
1567 3. To see debug-level messages as well as info-level events, run the following command via CLI:
1568
1569 .. prompt:: bash $
1570
1571 ceph config set mgr mgr/cephadm/log_to_cluster_level debug
1572
1573 4. To enable logging to files, run the following commands via CLI:
1574
1575 .. prompt:: bash $
1576
1577 ceph config set global log_to_file true
1578 ceph config set global mon_cluster_log_to_file true
1579
1580 5. Click on the Daemon Logs tab under Cluster -> Logs.
1581
1582 6. You can find some pre-defined labels there on clicking the Log browser button such as filename,
1583 job etc that can help you query the logs at one go.
1584
1585 7. You can query the logs with LogQL for advanced search and perform some
1586 calculations as well - https://grafana.com/docs/loki/latest/logql/.
1587
1588
1589 Reporting issues from Dashboard
1590 """""""""""""""""""""""""""""""
1591
1592 Ceph-Dashboard provides two ways to create an issue in the Ceph Issue Tracker,
1593 either using the Ceph command line interface or by using the Ceph Dashboard
1594 user interface.
1595
1596 To create an issue in the Ceph Issue Tracker, a user needs to have an account
1597 on the issue tracker. Under the ``my account`` tab in the Ceph Issue Tracker,
1598 the user can see their API access key. This key is used for authentication
1599 when creating a new issue. To store the Ceph API access key, in the CLI run:
1600
1601 .. prompt:: bash $
1602
1603 ``ceph dashboard set-issue-tracker-api-key -i <file-containing-key>``
1604
1605 Then on successful update, you can create an issue using:
1606
1607 .. prompt:: bash $
1608
1609 ``ceph dashboard create issue <project> <tracker_type> <subject> <description>``
1610
1611 The available projects to create an issue on are:
1612 #. dashboard
1613 #. block
1614 #. object
1615 #. file_system
1616 #. ceph_manager
1617 #. orchestrator
1618 #. ceph_volume
1619 #. core_ceph
1620
1621 The available tracker types are:
1622 #. bug
1623 #. feature
1624
1625 The subject and description are then set by the user.
1626
1627 The user can also create an issue using the Dashboard user interface. The settings
1628 icon drop down menu on the top right of the navigation bar has the option to
1629 ``Raise an issue``. On clicking it, a modal dialog opens that has the option to
1630 select the project and tracker from their respective drop down menus. The subject
1631 and multiline description are added by the user. The user can then submit the issue.