Enable OpenStack database remote backups

TechPreview

By default, MOSK stores the OpenStack database backups locally in the Mirantis Ceph cluster, which is a part of the same cloud.

Alternatively, MOSK enables you to save the backup data to an external storage. This section contains the details on how you, as a cloud operator, can configure a remote storage back end for OpenStack database backups.

In general, the built-in automated backup mechanism saves the data to the mariadb-phy-backup-data PersistentVolumeClaim (PVC), which is provisioned from StorageClass specified in the spec.persistent_volume_storage_class parameter of the OpenstackDeployment custom resource (CR).

Configure a remote NFS storage for OpenStack backups

  1. If your MOSK cluster was originally deployed with the default backup storage, proceed with this step. Otherwise, skip it.

    1. Copy the already existing backup data to a storage different from the mariadb-phy-backup-data PVC.

    2. Remove the mariadb-phy-backup-data PVC manually:

      kubectl -n openstack delete pvc mariadb-phy-backup-data
      
  2. Enable the NFS back end in the OpenStackDeployment object by editing the backup section of the OpenStackDeployment CR as follows:

    spec:
      features:
        database:
          backup:
            enabled: true
            backend: pv_nfs
            pv_nfs:
              server: <ip-address/dns-name-of-the-server>
              path: <path-to-the-share-folder-on-the-server>
    
  3. Optional. Set the required mount options for the NFS mount command. You can set as many options of mount as you need. For example:

    spec:
      services:
        database:
          mariadb:
            values:
              volume:
                phy_backup:
                  nfs:
                    mountOptions:
                      - "nfsvers=4"
                      - "hard"
    
  4. Verify the mariadb-phy-backup-data PVC and NFS persistent volume (PV):

    kubectl -n openstack get pvc mariadb-phy-backup-data -o wide
    
    kubectl -n openstack get pv mariadb-phy-backup-data-nfs-pv -o yaml
    

    An example of a positive system response:

    NAME                      STATUS   VOLUME                           CAPACITY   ACCESS MODES   STORAGECLASS   AGE     VOLUMEMODE
    mariadb-phy-backup-data   Bound    mariadb-phy-backup-data-nfs-pv   20Gi       RWO                           5m40s   Filesystem
    
    apiVersion: v1
    kind: PersistentVolume
    metadata:
      annotations:
        meta.helm.sh/release-name: openstack-mariadb
        meta.helm.sh/release-namespace: openstack
      <<<skipped>>>>
      name: mariadb-phy-backup-data-nfs-pv
      resourceVersion: "2279204"
      uid: 60db9f89-afc4-417b-bf44-8acab844f17e
    spec:
      accessModes:
      - ReadWriteOnce
      capacity:
        storage: 20Gi
      claimRef:
        apiVersion: v1
        kind: PersistentVolumeClaim
        name: mariadb-phy-backup-data
        namespace: openstack
        resourceVersion: "2279201"
        uid: e0e08d73-e56f-425a-ad4e-e5393aa3cdc1
      mountOptions:
      - nfsvers=4
      - hard
      nfs:
        path: /
        server: 10.10.0.116
      persistentVolumeReclaimPolicy: Retain
      volumeMode: Filesystem
    status:
      phase: Bound
    

Switch back to the local storage for OpenStack backups

  1. Remove NFS PVC and PV:

    kubectl -n openstack delete pvc mariadb-phy-backup-data
    
    kubectl -n openstack delete pv mariadb-phy-backup-data-nfs-pv
    
  2. Re-enable the local backup in the OpenStackDeployment CR:

    spec:
      features:
        database:
          backup:
            enabled: true
            backend: pvc
    
  3. Verify that the mariadb-phy-backup-data PVC uses the default PV:

    kubectl -n openstack get pvc mariadb-phy-backup-data
    

    An example of a positive system response:

    NAME                      STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS              AGE
    mariadb-phy-backup-data   Bound    pvc-a4f6e24b-c05b-4a76-bca2-bb6a5c8ef5b5   20Gi       RWO            mirablock-k8s-block-hdd   80m