Introduction of icic-config storage backup-service command tool

The icic-config storage backup-service command is used to set or display the configurations for the Cinder backup sevice.

Location

The command can be found under /usr/bin/ of the management node.

/usr/bin/icic-config

Usage

And the command usage can be found in the help messages:

# icic-config storage backup-service -h
usage: icic-config storage backup-service [-h] {swift,posix,show} ...

Sets or displays the IBM Cloud Infrastructure Center Cinder configuration for
the backup service.

positional arguments:
  {swift,posix,show}
    swift             Enables the Cinder Swift Backup driver. This operation
                      is only supported on HA environment.
    posix             Configures and enables the Posix Cinder backup driver.
                      If no input is provided, the IBM Cloud Infrastructure
                      Center default Cinder backup values are used.
    show              Shows the current configuration for the enabled backup
                      service.

optional arguments:
  -h, --help          show this help message and exit

Prerequisites

The storage provider must be available, and find the agent node for the storage provider. Use the following steps to obtain the necessary values:

  • Set environment variables.

  • Run openstack volume service list command and check Host column. The value of Host in cinder-volume service row is the storage Host.

  • Get the Agent Node on the details page of the storage provider from UI.

  • Ensure that the Agent Node is up and accessable from the management node on which to run this tool.

Note: If you want to change the backup setting for the IBM Storage Scale storage provider, make sure that the compute node belongs to the same cluster as storage provider. You can find the Agent Node on the details page of the storage provider.

Check current backup settings for all storage providers

Check the current backup driver settings with subcomamnd show as follows:

# icic-config storage backup-service show
+----------------------------------------------+
| ds8k63c1 enabled backup service type: posix  |
+--------------------------------+-------------------------------------------------+
| Property                       | Value                                           |
+--------------------------------+-------------------------------------------------+
| "backup_compression_algorithm" | "none"                                          |
| "backup_driver"                | "cinder.backup.drivers.posix.PosixBackupDriver" |
| "backup_file_size"             | "268435456"                                     |
| "backup_posix_path"            | "/var/opt/ibm/icic/image-backups"               |
| "backup_sha_block_size_bytes"  | "<default>"                                     |
| "quota_backup_gigabytes"       | "15000"                                         |
| "quota_backups"                | "30"                                            |
+--------------------------------+-------------------------------------------------+

+------------------------------------------+
| fl63 enabled backup service type: posix  |
+--------------------------------+-------------------------------------------------+
| Property                       | Value                                           |
+--------------------------------+-------------------------------------------------+
| "backup_compression_algorithm" | "none"                                          |
| "backup_driver"                | "cinder.backup.drivers.posix.PosixBackupDriver" |
| "backup_file_size"             | "268435456"                                     |
| "backup_posix_path"            | "/var/opt/ibm/icic/image-backups"               |
| "backup_sha_block_size_bytes"  | "<default>"                                     |
| "quota_backup_gigabytes"       | "15000"                                         |
| "quota_backups"                | "30"                                            |
+--------------------------------+-------------------------------------------------+

+-------------------------------------------------------------------------+
| gpfs-14573663776078067384-icic_gpfs enabled backup service type: posix  |
+--------------------------------+-------------------------------------------------+
| Property                       | Value                                           |
+--------------------------------+-------------------------------------------------+
| "backup_compression_algorithm" | "zlib"                                          |
| "backup_driver"                | "cinder.backup.drivers.posix.PosixBackupDriver" |
| "backup_file_size"             | "268435456"                                     |
| "backup_posix_path"            | "/gpfs/icic_gpfs/vmsbackup"                     |
| "backup_sha_block_size_bytes"  | "<default>"                                     |
| "quota_backup_gigabytes"       | "15000"                                         |
| "quota_backups"                | "30"                                            |
+--------------------------------+-------------------------------------------------+

Change backup settings for the specified storage provider

You can change backup driver to Swift or Posix.

Change backup driver to Posix:

Before you change the backup driver to Posix, login to the Agent Node obtained in the previous step and complete these steps to prepare the backup directory:

  1. Create a backup directory:

    # sudo mkdir -p <backup_directory>

    Here, <backup_director> is path of directory that contains the backup archive files. If you use NFS, or IBM Storage Scale as the backup storage, remember to mount the shared storage device to the new created backup directory before you do next step.

  2. Make the backup directory writable for the cinder user:

    # sudo chmod u+w <backup_directory>
  3. Then, login to one of your management nodes and run posix subcommand as follows to change the backup driver to Posix:

    # icic-config storage backup-service posix --posix-path <backup_directory> --storageHost <storage_host>

    The <storage_host> is storage Host for the choosen storage provider. This posix subcommand also provides a few other parameters to customize driver settings:

    --posix-path BACKUP_PATH
                        Path specifying where to store the backup files.
                        Specified directory should have the 'cinder' owner and
                        write permissions
    --file-size FSIZE     The backup_file_size value is the maximum size in
                          bytes of the files used to hold backups. If the volume
                          being backed up exceeds this size, then it will be
                          backed up into multiple files. The backup_file_size
                          value must be a multiple of
                          backup_sha_block_size_bytes
    --sha-size SHASIZE    The backup_sha_block_size_bytes value is the size in
                          bytes stored to tracked for incremental backups
    --compress {none,off,no,zlib,gzip,bz2,bzip2}
                          The backup_compression_algorithm value is the
                          compression algorithm used for backup
    --restart             Restart the cinder backup service. If this option is
                          not specified, you must manually restart the service
                              for the changes to take effect.
    --quota-backups QUOTA_BACKUPS
                          Number of volume backups allowed per project
    --quota-backup-gigabytes QUOTA_BACKUP_GIGABYTES
                          Total amount of storage, in gigabytes, allowed for
                          backups per project.
    --storageHost HOST    REQUIRED, the storage provider host to which changes
                          are to be made. The list of candidate hosts can be
                          obtained from the 'openstack volume service list'
                          command, and the 'Host' column of the output.

Change backup driver to Swift:

Login to one of your management nodes and run swift subcommand as follows:

icic-config storage backup-service swift --storageHost <storage_host>

You can get more usage of swift subcommand with -h or --help option:

# icic-config storage backup-service swift -h
usage: icic-config storage backup-service swift [-h] --storageHost HOST
                                                [--restart]

Enables Cinder Swift backup driver in multi tenant mode. Only Keystone v3 auth
system is supported.

optional arguments:
  -h, --help          show this help message and exit
  --storageHost HOST  REQUIRED, the storage provider host to which changes are
                      to be made. The list of candidate hosts can be obtained
                      from the 'openstack volume service list' command, and
                      the 'Host' column of the output.
  --restart           Restart the Cinder backup service.  If this option is
                      not specified, you must manually restart the services
                      for changes to take effect.