Swarm migration

Available since MMT 2.0.3

In a streamlined Swarm migration, you run the migrate command, which accomplishes the migration in a small number of steps.

Perform migration

The migration operation differs, depending on whether you are running it on a Docker volume storage system or a Filesystem storage system

A migration performed on a Docker volume storage system (such as AWS S3, Google Cloud, or Azure) requires that you run the migrate command within the MMT container only.

Run the following command sequence, to:

  • Connect to the MSR 2.9.x or 3.x.x system.

  • Mount the DTR (Docker Trusted Registry) volume from the 2.9.x or 3.x.x system to /storage in the MMT container.

docker run -it --rm
-v <MSR 2.9x registry volume name>:/storage \
-v <local-migration-directory>:/migration \
-v /var/run/docker.sock:/var/run/docker.sock \
msr.ci.mirantis.com/msr/mmt migrate \
/migration \
--storage-mode copy \
--parallel-io-count 1 \
--source-mke-url <mke-url> \
--source-url <source-msr-url> \
--source-username <MRS admin username> \
--source-password <MSR admin password> \
--swarm

Note

Migrations that use the copy storage mode and a filesystem storage backend must also include the --mount option, to specify the MSR 2.9.x Docker volume you want to mount to the MMT container at the /storage directory. As --mount is a Docker option, it must be included prior to the registry.mirantis.com/msr/mmt:<mmt-version> portion of the command.

--mount source=dtr-registry-<replica-id>,target=/storage

To obtain the MSR replica ID, run the following command from within an MSR node:

docker ps --format '{{.Names}}' -f name=dtr-rethink | cut -f 3 -d '-'
Command line parameters

Parameter

Description

storage-mode

Set the registry migration storage mode.

Valid values: inplace, copy

parallel-io-count

Optional. Sets the number of parallel IO copies when performing blob storage copy tasks.

Default: 4

source-mke-url

Set the URL for the source Mirantis Kubernetes Engine (MKE) system.

source-url

Set the URL for the source MSR system.

source-username

Set the username of the admin user. For MSR 2.9.x source systems, use the MKE admin user.

source-password

Set the password of the admin user. For MSR 2.9.x source systems, use the MKE admin user.

swarm

Optional. Specifies that the source system runs on Docker Swarm.

Default: false

Example output:

Successfully restored metadata from: "/home/<user-directory>/tmp/migrate/msr-backup-<MSR-version>-mmt.tar"

A migration performed on a filesystem storage requires that you run the migrate command twice, once within the MMT container, and then again on the target system.

  1. Run the following command sequence, to:

    • Connect to the MSR 2.9.x or 3.x.x system.

    • Mount the DTR (Docker Trusted Registry) volume from the 2.9.x or 3.x.x system to /storage in the MMT container.

    docker run -it --rm
    -v <MSR 2.9x registry volume name>:/storage \
    -v <local-migration-directory>:/migration \
    -v /var/run/docker.sock:/var/run/docker.sock \
    msr.ci.mirantis.com/msr/mmt migrate \
    /migration \
    --storage-mode copy \
    --parallel-io-count 1 \
    --source-mke-url <mke-url> \
    --source-url <source-msr-url> \
    --source-username <MRS admin username> \
    --source-password <MSR admin password> \
    --swarm
    

    Note

    Migrations that use the copy storage mode and a filesystem storage backend must also include the --mount option, to specify the MSR 2.9.x Docker volume you want to mount to the MMT container at the /storage directory. As --mount is a Docker option, it must be included prior to the registry.mirantis.com/msr/mmt:<mmt-version> portion of the command.

    --mount source=dtr-registry-<replica-id>,target=/storage
    

    To obtain the MSR replica ID, run the following command from within an MSR node:

    docker ps --format '{{.Names}}' -f name=dtr-rethink | cut -f 3 -d '-'
    

    Example output:

    INFO[0025] Migration step one complete. Refer to the documentation for instructions on how to complete the second step of migration.
    
  2. To restore your data, run the migrate command on the target system, from a worker node on which MSR is installed:

    docker run -it --rm \
    -v msr_msr-storage:/storage \
    -v <local-migration-directory>:/migration \
    -v /var/run/docker.sock:/var/run/docker.sock \
    msr.ci.mirantis.com/msr/mmt \
    migrate /migration \
    --storage-mode copy \
    --parallel-io-count 1 \
    --source-mke-url <mke-url> \
    --source-url <source-msr-url> \
    --source-username admin \
    --source-password password \
    --swarm
    

    Example output:

    Successfully restored metadata from: "/home/<user-directory>/tmp/migrate/msr-backup-<MSR-version>-mmt.tar"
    
    Command line parameters

    Parameter

    Description

    storage-mode

    Set the registry migration storage mode.

    Valid values: inplace, copy

    parallel-io-count

    Optional. Sets the number of parallel IO copies when performing blob storage copy tasks.

    Default: 4

    source-mke-url

    Set the URL for the source Mirantis Kubernetes Engine (MKE) system.

    source-url

    Set the URL for the source MSR system.

    source-username

    Set the username of the admin user. For MSR 2.9.x source systems, use the MKE admin user.

    source-password

    Set the password of the admin user. For MSR 2.9.x source systems, use the MKE admin user.

    swarm

    Optional. Specifies that the source system runs on Docker Swarm.

    Default: false

Perform post-restore eNZi registration

  1. Register MSR with eNZi:

    docker exec -it $(docker ps -q --filter "name=msr-api") sh -c 'msr auth register https://$TASK_SLOT.msr-enzi-api:4443/enzi'
    
  2. Restart the affected services:

    docker service update --force msr_msr-enzi-api && \
    docker service update --force msr_msr-api-server && \
    docker service update --force msr_msr-registry && \
    docker service update --force msr_msr-garant && \
    docker service update --force msr_msr-jobrunner
    
Command line parameters

Parameter

Description

storage-mode

Sets the registry migration storage mode.

Valid values: inplace, copy

parallel-io-count

Optional. Sets the number of parallel IO copies when performing blob storage copy tasks. Kubernetes, Swarm

Default: 4

source-mke-url

Sets the URL for the source Mirantis Kubernetes Engine (MKE) system.

source-url

Sets the URL for the source MSR system.

source-username

Sets the username of the admin user. For MSR 2.9.x source systems, use the MKE admin user.

source-password

Sets the password of the admin user. For MSR 2.9.x source systems, use the MKE admin user.

swarm

Optional. Specifies that the source system runs on Docker Swarm.

Default: false