- 3 Minutes to read
- Print
- PDF
Run EZswitch on Linux from the zestyctl CLI
- 3 Minutes to read
- Print
- PDF
This topic describes how to run EZswitch on a Linux instance from the zestyctl CLI.
Prerequisites
User access to the Zesty platform and the Zesty API Key
For more information, see Find your Zesty API key.AWS account is integrated with Zesty Disk
For more information, see Integrate your AWS account with Zesty.A mounted volume (the source filesystem) with data to be migrated
An instance with:
A clean, 50 GB volume (not the root volume), that meets the volume, instance, and network settings described in System requirements.
Make sure the EBS volume is in the same region and availability zone as the instance.Root CLI access, for example, using SSH
You need the AWS ID of the created volume.
To run EZswitch from the zestyctl CLI:
Connect to the instance with CLI root access.
Install the latest Zesty Disk Agent by running the following command:
curl -s https://static.zesty.co/ZX-InfraStructure-Agent-release/install.sh | sudo bash -s apikey=<API_KEY>
Verify that EZswitch supports the source filesystem by running the following command:
zestyctl disk ezswitch analyze <mount_path>
The analysis checks for problems that can prevent the migration from completing successfully.
Identify the device path of the EBS volume that will become the Zesty Disk filesystem:
Run the following command:
lsblk -o NAME,SERIAL,MOUNTPOINT -n | awk '$2 ~ /^vol/ {print $1,$2,$3}' | sed s/vol/vol-/g
The output displays a list of device name, AWS serial, and the mount path if the volume is mounted. For example:
Identify the device name that is associated with the EBS volume.
In our example, the created volume ID (from AWS) is “vol-0db571ecc7fc9cf95,” so the device name is “/dev/nvme1n1”. From now on, wheneverdevice_name
is mentioned, it will refer to/dev/nvme1n1
.Identify the mount path to migrate and save aside the AWS volume ID.
For example, if the mount path is “/mnt/data,” the AWS volume ID is “vol-0c8b043ff429ffcb7”. This will be used later to detach the volume from the instance upon successful completion of the migration.
(Optional) In AWS, back up the source volume by taking a snapshot.
You can find the volume ID from section 4c.Start EZswitch by running the following command:
zestyctl disk ezswitch start <mount_path> <device_name> [--auto-reboot]
Example:zestyctl disk ezswitch start /mnt/data /dev/nvme1n1
Where:
<mount_path>
is the mount path to be migrated<device_name>
is the device name of the new EBS volume with the/dev/
prefix, for example/dev/nvme1n1
(Optional) To reboot the instance automatically, add the
--auto-reboot
argument
(Optional) To check the status of the migration, run the following command:
zestyctl disk ezswitch status
Output similar to the following is displayed:
In this example, the reboot is done manually, 4 steps were completed so far, and the migration is currently paused until a reboot is done. You can reboot using the CLI, from AWS, or from the Zesty platform.
After the reboot, the migration will resume from the same point.When the migration completes, running the status command will return the following output:
No ezswitch is running
(Optional) You can cancel an EZswitch migration either from the Managed filesystems tab of the Zesty Disk platform or by running the following command:
zestyctl disk ezswitch abort <mount_path>
Canceling will stop the copying of data to the destination disk, umount the destination disk, and revert all system settings.Important: Canceling a migration is only allowed before the first reboot.
(Optional) To validate that the migration finished successfully, run the following command:
df -h <mount_point>
Output similar to the following is displayed:
Where<device_name>
and<mount_point>
are the same as the ones from step 6.(Recommended) Clean up, by doing the following from AWS:
Detach the original source volume from the instance.
Find the volume ID as described in step 4c.
After verifying that the data migration was successful, you can delete the volume.If you made a backup snapshot before beginning the migration, verify the data migration, and then delete the snapshot.
Congratulations. Your data is now being managed by Zesty Disk!