Creating a Cloud Backup (CLI)

After defining cloud targets, you can create a cloud backup of a share's (filesystem's or LUN's) full or incremental snapshot to a cloud target(s). Depending on how an incremental cloud backup is created, the parent snapshot must be available on both the local system and backed up to the same cloud target, or the parent snapshot does not also have to be available on the same cloud target. An incremental snapshot backup only backs up the difference between the previous snapshot and the current snapshot. Also, snapshot retention holds are preserved when moving the snapshot to another system via cloud snapshot backup.

Creating a cloud backup creates a cloud job with an operation of backup. Snapshots on different systems can have the same name, such as snap2, because snapshots are assigned a unique identification for each system.

There are two formats for cloud backups: "zfs" and "tar". The same snapshot on the same system can be used in two cloud backups: one with the zfs format, and one with the tar format. The formats support the features shown in the following table.

Feature ZFS Format Tar Format

Restore on only Oracle ZFS Storage Appliance or an Oracle Solaris server

Restore on any system regardless of operating system

Supports both filesystem and LUN snapshots

Supports filesystem snapshots only

Preserves filesystem properties

Preserves LUN properties

Supports full and incremental backups

Supported within the same Oracle Cloud Infrastructure bucket

High-efficiency compression:

  • If the underlying share is compressed, less data is transferred and, therefore, the backup is faster.

  • Incremental backups are performed at the block level.

Mid-efficiency compression:

  • Files are read and compressed during the backup operation.

  • Incremental backups are performed at the file level. Especially not efficient if a large file is modified because the full file will be part of the incremental backup.

Note:

After a local snapshot is in a cloud backup in your Oracle Cloud Infrastructure account, you can delete it locally, per your policies. However, retain local snapshots that could be parent snapshots for future incremental snapshots.

Filesystem snapshots that contain files created with the file retention feature (not the snapshot retention feature) are subject to the rules governing file retention. For information, see Planning Guidelines for File Retention.

Before You Begin

(Optional) To determine if a cloud backup of a snapshot is incremental and to view its parents, navigate to the snapshot (steps 1 through 7), enter the targets node, list and select the target, and list the target's properties. The parents property is populated if the cloud backup has parents, as shown in the following example.

