Get Virtualizor

Clone VPS

Overview

Virtualizor Clone VPS wizard allows you to seamlessly clone VPS from one server to another server OR same server without any manual intervention. Clone process transfers all your VPS data including configuration and user data.

Features

  • One click Clone
  • Multiple Cloning process at the same time
  • Cloning Graph
  • Integrated Tasks Page

Requirements

  • Both the servers should have Virtualizor Installed.
  • Servers should be in Cluster. ( for more information : Add Server )

Note

  • It is recommended that you save the VPS data before starting the Clone process as Virtualizor will power off the VPS to do the transfer.
  • Cloning is only available for OpenVZ, KVM, XEN and LXC Servers.
  • Clone process may take some time depending on the VPS size and transfer rate.
  • You can navigate away from the Clone page and check the status on the Tasks page.
  • Cloning is allowed between the following storage types:
  • LVM <-> LVM
  • File Based RAW <-> LVM
  • LVM <-> File BAsed RAW
  • Thin LVM <-> LVM
  • Thin LVM <-> File Based RAW
  • But if your storage type is QCOW2.Then,
  • QCOW2 <-> QCOW2
  • Meaning clone can only be done if the storage type of both the destination and the source is QCOW2. Cloning of QCOW2 to other storage type is not supported.
  • Target storage on the destination server should be primary storage
  • Migrating VPS with File based storage from centos 7 node to centos 6 node is not supported.

Process

  • Go to Virtual Servers >> Clone VPS
  • Select The Source Server. The server where the current VPS is.
  • Select the VPS(s) you want to Clone
  • Select the Destination Server
  • Set the transfer speed for migration. If not set, by default it will be 100mbits/s.If you want to transfer the data at speed higher than 100mb/s then please specify the speed as Virtualizor will by default restrict it to 100mb/s
  • Click on Clone VPS.
  • You can check clone logs in /var/virtualizor/log/clone directory.
  • For transfer logs you can check the /var/virtualizor/log/clone/vpsid-transfer.log file on the source server.
  • A detailed Master log is created on the Master server in the /var/virtualizor/log/clone/vpsid-master.log file.
  • For Multiple Clone a separate Log is created on the Master Server apart from the two logs in the /var/virtualizor/log/clone/taskid-multi_clone.log file.

Different storage type

If you have different type for target storage (other than mentioned in notes above for supported types) then you will need to follow manual steps to copy and convert existing vps primary disk :

Note : Please proceed ahead only after a proper vps backup and database backup of panel.

For moving vps between File Raw/LVM to Qcow2

  1. Stop the vps which you want to clone to another storage.
  2. Add 2nd disk to vps from another storage (Qcow2 in this case).
  3. Copy vps primary disk to Qcow2 storage location using cp command and use same name in Qcow2 storage location.
    You can over-write that 2nd disk.

    For LVM, you can directly use dd to copy the image to Qcow2 storage location :

    Syntax : dd if=/dev/vg/vps-lv of=/converted.img
    Example : dd if=/dev/vg/vsv1001-dvhckogpoqenoy9c-fy4xodn6olq3efvi of=/path-to-Qcow2-storage/vsv1001-dsegaogpoqenoy9c-fy4xodn6olq3efvi.img status=progress

    Note : Naming of the 2nd disk should be the same as created by Virtualizor.

  4. Then convert the .img to Qcow2 :

    qemu-img convert /path-to-Qcow2-storage/vsv1001-dvhckogpoqenoy9c-fy4xodn6olq3efvi.img -O qcow2 /path-to-Qcow2-storage/vsv1001-dvhckogpoqenoy9c-fy4xodn6olq3efvi.qcow2

  5. Take database backup before making the changes.
    You can then access database using Admin panel->Configuration->Phpmyadmin->VPS table and note down the vps_uuid and use that uuid in disks table to search for vps's disk entry in Disks table.
    It should list 2 disks entry, inter-change their primary column's value so that the newly added disk can become primary and do that same with num column.

    Once done, you can edit vps from panel and see if it gets saved properly or not.
    Once it saves properly, you can start vps and verify.

    After it boots properly, you can delete the un-wanted vps disk entry from disk's table and stop the vps again to remove the old vps disk from the storage location.

For moving vps between from Qcow2 to File Raw/LVM

You can use the same steps mentioned above but first it needs to be converted to .img and then you can use cp or dd command depending on which storage you want to clone the vps to.

Summary

  • Clone process may take some time depending upon the VPS size and transfer rate.
  • If you face any difficulties cloning the VPS, you can contact us at support [at] virtualizor [dot] com or open a Support Ticket.
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list