Backing Up and Restoring the Manager

For this example scenario, you backup and restore the Oracle Linux Virtualization Manager by using the engine-backup command utility.

Backing Up the Manager

To backup the Manager:

  1. Log in to the host that is running the Manager.

  2. Create a full backup of the Manager.

    # engine-backup --mode=backup --scope=all --file=path --log=path

    The following example shows how to use the engine-backup command to create a full backup of the Manager. A backup file and log file for the Manager backup is created in the path specified.

    # engine-backup --mode=backup --scope=all --file=backup/file/ovirt-engine-backup --log=backup/log/ovirt-engine-backup.log
    Backing up:
    Notifying engine
    - Files
    - Engine database 'engine'
    - DWH database 'ovirt_engine_history'
    Packing into file 'backup/file/ovirt-engine-backup'
    Notifying engine
    Done.
    
  3. (Optional) Set up a cron job to take regular backups.

    By default, the Manager does not take automatic backups. Oracle recommends that you take you regular backups of the Manager.

    The following example shows a sample cron job defined in a crontab-format file.

    today=`date +'%Y%m%d-%H%M'`
    engine-backup --mode=backup --scope=all --file=/backup/file/ovirt-engine-backup-${today} 
    --log=/backup/log/ovirt-engine-backup-${today}.log

Restoring a Full Backup of the Manager

To restore a full backup of the Manager:

  1. Log in to the host that is running the Manager.

  2. Clean up the objects associated with the Manager.

    # engine-cleanup

    This engine-cleanup command removes the configuration files and cleans the database associated with the Manager.

    The following example shows output from the engine-cleanup command.

    # engine-cleanup
    [ INFO  ] Stage: Initializing
    [ INFO  ] Stage: Environment setup
              Configuration files: ...
              Log file: ...
              Version: otopi-1.7.8 (otopi-1.7.8-1.el7)
    [ INFO  ] Stage: Environment packages setup
    [ INFO  ] Stage: Programs detection
    [ INFO  ] Stage: Environment customization
              Do you want to remove all components? (Yes, No) [Yes]: Yes
              The following files were changed since setup:
              /etc/ovirt-engine/engine.conf.d/11-setup-sso.conf
              Remove them anyway? (Yes, No) [Yes]: Yes
    
              --== PRODUCT OPTIONS ==--
    
    [ INFO  ] Stage: Setup validation
              During execution engine service will be stopped (OK, Cancel) [OK]: OK
              All the installed ovirt components are about to be removed ...(OK, Cancel) 
              [Cancel]: OK
    [ INFO  ] Stage: Transaction setup
    [ INFO  ] Stopping engine service
    [ INFO  ] Stopping ovirt-fence-kdump-listener service
    [ INFO  ] Stopping dwh service
    [ INFO  ] Stopping Image I/O Proxy service
    [ INFO  ] Stopping vmconsole-proxy service
    [ INFO  ] Stopping websocket-proxy service
    [ INFO  ] Stage: Misc configuration
    [ INFO  ] Stage: Package installation
    [ INFO  ] Stage: Misc configuration
    [ INFO  ] Backing up PKI configuration and keys
    ...
    [ INFO  ] Clearing Engine database engine
    ...
    [ INFO  ] Clearing DWH database ovirt_engine_history
    [ INFO  ] Removing files
    [ INFO  ] Reverting changes to files
    ...
    [ INFO  ] Stage: Transaction commit
    [ INFO  ] Stage: Closing up
    
              --== SUMMARY ==--
    
              Engine setup successfully cleaned up
              A backup of PKI configuration and keys is available at ...
              ovirt-engine has been removed
              A backup of the Engine database is available at ...
              A backup of the DWH database is available at ...
    
              --== END OF SUMMARY ==--
    
    [ INFO  ] Stage: Clean up
              Log file is located at ...
    [ INFO  ] Generating answer file ...
    [ INFO  ] Stage: Pre-termination
    [ INFO  ] Stage: Termination
    [ INFO  ] Execution of cleanup completed successfully
    
  3. Restore a full backup of the Manager.

    The following form of the engine-backup command is used to a restore a full backup of the Manager.

    engine-backup --mode=restore --scope=all --file=path --log=path --restore-permissions

    The following example shows how to use the engine-backup command to restore a full backup of the Manager.

    # engine-backup --mode=restore --scope=all --file=backup/file/ovirt-engine-backup --log=backup/log/ovirt-engine-backup.log --restore-permissions
    Preparing to restore:
    - Unpacking file 'backup/file/ovirt-engine-backup'
    Restoring:
    - Files
    - Engine database 'engine'
      - Cleaning up temporary tables in engine database 'engine'
      - Updating DbJustRestored VdcOption in engine database
      - Resetting DwhCurrentlyRunning in dwh_history_timekeeping in engine database
      - Resetting HA VM status
    ------------------------------------------------------------------------------
    Please note:
    
    The engine database was backed up at 2019-03-25 12:48:02.000000000 -0700 .
    
    Objects that were added, removed or changed after this date, such as virtual
    machines, disks, etc., are missing in the engine, and will probably require
    recovery or recreation.
    ------------------------------------------------------------------------------
    - DWH database 'ovirt_engine_history'
    You should now run engine-setup.
    Done.
  4. Run the engine-setup command to complete the setup of the restored Manager.

    # engine-setup

    This command reconfigures the firewall and ensures that the Manager service is correctly configured.

  5. Log in to the Manager and verify that the Manager has been restored to the backup.