Move volumes to a different instance
  • 4 Minutes to read
  • PDF

Move volumes to a different instance

  • PDF

Article summary

Move volumes to a different instance

This topic describes how to move all the volumes in a Zesty Disk filesystem from one instance to another.

You can move volumes in the following filesystems:

Move volumes in a Btrfs filesystem

This section describes how to move all the volumes in a Btrfs filesystem from one Amazon Linux 2 instance (source) to another (target).

Note: This procedure requires stopping the source and target instances. You may want to plan to do this during a maintenance window.

Prerequisites

  • User access to the Zesty platform

  • AWS permission level: AmazonEC2FullAccess

  • Root CLI access to the source and target instances

To move volumes in a Btrfs filesystem:

  1. From the Zesty platform main menu, select Zesty Disk.

  2. Prepare the target instance mount point:

    1. Connect to the target instance with CLI root access (for example using SSH or Putty).

    2. Install the Zesty Disk agent as described in Install the Zesty Disk Agent.

    3. Create a mount point for the new Zesty Disk filesystem, using the following command:
      mkdir <mount point>
      The target mount point should be identical to the source mount point. For example, if the source mount point is /mnt/data/, run mkdir /mnt/data/

  3. Copy the Zesty Disk mount point metadata:

    1. Connect to the source instance with CLI root access (for example using SSH or Putty).

    2. Open the /zesty directory.

    3. Using a file editor (like Nano or Vim), copy the contents of the zesty-disk-mountpoints file.

    4. On the target instance, open the /zesty directory.

    5. Using a file editor, open the zesty-disk-mountpoints file and paste (and overwrite) the content copied from this file on the source.

  4. Shut down the source instance.

  5. Shut down the target instance.

  6. Identify the volumes to be moved:

    1. In the Zesty Disk platform, from the Zesty Disk > Managed Filesystems page, select the source Zesty Disk filesystem (whose volumes are to be moved).
      The filesystem properties are displayed.

    2. From the Overview tab, manually copy the volume IDs to a temporary file:

  7. Detach the volumes from the source instance:

    1. From the AWS console, navigate to the EC2 dashboard Elastic Block Store > Volumes page.

    2. Find and choose the volumes identified in the Zesty Disk platform.

    3. From the Actions drop-down menu, select Detach volumes, then confirm.
      When the volume is detached, its value in the Volume state column changes from “In-use” to “Available.”

  8. Attach the volumes to the target instance:

    1. From the Elastic Block Store > Volumes page, find and choose the same volumes that were detached from the source instance (originally identified in the Zesty Disk platform).

    2. From the Actions drop-down menu, select Attach volumes.

    3. Select the ID of the target instance, select the mount path created in step 2, then confirm.

  9. Start the target instance.

  10. To confirm that the volumes are now attached to the target instance, run either of the following commands from the target instance:
    lsblk (or fdisk -l)

Move volumes in a ZFS filesystem

This section describes how to move all the volumes in a ZFS filesystem from one instance (source) to another (target).

Note: This procedure requires stopping the source and target instances. You may want to plan to do this during a maintenance window.

Prerequisites

  • User access to the Zesty platform

  • AWS permission level: AmazonEC2FullAccess

  • Root CLI access to the source and target instances

To move volumes in a ZFS filesystem:

  1. From the Zesty platform main menu, select Zesty Disk.

  2. Prepare the target instance mount point:

    1. Connect to the target instance with CLI root access (for example using SSH or Putty).

    2. Install the Zesty Disk agent as described in Install the Zesty Disk Agent.

    3. Create a mount point for the new Zesty Disk filesystem, using the following command:
      mkdir <mount point>
      The target mount point should be identical to the source mount point. For example, if the source mount point is /mnt/data/, run mkdir /mnt/data/

  3. Discover the Zesty Disk filesystem storage pool name and device list:

    1. Connect to the source instance with CLI root access (for example using SSH or Putty).

    2. Display the storage pool name, by running the following command:
      zpool list -v

    3. Copy the storage pool name to a temporary file.

  4. Shut down the source instance.

  5. Shut down the target instance.

  6. Identify the volumes to be moved:

    1. In the Zesty Disk platform, from the Zesty Disk > Managed Filesystems page, select the source Zesty Disk filesystem (whose volumes are to be moved).
      The filesystem properties are displayed.

    2. From the Overview tab, manually copy the volume IDs to a temporary file:

  7. Detach the volumes from the source instance:

    1. From the AWS console, navigate to the EC2 dashboard Elastic Block Store > Volumes page.

    2. Find and choose the volumes identified in the Zesty Disk platform.

    3. From the Actions drop-down menu, select Detach volumes, then confirm.
      When the volume is detached, its value in the Volume state column is “Available.”

  8. Attach the volumes to the target instance:

    1. From the Elastic Block Store > Volumes page, find and choose the same volumes that were detached from the source instance (originally identified in the Zesty Disk platform).

    2. From the Actions drop-down menu, select Attach volumes.

    3. Select the ID of the target instance, select the mount path created in step 2, then confirm.

  9. Start the target instance.

  10. On the target instance, import the storage pool by running the following command:
    zpool import <pool name>
    Where <pool name> is the name discovered in step 3.

  11. To confirm that the volumes are now attached to the target instance, run the following command:
    zpool list -v


Was this article helpful?