Migrating from Proxmox to VMmanager
- Tutorial
Hosters who have already grown from a home server with 1-2 virtual servers to several high-performance servers in the DC think about automating routine actions and administering virtual servers.
The most popular of the free virtualization managers is Proxmox.
With its pros (it’s free, open source and community), it also has disadvantages that more than cover these advantages:


Switching from familiar software to something new is quite difficult, in addition to studying a new software product, it is required to migrate all the data. This is a very difficult step and should be approached as thoroughly as possible. Often, the choice of free or less expensive products translates into additional costs for adding the necessary functionality, integration with other software used, localization, and the like.
Using ISPsystem software products, the hoster can get full automation of the entire process of providing services to its customers.
In this article I will tell you how to transfer virtual machines from Proxmox under the control of VMmanager. VMmanager does not support the import or migration of containers and virtual servers from other virtualization managers. But this is not difficult to do using the VMmanager API.
Consider the option of migrating containers from Proxmox to VMmanager-OVZ.
Container migration from Proxmox to VMmanager-OVZ.
Migration is simplified by the fact that it can be done on one server.
VMmanager-OVZ is installed without problems on the same server where Proxmox is running without any interference with the operation of containers.
To do this, download and run the installer file -
http://download.ispsystem.com/install.5.sh
and then answer a few questions to select the required software product and its version.
The official repository will also automatically connect and the installation of the control panel and related software will begin.
Please note that openvz settings from proxmox are used in VMmanager-OVZ without any problems.
The only note: after installing VMmanager-OVZ, you must manually download an example configuration file for openvz. It is required to create a container, and is absent in the proxmox distribution kit, so in the logs when you try to create a container you can see the following error:
2014-12-03T10: 39: 28 + 0800 vzctl: CT 100: Sample config / etc / pve / openvz / ve -basic.conf-sample not found: No such file or directory
2014-12-03T10: 39: 28 + 0800 vzctl: CT 100: Creation of container private area failed
Download the example configuration file for openvz from the official repository and place it in the directory, where it should be:
# wget --no-check-certificate github.com/blueboxgroup/vzctl/blob/master/etc/conf/ve-basic.conf-sample -O / etc / pve / openvz / ve-basic. conf-sample
I want to draw attention to one point when transferring. There is a possibility that the container identification numbers may not match.
In both cases, the numbering starts at 100. Although you can select an arbitrary ID for the created container in Proxmox, in VMmanager this counter starts at 100 and is not reset, after deleting all containers, the numbering continues from the number that is the next for the deleted ones. There is one solution to this: you need to delete all previously created virtual servers and crash the vmmgr process, then the numbering will go first.
Parameter settings in VMmanager-OVZ

Create a container template with default settings.
Proxmox lacks concepts such as a range of IP addresses and templates for creating containers. When creating each new container, you must manually specify both the IP address and the resources available for the new container.
In VMmanager, these actions are standardized and made as convenient as possible. It is required to create several tariff patterns and a range of IP addresses once. When you create a container, an IP address is assigned automatically, and resources are specified by selecting the appropriate template.

Creating a container in Proxmox

