Updated on 2024-01-25 GMT+08:00

Migrating Linux Servers Running Unsupported OSs

This practice walks you through how to migrate servers running unsupported Linux OSs. You can check whether your source OSs are supported by SMS in Supported Linux OSs.

Procedure

  1. Check the format of the system partition on the source server to be migrated.

    sudo parted -l /dev/vda | grep 'Partition Table'
    • If msdos is displayed, the partition uses MBR, and you can continue to the next step.
    • If gpt is displayed, the partition uses GPT. This solution does not work, and you need to find another way.

  2. Run df -TH to view the disk information. As shown in the following figure, /dev/vda1 is the system partition.

  3. Obtain the UUID of the system partition.

    sudo blkid /dev/vda1

  4. Use vi to open /etc/fstab. Press i to enter editing mode and add the UUID obtained in Step 3 to the end of the file.

    vi /etc/fstab

  5. Save the file and exit.

    :wq

  6. Install the qemu-img tool.

    CentOS is used as an example.
    yum -y install qemu-img

  7. Export /dev/vda1 to /mnt/vdb/test.qcow2.

    sudo qemu-img convert -f raw -O qcow2 /dev/vda1 /mnt/vdb/test.qcow2

    In this command, /mnt/vdb is the data disk or other storage where the image will be created. To export the partition to another format, you can change the value of the -O option.

    Example Value

    Description

    qcow2

    QCOW2 format

    vhd

    VHD format

    vmdk

    VMDK format

    raw

    Raw image format

  8. Use OBS Browser+ to upload the image file to an OBS bucket on Huawei Cloud and register the image file as a private image. For details, see Registering the Image File as a Private Image.
  9. Create an ECS from the registered private image. For details, see Creating an ECS from an Image.
  10. Create images for data disks on the source server by repeating Step 2 to Step 8.
  11. On the IMS console, create data disks using the data disk images.

  12. Attach the created data disks to the ECS by referring to Attaching an EVS Disk to an ECS.