Install a CentOS 6.x Appliance Template in Proxmox

It's quite easy to install a CentOS 6.0 appliance (template).

  1. Download the precreated template from the OpenVZ site ( ) and store it in the folder /var/lib/vz/template/cache/ of your Proxmox hostnode
  2. Rename the template to <OS>-<OSVERSION>-<NAME>_<VERSION>_<ARCH>.tar.gz to suit Proxmox' naming convention.
    E.g. centos-6-x86.tar.gz --> centos-6-standard_6.0_i386.tar.gz
    or centos-6-x86_64.tar.gz --> centos-6-standard_6.0_amd64.tar.gz
  3. In the Proxmox Virtual Environment web administrator goto "Virtual Machines -> Create" and use your new template there



Migrating a shared server client database to a Direct Admin server (shell commands)


  1. @DA control panel: create a new DB
  2. @DA SSH console as root: retrieve DB as SQL from source MySQL host
  3. @DA SSH console as root: restore the database

After finishing step 1, login at the Direct Admin server as root user and execute the following commands. (Adapt hostname, dbname and credentials to fit your situation)

mysqldump -h --user=yyyyyy --password=zzzzzz --no-create-db --add-drop-table --databases dbname | grep -v "USE.*\`dbname\`" > dump.sql

mysql -u da_admin --password=`awk -F'=' '$1=="passwd" {print $2}' /usr/local/directadmin/conf/mysql.conf` -D newdbname < dump.sql

Migrate openvz container to proxmox VE best practice


Alternative method to do this:

@SOURCE NODE (=openvz node)

# ssh-copy-id -i ~/.ssh/ targethost.domain.tld
# mkdir -p /var/lib/vz
# ln -s /vz/private /var/lib/vz
# ln -s /vz/root /var/lib/vz
# nano -w /etc/vz/conf/101.conf



# vzmigrate targethost.domain.tld 101

On error: "Error: Failed to stop container", migrate again! (Only this time the container is offline)
# vzmigrate targethost.domain.tld 101

@DESTINATION NODE (=proxmox ve)

# vzctl restart 101



In this article I describe the process of moving an openvz container from a openvz server to a proxmox VE host.

The challenge:

  • we want to have a minimum of downtime
  • we want /etc/vz/private/101 and /etc/vz/root/101 moved to "Proxmox directories" /var/lib/private/101 and /var/lib/root/101


  • a running openvz host
  • a running proxmox host

The plan:

  1. reconfigure "root" and "private" dirs of the container to fit proxmox
  2. alter container's configuration file and stop container
  3. do a second sync of earlier mentioned directories
  4. restart the container
  5. migrate the container to the proxmox host (over a SSH connection)
  6. fix the container's configuration at the proxmox host


Example to migrate container 101 to proxmox VE at another host node (targethost.domain.tld). Run these commands as root user.

@SOURCE NODE (=openvz node)
# mkdir -p /var/lib/vz/private
# mkdir -p /var/lib/vz/root

# rsync --progress -a --delete \
--include="/*/dev/console" \
--include="/*/dev/initctl" \
--include="/*/dev/null" \
--include="/*/dev/zero" \
--exclude="/*/dev/*" \
--exclude="/*/proc/*" \
--exclude="/*/sys/*" \
--exclude="/*/tmp/*" \
--exclude="*lost+found" \
/vz/private/101 /var/lib/vz/private/

# vzctl stop 101
# nano -w /etc/vz/conf/101.conf


# vzctl start 101
# vzquota drop 101

# ssh-copy-id -i ~/.ssh/ targethost.domain.tld

# vzmigrate targethost.domain.tld 101

@DESTINATION NODE (=proxmox ve)

# nano -w /etc/vz/conf/101.conf


# vzctl restart 101


Things I miss in Proxmox Virtual Environment 1.7 Webgui

Proxmox Virtual Environment version 1.7 (released 30/11/2010) is the successor of version 1.6. I didn't find any cosmetic changes in the webgui, so this is my personal enhancement list.


  • ability to change server hostname (it keeps *.localhost.localdomain) which results in e-mail delivery errors;
  • doing network changes without rebooting (e.g. configuring eth1 for local LAN);
  • option to copy an existing/running VM to a new VMID;
  • a status screen of the local harddisks (incl. raid) health;
  • a history graph of the virtual machines cpu/memory load to detect performance problems.

Missing the following for Configuration -> Backups:

  • "standard excludes" (log/temp files) checkbox;
  • configure to run multiple backups a day;
  • configuring the "maxfile" option (max. number of backups to hold per containter);
  • a run-back-up-now button.


Migrate openvz container to another openvz host

Example to migrate container 101 to another host node (targethost.domain.tld).
Run these commands as root user.

The first command copies the public ssh key to the target. This way vzmigrate has the privileges to do the migration.
$ ssh-copy-id -i ~/.ssh/ targethost.domain.tld
$ vzmigrate targethost.domain.tld 101

Optional. If you're migrating to a "Proxmox Virtual Environment" you need to edit /etc/vz/conf/101.conf as follows:

(If you forget this step you'll be unable to make changes to the container from the Promox Web GUI)


Final note:
Possibly in the Proxmox Virtual Environment webinterface you'll notice the disk space usage of the container is 0 MB. In that case make the following adaptions:

@HOST NODE as `root` in a SSH console:

  • Stop the container (vzctl stop 101)
  • Optionally move the container data locations to the location proxmox expects (this could take a long time)
    mv /vz/root/101 /var/lib/vz/root/
    mv /vz/private/101 /var/lib/vz/private/
  • Make corrections in the container's configuration file /etc/vz/conf/101.conf
  • Drop the old quota: vzquota drop 101
  • Restart the container: vzctl start 101