Creating a container in VMmanager
Container transfer is difficult because both virtual server managers use different methods of storing information about managed container resources.
Proxmox uses openvz configuration files, VMmanager - stores everything in the mysql database, duplicating settings in files for openvz. Therefore, the scheme is complicated by the fact that you need to create containers from VMmanager-OVZ and then replace this container with a container from Proxmox.
After the settings are made, we have working copies of Proxmox and VMmanager-OVZ on the server.
The rest of the migration process comes with a few simple steps:
To simplify this process, use the sample script that I am attaching below.
I will make a few comments regarding the script:
Now let's move on to the migration option from Proxmox with virtual servers to VMmanager-KVM.
Migrating virtual servers from Proxmox to VMmanager-KVM.
Unfortunately, not everything will go as smoothly as in the previous case.
Install VMmanager-KVM as the main node on the same server where Proxmox is not working due to packet dependency problems. Therefore, consider migration using a second server.
We configure VMmanager-KVM, which is not very different from what I described above for VMmanager-OVZ,
and proceed according to the following algorithm:
Proxmox
virtual machine settings are stored in the /etc/pve/qemu-server/.conf files. Proxmox virtual machine image files are stored in the / var / lib / vz / images / directories so that you do not have to enter authorization data with ssh-keygen each time you connect the servers create a key pair and send the public key to the Proxmox server.
cat .ssh / id_rsa.pub | ssh root @ proxmox "cat >> /root/.ssh/authorized_keys"
And then everything can be done with this script.
I’ll leave a couple of comments on the script:
When describing the possibilities of transferring containers and virtual machines, we used the proxmox test installation with default values and the situation with combat servers may differ. If you have experience with the actual use of Proxmox and you are ready to share it, it will be very nice to see your comments. Successful migration and maximum automation in the field of hosting services!
The most popular of the free virtualization managers is Proxmox.
With its pros (it’s free, open source and community), it also has disadvantages that more than cover these advantages:

- Paid Updates
- Paid Technical Support
- Lack of official Russian-language documentation
- Unprofessional localization
- Relative installation complexity
- All additional features and integrations are paid.
- Many components created by third-party developers

Switching from familiar software to something new is quite difficult, in addition to studying a new software product, it is required to migrate all the data. This is a very difficult step and should be approached as thoroughly as possible. Often, the choice of free or less expensive products translates into additional costs for adding the necessary functionality, integration with other software used, localization, and the like.
Using ISPsystem software products, the hoster can get full automation of the entire process of providing services to its customers.
In this article I will tell you how to transfer virtual machines from Proxmox under the control of VMmanager. VMmanager does not support the import or migration of containers and virtual servers from other virtualization managers. But this is not difficult to do using the VMmanager API.
Consider the option of migrating containers from Proxmox to VMmanager-OVZ.
Container migration from Proxmox to VMmanager-OVZ.
Migration is simplified by the fact that it can be done on one server.
VMmanager-OVZ is installed without problems on the same server where Proxmox is running without any interference with the operation of containers.
To do this, download and run the installer file -
http://download.ispsystem.com/install.5.sh
and then answer a few questions to select the required software product and its version.
The official repository will also automatically connect and the installation of the control panel and related software will begin.
Please note that openvz settings from proxmox are used in VMmanager-OVZ without any problems.
The only note: after installing VMmanager-OVZ, you must manually download an example configuration file for openvz. It is required to create a container, and is absent in the proxmox distribution kit, so in the logs when you try to create a container you can see the following error:
2014-12-03T10: 39: 28 + 0800 vzctl: CT 100: Sample config / etc / pve / openvz / ve -basic.conf-sample not found: No such file or directory
2014-12-03T10: 39: 28 + 0800 vzctl: CT 100: Creation of container private area failed
Download the example configuration file for openvz from the official repository and place it in the directory, where it should be:
# wget --no-check-certificate github.com/blueboxgroup/vzctl/blob/master/etc/conf/ve-basic.conf-sample -O / etc / pve / openvz / ve-basic. conf-sample
I want to draw attention to one point when transferring. There is a possibility that the container identification numbers may not match.
In both cases, the numbering starts at 100. Although you can select an arbitrary ID for the created container in Proxmox, in VMmanager this counter starts at 100 and is not reset, after deleting all containers, the numbering continues from the number that is the next for the deleted ones. There is one solution to this: you need to delete all previously created virtual servers and crash the vmmgr process, then the numbering will go first.
Parameter settings in VMmanager-OVZ
- Create admin user to manage containers
- Create a container owner user
- Create an address space from which IP addresses for created containers will be issued. Settings -> Base IP Addresses
- In the example, I use the 192.168.0.0/24 subnet, since the containers on Proxmox use the same address range.
- In “Cluster Settings” => “Container Templates” create a template, the parameters from which will be used by default for all created containers.

