Backing up

Use the icic-backup command to back up your essential IBM® Cloud Infrastructure Center data. You can then restore your system to a working state if you encounter data corruption or data loss.

Notes:

  • The icic-backup command is optimized in the IBM Cloud Infrastructure Center 1.2.1 stand-alone deployment environment. It dumps mysql data instead of copying database files.

  • If you want to run the backup process as a non-root user, configure the sshd setting for the non-root user before you start the back up process. For more information, see Preparing the management and compute node.

The icic-backup command is in the /opt/ibm/icic/bin/ directory. For syntax and options, run icic-backup --help.

The following data is backed up:

  • The IBM Cloud Infrastructure Center databases, such as the nova database where information about your registered hosts is stored

  • The IBM Cloud Infrastructure Center configuration data, such as /etc/nova

  • SSH private keys that are provided by the administrator

  • Glance image repositories

  • SSH key pairs generated for software-defined storage

The following data is NOT backed up:

  • The virtual server instances created by the IBM® Cloud Infrastructure Center

  • The OpenStack policy.json files

  • The version.properties file in folder /opt/ibm/icic/

  • The certificate files or directory of LDAP server

Complete the following steps to back up the IBM Cloud Infrastructure Center data:

  1. Open a command-line interface to the operating system on the virtual machine on which the IBM Cloud Infrastructure Center is installed.

  2. Navigate to the /opt/ibm/icic/bin/ directory.

  3. Run the icic-backup command with any needed options. If prompts are not suppressed, respond to them as needed. The following example runs the command with no prompts and backs up data to a nondefault mounted file system's target directory:

    icic-backup --noprompt --targetdir=/tmp/backups

    Make sure that it has enough disk space in target directory /tmp/backups before you run the backup command.
    The previous example only back ups the data on the IBM Cloud Infrastructure Center management node. The following example runs the command that uses the all option to back up the data on the management node and all compute nodes. The backup file of the management node and all backup files from compute nodes are zipped into one .tar.gz backup file in the target directory.

    icic-backup --all --targetdir=/tmp/backups

    When the backup operation completes, the new archive file icic_backup_<timestamp>.tar.gz is stored in the dynamically created <timestamp> subdirectory of the target directory, for example, a potential file path is /tmp/backups/20200208210343451220/icic_backup_20200208210343451220.tar.gz.
    The icic_backup_20200208210343451220.tar.gz.sha archive file is stored in the same directory. This file is used to process SHA256 checksum verification for this backup file. You can leave the archive files in the directory or you can move or copy them to another directory as needed. The following example runs the command that uses the noimagedata option to back up the data excluding the image data in folder /var/lib/glance/images.

    icic-backup --all --targetdir=/tmp/backups --noimagedata

    This backup with noimagedata option is called a lightweight backup because the size of the backup file is only a few megabytes and the backup takes little time.

    The following example runs the command that uses the hosts option to back up the data on all compute nodes.

    icic-backup --hosts all --targetdir=/tmp/backups

    The following example runs the command that uses the hosts option to back up the data on some specific compute nodes. Name list of available hosts can be fetched by running command icic-services remote list on the management node.

    icic-backup --hosts hostname1,hostname2,...,hostnameN --targetdir=/tmp/backups

    When you apply hosts argument, the new archive files hostname1_icic_backup_20230604234816709821.tar.gz, hostname2_icic_backup_20230604234816709856.tar.gz and hostnameN_icic_backup_20230604234816709931.tar.gz are directly stored in the target directory.

The following table shows the CLI of backup service in the IBM Cloud Infrastructure Center standalone deployment environment:

Command Description
icic-backup Only backup the management node and the backup file is stored in the default folder /var/opt/ibm/icic/backups
icic-backup --targetdir backup_folder Backup to a specific target directory, that can be a mounted file path
icic-backup --all Backup the management node and all compute nodes and the backup files are zipped into one .tar.gz file
icic-backup --hosts host1,host2,hostn Only backup the specified compute nodes
icic-backup --hosts all Backup all compute nodes
icic-backup --noimagedata A lightweight backup without image data, that is usually used in Running periodic active backups case
icic-backup --noprompt Backup without prompt message, that is usually called from bash or ansible script

Note: If an error occurs while you run icic-backup, check for errors in the icic-backup logs in /opt/ibm/icic/log. The log file name contains the same timestamp as the one in the backup file. For example, the log file name is icic_backup_20200208210343451220.log.

Note: Forced termination of a backup action is not suggested. In the console where the icic-backup command is run, the program prompts what the backup's next action is. Now, The user can cancel the backup action. If the user agrees to continue, it is not suggested exiting forcibly. It might cause resource leak.

Note: This step is only necessary if you turn on the monitoring services (ceilometer, gnocchi) to collect the metrics. In order to retain the meter data before backing, you need to manually pack the /var/lib/gnocchi directory to one local store directory. When you need to check historical meter data before backing, you can restore it from the local store directory manually.

Consider backing up your IBM Cloud Infrastructure Center data regularly, for example, daily, as part of a broader system backup and recovery strategy. If you want to regularly back up your data, use your operating system's scheduling tool to set the icic-backup --all command with no prompt option to run on a schedule. Target off-peak intervals when few or no other operations are running in the IBM Cloud Infrastructure Center.

Refer to Running periodic active backups for more details.