MAS DevOps Ansible Collection Ansible CLI
Home Ansible Automation Platform OCP Install Cloud Pak For Data Install Core Add AIBroker Add IoT Add Manage Add Monitor Add Optimizer Add Predict Add Visual Inspection Update Upgrade Uninstall Core Backup & Restore ocp_cluster_monitoring ocp_config ocp_deprovision ocp_efs ocp_github_oauth ocp_login ocp_node_config ocp_provision ocp_roks_upgrade_registry_storage ocp_upgrade ocp_verify appconnect aws_bucket_access_point aws_documentdb_user aws_policy aws_route53 aws_user_creation aws_vpc cert_manager cis common-services configure_manage_eventstreams cos cos_bucket cp4d_admin_pwd_update cp4d cp4d_service db2 dro eck grafana ibm_catalogs kafka nvidia_gpu mongodb ocs sls turbonomic uds mirror_case_prepare mirror_extras_prepare mirror_images mirror_ocp ocp_idms ocp_simulate_disconnected_network registry suite_app_config suite_app_install suite_app_uninstall suite_app_upgrade suite_app_rollback suite_app_backup_restore suite_certs suite_config suite_db2_setup_for_manage suite_dns suite_install suite_manage_attachments_config suite_manage_birt_report_config suite_manage_bim_config suite_manage_customer_files_config suite_manage_imagestitching_config suite_manage_import_certs_config suite_manage_load_dbc_scripts suite_manage_logging_config suite_manage_pvc_config suite_uninstall suite_upgrade suite_rollback suite_verify suite_backup_restore ansible_version_check entitlement_key_rotation gencfg_jdbc gencfg_watsonstudio gencfg_workspace gencfg_mongo

Backup and Restore MAS Applications¤

Overview¤

This role supports backing up and restoring the data for below MAS applications:

Supports creating on-demand or scheduled backup jobs for taking full or incremental backups, and optionally creating Kubernetes jobs for running the backup/restore process.

Important

An application backup can only be restored to an instance with the same MAS instance ID.

Role Variables - General¤

masbr_action¤

Set backup or restore to indicate the role to create a backup or restore job.

mas_app_id¤

Defines the MAS application ID (manage, iot, monitor, health, optimizer, or visualinspection) for the backup or restore action.

mas_instance_id¤

Defines the MAS instance ID for the backup or restore action.

mas_workspace_id¤

Defines the MAS workspace ID for the backup or restore action.

masbr_confirm_cluster¤

Set true or false to indicate the role whether to confirm the currently connected cluster before running the backup or restore job.

masbr_copy_timeout_sec¤

Set the transfer files timeout in seconds.

masbr_job_timezone¤

Set the time zone for creating scheduled backup job. If not set a value for this variable, this role will use UTC time zone when creating a CronJob for running scheduled backup job.

masbr_storage_local_folder¤

Set local path to save the backup files.

Role Variables - Backup¤

masbr_backup_type¤

Set full or incr to indicate the role to create a full backup or incremental backup. Only supports creating incremental backup for persistent volume data, this role will always create a full backup for other type of data regardless of whether this variable be set to incr.

masbr_backup_data¤

Set the types of data to be backed up, multiple data types are separated by commas (e.g. namespace,pv). If not set a value for this variable, this role will back up all types of data that supported by the specified MAS application. The data types supported by each MAS applications:

MAS App Name MAS App ID Data types
Manage manage namespace, pv
IoT iot namespace
Monitor monitor namespace
Health health namespace, wsl
Optimizer optimizer namespace
Visual Inspection visualinspection namespace, pv

masbr_backup_from_version¤

Set the full backup version to use in the incremental backup, this will be in the format of a YYYMMDDHHMMSS timestamp (e.g. 20240621021316). This variable is only valid when MASBR_BACKUP_TYPE=incr. If not set a value for this variable, this role will try to find the latest full backup version from the specified storage location.

masbr_backup_schedule¤

Set Cron expression to create a scheduled backup. If not set a value for this varialbe, this role will create an on-demand backup.

Role Variables - Restore¤

masbr_restore_from_version¤

Set the backup version to use in the restore, this will be in the format of a YYYMMDDHHMMSS timestamp (e.g. 20240621021316)

masbr_restore_data¤

Set the types of data to be restored, multiple data types are separated by commas (e.g. namespace,pv). If not set a value for this variable, this role will restore all types of data that supported by the specified MAS application. The data types supported by each MAS applications:

MAS App Name MAS App ID Data types
Manage manage namespace, pv
IoT iot namespace
Monitor monitor namespace
Health health namespace, wsl
Optimizer optimizer namespace
Visual Inspection visualinspection namespace, pv

Role Variables - Manage¤

masbr_manage_pvc_paths¤

Set the Manage PVC paths to use in backup and restore. The PVC path is in the format of <pvcName>:<mountPath>/<subPath>. Multiple PVC paths are separated by commas (e.g. manage-doclinks1-pvc:/mnt/doclinks1/attachments,manage-doclinks2-pvc:/mnt/doclinks2).

The <pvcName> and <mountPath> are defined in the ManageWorkspace CRD instance spec.settings.deployment.persistentVolumes:

persistentVolumes:
  - accessModes:
      - ReadWriteMany
    mountPath: /mnt/doclinks1
    pvcName: manage-doclinks1-pvc
    size: '20'
    storageClassName: ocs-storagecluster-cephfs
    volumeName: ''
  - accessModes:
      - ReadWriteMany
    mountPath: /mnt/doclinks2
    pvcName: manage-doclinks2-pvc
    size: '20'
    storageClassName: ocs-storagecluster-cephfs
    volumeName: ''

If not set a value for this variable, this role will not backup and restore persistent valumne data for Manage.

Example Playbook¤

Backup¤

Backup Manage attachments, note that this does not include backup of any data in Db2, see the backup action in the db2 role.

- hosts: localhost
  any_errors_fatal: true
  vars:
    masbr_action: backup
    mas_instance_id: main
    mas_workspace_id: ws1
    mas_app_id: manage
    masbr_backup_data: pv
    masbr_manage_pvc_paths: "manage-doclinks1-pvc:/mnt/doclinks1"
    masbr_storage_local_folder: /tmp/masbr
  roles:
    - ibm.mas_devops.suite_app_backup_restore

Restore¤

Restore Manage attachments, note that this does not include restore of any data in Db2, see the restore action in the db2 role.

- hosts: localhost
  any_errors_fatal: true
  vars:
    masbr_action: restore
    masbr_restore_from_version: 20240621021316
    mas_instance_id: main
    mas_workspace_id: ws1
    mas_app_id: manage
    masbr_backup_data: pv
    masbr_manage_pvc_paths: "manage-doclinks1-pvc:/mnt/doclinks1"
    masbr_storage_local_folder: /tmp/masbr
  roles:
    - ibm.mas_devops.suite_app_backup_restore

License¤

EPL-2.0