June 14th, 2013 |
admin |
Here’s is a simple shell script to run a weekly lvm snapshot dump of all OpenVZ containers using the vzdump utility: #!/bin/bash # ve_dumps.sh # Dump all VEs# Todays’ date DATE=$(date +%d) # Paths BAK_PATH=/opt/bak/vz_dumps # Week of month BAK_DIR=$(cal | awk -v date=”${DATE}” ‘{ for( i=1; i <= NF ; i++ ) if [...]
I need sometimes to clone a vps in an openvz environment, so here you can find three methods to do this task: first option: # vzctl stop 101 Stopping VE … VE was stopped VE is unmounted # cp -r /vz/private/101 /vz/private/202 # cp /etc/vz/conf/101.conf /etc/vz/conf/202.conf # vzctl start 202 Starting VE … Initializing quota [...]
April 28th, 2013 |
admin |
Helper script to create users on all OpenVZ VEs simultaneously: #!/bin/bash # create_ve_users.sh # Usage: ./create_ve_users.sh <username> <password> <uid> <group1,group2> USERNAME=$1 PASSWORD=$2 USERID=$3 GROUP=$4 EXPECTED_ARGS=4 OUT_FILE=.create_users_$$ if [ $# -ne $EXPECTED_ARGS ] then echo “Usage: `basename $0` <username> <password> <uid> <group1,group2>” exit 65 fi VE_LIST=$(/usr/sbin/vzlist -H -o veid) for VE in ${VE_LIST} do vzctl [...]
April 27th, 2013 |
admin |
If you manage several OpenVZ containers, here is a simple bash script to keep the OpenVZ containers upto date. #!/bin/bash # vzyum_updates.sh # updates VEs VE_LIST=$(/usr/sbin/vzlist -H -o veid | grep -v Warning) for VE in ${VE_LIST} do /usr/bin/vzyum $VE update done exit 0
December 24th, 2012 |
admin |
How to re-create/re-install a OpenVZ VPS? 1) Make a backup of the configuration file: cp -p /etc/sysconfig/vz-scripts/VEID.conf /etc/sysconfig/vz-scripts/VEID.conf_old 2) Stop the VPS: vzctl stop VEID 3) Destroy/Terminate the VPS: vzctl destroy VEID 4) Create the VPS using the OS templates stored under /vz/template/cache directory: vzctl recreate VEID –ostemplate os-template-name 5) Copy the original configuration file [...]
December 10th, 2012 |
admin |
Our goal is to start the pppd daemon in a virtual machine. Then it is possible, for example, to connect to your DSL provider in a VM. Caveat This feature is experimental. It currently requires a version of vzctl patched with this patch. It is also necessary to run one of these 2 kernels : 2.6.27 [...]
October 19th, 2012 |
admin |
You may receive an error as “Unable to get tty name: Bad file descriptor” while accessing a VPS from the host server. The problem occur when some files from /lib directory of the VPS goes missing. See example below: root@hostserver:/# vzctl enter VEID entered into CT VEID Unable to get tty name: Bad file descriptor [...]
October 1st, 2012 |
admin |
You may receive the following error message while starting a VPS: root@server [~]# vzctl start VEID vzquota : (error) Quota on syscall for id xxx: Device or resource busy vzquota : (error) Possible reasons: vzquota : (error) – Container’s root is already mounted vzquota : (error) – there are opened files inside Container’s private area [...]
September 28th, 2012 |
admin |
1. Host will be open on LAN and guests on WAN. Additionally, there is a bridged LAN for guests. 2. We will be using bridge networking for protecting the Host Network and saving IP addresses, also giving flexibility with the guest network setup. 3. Configure LAN Eth1 port to 192.168.1.2 4. WAN Eth0 port is [...]
August 20th, 2012 |
admin |
You may receive the error message while starting a VPS on OpenVZ server. vzquota : (error) Quota getstat syscall for id 101: Inappropriate ioctl for device vzquota init failed [3] This is a typical Quota error message on OpenVZ servers while starting a VPS. The message indicates that you need to initialize quota on the [...]