hostname:shares default/fs-1@snap3> targets
hostname:shares default/fs-1@snap3 targets> select target-000
hostname:shares default/fs-1@snap3 target-000> ls
Properties:
           name = oci-phoenix
             id = a9aea6e0-55b8-4cd5-bdf0-ba0637be44b2
         format = zfs
        parents = snap1,snap2
  1. Ensure the cloud target(s) is online.
    1. Go to configuration services cloud targets.
    2. Enter ls to list the cloud targets, and select the appropriate target.
    3. Enter ls and ensure that the state property is online. If it is offline, but the cloud data service is online, verify that the cloud target properties are valid. See Defining a Cloud Target (CLI).
  2. Enter top to return to the root context.
  3. Go to shares and enter ls to list the projects.
  4. Select the project with the share snapshot to be backed up, and enter ls to list its properties and shares.
    hostname:shares> select default
    hostname:shares default> ls
  5. Select the share with the snapshot to be backed up.
    hostname:shares default> select fs-1
  6. Go to snapshots and enter ls to list the snapshots.
    hostname:shares default/fs-1> snapshots
    hostname:shares default/fs-1 snapshots> ls
  7. Select the snapshot for cloud backup.
    hostname:shares default/fs-1 snapshots> select snap2
    hostname:shares default/fs-1@snap2>
  8. Go to backups.
    hostname:shares default/fs-1@snap2> backups
    hostname:shares default/fs-1@snap2 backups>
  9. Enter create.
    hostname:shares default/fs-1@snap2 backups> create
    hostname:shares default/fs-1@snap2 backup-001 (uncommitted)>
  10. Set the target to an existing cloud target name.

    If the cloud target name has a space(s) in it, use command select name="target name".

    Tip: Use tab completion for the cloud target name.

    hostname:shares default/fs-1@snap2 backup-001 (uncommitted)> set target=oci-phoenix
       target = oci-phoenix
    hostname:shares default/fs-1@snap2 backup-001 (uncommitted)>
  11. To specify the tar format, set format to tar. Otherwise, the default zfs format is used.
    hostname:shares default/fs-1@snap2 backup-001 (uncommitted)> set format=tar
       format = tar
    hostname:shares default/fs-1@snap2 backup-001 (uncommitted)>
  12. To set the current snapshot as an incremental snapshot, set incremental to true, and set the parent snapshot by name.

    Depending on how the require_parent_exists property is set as described next, the parent snapshot must be available on both the local system and backed up to the same cloud target, or the parent snapshot does not also have to be available on the same cloud target. The parent snapshot must also be in the same format as the incremental snapshot: zfs or tar.

    Tip: Use tab completion for a list of parent snapshot names on both the local system and on the cloud target.

    hostname:shares default/fs-1@snap2 backup-001 (uncommitted)> set incremental=true
       incremental = true
    hostname:shares default/fs-1@snap2 backup-001 (uncommitted)> set parent=snap0
       parent = snap0
    hostname:shares default/fs-1@snap2 backup-001 (uncommitted)>
  13. For an incremental snapshot and to require that it must have a parent snapshot on the same cloud target, set require_parent_exists to true. For a parent snapshot and to require that you cannot later delete the cloud backup with the parent snapshot if it has cloud backed-up incremental snapshots (children), set require_parent_exists to true.

    For both parent and incremental snapshots, this property can affect cloud backup restore and delete operations, as described in the following table.

    Snapshot Type Property True? Restore Effect Delete Effect

    Parent

    Yes

    No effect.

    Cannot delete cloud backup with parent snapshot if cloud backed-up incremental snapshots exist.

    Parent

    No

    No effect.

    Can delete cloud backup with parent snapshot if cloud backed-up incremental snapshots exist, which would save space on the cloud target.

    Incremental

    Yes

    Parent snapshot must exist on the same cloud target, as well as on the local system.

    No effect.

    Incremental

    No

    Parent snapshot must exist on the local system. This allows you to create a cloud backup of an incremental snapshot without its parent snapshot on the same cloud target.

    No effect.

  14. Enter commit.

    To send the cloud backup to a different cloud target, repeat steps 9 through 14 to create a new cloud backup job with a different cloud target.

    hostname:shares default/fs-1@snap2 backup-001 (uncommitted)> commit
    hostname:shares default/fs-1@snap2 backups>
  15. To monitor progress as data is being backed up, enter top and go to configuration services cloud jobs.
    hostname:configuration services cloud backups> top
    hostname:> configuration services cloud jobs
  16. Enter ls to view the cloud jobs.

    The Jobs list contains active and recently completed jobs in the cloud data service and is in chronological order. Up to one hundred cloud jobs are displayed. Use the next command to list the next 100 jobs, and use the previous command to list the previous 100 jobs.

    hostname:configuration services cloud jobs> ls
    Jobs:
    JOB      OPERATION  CREATED
    job-000  backup     2019-8-03 15:05:53
  17. Find and select the cloud job by its number, and enter ls to view its details.

    After the job has completed, the backup data will be available to other Oracle ZFS Storage Appliance systems configured with the same cloud target. If the tar format was selected, the cloud backup can be restored on any system, regardless of its operating system, that can access the cloud target.

    The dataset path in the details property reflects the cloud backup format:

    • ZFS format: zfs/backups/zfs

    • Tar format: zfs/backups/tar

    If the write_limit property was set for the cloud target, the write traffic bandwidth is limited to the set value when uploading the cloud backup to the cloud target.

    hostname:configuration services cloud jobs> select job-000
    hostname:configuration services cloud job-000> ls
    Properties:
                        op = backup
                    target = e641f83d-4628-42ba-8757-d66c4c98c0d9
                targetName = oci-phoenix
                   created = 2020-10-22 22:23:40
                   updated = 2020-10-22 22:27:33
                        id = 3babb944-07f6-4b69-8de1-f6dcfeab5fb2
                    status = in-progress
                    format = zfs
                      rate = 6MB/s
               transferred = 1.46G
            estimated_size = 40.1G
                   dataset = p1/local/default/f-1
                    backup = 3e035b7e546e0d02/1cbfdb5ff2259b76
                  snapshot = snap9
                   details = uploading backup to zfs/backups/zfs
                             3e035b7e546e0d02/1cbfdb5ff2259b76/000000001