Periodic OpenStack database backups¶
MOSK enables you to configure the periodic backup of the
OpenStack database through the OpenStackDeployment
object. To enable the
backup, use the following structure:
spec:
features:
database:
backup:
enabled: true
MOSK uses the Mariabackup utility to back up the MariaDB Galera cluster data where the OpenStack data is stored. The Mariabackup gets launched on a periodic basis as a part of the Kubernetes cron job included in any MOSK deployment and is suspended by default.
By default, the backup job has the following configuration:
Runs on a daily basis at 01:00 AM
Creates incremental backups daily and full backups weekly
Keeps 10 latest full backups
Saves backups to the
mariadb-phy-backup-data
PVCThe backup timeout is
3600
secondsThe backup type is
incremental
To override the default configuration, set the parameters and environment variables that are passed to the cron as described in the tables below.
Parameter |
Type |
Default |
Description |
---|---|---|---|
|
String |
|
Type of a backup. The list of possible values include:
Usage example: spec:
features:
database:
backup:
backup_type: incremental
|
|
Integer |
|
Timeout in seconds for the system to wait for the backup operation to succeed. Usage example: spec:
services:
database:
mariadb:
values:
conf:
phy_backup:
backup_timeout: 30000
|
|
Boolean |
|
Not recommended, removed since MOSK 22.4. If set to
Usage example: spec:
services:
database:
mariadb:
values:
conf:
phy_backup:
allow_unsafe_backup: true
|
Variable |
Type |
Default |
Description |
---|---|---|---|
|
Integer |
|
Number of full backups to keep. Usage example: spec:
features:
database:
backup:
backups_to_keep: 3
|
|
String |
|
Persistent volume claim used to store backups. Usage example: spec:
services:
database:
mariadb:
values:
conf:
phy_backup:
backup_pvc_name: mariadb-phy-backup-data
|
|
Integer |
|
Number of seconds that defines a period between 2 full backups.
During this period, incremental backups are performed. The parameter
is taken into account only if Usage example: spec:
features:
database:
backup:
full_backup_cycle: 70000
|
|
Floating |
|
Multiplier for the database size to predict the space required to create a backup, either full or incremental, and perform a restoration keeping the uncompressed backup files on the same file system as the compressed ones. To estimate the size of The Usage example: spec:
services:
database:
mariadb:
values:
conf:
phy_backup:
backup_required_space_ratio: 1.4
|
For example, to perform full backups monthly and incremental backups
daily at 02:30 AM and keep the backups for the last six months,
configure the database backup in your OpenStackDeployment
object
as follows:
spec:
features:
database:
backup:
enabled: true
backups_to_keep: 6
schedule_time: '30 2 * * *'
full_backup_cycle: 2628000