Import of virtual machines

From ISPWiki
Jump to: navigation, search
Hierarchy: VMmanager KVM -> VIRTUAL MACHINES
VMmanager Cloud -> VIRTUAL MACHINES

There are 4 variants of VM import:

  • Import from a server with VMmanager;
  • Import from a server with libvirt;
  • Import from a server with VDSmanager-KVM.
  • Import from another hypervisor (not KVM)

Import of virtual machines from a server with VMmanager or libvirt

Navigate to "Import" -> "VM import".

Click "Add" to add the server that virtual machines will be imported from.

Add a server to an import list


  • Public IP-address of the server;
  • Access details to the server;
  • Server type:
    • Import from libvirt;
    • Import from VMmanager KVM (enter the directory where the control panel is installed).

After you successfully connect to the server and get information about virtual machines from the control panel or libvirt, the server will be added into the import list. Click the "VM list' button to get a list of virtual machines located on this server. The list shows all the virtual machines on the selected server that can be imported. Virtual machines will be suspended during import.

To start the import process, select the virtual machines and click "Start import".

Imported virtual machines

You need to provide the following information:

  • Main parameters:
    • Cluster node the virtual machines will be imported to:
    • User - select the check box if you want to import the owner of this virtual machine;
    • Storage, Disable storage check - during the import process the virtual disk will be moved from the storage of the source server to the storage of the target server:
      • If you need to import virtual machines with the virtual disk located on a local storage:
During the import process the system will search for a storage on the target server which name matches the name of the source storage where the VM disk is located. If the storage is not found, the virtual disk will be imported into the storage specified in the "Storage" field. Select the "Disable disk check" check box to move the virtual disk into the storage selected in the "Storage' field;
  • If you need to import virtual machines with a virtual disk located on a network storage:
When importing from another VMmanager KVM a virtual machine with the disk located on a network storage, the network storages (both the source and the target) must not have the same names, because disk check will fail. Therefore, when importing you need to enable the "Disable disk check" option and in the "Storage" field enter the target storage with the names that differ from the name of the source storage. The virtual disk will be moved to the storage specified in the "Storage" field. You cannot import the virtual machine if its disk is located in the network storage connected to both clusters (the source and the target), since the disk already exists in the storage.
  • Default network - after importing the virtual machine the system will try to connect it to the network with the same name as on the source server. If it is not possible the virtual machine will be connected to the default network.
  • IP-addresses (this section is not available if several virtual machines are imported at the same tume):
    • New domain name - enter a new domain name for еhe virtual machine;
    • Select a new IP - enter the type of a new IP address and how it should be allocated.

Note: all the snapshots of virtual machines will be deleted during import.

Import from a server with VDSmanager-KVM

To add a server the virtual machines will be imported from, navigate to "Import" -> "VDS import" -> "Add".

Add server into import list

Provide the following parameters:

  • Public IP-address of the server ;
  • Access details to the server;
  • Server name.

After you successfully connect to the server and get information about virtual machines from the control panel or libvirt, the server will be added into an import list.

Click the "VPS list' button to get a list of virtual machines located on this server. The list shows all the virtual machines of the selected server that can be imported. Virtual machines will be suspended during the import.

To start the import process, select the virtual machines and click "Start import".

The administrator should select a user who will be the owner of the imported virtual machine. auto means that a user will be created automatically. Username - server IP address.

Besides, you need to select an administrator who will create a virtual machine, VM template, and storage where a disk image will be created.

Clicking "Start all" on the list of servers will import the VPS from the selected server. When the import is finished, the VPS will be suspended. VPS on the source server will be deleted!

Import requirements:

1. Enough resources on cluster nodes

2. If VDSmanager is integrated with IPmanager, make sure that VMmanager is integrated with the same IPmanager.

3. VDSmanager must work with KVM virtualization

Troubleshooting

Possible errors:

err ERROR Error: Type: 'host_missing' Object: Value:

This error means that a node for import is not found.

  • Make sure that the storage selected during the import has sufficient disk space.
  • Make sure that the server has enough RAM for creating a virtual machine. Learn more in Policy.

ERROR Error: Type: 'xml' Object: 'parse_file' Value: '/nfsshare/metainfo.xml'

To resolve the issue, create the /nfsshare/metainfo.xml file. Copy the content from metainfo.xml of any OS template.

Import of virtual machines created with another hypervisor (not KVM)

Import of virtual machines into VMmanager KVM cluster includes creation of the same virtual machine and connection of VM disk.

Import of a virtual machine created with a non-KVM hypervisor includes the following steps:

  1. The virtual disk of the imported virtual machine is converted into the format supported by VMmanager;
  2. The system defines configuration of the imported virtual machine;
  3. A virtual machine with the same configuration as the imported VM is created in VMmanager;
  4. The created virtual machine is suspended in VMmanager;
  5. The virtual disk of the newly created virtual machine is changed into the disk of the imported one;
  6. The virtual machine is activated and checked in VMmanager.

Converting virtual disk of the imported virtual machine into the format supported by VMmanager

VMmanager supports RAW and Qcow2 formats. We recommend using the virt-v2v utility for conersion.

Defining configuration of the imported virtual machine

The following information about the imported virtual machine is required:

  • VM resources (vCPU, RAN, disk space);
  • Location of virtual disk.

VMmanager uses libvirt for virtualization management. In libvirt virtual machines are kept in the form of XML-descriptions. You can get any information about a virtual machine from such description.

The way how you can get information about the imported virtual machine depends on how that machine was created.

Creating a virtual machine in VMmanager with the same configuration as the imported VM has

In the control panel you need to add a virtual machine similar to the one being imported. You need to specify its settings manually.

Suspending a virtual machine created in VMmanager

In the control panel change the VM status from "Running" into "Suspended".

Changing disk of the newly created virtual machine into the disk of the imported machine

The virtual disk of the machine created in the control panel and the converted virtual disk of the imported virtual machine must have the same format - RAW or Qcow2.

You need to copy the converted virtual disk of the imported virtual machine and use it instead of the virtual disk of the VM created in the control panel. The disk storage of the VM created in the control panel was specified on the VM creation form. The virtual disk has the same name as the virtual machine.

Enabling the virtual machine and checking its performance

In the control panel you need to change the VM status from "Suspended" into "Running".

Possible errors:

1. You may get an error something like the following:

qemu-kvm: -drive file=/vm/vm2,if=none,id=drive-virtio-disk0,format=qcow2: could not open disk image /vm/vm2: Invalid argument

Usually this error means that the format of VM disks does not match. You need to re-create a virtual machine in the control panel and specify the correct format of the virtual disk. Or convert the virtual disk of the imported virtual machine into an appropriate format.