There are 3 variants of VM import:

  • Import from a server with VMmanager OVZ;
  • Import from a server with VDSmanager-OpenVZ;
  • Import from a remote OVZ server. 

Import from a server with VMmanager OVZ or OpenVZ server


Importing virtual machines from an OpenVZ server

The configuration files of containers must be located in /etc/vz/conf/ directory on the remote server.

All the operations with a remote server should be executed via SSH with help of standard OpenVZ utilities.

When connected, the control panel receives a list of remote server containers with help of “vzlist” utility and creates a table of server’s VMs. 

In order to complete the import process, the control panel performs the following actions:

  • receives full information about the virtual machine from its configuration file;
  • creates a virtual machine with required parameters on the chosen node of the importing VMmanager OVZ;
  • stops the virtual machine on the remote server;
  • copies the virtual machine configuration file and makes necessary changes;
  • copies private space of the virtual machine (simfs files or plop container);
  • starts a new virtual machine if the imported one was started on the remote server;
  • informs the panel when the import process is finished. 

While copying the private space, the background task saves the information about the size of the target files and displays this information in the hint when moving the cursor at the import icon in Import VM→ VM list. As copying and compression of the data are performed simultaneously, the calculation of percentage ratio between the copied data size and general size is not performed.

After finishing the import process, the virtual machine on the remote server stays switched off.

Importing virtual machines from VMmanager OVZ

Import from VMmanager OVZ panel requires that every cluster of the remote server has the public IP address so that the panel can connect to them via SSH. 

Integrate the panels with  IPmanager in the same manner. 

Import from VMmanager OVZ panel and import from OpenVZ server don't have any significant differences. The main differences are listed below:

  • the VM owner can be imported;
  • the import background task receives information about a virtual machine from VMmanager OVZ;
  • before the import process starts, the target virtual machine is stopped and locked up by VMmanager OVZ. If the virtual machine on the source server is enabled and blocked, it will be unblocked, disabled, and blocked again; 
  • after finishing the import process the virtual machine located on the remote VMmanager OVZ receives status “imported to another server” and its icon appears in the VM list. If the remote VMmanager OVZ is integrated with IPmanager, deleting the virtual machine won't release the IP addresses. 

VM import 

Navigate to Import → VM import → Add

  • IP-address of the server;
  • Access details to the server;
  • Server type:
    • Import from OpenVZ;
    • Import from VMmanager OVZ.
    • Path to  VMmanager — enter VMmanager OVZ installation directory.  The field is displayed only if you have enabled the option "Import from VMmanager OVZ".

After you have successfully connected to the server and have received information about the virtual machines, the server will be added to Import→ VPS import.

Click on  Import→ VPS import → VPS list to view a list of virtual machines that you can import. When importing from another VMmanager OVZ click on Connection to select an external IP address of the source server from the list of available IP addresses. You may need it if the primary IP address of that server is private and the target server cannot access it. 

Select the virtual machines and click Start import.

  • Cluster node the virtual machines will be imported to:
  • Select user automatically  —  select the checkbox to create the owner of the virtual machine. If the username already exists, he will become the owner of the virtual machine. The option is available only when you select "Import from VMmanager OVZ";
  • Owner — if you select "Import from VMmanager OVZ" this field will be available only after you disable the option "Select user automatically";
  • New domain name - enter a new domain name for the virtual machine;
  • Select a new IP - enter the type of a new IP address and how it should be allocated.
  • IP-adders type:
    • Public — with access from the Internet;
    • Private — without access from the Internet;
    • NAT — to use with NAT networks.
  • IP-address — enter a new IP address.

Note

The tab IP-addresses is not available if you are importing several virtual machines at the same time.

Import from a server with VDSmanager-OpenVZ


Import principles

There are two variants:

  1. (Recommended)  Install VMmanager OVZ  on a "clean" server and add "clean" cluster nodes. VPS will be imported to the cluster nodes, and the original copy of the VPS is stored on the server with VDSmanager.
  2. Install VMmanager OVZ on the same server with VDSmanager:

    MIGRATION=mgr5 sh install.sh
    BASH

    When adding the local serverVDSmanager is suspended (start permissions are blocked) to avoid conflicts. To enable VDSmanager execute the commands:

    chmod 555 /usr/local/ispmgr/sbin/vdsnetstatd
    chmod 555 /usr/local/ispmgr/sbin/vdsmon
    chmod 555 /usr/local/ispmgr/bin/vdsmgr
    BASH

    When you import from the local VDSmanager VPS are not copied, they are given new CTID.


    Note

    You can import virtual machines from the local VDSmanager to a local cluster node of VMmanager OVZ.

    We do not recommend that you create new containers until all the VPS from the local VDSmanager is imported.

Requirements

  1. At least one cluster node; 
  2. Enough resources on the cluster nodes.
  3. If VDSmanager is integrated with IPmanager, make sure that VMmanager is integrated with the same IPmanager. VMmanager OVZ uses two types of IP addresses: public and private. When importing a VPS, its IP addresses are imported as public. In  IPmanager you need to create a new "public" network and specify it for the existing VPS subnets. 
  4. VDSmanager must support OpenVZ virtualization;
  5. Servers must be created in the same network; 
  6. The path to copy VPS is specified by the PrivateDiskDir parameter in the VDSmanager configuration file. If it is not present, the default path is /vz/private.

VM import

Navigate to Import → VM import → Add

  • Root password — authorization with the root password; 

  • Password —  root user password;

  • IP — server IP address;
  • Name.

After you have successfully connected to the server and have received information about the virtual machines, the server is added to Import→ VPS import.

Click on  Import→ VPS import → VPS list to view a list of virtual machines that you can import. Select the virtual machines and click Import.

Note

The virtual machine is suspended on the source-server, its snapshots are deleted.

After import, the VPS gets suspended on the source-server, but not deleted.

The import log file is  /usr/local/mgr5/var/importve.log.  You can view a container import status in the file /usr/local/mgr5/var/run/vemgr/IMPORT/<importve.ip_machine>. When importing a container, the panel starts the separate process named importve.