Service operations using pxctl
The Portworx pxctl CLI tool allows you to run the following service operations:
- Perform a node audit
- Manage the call home feature
- Generate diagnostics package
- Get the version of the installed software
- Configure kvdb
- Place Portworx in maintenance mode
- Manage the physical storage drives
These commands are helpful when you want do debug issues related to your Portworx cluster.
You can see an overview of the available service operations by running the following command:
/opt/pwx/bin/pxctl service --help
Perform a node audit
You can audit the node with:
pxctl service audit
AuditID Error Message
kvdb-limits none KV limits audit not yet available
kvdb-response none KV response audit not yet available
Manage the call home feature
With pxctl, you can enable and disable the call home feature:
pxctl service call-home enable
Call home feature successfully enabled
If you want to disable this feature, just run:
pxctl service call-home disable
Call home feature successfully disabled
Generate a complete diagnostics package
When there is an operational failure, you can use the pxctl service diags command to generate a complete diagnostics package. Run the pxctl service diags command with the --help flag to list the available subcommands and flags.
The diagnostics package will be available at /var/cores. It will be automatically uploaded to Pure1 if telemetry is enabled.
See Enable Pure1 integration for details on enabling Pure1 telemetry.
To collect diagnostics at the cluster level using the Portworx Operator, see On-demand diagnostics using PortworxDiag custom resource.
As an example, here's how to generate the diagnostics package for a container called px-enterprise:
pxctl service diags -a
Connected to Docker daemon. unix:///var/run/docker.sock
Running PX diagnostics on local node....
Using PX OCI container: <PX_VERSION>-<BUILD_HASH>
Archived cores to: /var/cores/test-k8s1-node0-px-cores.20210514230349.tgz, cleaning up archived cores...
Removing /var/cores/core-px-storage-sig6-user0-group0-pid312-time1620773250...
Getting diags file....
Creating a diags tar ball...
Executing core cleanup...
Finished core cleanup.
Removing /var/cores/test-k8s1-node0-px-cores.20210514230349.tgz...
Generated diags: /var/cores/test-k8s1-node0-diags-20210514230401.tar.gz
Done generating PX diagnostics.
Note: <PX_VERSION> and <BUILD_HASH> reflect the Portworx version and the respective hash.
Get the version of the installed software
The following command displays the version of the installed software:
pxctl service info
PX (OCI) Version: <PX_VERSION>
PX (OCI) Build Version: <BUILD_HASH>
PX Kernel Module Version: <KERNEL_MODULE_VERSION>
Note:
- <PX_VERSION> and <BUILD_HASH> reflect the Portworx version and the respective hash.
- <KERNEL_MODULE_VERSION> reflects the kernel module version used by Portworx.
Configure KVDB
You can configure the KVDB with the pxctl service kvdb command. Run the pxctl service kvdb command with the --help flag to list the available subcommands and flags.
Place Portworx in maintenance mode
Use the pxctl service maintenance command to enter or exit maintenance mode. Once the node is in maintenance mode, you can add or replace drives, add memory, and so on.
Run the pxctl service maintenance command with the --help flag to list the available subcommands and flags.
Enter maintenance mode with:
pxctl service maintenance --enter
This is a disruptive operation, PX will restart in maintenance mode.
Are you sure you want to proceed ? (Y/N): y
Once you're done adding or replacing drives, or adding memory, you can exit maintenance mode by running:
pxctl service maintenance --exit
Manage the physical storage drives
You can manage the physical storage drives on a node using the pxctl service drive command. Run the pxctl service drive command with the --help flag to list the available subcommands and flags.
Add a physical drive to a server
Use the pxctl service drive add command to add a physical drive to a server. Run the pxctl service drive add command with the --help flag to list the available subcommands and flags.
The following example shows how to add a physical drive:
pxctl service drive add --drive /dev/mapper/volume-3bfa72dd -o start
Adding drives may make storage offline for the duration of the operation.
Are you sure you want to proceed ? (Y/N): y
Adding device /dev/mapper/volume-3bfa72dd ...
Drive add successful. Requires restart.
To add physical drives, you must place the server in maintenance mode first.