Preparing for default live migration

Prepare the default live migration process for RADOS Block Device (RBD) images within the same IBM Storage Ceph cluster.

Before you begin

Before you begin, make sure that you have the following prerequisites in place:

  • A running IBM Storage Ceph.
  • Two block device pools.
  • One block device image.

About this task

The rbd migration prepare command accepts all the same layout options as the rbd create command. The rbd create command allows changes to the on-disk layout of the immutable image. If you only want to change the on-disk layout and want to keep the original image name, skip the migration_target argument. All clients using the source image must be stopped before preparing a live migration. The prepare step will fail if it finds any running clients with the image open in read/write mode. You can restart the clients using the new target image once the prepare step is completed.
Note: You cannot restart the clients using the source image as it results in a failure.
Important: Cloned images are implicitly flattened during live importing (using the --import-only and these images are disassociated from any parent chain in the source cluster when migrated to another Ceph cluster.

Procedure

  1. Optional: If you are migrating the image from one Ceph cluster to another, copy the ceph.conf and ceph.client.admin.keyring of both the clusters to a common node. This ensures the client node has access to both clusters for migration.
    • Example of copying ceph.conf and ceph.client.admin.keyring of cluster c1 to a common node.
      [root@rbd1-client /]# scp /etc/ceph/ceph.conf root@10.0.67.67:/etc/ceph/c1.conf
      root@10.0.67.67's password:
      ceph.conf
        100%  263     1.2MB/s   00:00
      
      [root@rbd1-client /]# scp /etc/ceph/ceph.client.admin.keyring  root@10.0.67.67:/etc/ceph/c1.keyring
      root@10.0.67.67's password:
      ceph.client.admin.keyring
    • Example of copying ceph.conf and ceph.client.admin.keyring of cluster c2 to a common node.
      [root@rbd2-client]# scp /etc/ceph/ceph.conf root@10.0.67.67:/etc/ceph/c2.conf
      ceph.conf 
        100%  261   864.5KB/s   00:00
      
      [root@rbd2-client]# scp /etc/ceph/ceph.client.admin.keyring root@10.0.67.67:/etc/ceph/c2.keyring
      root@10.0.67.67's password:
      ceph.client.admin.keyring
  2. Prepare the live migration within the storage cluster or rename the source image.
    • Prepare the live migration.
      rbd migration prepare SOURCE_POOL_NAME/SOURCE_IMAGE_NAME TARGET_POOL_NAME/SOURCE_IMAGE_NAME
      For example,
      [ceph: root@rbd-client /]# rbd migration prepare sourcepool1/sourceimage1 targetpool1/sourceimage1
    • Rename the source image.
      rbd migration prepare SOURCE_POOL_NAME/SOURCE_IMAGE_NAME TARGET_POOL_NAME/NEW_SOURCE_IMAGE_NAME
      In the following example, newsourceimage1 is the renamed source image.
      [ceph: root@rbd-client /]# rbd migration prepare sourcepool1/sourceimage1 targetpool1/newsourceimage1

What to do next

  1. Check the current state of the live migration process.
    rbd status TARGET_POOL_NAME/SOURCE_IMAGE_NAME
    For example,
    [ceph: root@rbd-client /]# rbd status targetpool1/sourceimage1
    Watchers: none
    Migration:
    source: sourcepool1/sourceimage1 (adb429cb769a)
    destination: targetpool2/testimage1 (add299966c63)
    state: prepared
    Important: During the migration process, the source image is moved into the RBD trash to prevent mistaken usage.
    For example:
    • [ceph: root@rbd-client /]# rbd info sourceimage1
      rbd: error opening image sourceimage1: (2) No such file or directory
    • [ceph: root@rbd-client /]# rbd trash ls --all sourcepool1
      adb429cb769a sourceimage1
  2. Run the live migration. For more information, see Running the live migration.