<a id="ngos-replication"></a>

# Replication

Version: 25.07

Scope: Object Storage Administrator Account Administrator

Zadara Object Storage supports replication at container level.

Object replication is the automatic duplication and ongoing synchronization
of objects from a container in a source Object Storage to a target
container in a remote Object Storage instance, or even to a target
container in the same Object Storage instance as the source.

Container replication can be used to support disaster recovery,
minimizing latency for users in different geographical locations,
data sharing between environments, and consistency across distributed
systems.

Key reasons for replication include:

* **Data Protection and Disaster Recovery**:

  Replication creates synchronized copies of containers across different
  systems or locations, safeguarding against data loss due to hardware
  failures, accidental deletions, or disasters.
* **High Availability**:

  By maintaining redundant copies, replication can ensure continuous
  access to data, even if one system or location becomes unavailable.
* **Operational Flexibility**:

  Replication allows for managing multiple copies of data, enabling
  features like cross-region data migration, load balancing, and
  offloading read operations to replicas.

## Container Replication Service

By default, the Container Replication Service is disabled for an
Object Storage instance.

The Container Replication Service for an Object Storage instance
must be enabled in order to configure Replication Jobs for the instance’s
containers. Enabling the Container Replication Service creates a Replicator
Virtual Controller that can take several minutes to complete.

The Container Replication Service can be enabled in either of the
following portals:

* **Provisioning Portal**
* **Command Center**

## Asynchronous Container Replication Scheduler

The Asynchronous Container Replication Scheduler (ACRS) is the service
responsible for collecting the objects for replication, and scheduling the
replication activity in a replication queue.
Rate-limiting is enforced based on the number of replicator VCs, to prevent
overloading the system.

The ACRS operates in two modes:

* **Batch mode**

  Processes replication in related groups of objects or operations.
  A container can accumulate a backlog of changes to its objects before
  the updates are queued in batches for replication.
* **Live (sync) mode**

  Proccesses replication in real-time response to changes at the source.
  On changes to source objects, updates are queued immediately for
  replication.

The system splits batch and live replication queues to manage workloads
separately.

## Prerequisites for replication

Object Storage container replication involves determining and configuring
properties of the destination (Replication Target) and the process
(Replication Job) that automatically duplicates source objects to the
target and syncs them when the source changes.

* Both the source and target containers must be on a Zadara Object Storage
  version that supports replication, Version: 25.07
  and later.
