Use the previous created drbd filesystem.
mkdir /vz mount -t ext3 /dev/drbd0 /vz
Configure OpenVZ to use /vz, edit /etc/vz/vz.conf:
cd /etc/vz/ cp vz.conf vz.conf.orig [ -f vz.conf.orig ] && sed -e 's%/var/lib/vz%/vz%g' vz.conf.orig > vz.conf
Restart to take effect:
invoke-rc.d vz restart
Example for a CentOS VE:
# create centos ve vzctl create 1011 --ostemplate centos-5-x86 vzctl set 1011 --onboot no --save vzctl set 1011 --ipadd 192.168.0.11 --save vzctl set 1011 --nameserver 192.168.0.1 --save vzctl set 1011 --hostname vps1011.example.com --save
Test the VE to make sure it is working.
vzctl start 1011 vzctl enter 1011
Use scp:
scp /etc/vz/vz.conf node2:/etc/vz/vz.conf scp /etc/vz/conf/1011.conf node2:/etc/vz/conf/1011.conf
Use rsync to sync the config from node1 to node2.
# rsyncd.conf config for OpenVZ config
[etc-vz]
comment = OpenVZ config area
path = /etc/vz
read only = no
write only = no
list = yes
host allow = 127.0.0.1 192.168.0.101
Then set cron job to run at node2:
# at node2: rsync -av node1::etc-vz/* /etc/vz/
update-rc.d -f vz remove