How to diagnose the OPCP control plane with opcp-diag
Find out how to run health checks on your OPCP controller with opcp-diag, apply automatic fixes and generate a diagnostic bundle for OVHcloud support
Objective
On an OVHcloud On-Prem Cloud Platform (OPCP), the opcp-diag tool runs health checks on the control plane hosted on your controller: the host itself, the Kubernetes cluster and the platform components (FluxCD, OpenTofu, OpenStack, Keycloak, etc.).
For some known issues, opcp-diag can also apply an automatic fix. At the end of each run, it collects its results, logs and dumps in a diagnostic bundle that you can share with OVHcloud support.
This guide explains how to run a diagnosis with opcp-diag, read its results, apply automatic fixes and send the diagnostic bundle to OVHcloud support.
Requirements
- An active OPCP service.
- SSH access to your OPCP controller with your
opcp-adminaccount, the Linux administrator account provided with your OPCP. This account can runopcp-diagwhether your OPCP is managed by OVHcloud or not (see IAM rights management). No specific role on the platform is required, asopcp-diaguses the credentials of the controller itself. - The
opcp-diagtool, available on the controller (/usr/local/bin/opcp-diag).
Instructions
opcp-diag groups its checks into suites, each suite covering one area of the control plane. Some checks provide an automatic fix, which runs only if the check fails and you have enabled it.
All the commands and options are described in the built-in help:
1. Running a diagnosis
Log in to your controller over SSH, then run:
This command runs all the suites. Automatic fixes are disabled by default: this run does not modify your platform.
For each check, opcp-diag displays its description and its result, then a summary at the end of the run:
Check the summary for the result of the diagnosis: the command exits with code 0 even when it detects problems.
For use in scripts, add the --headless option. opcp-diag then displays nothing and generates no bundle, and its exit code is not 0 if a problem is detected:
Without --headless, the last line of the output gives the path of the diagnostic bundle, created by default in the current directory. It contains the summary of the run (summary.txt), its metadata (metadata.yaml), the configuration applied (used-config.yaml) and one directory per area with the logs and dumps collected.
2. Selecting the suites and checks to run
To list the suites and checks available on your controller, with their description:
Then pass their names, separated by commas, to restrict or exclude suites and checks:
The --exclude-suites and --checks options work the same way. Use the names exactly as opcp-diag list displays them.
3. Applying automatic fixes
To list the checks that provide an automatic fix, with a description of what each fix does:
Enable the automatic fixes of specific checks with --fix, or all of them with --fix all:
Automatic fixes modify the state of your platform. Run a diagnosis without automatic fixes first, review the results, then enable only the fixes you need.
4. Other options
opcp-diag run provides other options, for example to change the bundle location (--bundle-path), filter the results displayed (--filter-results) or adjust the timeout of the suites (--timeout). Run opcp-diag run --help for the full list.
You can also set these options in a YAML configuration file, read by default from /opt/opcp/.opcp-diag.yaml or from the path given with --config. The used-config.yaml file of a bundle is a good starting point to write your own.
5. Sending the diagnostic bundle to OVHcloud support
The diagnostic bundle can contain sensitive information about your platform: environment variables, running processes, pod logs, lists of Keycloak users and roles, lists of OpenStack resources and secrets, system files, etc.
Before you share it:
-
Review its content. If needed, run the diagnosis again with
--exclude-checksto leave out the data you do not want to share. -
Compress the bundle. This step does not need
sudo: youropcp-adminaccount can read the bundle created byopcp-diag. -
Import the GPG public key provided by OVHcloud support, then check its fingerprint with your OVHcloud contact through a separate channel:
-
Encrypt the archive for this key:
As the key is not signed in your keyring,
gpgasks you to confirm that you want to use it: answery, once you have checked its fingerprint in the previous step. -
Send the encrypted file
opcp-diagnostic.tar.gz.gpgto OVHcloud support, attached to your support request. On a disconnected (air-gapped) platform, move the encrypted file out of the platform according to your security procedures.
Never send an unencrypted diagnostic bundle by email or over an unsecured channel.
Go further
For training or technical assistance implementing our solutions, contact your sales representative or visit our Professional Services page to request a quote and have your project analysed by our experts.
Join our community of users.