* Container replication must be enabled on the source Object Storage.
* The supported network topology, comprising Frontend and Outnet.
* It is highly recommended to [Enable Versioning](ngos-console.md#ngos-container-enable-versioning) on
  both the source and target containers.

## Replication configuration flow

The configuration process for setting up replication of a source container
to a destination container:

1. [Enable the Container Replication Service for an Object Storage](#enable-object-storage-replication), if not already enabled.
2. [Enable Versioning](ngos-console.md#ngos-container-enable-versioning) on both the source and target
   containers, if not already configured.
3. [Register a Replication Target](#register-replication-target).
4. [Create a Replication Job](#create-replication-job).

## Enable or Disable the Container Replication Service

<a id="enable-object-storage-replication"></a>

### Enable the Container Replication Service for an Object Storage

Scope: Object Storage Administrator

By default, the Container Replication Service is disabled for an
Object Storage instance.

Enabling the Container Replication Service for an Object Storage instance
is a prerequisite for configuring Replication Jobs for containers in the
Object Storage instance.

Enabling the Container Replication Service creates a Replicator Virtual
Controller that can take several minutes to complete.

The Container Replication Service can be enabled in either of the
following portals:

* **Provisioning Portal**:
  1. In the Provisioning Portal’s **Service Inventory** tab, locate and
     select the Object Storage instance.
  2. On the Object Storage instance’s entry, click **Actions**.
  3. From the dropdown, select **Enable Container Replication Service**.
  4. In the **Enable Container Replication Service** dialog, confirm the
     operation.

     In the **Service Inventory** tab, the Object Storage instance’s
     **Status** value changes to **Reconfiguring**, and then to
     **Created** when complete.
* **Command Center**:

  See [Enabling Container Replication Service](https://guides.zadarastorage.com/admin-guide/latest/object-storage-vpsas.html#enabling-container-replication-service)
  in the Command Center Administration Guide.

<a id="disable-replication-service"></a>

### Disable the Container Replication Service for an Object Storage

Scope: Object Storage Administrator

Disabling the Container Replication Service for an Object Storage can be
configured only in the Command Center.

See [Disabling Container Replication Service](http://guides.zadarastorage.com/admin-guide/latest/object-storage-vpsas.html#disabling-container-replication-service)
in the Command Center Administration Guide.

## Replication Targets

<a id="register-replication-target"></a>

### Register a Replication Target

Scope: Account Administrator

A Replication Target is the destination Object Storage that hosts
synchronized replicas of one or more containers in the source Object
Storage.

Registering a Replication Target specifies the properties for connecting
the source Object Storage to the destination Object Storage.

A Replication Target Object Storage contains the destination container that
A Replication Target Object Storage contains the destination container that
is a replica of either:

* An entire source container.
* Selected objects of a source container with filenames containing a
  prefix that matches a specified string.

Every Replication Job is associated with a Replication Target, for the
purpose of using the connection details to the destination Object Storage
for syncing the target container’s replica objects.

Replication can be configured to take place to a target container in a
remote Object Storage instance, or to a target container in the same Object
Storage instance as the source container.

To register a Replication Target:

1. In the **target** Object Storage, click the username at the top right
   to view and copy the parameter values required for Replication Job
   connectivity:
   * **Authentication** section:
     * **Region**
     * **S3 Access Key**
     * **S3 Secret Key**
   * Depending on the network connection, select the endpoint:
     * For Public Network connection:

       From the **Connectivity - Public Network** section,
       copy the **Public API Endpoint**.
     * For Frontend Network connection:

       From the **Connectivity - Front End Network** section,
       copy the **API Endpoint**.
2. In the **source** Object Storage left navigation tree menu, select
   **Replication Targets**.
3. In the Replication Targets top menu bar, select **Connect**.

   The **Connect to a new Replication Target** dialog opens.

   Enter the parameters:

   | Parameter           | Value                                                                                                                                                                                        |
   |---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
   | Target Display Name | The display name of the Registered Target for the UI                                                                                                                                         |
   | Target Region       | Copy Target Object Storage **Region**                                                                                                                                                        |
   | Target URL          | * For Public Network connection:<br/><br/>  Copy Target Object Storage **Public API Endpoint**<br/>* For Frontend Network connection:<br/><br/>  Copy Target Object Storage **API Endpoint** |
   | S3 Access Key       | Copy Target user’s **S3 Access Key**                                                                                                                                                         |
   | S3 Secret Key       | Copy Target user’s **S3 Secret Key**                                                                                                                                                         |
   | Connect Via         | Select the network connection:<br/>* Outnet/Public Network<br/>* Frontend Network                                                                                                            |

   Click **Submit**.

   The system takes a few moments to confirm connectivity, and the new
   Replication Target appears in the Replication Targets list.

<a id="list-replication-target-containers"></a>

### List a Replication Target’s containers

Scope: Account Administrator

To view the list of containers in the Replication Target Object Storage:

1. In the Object Storage left navigation tree menu, select
   **Replication Targets**.
2. In the Replication Targets list, locate and select the Replication
   Target.
3. In the Replication Targets top menu bar, select **List Containers**.

   The **List Replication Target Containers** dialog opens, displaying a
   list of the containers in the destination Object Storage.

   Enter a string in the search field to filter the list, limiting the
   display to only those container names that contain the matching string.

<a id="edit-replication-target"></a>

### Edit a Replication Target

Scope: Account Administrator

A registered Replication Target can be updated, permitting edits to some of
its connectivity properties.

All properties except for the Registered Target’s Display Name are derived
from the **target** Object Storage user’s connectivity properties.

1. In the **target** Object Storage, click the username at the top right.

   From the user’s **Authentication** section, copy the connectivity
   parameter values that will be updated in the Replication Target:
   * **Region**
   * **S3 Access Key**
   * **S3 Secret Key**
2. In the **source** Object Storage left navigation tree menu, select
   **Replication Targets**.
3. In the Replication Targets list, locate and select the Replication
   Target to edit.
4. In the Replication Targets top menu bar, select **Edit**.

   The **Edit Replication Target** dialog opens.
   1. Edit the parameters values that must be updated:

      | Parameter                          | Value                                                                             |
      |------------------------------------|-----------------------------------------------------------------------------------|
      | Display Name                       | The display name of the Registered Target for the UI                              |
      | Connect Via                        | Select the network connection:<br/>* Outnet/Public Network<br/>* Frontend Network |
      | Region                             | Copy Target Object Storage **Region**                                             |
      | **Change Endpoint Authentication** | Mark the checkbox to edit the following values:                                   |
      | Access Key ID                      | Copy Target user’s **S3 Access Key**                                              |
      | Secret Access Key                  | Copy Target user’s **S3 Secret Key**                                              |
   2. Click **Submit**.

      The system takes a few moments to confirm connectivity.
   3. In the Replication Targets list, locate and select the edited
      Replication Target.

      The Replication Target’s lower pane **Properties** displays the
      updated property values.

<a id="delete-replication-target"></a>

### Delete a Replication Target

Scope: Account Administrator

A Replication Target that is in use by Replication Jobs cannot be deleted.

To delete a Replication Target:

1. In the Object Storage left navigation tree menu, select
   **Replication Targets**.
2. In the Replication Targets list, locate and select the Replication
   Target to delete.
3. In the Replication Targets top menu bar, select **Delete**.

   In the **Delete Replication Target** dialog that opens, confirm the
   deletion.

   The Replication Target disappears from the Replication Target list.

## Replication Jobs

A Replication Job automatically duplicates source objects to a target,
and syncs them when the source changes.

<a id="create-replication-job"></a>

### Create a Replication Job

Scope: Account Administrator

A Replication Job specifies the Replication Target used for connecting
to the destination Object Storage, the source container and the
target container in the destination Object Storage.

The destination container is a replica of either:

* An entire source container.
* Selected objects of a source container with filenames containing a
  prefix that matches a specified string configured in the Replication Job.

There is an option to create a new target container in the
**Create a New Replication Job** dialog.

If you plan to create a new Replication Job that will replicate to an
existing destination container, [Enable Versioning](ngos-console.md#ngos-container-enable-versioning) on
the existing target container before specifying it in the Replication Job.

To create a Replication Job:

1. In the Object Storage left navigation tree menu, select **Console**.
2. In the **Containers** list, locate and select the **source** container.
3. On the Containers top menu bar, click Replicate
   (cloud icon with an up-arrow).

   The **Create a New Replication Job** dialog opens.
   1. Configure the parameters:

      | Parameter                       | Description                                                                                                                                                                                                                                                                                                 |
      |---------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
      | Display Name                    | The display name of the Replication Job.                                                                                                                                                                                                                                                                    |
      | Propagate Object Deletion       | Mark to delete objects from the target when deleted at source.                                                                                                                                                                                                                                              |
      | Propagate Object Delete Markers | When propagated, the DeleteMarker is replicated to the target.<br/>Deleting an object in a versioned container yields a new 0-byte<br/>version of the same object with a DeleteMarker tombstone.<br/>The DeleteMarker version lists the object as deleted,<br/>however, all previous versions are retained. |
      | Filter                          | * Leave empty to replicate all objects from the source container.<br/>* Enter a prefix to replicate only objects with filenames<br/>  beginning with a matching prefix.                                                                                                                                     |
   2. Click **Next**.

      The dialog transitions to the **Select Replication Target** tab.
   3. From the list, select the Replication Target where the destination
      container resides.
   4. From the **Destination Container** dropdown that lists all the
      containers in the connected user account’s Replication Target
      Object Storage, select the destination container that has been
      previously configured for this job.

      If a destination container for replication was not already created
      in the Replication Target Object Storage, mark the
      **Create Remote Container** checkbox and enter a name for it in
      **Destination Container**.
   5. Click **Next**.

      The confirmation screen displaying the entered details appears,
      with the option to go **Back** to amend items.
   6. Click **Create** to confirm creation of the Replication Job.
4. Verify successful Replication Job creation:
   1. In the Object Storage left navigation tree menu, select
      **Replication Jobs**.

      The new job appears in the list of **Replication Jobs**, and its
      **Status** is **Enabled**.

      Select the new Replication Job to view the job’s **Properties**,
      **Status**, **Metering** and **Errors** in the lower pane’s tabs.
   2. In the Object Storage left navigation tree menu, select
      **Replication Targets**.

      The **Job Count** for the selected **Replication Target** has
      increased by one.
   3. In the Object Storage left navigation tree menu, select
      **Console**.
      1. Select the **source** container.
      2. In the container’s lower pane, the [Replication tab](ngos-console.md#console-container-replication-tab)
         displays the new Replication Job’s details.
   4. In Command Center:
      1. Select **Object Storage** in Command Center’s left menu panel.
      2. In the **Instances** tab, select the Object Storage instance in the
         Object Storages grid.
      3. In the Object Storage instance’s **Logs** tab, the following
         **Info** message indicates successful creation of the
         Replication Job:
         ```console
         Container replication job [Replication Job name] created successfully.
         ```
      4. In the Object Storage’s **Dashboard** tab, on the Object Storage’s
         **Storage Information** panel, the **Replication Jobs** Count
         has increased by one.

<a id="monitor-view-replication-job"></a>

### Monitor or view a Replication Job

Scope: Account Administrator

To monitor a Replication Job or to view its properties:

1. In the Object Storage left navigation tree menu, select
   **Replication Jobs**.

   The list of **Replication Jobs** appears.
2. Select the Replication Job to monitor or view.

<!-- comment

Containers that are marked with the replication decorator (cloud with an
up-arrow) also have a :ref:`console-container-replication-tab` in the
container's lower Details Pane.

.. note::

   Containers in the list that are marked with the replication decorator
   (cloud with an up-arrow) have an associated Replication Job.
   This indicates that this is a **source** container that has an
   associated Replication Job that replicates this container or selected
   objects from it matching a specified prefix, to a destination container
   in an Object Storage specified in a Replication Target.

   There is a limit of one Replication Job per source container.
   Similarly, a target container can be the destination of only one
   Replication Job.

   For more information on Replication, see :ref:`replicate-containers`.

The container's :ref:`console-container-replication-tab` displays the
container's Replication Job properties: -->

#### Properties

The Replication Job **Properties** tab lists the job’s properties’ values:

| Property                        | Description                                                                                                                                                                                                                                                                                                                                   |
|---------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Job Name                        | The display name of the Replication Job.                                                                                                                                                                                                                                                                                                      |
| Status                          | The current status of the job. Possible values:<br/><br/>* **enabled**<br/><br/>  Actively syncing changes from source to target.<br/>* **pausing/paused**<br/><br/>  Administrator suspended replication activity.<br/>* **failed**<br/><br/>  Check the logs for causes such as connectivity issues,<br/>  insufficient capacity at target. |
| Replication Target              | The display name of the Replication Target referenced by this job.                                                                                                                                                                                                                                                                            |
| Destination Container           | The name of the container in the destination Object Storage where<br/>this job creates and syncs the replica and its objects.                                                                                                                                                                                                                 |
| Propagate Object Deletion       | Mark to delete objects from the target when deleted at source.                                                                                                                                                                                                                                                                                |
| Propagate Object Delete Markers | When propagated, the DeleteMarker is replicated to the target.<br/>Deleting an object in a versioned container yields a new 0-byte<br/>version of the same object with a DeleteMarker tombstone.<br/>The DeleteMarker version lists the object as deleted,<br/>however, all previous versions are retained.                                   |
| Destination Account ID          | The UUID of the destination Object Storage account.                                                                                                                                                                                                                                                                                           |
| Destination Account             | The name of the destination Object Storage account.                                                                                                                                                                                                                                                                                           |
| Filter                          | * Leave empty to replicate all objects from the source container.<br/>* Enter a prefix to replicate only objects with filenames<br/>  beginning with a matching prefix.                                                                                                                                                                       |

#### Status

The Replication Job **Status** tab displays information about the job and
its most recent updates.

The Replication Job **Status** tab’s information is organized into the
following columns:

* **General**
* **Source Container**
* **Destination Container**
* **Replication Job Statistics**

| Parameter                      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|--------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **General**                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Remote target name             | The Replication Target referenced by this job.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Last full sync time            | Timestamp indicating the point in time up to which replication<br/>is confirmed to have caught up.<br/><br/>During Continuous Sync while objects are being replicated,<br/>the value reflects the creation time of the most recently<br/>replicated object.<br/><br/>When the system is fully synchronized, the value is periodically<br/>updated (every 10 minutes) to confirm that the target remains<br/>fully in sync with the source.<br/><br/>During the initial full synchronization, or before the first<br/>object is replicated, the value may appear as **0**.                                                                              |
| Last Replication time          | Timestamp indicating when the most recent replication operation<br/>completed.<br/><br/>This value represents the completion time of the most recently<br/>processed replication event.<br/><br/>Unlike **Last full sync time**, which indicates how current the<br/>replicated data is, this value indicates when the system last<br/>performed replication work.                                                                                                                                                                                                                                                                                     |
| Replication lag                | Status of the most recent replication process, indicating whether<br/>it is up to date, or how far the replication process is behind the<br/>source data.<br/><br/>The status value is derived from the difference between the<br/>current time and the creation time of the most recently replicated<br/>object.<br/><br/>Possible values include:<br/><br/>* **N/A In Full-Sync Mode** — the system is performing the<br/>  initial full synchronization.<br/>* **Sync Completed** — replication is fully up to date.<br/>* A time duration such as `X days, Y hrs, Z mins` indicating<br/>  the delay between source changes and their replication. |
| **Source Container**           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Total objects                  | The total number of objects in the source container.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Versioned objects              | The number of versioned objects in the source container.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Total capacity                 | The capacity used by all versions of all objects in the source<br/>container.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **Destination Container**      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Total objects                  | The total number of objects replicated in the destination<br/>container.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Versioned objects              | The number of versioned objects in the destination container.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Total capacity                 | The capacity used by all the versions of all objects that were<br/>replicated to the destination container.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Replication Job Statistics** |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Objects replicated             | Total number of objects successfully replicated to the target as<br/>PUT operations.<br/><br/>This counter reflects successful operations rather than the number<br/>of unique objects. This is based on approximations extracted from<br/>statistics.<br/><br/>For example, if replication for one object fails and is retried<br/>times, and then succeeds **N** times across those retries, the<br/>counter increases by **N** for that single object.                                                                                                                                                                                              |
| Total capacity transferred     | Total size of objects successfully transferred to the<br/>destination container in all PUT operations.<br/><br/>If replication retries occur, the same object data may be<br/>counted more than once.                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Objects deleted                | Total number of objects successfully replicated to the target as<br/>DELETE operations.<br/><br/>This counter reflects successful operations rather than the number<br/>of unique objects. This is based on approximations extracted from<br/>statistics.<br/><br/>For example, if replication for one object fails and is retried<br/>times, and then succeeds **N** times across those retries, the<br/>counter increases by **N** for that single object.                                                                                                                                                                                           |
| Failed objects                 | Number of objects that failed replication after retry attempts.<br/><br/>The system retries replication for a defined period.<br/>If the retries continue to fail, the object is marked as<br/>**failed** and is no longer retried automatically.<br/><br/>Failed objects may require manual intervention or<br/>investigation.                                                                                                                                                                                                                                                                                                                        |

#### Metering

The Replication Job **Metering** tab displays monitoring charts that track
successful replication PUT and GET operations over a configurable time
scale:

* Operations per second (OP/s)
* Bandwidth
* Latency in milliseconds

The PUT and GET operations are depicted according to a color-coded legend.

The time scale can be configured to display metering data for every:

* **10 seconds**: measured at every ten second interval in the past 5
  minutes.
* **1 minute**: measured at every one minute interval in the past 30
  minutes.
* **10 minutes**: measured at every ten minutes interval in the past 5
  hours.
* **1 hour**: measured at every one hour interval for the past 36 hours.
* **1 day**: measured at a daily interval for the past 30 days.
* **1 week**: measured at a weekly interval since the beginning of the
  calendar year (1st January).
* **Auto**: toggle switches between static metering display at the moment
  selected, or a continuous live update display.

The **expanded/contraction** toggle switches between the default 3 charts
side-by-side contraction view and the expanded view of a single chart
filling the screen width.

At the top of the expanded view there are buttons to select each of the 3
monitoring charts.

#### Errors

The Replication Job **Errors** tab displays a monitoring chart that tracks
replication PUT and DELETE operations that returned 400, 403, 404, 500 and
503 status errors over a configurable time scale.

The Y-axis on the Errors chart measures IOPs Errors.

The X-axis on the Errors chart depicts the time scale, which can be
configured to display error counts per status, measured at 10 minute,
1 hour, 1 day and 1 week intervals.

<a id="pause-resume-replication-job"></a>

### Pause or Resume a Replication Job

Scope: Account Administrator

Replication Jobs can be paused and resumed manually, according to system
needs and considerations.

To pause or resume a Replication Job:

1. In the Object Storage left navigation tree menu, select
   **Replication Jobs**.

   The list of **Replication Jobs** appears.
2. Select the Replication Job to pause or resume.

   The **Status** in the Replication Job’s lower pane **Properties** tab
   indicates whether the Replication Job is **paused** or **enabled**.
3. Click the **Pause/Start** toggle in the Replication Job top menu to
   pause or resume the job’s replication activity.

   In the dialog that opens, confirm the pause or start selection.

   The **Pause/Start** toggle in the Replication Job top menu switches,
   as does the **paused/enabled** value in the **Status** entry in the
   Replication Job’s lower pane **Properties** tab.

<a id="edit-replication-job"></a>

### Edit a Replication Job

Scope: Account Administrator

Enabling or disabling object propagation deletion properties are the only
editable Replication Job properties.

To edit a Replication Job:

1. In the Object Storage left navigation tree menu, select
   **Replication Jobs**.

   The list of **Replication Jobs** appears.
2. Select the Replication Job to edit.
3. Click **Edit** in the Replication Job top menu.
   1. In the dialog that opens, you can activate or deactivate the
      object propagation properties by marking or unmarking their checkboxes.

      | Parameter                       | Description                                                                                                                                                                                                                                                                                                 |
      |---------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
      | Propagate Object Deletion       | Mark to delete objects from the target when deleted at source.                                                                                                                                                                                                                                              |
      | Propagate Object Delete Markers | When propagated, the DeleteMarker is replicated to the target.<br/>Deleting an object in a versioned container yields a new 0-byte<br/>version of the same object with a DeleteMarker tombstone.<br/>The DeleteMarker version lists the object as deleted,<br/>however, all previous versions are retained. |
   2. Click **Update** to confirm the changes.

      The Propagate Object Deletion and Propagate Object Delete Markers
      entry values in the Replication Job’s lower pane **Properties** tab
      indicate the latest updates to the Replication Job’s settings.

<a id="delete-replication-job"></a>

### Delete a Replication Job

Scope: Account Administrator

Deleting a container’s Replication Job can take some time to complete.
Since there is a limit of one Replication Job per source or target container,
it is not possible to create a new Replication Job for the same container
while the deletion process is running.

To delete a Replication Job:

1. In the Object Storage left navigation tree menu, select
   **Replication Jobs**.

   The list of **Replication Jobs** appears.
2. Select the Replication Job to delete.
3. Click **Delete** in the Replication Job top menu.

   In the dialog that opens, confirm the delete action.

   The Replication Job’s **Status** changes to **deleting**  while the
   during the deletion process.
   When the deletion completes, its **Status** changes to **deleted**, and
   the job disappears from the Replication Jobs list.

## Source containers for replication

Source containers for replication are easily identified in an Object
Storage’s Container’s list:

In the navigation tree, select **Resources > Console**. The Console screen
appears, with the Containers pane displaying the listing of containers.

Containers that are marked with the replication decorator (cloud with an
up-arrow) have an associated Replication Job, and also have a
[Replication tab](ngos-console.md#console-container-replication-tab) in the container’s lower
Details Pane.

## CLI examples in the Container Replication Lifecycle

Scope: Account Administrator

This section provides a series of REST API CLI examples in
a Container’s Replication lifecycle.

* [Register a Replication Target (CLI)](#rest-create-replication-target) and
  [Verify Replication Target Registration (CLI)](#rest-verify-replication-target-registration)
* [List Containers in a Replication Target (CLI)](#rest-list-target-containers)
* [Create a Replication Job (CLI)](#rest-create-replication-job) and
  [Verify Replication Job Creation (CLI)](#rest-verify-replication-job-creation)
* [View or Monitor a Replication Job (CLI)](#rest-view-replication-job)
* [Pause a Replication Job (CLI)](#rest-pause-replication-job) and
  [Verify Paused Replication Job (CLI)](#rest-verify-paused-replication-job)
* [Resume a Paused Replication Job (CLI)](#rest-resume-replication-job) and
  [Verify Resumed Replication Job (CLI)](#rest-verify-resumed-replication-job)
* [Delete a Replication Job (CLI)](#rest-delete-replication-job) and
  [Verify Deletion of Replication Job (CLI)](#rest-verify-deletion-replication-job)
* [Delete a Replication Target (CLI)](#rest-delete-replication-target) and
  [Verify Deletion of Replication Target (CLI)](#rest-verify-deletion-replication-target)

### Prerequisites

Before running any operation, collect the source and destination
Object Storages’ accounts, access details and endpoints.
See [User Information](administration-accounts-users.md#user-information).

This series of examples assumes that Container Replication has already been
enabled for the Object Storage.
See [Enable the Container Replication Service for an Object Storage](#enable-object-storage-replication).

Environment variables are applied for ease of reuse on multiple commands:

```console
SOURCE_API_ENDPOINT="https://vsa-00000123-zadara.example.com:8443"

TOKEN="<API Token string from the Authentication section of the user's Change Password screen>"
```

<a id="rest-create-replication-target"></a>

### Register a Replication Target (CLI)

A Replication Target is the destination Object Storage that hosts
synchronized replicas of one or more containers in the source Object
Storage.

Registering a Replication Target specifies the properties for connecting
the source Object Storage to the destination Object Storage.

From the **destination** Object Storage user details screen, use the values
of the following parameters in the REST API call:

* `name`: The display name of the Registered Target
* `endpoint_url`:
  * For Front End connection, use **Connectivity - Front End Network** >
    **API Endpoint**
  * For Public Network connection, use **Connectivity - Public Network** >
    **Public API Endpoint**
* `region`: **Authentication** section > **Region**
* `username`: **Authentication** section > **S3 Access Key**
* `password`: **Authentication** section > **S3 Secret Key**
* `connectVia`: The connection method for the remote Object Storage:
  * `fe` - via Front End Network
  * `outnet` - via Public Network

Request:

```console
curl -X POST "$SOURCE_API_ENDPOINT/api/zios/object_storage_destinations.json" \
  -H "accept: application/json" \
  -H "X-Access-Key: $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "exampleRepTarget1",
    "endpoint_url": "https://vsa-99900abc-zadara.example.com:443",
    "region": "us-east-1",
    "username": "abcd7bc7fda34c1c9ed04b0123456789",
    "password": "abcdd2e10904bf98900c2b0123456789",
    "connectVia": "fe"
  }'
```

Response:

```console
{
  "response": { "status": 0 }
}
```

The zero status indicates that the Replication Target is registered
successfully.

<a id="rest-verify-replication-target-registration"></a>

#### Verify Replication Target Registration (CLI)

The GET operation lists all registered Replication Targets in the source
account.

If more than one Replication Target appears for the account,
locate the newly registered Replication Target by its `display_name`.
The other properties that are listed for that Replication Target should
match the values entered in the previous
[Register a Replication Target (CLI)](#rest-create-replication-target) operation.

Request:

```console
curl -X GET "$SOURCE_API_ENDPOINT/api/zios/object_storage_destinations.json" \
  -H "accept: application/json" -H "X-Access-Key: $TOKEN"
```

Response (example):

```console
{
  "response": {
    "status": 0,
    "replication_targets": [
      {
        "created_at": "1762350015.7229927",
        "modified_at": "1762350015.7229927",
        "display_name": "exampleRepTarget1",
        "src_account": "123450b13d1147f994f525d01f2c6789",
        "destination_account_name": "daccount1",
        "destination_user_name": "user1",
        "destination_access_key": "12345bc7fda34c1c9ed04bdb39167890",
        "destination_endpoint": "https://vsa-99900abc-zadara.example.com:443",
        "destination_region": "us-east-1",
        "source_access_key": "abcdee61d70543ac9edfb6cc078vwxyz",
        "source_endpoint": "https://vsa-00000123-zadara.example.com:443",
        "source_region": "us-east-1",
        "interface": "feip",
        "job_count": "0",
        "target_id": "replication-target-1762350015",
        "src_account_name": "saccount1"
      }
    ],
    "count": 1
  }
}
```

The Replication Target now appears in listings and can be referenced by
`target_id`.

<a id="rest-list-target-containers"></a>

### List Containers in a Replication Target (CLI)

After creating and verifying a Replication Target, you can list all
destination containers associated with that target, by specifying the
Replication Target’s `target_id` in the `list_destination_containers`
query.
This is useful for confirming that the remote destination endpoint is
accessible and that its containers are visible.

To view the list of containers in a Replication Target Object Storage:

Request:

```console
curl -X GET "$SOURCE_API_ENDPOINT/api/zios/object_storage_destinations/replication-target-1762350015/list_destination_containers.json" \
  -H "accept: application/json" \
  -H "X-Access-Key: $TOKEN"
```

Response:

```console
{
  "response": {
    "status": 0,
    "containers": [
      {"name": "my-container1"},
      {"name": "example-container2"}
    ],
    "count": 2
  }
}
```

This example returns a list of 2 containers in the Replication Target
Object Storage, in the “containers” array.
The zero status confirms a successful query.

<a id="rest-create-replication-job"></a>

### Create a Replication Job (CLI)

For the Replication Target specified by its `target_id`, create a job
that replicates and synchronizes a specified container in the source
account to a destination container.

The Replication Job retrieves the destination Object Storage and account’s
access details, by using the `target_id` value returned in the previous
step to retrieve the matching Replication Target.

The Replication Job creates a replication of the source container
`src_bucket` in the destination Object Storage account, named according
to the value of `dst_bucket`.
As changes are applied in the source container, the Replication Job is
triggered to synchronize the source changes to the destination.

This example demonstrates usage of optional parameters:

* `prefix`: Only replicate objects with names beginning with the
  specified prefix.
* `delete_propagation`: For a versioned container only:
  Delete objects from the target when they are deleted in the source
  container.
* `delete_marker_propagation`: Deleting an object in a versioned
  container yields a new 0-byte version of the same object with a
  DeleteMarker tombstone. The DeleteMarker version lists the object as
  deleted, however, all previous versions are retained.

Request:

```console
curl -X POST "$SOURCE_API_ENDPOINT/api/zios/container_replications.json" \
  -H "accept: application/json" \
  -H "X-Access-Key: $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "display_name": "my-replication-job1",
    "src_bucket": "my-source-container1",
    "target_id": "replication-target-1762350015",
    "dst_bucket": "my-destination-container1",
    "prefix": "abc",
    "delete_propagation": true,
    "delete_marker_propagation": true,
    "force_dest_bucket_creation": true
  }'
```

Response:

```console
{
  "response": { "status": 0 }
}
```

The zero status indicates that the Replication Job is successfully
configured and activated.

<a id="rest-verify-replication-job-creation"></a>

#### Verify Replication Job Creation (CLI)

After creating the Replication Job, verify that it was successfully
registered and is in the `enabled` state.

Request:

```console
curl -X GET "$SOURCE_API_ENDPOINT/api/zios/container_replications.json?src_bucket=my-source-container1" \
  -H "accept: application/json" \
  -H "X-Access-Key: $TOKEN"
```

Response (example):

```console
{
  "response": {
    "status": 0,
    "replication_jobs": [
      {
        "created_at": "1762417379.1855025",
        "modified_at": "1762417708.6272612",
        "state": "enabled",
        "display_name": "my-replication-job1",
        "source_bucket": "my-source-container1",
        "destination_bucket": "my-destination-container1",
        "replication_id": "replication-conf-1762417375",
        "target_display_name": "exampleRepTarget1",
        "replication_lag": "N/A In Full-Sync Mode"
      }
    ],
    "count": 1
  }
}
```

The job exists and is currently active.
The “state” value should be `enabled`, confirming that replication has
been initialized.

<a id="rest-view-replication-job"></a>

### View or Monitor a Replication Job (CLI)

After the Replication Job has been created and initialized, you can
view its current status and metrics using the Replication Job’s
`replication_id`.
This command retrieves detailed information about replication progress,
object counts, and synchronization state.

Request:

```console
curl -X GET "$SOURCE_API_ENDPOINT/api/zios/container_replications/replication-conf-1762417375.json" \
  -H "accept: application/json" \
  -H "X-Access-Key: $TOKEN"
```

Response (example):

```console
{
  "response": {
    "status": 0,
    "replication_jobs": [
      {
        "created_at": "1763022696.8639064",
        "modified_at": "1763022696.8639064",
        "state": "enabled",
        "display_name": "my-replication-job1",
        "source_account": "123450b13d1147f994f525d01f2c6789",
        "source_bucket": "my-source-container1",
        "destination_account": "012348ed8e9a40019f835869f2256789",
        "destination_bucket": "my-destination-container1",
        "destination_ssl": "True",
        "destination_account_name": "daccount1",
        "target_id": "replication-target-1763018752",
        "prefix": "abc",
        "methods": "['put', 'delete']",
        "delete_propagation": "True",
        "delete_marker_propagation": "True",
        "replication_type": "AP",
        "mode": "1",
        "paused_at": "0",
        "resumed_at": "0",
        "num_batches": "0",
        "bytes": "228633",
        "replicated": "1",
        "failed_put": "0",
        "failed_delete": "0",
        "failed_objects": "0",
        "deleted": "0",
        "source_container_objects": "3",
        "source_container_versions_objects": "0",
        "source_container_bytes": "1091206",
        "destination_container_objects": "1",
        "destination_container_versions_objects": "0",
        "destination_container_bytes": "228633",
        "last_object_replicated_creation_time": "1763023873.0",
        "last_full_sync_time": "1763024072.0",
        "disable_count": "Not-Applicable",
        "state_changed_at": "1763022696.8679135",
        "last_replicated_time": "1763023975.0",
        "replication_id": "replication-conf-1763022694",
        "target_display_name": "exampleRepTarget1",
        "replication_lag": "Sync Completed",
        "disable_percentage": null
      }
    ],
    "count": 1
  }
}
```

This response shows that the Replication Job is in the `enabled` state and
operating normally.
The metrics provide insight into replication activity:

* `bytes`: Total number of bytes replicated (228,633).
* `source_container_objects`:
  Total number of objects in the source container (3).
* `destination_container_objects`:
  Number of objects replicated to the destination container (1).

  In this example, although there are 3 objects in the source container,
  only one of the 3 source filenames has a leading prefix matching the
  specified `prefix` rule.
* `last_full_sync_time`: Timestamp of the last full synchronization.
* `replication_lag`: Indicates “Sync Completed” if replication is up
  to date.

Use this command periodically to monitor synchronization progress and
validate replication health.

<a id="rest-pause-replication-job"></a>

### Pause a Replication Job (CLI)

Use the `replication_id` value from the previous step, to specify the
Replication Job to pause.

Request:

```console
curl -X POST "$SOURCE_API_ENDPOINT/api/zios/container_replications/replication-conf-1762417375/pause.json" \
  -H "accept: application/json" \
  -H "X-Access-Key: $TOKEN" \
  -H "Content-Type: application/json"
```

Response:

```console
{
  "response": { "status": 0 }
}
```

<a id="rest-verify-paused-replication-job"></a>

#### Verify Paused Replication Job (CLI)

Pausing a Replication Job can take up to several minutes to complete.
<br/>
The job immediately transitions to  an interim `pausing` state.
<br/>
On successful completion, the job state is `paused`.
<br/>

Request:

```console
curl -X GET "$SOURCE_API_ENDPOINT/api/zios/container_replications.json?src_bucket=my-source-container1" \
  -H "accept: application/json" \
  -H "X-Access-Key: $TOKEN"
```

Paused Replication Job **Interim State** response:

```console
{
  "response": {
    "status": 0,
    "replication_jobs": [
      {
        "state": "pausing",
        "display_name": "my-replication-job1",
        "replication_id": "replication-conf-1762417375"
      }
    ],
    "count": 1
  }
}
```

Paused Replication Job **Final State** response:

```console
{
  "response": {
    "status": 0,
    "replication_jobs": [
      {
        "state": "paused",
        "display_name": "my-replication-job1",
        "paused_at": "1762417705.5836282",
        "mode": "2"
      }
    ],
    "count": 1
  }
}
```

<a id="rest-resume-replication-job"></a>

### Resume a Paused Replication Job (CLI)

A Replication Job can only be resumed after it has reached the `paused`
state.

Request:

```console
curl -X POST "$SOURCE_API_ENDPOINT/api/zios/container_replications/replication-conf-1762417375/resume.json" \
  -H "accept: application/json" \
  -H "X-Access-Key: $TOKEN" \
  -H "Content-Type: application/json"
```

Response:

```console
{
  "response": { "status": 0 }
}
```

<a id="rest-verify-resumed-replication-job"></a>

#### Verify Resumed Replication Job (CLI)

Request:

```console
curl -X GET "$SOURCE_API_ENDPOINT/api/zios/container_replications.json?src_bucket=my-source-container1" \
  -H "accept: application/json" -H "X-Access-Key: $TOKEN"
```

Response:

```console
{
  "response": {
    "status": 0,
    "replication_jobs": [
      {
        "state": "enabled",
        "display_name": "my-replication-job1",
        "resumed_at": "1762423019.6906137"
      }
    ],
    "count": 1
  }
}
```

The `enabled` state indicates that the Replication Job resumes operation.

<a id="rest-delete-replication-job"></a>

### Delete a Replication Job (CLI)

Deleting a container’s Replication Job can take some time to complete.

Request:

```console
curl -X DELETE "$SOURCE_API_ENDPOINT/api/zios/container_replications/replication-conf-1762417375/delete.json" \
  -H "accept: application/json" \
  -H "X-Access-Key: $TOKEN" \
  -H "Content-Type: application/json"
```

Response:

```console
{
  "response": { "status": 0 }
}
```

The zero status indicates that the job deletion was initiated successfully.

<a id="rest-verify-deletion-replication-job"></a>

#### Verify Deletion of Replication Job (CLI)

Using the GET operation to retrieve Replication Job attributes can be
applied with or without the `include_deleted` parameter:

* **include_deleted=false** (default):
  Only enabled or paused Replication Jobs will be displayed in the output.
  <br/>
  The deleted Replication Jobs will not be displayed.
  <br/>
  * Without include_deleted
    ```console
    curl -X GET "$SOURCE_API_ENDPOINT/api/zios/container_replications/replication-conf-1762417375.json" \
      -H "accept: application/json" \
      -H "X-Access-Key: $TOKEN" \
      -H "Content-Type: application/json"
    ```

    Response:
    ```console
    {
    "response": {
        "status": 0,
        "replication_jobs": [
        {
            "state": "deleting",
            "display_name": "my-replication-job1",
            "replication_id": "replication-conf-1762417375"
        }
        ],
        "count": 1
    }
    }
    ```

    The interim `deleting` state indicates that the job is being deleted.
  * With include_deleted=false:
    ```console
    curl -X GET "$SOURCE_API_ENDPOINT/api/zios/container_replications/replication-conf-1762417375.json?include_deleted=false" \
      -H "accept: application/json" \
      -H "X-Access-Key: $TOKEN" \
      -H "Content-Type: application/json"
    ```

    Response:
    ```console
    *No output; the job no longer appears once deleted*
    ```
* **include_deleted=true** (default):

  All Replication Jobs will be displayed in the output,
  including deleted Replication Jobs.
  ```console
  curl -X GET "$SOURCE_API_ENDPOINT/api/zios/container_replications/replication-conf-1762417375.json?include_deleted=true" \
    -H "accept: application/json" \
    -H "X-Access-Key: $TOKEN" \
    -H "Content-Type: application/json"
  ```

  Response:
  ```console
  {
    "response": {
      "status": 0,
      "replication_jobs": [
        {
          "state": "deleted",
          "display_name": "my-replication-job1",
          "replication_id": "replication-conf-1762417375",
          "replication_lag": "Sync Completed"
        }
      ],
      "count": 1
    }
  }
  ```

A deleted job can still be retrieved for verification.

<a id="rest-delete-replication-target"></a>

### Delete a Replication Target (CLI)

A Replication Target that is referenced by a Replication Job cannot be
deleted.

Request:

```console
curl -X DELETE "$SOURCE_API_ENDPOINT/api/zios/object_storage_destinations/replication-target-1762350015.json" \
  -H "accept: application/json" \
  -H "X-Access-Key: $TOKEN"
```

Response:

```console
{
  "response": { "status": 0 }
}
```

The zero status indicates that the Replication Target is deleted successfully.

<a id="rest-verify-deletion-replication-target"></a>

#### Verify Deletion of Replication Target (CLI)

Immediately after deletion, querying the same target ID returns an
empty or null response, confirming removal.

Request:

```console
curl -X GET "$SOURCE_API_ENDPOINT/api/zios/object_storage_destinations/replication-target-1762350015.json" \
  -H "accept: application/json" -H "X-Access-Key: $TOKEN"
```

Response before deletion:

```console
{
  "response": {
    "status": 0,
    "replication_targets": [
      {
        "display_name": "exampleRepTarget1",
        "target_id": "replication-target-1762350015"
      }
    ],
    "count": 1
  }
}
```

Response after deletion:

```console
{
  "response": {
    "status": 0,
    "replication_targets": [],
    "count": 0
  }
}
```

The Replication Target no longer appears, and has been fully deleted.
