oadp du-pv

Get an estimated volume usage size to allocate sufficient storage for backups.

Extended description

Required role
You must have the Cluster administrator role in IBM® Software Hub.
Note: Do not use this feature in production environments.

Before you run the du-pv command, the cluster administrator must install the cpdbr-agent to the Red Hat® OpenShift® cluster. For more information, see the section Optional: Estimating how much storage to allocate for backups in IBM Software Hub online backup and restore to the same cluster with the OADP utility.

You must also export the following environment variable before you run the du-pv command.

export CPDBR_ENABLE_FEATURES=volume-util

The estimated usage size that is returned by du-pv includes only PVCs that are bound and mounted by pods.

Syntax

cpd-cli oadp du-pv

# Global options
[--add_dir_header=true|false] \
[--alsologtostderr=true|false] \
[--cpd-namespace=<cpd-namespace>] \
[--kubeconfig=<kubeconfig-paths> \
[--log-level=info|debug|warn|error|panic|trace] \
[--log-backtrace-at traceLocation=<integer>] \
[--log-dir=<log_directory>] \
[--log-file=<log_file_name>] \
[--log_file_max_size=<uint>] \
[--logtostderr=true|false] \
[--namespace=<namespace-name>] \
[--one-output=true|false] \
[--skip-headers=true|false] \
[--skip-log-headers=true|false] \
[--stderrthreshold severity=<integer>] \
[--v=<integer>] \
[--verbose \
[--vmodule moduleSpec=<pattern1, pattern2, and so on>]

Arguments

Table 1: Global options arguments
Argument Description
<trace-location> The stack trace location
<severity> The log severity level

Options

Table 1: Command options
Option Description
--include-namespaces The namespaces in which to run du-pv exec-hooks.
Status
Optional.
Syntax
--include-namespaces=<project-name1,project-name2,...>
Default value
All namespaces, which includes the IBM Software Hub operators (${PROJECT_CPD_INST_OPERATORS}), IBM Software Hub instance (${PROJECT_CPD_INST_OPERANDS}), and its tethered namespaces if any (${PROJECT_CPD_INSTANCE_TETHERED_LIST}).
Valid values
Any valid project names. (Comma-separated string array.)

5.1.1 and later This option is merged with IBM Software Hub tenant namespaces.

Global options

You can also use the following global options with this command:

Table 2: Command global options
Option Description
--add_dir_header Add the file directory to the header of log messages.
Status
Optional.
Syntax
--add_dir_header=true|false
Default value
false
Valid values
false
Do not add the file directory to the header of log messages.
true
Add the file directory to the header of log messages.
--alsologtostderr Log to standard error as well as files.
Status
Optional.
Syntax
--alsologtostderr=true|false
Default value
false
Valid values
false
Do not log to standard error as well as files.
true
Log to standard error as well as files.
Note: This option has no effect when --logtostderr=true.
--cpd-namespace The IBM Software Hub namespace in which the utility operates.
Status
Optional.
Syntax
--cpd-namespace=<cpd-namespace>
Default value

5.1.0 zen

5.1.1 and later No default value.

Valid values
A valid IBM Software Hub namespace.
Tip: The following command is an alternative to using this option:
cpd-cli oadp client config set cpd-namespace=<cpd-namespace-name>
However, the option takes precedence over the command.
--kubeconfig Paths to a kubeconfig. Only required if out-of-cluster.
Status
Optional.
Syntax
--kubeconfig=<kubeconfig-paths>
Default value
No default.
Valid values
Valid kubeconfig paths.
--log-level The command log level.
Status
Optional.
Syntax
--log-level=info|debug|warn|error|panic|trace
Default value
info
Valid values
debug
Debug messages are written to the log.
error
Error messages are written to the log.
info
Informative messages are written to the log.
panic
Panic messages are written to the log.
warn
Warning messages are written to the log.
--log-backtrace-at traceLocation When logging hits line file:N, emit a stack trace.
Status
Optional.
Syntax
--log-backtrace-at traceLocation=<integer>
Default value

0.

Valid values
Any positive integer.
--log-dir If non-empty, write log files in this directory.
Status
Optional.
Syntax
--log-dir=<log_directory>
Default value
No default.
Valid values
A valid directory.
Note: This option has no effect when --logtostderr=true.
--log-file If non-empty, use this log file.
Status
Optional.
Syntax
--log-file=<log_file_name>
Default value
No default.
Valid values
A valid directory.
Note: This option has no effect when --logtostderr=true.
--log_file_max_size The maximum size, in MB, that a log file can grow to. If you specify 0, the maximum file size is unlimited.
Status
Optional.
Syntax
--log_file_max_size=<uint>
Default value
1800.
Valid values
A valid unsigned integer.
Note: This option has no effect when --logtostderr=true.
--logtostderr Log to standard error instead of files.
Status
Optional.
Syntax
--logtostderr=true|false
Default value
true
Valid values
true
Log to standard error instead of files.
false
Log to files.
--namespace

-n

The namespace where OADP is installed.
Status
Optional.
Syntax
--namespace=<oadp-namespace>
Default value

5.1.0oadp-operator

5.1.1 and later No default value.

Valid values
Valid namespace name.
Tip: The following command is an alternative to using this option:
cpd-cli oadp client config set namespace=<OADP-operator-namespace>
However, the option takes precedence over the command.
--one-output Specifies whether to only write logs to their native severity level.
Status
Optional.
Syntax
--one-output=true|false
Default value
false
Valid values
false
Write logs to their native severity level and also to each lower severity level.
true
Write logs only to their native severity level.
Note: This option has no effect when --logtostderr=true.
--skip-headers Specifies whether to avoid header prefixes in log messages.
Status
Optional.
Syntax
--skip-headers
Default value
false
Valid values
false
Do not avoid header prefixes in log messages.
true
Avoid header prefixes in log messages.
--skip-log-headers Specifies whether to avoid header prefixes when opening log files.
Status
Optional.
Syntax
--skip-log-headers
Default value
false
Valid values
false
Do not avoid headers when opening log files.
true
Avoid headers when opening log files.
Note: This option has no effect when --logtostderr=true.
--stderrthreshold severity Logs at or above the specified threshold. Go to stderr when writing to files and stderr.
Status
Optional.
Syntax
--stderrthreshold severity=<integer>
Default value
2
Valid values
Any positive integer.
Note: This option has no effect when --logtostderr=true or .--alsologtostderr=false
--v

-v

Number for the log level verbosity.
Status
Optional.
Syntax
--v=<integer>
Default value
No default.
Valid values
Any valid positive integer.
--verbose Logs include more detailed messages.
Status
Optional.
Syntax
--verbose
Default value
No default.
Valid values
Not applicable.
--vmodule moduleSpec Comma-separated list of pattern=N settings for file-filtered logging.
Status
Optional.
Syntax
--vmodule moduleSpec=<pattern1, pattern2, and so on>
Default value
No default.
Valid values

Examples

Note: The following examples use the recommended installation environment variables.

It is strongly recommended that you use a script to create environment variables with the correct values for your environment. For more information, see Setting up installation environment variables.

cpd-cli oadp du-pv --include-namespaces=${PROJECT_CPD_INST_OPERANDS}

This command might return information that is similar to the following example.


PVC NAME    				NAMESPACE    		VOLUME       					STATUS		MOUNTED 	CAPACITY 	USED		CREATED AT 		ACCESS MODES	STORAGE CLASS 
 
export-zen-minio-0 			cpd-instance 		pvc-45080d04-fd88-4612-8963-37c456f7be27 	Bound 		true 		10Gi 		130Mi 		25 May 23 11:16 PDT 	RWO 		managed-nfs-storage 
export-zen-minio-1	 		cpd-instance 		pvc-4b0630d7-2ea2-4485-bdd7-c55cce26c6ec 	Bound 		true 		10Gi 		130Mi 		25 May 23 11:16 PDT 	RWO 		managed-nfs-storage 
export-zen-minio-2 			cpd-instance 		pvc-d64ea3ae-3435-4d30-a7e7-b30eb03f5b56 	Bound 		true 		10Gi 		130Mi 		25 May 23 11:16 PDT 	RWO 		managed-nfs-storage 
ibm-zen-cs-mongo-backup   		cpd-instance 		pvc-e1ac51ce-94ef-47d5-993c-9de48bb5d9e4 	Bound 		false		20Gi 		-     		25 May 23 11:44 PDT 	RWO 		managed-nfs-storage 
ibm-zen-objectstore-backup-pvc   	cpd-instance 		pvc-2d1d4ab2-4e51-4701-a864-9f946eafdd83 	Bound 		false		20Gi 		-     		25 May 23 11:22 PDT 	RWO 		managed-nfs-storage 
mongodbdir-icp-mongodb-0  		cpd-instance 		pvc-84013df3-3b46-4432-988f-d951271d1d42 	Bound 		true 		20Gi 		432Mi 		25 May 23 11:38 PDT 	RWO 		managed-nfs-storage 
mongodbdir-icp-mongodb-1  		cpd-instance 		pvc-a1e509f7-ee08-48e3-b0ed-95182f3d3158 	Bound 		true 		20Gi 		448Mi 		25 May 23 11:40 PDT 	RWO 		managed-nfs-storage 
mongodbdir-icp-mongodb-2  		cpd-instance 		pvc-17bc7875-c203-44a9-a608-a5120b9a04cf 	Bound 		true 		20Gi 		444Mi 		25 May 23 11:40 PDT 	RWO 		managed-nfs-storage 
zen-metastore-edb-1			cpd-instance 		pvc-9087d25e-d54e-4823-b8a6-6a5ad6a55de7 	Bound 		true 		10Gi 		588Mi 		25 May 23 11:18 PDT 	RWO 		managed-nfs-storage 
zen-metastore-edb-2			cpd-instance 		pvc-185de0d4-c6c9-4944-8a51-5e5626b34f06 	Bound 		true 		10Gi 		604Mi 		25 May 23 11:18 PDT 	RWO 		managed-nfs-storage 
 
Total estimated volume usage size: 3Gi

If --include-namespaces is not specified, the du-pv command includes the zen namespace and its tethered namespaces.

To uninstall the cpdbr-agent, run the following command.

cpd-cli oadp uninstall --component=cpdbr-agent