Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/how-to/import-remote-cluster.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ At the primary cluster, this token can be imported to create the remote record.

sudo microceph remote import simple eyJmc2lkIjoiN2FiZmMwYmItNjIwNC00M2FmLTg4NDQtMjg3NDg2OGNiYTc0Iiwia2V5cmluZy5jbGllbnQubWFnaWNhbCI6IkFRQ0hJdmRtNG91SUNoQUFraGsvRldCUFI0WXZCRkpzUC92dDZ3PT0iLCJtb24uaG9zdC5zaW1wbGUtcmVpbmRlZXIiOiIxMC40Mi44OC42OSIsInB1YmxpY19uZXR3b3JrIjoiMTAuNDIuODguNjkvMjQifQ== --local-name magical

.. note::

The value of ``--local-name`` must be different from the remote cluster name (``simple`` in this example).
Using the same name for both will result in an error to avoid conflicts during replication.

This will create the required $simple.conf and $simple.keyring files.
Note: Importing a remote cluster is a uni-directional operation. For symmetric
relations both clusters should be added as remotes at each other.
Expand Down
4 changes: 4 additions & 0 deletions microceph/api/ops_replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ func cmdOpsReplication(s state.State, r *http.Request, patchRequest types.Replic
return response.InternalError(err)
}

if data.RemoteName != "" && data.RemoteName == data.LocalAlias {
return response.SmartError(fmt.Errorf("local alias (--local-name) and remote name must be different to avoid site conflicts"))
}

// carry RbdReplicationRequest in interface object.
data.SetAPIObjectId(resource)
// Patch request type.
Expand Down
1 change: 1 addition & 0 deletions microceph/api/types/replication_rbd.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ type RbdReplicationRequest struct {
SourcePool string `json:"source_pool" yaml:"source_pool"`
SourceImage string `json:"source_image" yaml:"source_image"`
RemoteName string `json:"remote" yaml:"remote"`
LocalAlias string `json:"local_alias" yaml:"local_alias"`
// snapshot in d,h,m format
Schedule string `json:"schedule" yaml:"schedule"`
ReplicationType RbdReplicationType `json:"replication_type" yaml:"replication_type"`
Expand Down
Loading