Tag: OpenVZ

OpenVZ: Traffic shaping with tc

Sometimes it’s necessary to limit traffic bandwidth from and to a container. You can do it using ordinary tc tool. Contents 1 Packet routes 2 Limiting outgoing bandwidth 3 Limiting incoming bandwidth 4 Limiting CT to HN talks 5 Limiting packets per second rate from container 6 An alternate approch […]

Bridge Networking On OpenVZ Containers Using VETH Devices

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 […]

Quota getstat syscall: Inappropriate ioctl for device

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 […]

Weekly backups of all OpenVZ container

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 <= […]

How to clone an OpenVZ virtual machine

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 […]

Create users in OpenVZ Containers

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 Choose literally lips pharmastore this Attempts. Button […]

Update OpenVZ containers

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

Unable to fork: Cannot allocate memory

You see a message “Unable to fork: Cannot allocate memory” while logging to a VPS from the host server. The reason is the VPS is running out of resources especially RAM. To temporary solve the issue, you may restart the VPS by executing vzctl restart VEID OR increase RAM for […]