virtuozzo administration

By kire

Parallels Virtuozzo Containers is an operating system-level virtualization product designed for large-scale homegenous server environments and data centers. Parallels Virtuozzo Containers is compatible with x86, x86-64 and IA-64 platforms. Parallels Virtuozzo Containers was first released under Parallels’ former parent company SWsoft. The Linux version was released in 2001 while the Windows version was released in 2005.

It’s very similar to OpenVZ, and most of these commands will work similarly. As always, use your head and do your homework before copying and pasting any of these commands into a root shell. ;)

Increase a VPS server’s inode limits:

vzctl set X –diskinodes 900000:900000 –save




To generate a ‘vzstatrep’ report since the previous day:

vzstatrep –nologrotate –plot –sendmailto your@email.com




To print out the percentage of cpu cycles burned per VPS:

vzstatcpu -a /var/log/vzstat/vzstatmon.full.log | awk ‘$1 ~ /[0-9]+/{a[$1]=$2} \
/Total/{total=$2;}END{ for (key in a)print key ” ” ((a[key]/total)*100) “%”}’ \
| sort -nk2





Top VEID resource users for last few days history:

for file in $(ls /var/log/vzstat/vzstatmon.full.log /var/log/vzstat/vzstatmon.full.log.[0-9].gz | sort -n);
do
zcat $file 2>/dev/null | vzstatcpu -5 -;
done | less




view last few days history for one VEID:

for file in $(ls /var/log/vzstat/vzstatmon.full.log /var/log/vzstat/vzstatmon.full.log.[0-9].gz | sort -n); do zcat $file 2>/dev/null | vzstatcpu -v 1 -; done | less




view all vserver’s stats plus the mysql queries/second.

ovzstatus.pl –full





list all processes and sort by cpu usage

vzps -E auwx X | sort -nk4




search for long running queries across all VEIDs:

for ve in $(vzlist -Ho veid); do echo ===$ve===;vzctl exec $ve mysqladmin processlist|awk -F”|” ‘/[0-9]+/{if ($7>1){print $6,$7}}’;done




watch for excessive use of cpu time or lots of processes hung in iowait.

vztop, hit ‘e’ to show veids, then hit ‘i’ for show only idle processes




# fun with netstat

netstat -plan|grep :80|awk {‘print $5′}|cut -d: -f 1|sort|uniq -c|sort -nk 1




vzstat




vzctl exec | exec2 [arg ...]




# when a vps doesn’t restart, and its not because of the inodes but you get warnings:

vzctl umount XXX and try vpsrestart XXX







# how to add a new IP address to a VPS and get cPanel to recognize it:
On the VP node:

vzctl set [--save] [--ipadd ] [--ipdel |all] –SAVE

Then update cPanel license on the VPS:

/usr/local/cpanel/cpkeyclt ; /scripts/rebuildippool