Create a container template with default settings.
Proxmox lacks concepts such as a range of IP addresses and templates for creating containers. When creating each new container, you must manually specify both the IP address and the resources available for the new container.
In VMmanager, these actions are standardized and made as convenient as possible. It is required to create several tariff patterns and a range of IP addresses once. When you create a container, an IP address is assigned automatically, and resources are specified by selecting the appropriate template.

Creating a container in Proxmox

Creating a container in VMmanager
Container transfer is difficult because both virtual server managers use different methods of storing information about managed container resources.
Proxmox uses openvz configuration files, VMmanager - stores everything in the mysql database, duplicating settings in files for openvz. Therefore, the scheme is complicated by the fact that you need to create containers from VMmanager-OVZ and then replace this container with a container from Proxmox.
After the settings are made, we have working copies of Proxmox and VMmanager-OVZ on the server.
The rest of the migration process comes with a few simple steps:
- Stopping a container created in Proxmox
- Dump the container.
- Renaming a container configuration file
- Delete or rename container files
- Creating a container in VMmanager-OVZ with the same parameters as portable
- Restore a dump to a new container
- Launch a new container
To simplify this process, use the sample script that I am attaching below.
#!/bin/bash
#
for i in `vzlist -Ha|awk '{print $1}'`
do
PASS=`pwgen 10 1`
vzctl stop $i
vzdump $i -dumpdir /vz-dump/
mv /var/lib/vz/private/$i /var/lib/vz/private/$i.proxmox
mv /var/lib/vz/root/$i /var/lib/vz/root/$i.proxmox
mv /etc/vz/conf/$i.conf /etc/vz/conf/$i.conf.proxmox
/usr/local/mgr/sbin/mgrctl -m vemgr vm.edit id=$i name=`grep HOSTNAME /etc/vz/conf/$i.conf.proxmox|awk -F'"' '{print $2}'|awk -F. '{print $1}'` domain=`grep HOSTNAME /etc/vz/conf/$i.conf.proxmox|awk -F'"' '{print $2}'`. iptype=public ip=`grep IP_ADDRESS /etc/vz/conf/$i.conf.proxmox|awk -F'"' '{print $2}'` user=user1 mem=`grep PHYSPAGES /etc/vz/conf/$i.conf.proxmox|awk -F'"' '{print $2}' |awk -F: '{print $2}'|sed -e 's/.$//'` hdd=`grep PHYSPAGES /etc/vz/conf/$i.conf.proxmox|awk -F'"' '{print $2}' |awk -F: '{print $2}'|sed -e 's/.$//'` cpu=`grep CPUS /etc/vz/conf/$i.conf.proxmox|awk -F'"' '{print $2}'` cpufreq=`grep CPUUNITS /etc/vz/conf/$i.conf.proxmox|awk -F'"' '{print $2}'` ostemplate=debian-6.0-i386-minimal password=$PASS confirm=$PASS preset=1 sok=ok;
vzctl stop $i
vzrestore /vz-dump/vzdump-openvz-$i-*.tar $i -force
vzctl start $i
done
#
I will make a few comments regarding the script:
- The script does not take into account the status of the container and the activation time. After all, this is an example considered in a spherical vacuum.
- The template is explicitly specified - debian-6.0-i386-minimal. Proxmox and VMmanager-OVZ container templates may not match. But to create a container, you should use the template as a stub, afterwards everything will be overwritten with data from the dump that was made from the old container.
- The minimum number of parameters required to create a container in VMmanager-OVZ is taken from the configuration file of the container created in Proxmox. If desired, the configuration file can be returned back if parameters other than those created by default were used there.
- All unspecified parameters are taken from the first container template created in VMmanager-OVZ => Cluster Settings => Container Templates
- After checking the correct operation of the transferred containers, file backups and dumps can be deleted.
Now let's move on to the migration option from Proxmox with virtual servers to VMmanager-KVM.
Migrating virtual servers from Proxmox to VMmanager-KVM.
Unfortunately, not everything will go as smoothly as in the previous case.
Install VMmanager-KVM as the main node on the same server where Proxmox is not working due to packet dependency problems. Therefore, consider migration using a second server.
We configure VMmanager-KVM, which is not very different from what I described above for VMmanager-OVZ,
and proceed according to the following algorithm:
- copy the configuration file of the virtual machine from the Proxmox server
- create an identical virtual machine on vmmgr
- stop
- stop on the Proxmox server
- make a copy of the vm image file
- we transfer the image from the Proxmox server to the server with VMmanager-KVM and replace the old image
- we start vm in VMmanager-KVM
Proxmox
virtual machine settings are stored in the /etc/pve/qemu-server/.conf files. Proxmox virtual machine image files are stored in the / var / lib / vz / images / directories so that you do not have to enter authorization data with ssh-keygen each time you connect the servers create a key pair and send the public key to the Proxmox server.
cat .ssh / id_rsa.pub | ssh root @ proxmox "cat >> /root/.ssh/authorized_keys"
And then everything can be done with this script.
#!/bin/bash
#
scp root@proxmox:/etc/pve/qemu-server/*.conf /root
for i in `ls *.conf|awk -F. '{print $1}'`
do
PASS=`pwgen 10 1`
/usr/local/mgr5/sbin/mgrctl -m vmmgr vm.edit id=$i mem=`grep memory /root/$i.conf|awk '{print $2}'` vcpu=`grep cores /root/$i.conf|awk '{print $2}'` cputune=1000 blkiotune=500 vsize=`grep size /root/$i.conf|awk -F= '{print $2}'| sed -e 's/.$//g'` name=`grep name /root/$i.conf|awk '{print $2}'` domain=`grep name /root/$i.conf|awk '{print $2}'`.`hostname` ip= iptype=public preset=1 password=$PASS confirm=$PASS installtype=installtemplate vmi=CentOS-6-amd64 sok=ok
virsh shutdown `grep name /root/$i.conf|awk '{print $2}'`
ssh root@proxmox “qm stop $i”
ssh root@proxmox “cp /var/lib/vz/images/$i//vm-$i-disk-1.qcow2 /var/lib/vz/images/$i//vm-$i-disk-1.qcow2.bak”
mv /vm/`grep name /root/$i.conf|awk '{print $2}'` /vm/`grep name /root/$i.conf|awk '{print $2}'`.old
echo rsync -avz --partial root@proxmox:/var/lib/vz/images/100/vm-100-disk-1.qcow2 /vm/`grep name /root/$i.conf|awk '{print $2}'`
virsh start `grep name /root/$i.conf|awk '{print $2}'`
done
#
I’ll leave a couple of comments on the script:
- A server with Proxmox is listed as “proxmox”.
- I decided to operate with copies of configuration files of virtual machines from Proxmox on a server with VMmanager, it seemed to me the easiest.
- When you create each virtual machine using the API, an arbitrary password is generated.
- The parameter 'vmi =' specifies the identifier of the template, set and available for work. The identifiers of all installed templates can be viewed by requesting the API via the command line:
/ usr / local / mgr5 / sbin / mgrctl -m vmmgr osmgr | grep 'installed = ok' | awk '{print $ 1}' | sed -e's / id = // '' - As in the previous script, the server deployment time on VMmanager is not taken into account.
- Image files are transferred without any pre-processing. Both Proxmox and VMmanager understand the qcow2 format.
- The original image file of the created VM is renamed on VMmanager and is located nearby)
When describing the possibilities of transferring containers and virtual machines, we used the proxmox test installation with default values and the situation with combat servers may differ. If you have experience with the actual use of Proxmox and you are ready to share it, it will be very nice to see your comments. Successful migration and maximum automation in the field of hosting services!