Editing
VPS Management
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= Virtuozzo VPS Management Tools = == vm == To create a new Linux VPS * get an IP address from mgmt screen * run df -h to figure out which disk has enough space * run vm with no arguments to get syntax and exact template name * use col0xxxx for hostname if they don’t give you a hostname * copy over dir, veid, ip and password to pending customer screen vm CID IP hostname /vz[1|2] email[,email] template ( <LB|LBP|LS|LM|LMP|LP> [disk] | <gb_disk/mb_ram/gb_burst> ) == disable == To disable a customers Virtuozzo VPS server. * stop the server vzctl stop <veid> * prevent restart on server reboot and user restart via Control Panel vzctl set <veid> --disabled=yes --offline_management=no --save == cancelve == When a customer cancels all service. cancelve <veid> this will: * stop a ve * check for backups (offer to remove them from the backup server and the backup.config) * rename the private dir * check for PTR, provide the commands to reset to default * and rename the ve’s config * remind you to remove firewall rules * remind you to remove DNS entries == ipadd == ipadd <veid> <ip> [ip] [ip] add’s ip(s) to a ve == ipdel == ipdel <veid> <ip> [ip] [ip] removes ip(s) from a ve == vc == vc <veid> display the contents of the vz config file for the <veid> the equivalent of: <tt>cat /vzconf/<veid>.conf</tt> == vl == vl List all virtual environments running on this machine. will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop) == vp == vp <veid> show processes running under this <veid>. the equivalent of: <tt>vzps auxww –E <veid></tt> == vpe == DEPRECATED vpe <veid> this will allow you to do a vp when a ve is running out of control, the equivalent of (deprecated since vp operates outside the VPS): <pre>vzctl set <veid> --kmemsize 2100000:2200000 vzctl exec <veid> ps auxw vzctl set <veid> --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)</pre> == vt == vt <veid> the equivalent of: <tt>vztop –E <veid></tt> == vr == vr <veid> Restart a <veid>. the equivalent of: <tt>vzctl stop <veid>; vzctl start <veid></tt> You can run this even if the ve is down - the stop command will just fail == vs == vs [veid] displays status (output of <tt>vzctl status <veid></tt>) on each ve configured on the system (as determined by <tt>/vzconf/*.conf</tt>) If passed an argument, gives the status for just that ve. A running system looks like: <tt>VEID 16066 exist mounted running</tt> A ve which is not running (but does exist) looks like: <tt>VEID 9990 exist unmounted down</tt> A ve which is not running and doesn’t exist looks like: <tt>VEID 421 deleted unmounted down</tt> == vs2 == vs2 [veid] this is similar to vs in that it displays status (output of <tt>vzctl status <veid></tt>) on each ve, but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch the rare case where a ve configured but exists. == vw == vw [veid] displays the output of ‘<tt>w</tt>’ (the equivalent of <tt>vzctl exec <veid> w</tt>) for each configured ve (as determined by <tt>/vzconf/*.conf</tt>). Useful for determing which ve is contributing to a heavily-loaded system. If passed an argument, gives ‘<tt>w</tt>‘ output for just that ve. Ex: <pre>[root@virt2 etc]# vw 134 10:52pm up 79 days, 6:14, 0 users, load average: 0.02, 0.02, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT 16027 2:52pm up 7 days, 19:54, 0 users, load average: 0.00, 0.00, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT 16055 2:52pm up 79 days, 6:38, 0 users, load average: 0.00, 0.04, 0.07 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT</pre> == vwe == vwe [constraint] just like <tt>vw</tt>, but takes a constraint as an argument, only show’s ve’s with loads >= the constraint provided. If no constraint is provided, 1 is used by default == vzs == vzs [veid] displays the beancounter status for all ve’s, or a particular ve if an argument is passed == ve == ve <veid> enter a <veid> as root. the equivalent of: <tt>vzctl enter <veid></tt> == vx == vx <veid> <command> execute a single command in the <veid> environment. the equivalent of: <tt>/usr/sbin/vzctl exec <veid> <command></tt> == dprocs == dprocs [count] a script which outputs a continuous report (or a certain number of reports if an option is passed) of processes stuck in the D state and which VPS’s those procs belong to. == setmem == setmem VEID <256|512|768|1024|1280|1536|2048> [burst GB] adjusts the memory resources for the VE. If this is on VZ ver >4, you will also be prompted to provide a burst ram amount. Sample usage: <pre># setmem 21671 1024 4 /usr/sbin/vzctl set 21671 --ram 1024m --swap 3072m --save </pre> == afacheck.sh == afacheck.sh displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI == backup == backup backup script called nightly to update virt scripts and do customer backups == checkload.pl == checkload.pl this was intended to be setup as a cronjob to watch processes on a virt when the load rises above a certain level. Not currently in use. == findbackuppigs.pl == findbackuppigs.pl looks for files larger than 50MB which customers have asked us to backup. Emails matches to linux@johncompanies.com == gatherlinux.pl == gatherlinux.pl gathers up data about ve’s configured and writes to a file. Used for audits against the db == gb == gb <search> greps backup.config for the given search parameter == gbg == gbg <search> greps backup.config for the given search parameter and presents just the directories (for clean pasting) == linuxtrafficgather.pl == linuxtrafficgather.pl [yy-mm] sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com. Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on traffic logs created by netstatreset and netstatbackup == linuxtrafficwatch.pl == linuxtrafficwatch.pl checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and the limit (40G). Works on virtuozzo versions <= 2.6.x. We really aren’t using this anymore now that we have netflow. == linuxtrafficwatch2.pl == linuxtrafficwatch2.pl checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow. == load.pl == load.pl feeds info to load mrtg - executed by inetd. == mb (linux) == mb <mount|umount> (nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. == migrate == migrate <ip of node migrating to> <veid> <target_veid> [target dir: vz | vz1 | vz2] this is basically a wrapper for <tt>vzmigrate</tt> – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was written cause vz virtuozzo version 2.6 had a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables. This script mitigates that. Since it makes multiple ssh connections to the target host, it’s a good idea to put the pub key for the src system in the authorized_keys file on the target host. In addition, it emails ve owners when their migration starts and stops (if they place email addresses in a file on their system: /migrate_notify). To move everyone off a system, you’d do: for f in `vl`; do migrate <ip> $f; done == migrateonline == migrateonline <ip of node migrating to> <veid> <target_veid> [target dir: vz | vz1 | vz2] this is the same as migrate but will migrate a ve in <tt>–online</tt> mode which means it won’t be shut down at the end of the migration. This only works when migrating ve’s between 2 machines running a 2.6 kernel (currently tempvirt1-2. virt16-19, virt12). If you get an error that the machine you’re trying to migrate to has a different CPU or features, etc, then you have to edit the file and add the –f switch to the vzmigrate line- you can basically ignore this kind of warning (but never ignore a warning about missing templates on the destination node). NOTE: This edit (if made to migrateonline) will be overwritten by the base script during each night’s backup. == netstatbackup == DEPRECATED netstatbackup writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. == netstatbackup2 == DEPRECATED netstatbackup2 writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. == netstatreset == DEPRECATED netstatreset writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x == netstatreset2 == DEPRECATED netstatreset2 writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. == orphanedbackupwatchlinux == orphanedbackupwatchlinux looks for directories on backup2 which aren’t configured in backup.config and offers to delete them == rsync.backup (linux) == rsync.backup does customer backups (relies on backup.config) == startvirt.pl == startvirt.pl forks off start ve commands – keeps 6 running at a time. This is not to be used on systems where fastboot is enabled as it circumvents the benefit of the fastboot. The script will occasionally not exit gracefully and will continue to use up CPU, so it should be watched. Also, don’t exit from the script till you’re sure all ve’s are started – if you do you need to start them manually and may have to free up locks. On some systems, the startvirt script doesn’t exit cleanly and you have to ^C out of it. Be careful though- doing so can leave some VE’s in an odd bootup state and you may need to ‘vr’ them manually. You should check to see which ve’s aren’t running and/or confirm all have started when ^C’ing out of startvirt. == taskdone (linux) == taskdone when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject == vb (linux) == vb the equivalent of: <tt>vi /usr/local/sbin/backup.config</tt> == vemakeXX == DEPRECATED vemakerh9 ve create script for RH9 (see vemake) vemakedebian30 ve create script for debian 3.0 (Woody) (see vemake) vemakedebian31 ve create script for debian 3.1 (Sarge) (see vemake) vemakedebian40 ve create script for debian 4.0 (Etch) (see vemake) vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7 ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake) vemakecentos3, vemakecentos4 ve create script for centos 3, 4 respectively (see vemake) vemakesuse, vemakesuse93, vemakesuse100 ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake) vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704 ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake) == vemove == DEPRECATED vemove <veid> <target_ip> </vz/private/123> this script simplifies the old way of moving ve’s from one system to another - in short moving a ve to or from a virt running virtuozzo < 2.6.x It’s the equivalent of: <tt>tar cfpP - <veid> --ignore-failed-read | (ssh -2 -c arcfour <target_ip> "split - -b 1024m </vz/private/123>.tar" )</tt>This should only be used if migrate/vzmigrate can’t be used. == vim.watchdog == vim.watchdog looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time & consuming lots of cpu. Works on virtuozzo versions 2.5.x == vim.watchdog2 == vim.watchdog2 looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time & consuming lots of cpu. Works on virtuozzo versions 2.6.x. == vzmigrate == vzmigrate <target_ip> -r no <veid>:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid] (this is the raw command “wrapped” by migrate/migrateonline) this will seamlessly move a ve from one host to another. The ve will run for the duration of the migration till the very end when it’s shut down, ip moved and started up on the target system. The filesystem on the src will remain. This should be watched – occasionally the move will timeout and leave the system shut down. If target private and root aren’t specified it just puts it in /vz. Only works when both systems are running virtuozzo 2.6.x == vztrafdump.sh == DEPRECATED vztrafdump.sh writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions <= 2.5.x. == vztrafdump2.sh == DEPRECATED vztrafdump2.sh writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions 2.6.x. == addtun == addtun <veid> Add’s tun device to ve. == bwcap == bwcap <veid> <kbps> Ex: <tt>bwcap 1234 512</tt> Caps a VE’s bandwidth to the amount given == setdisk == setdisk <veid> <diskspace in GB> Ex: <tt>setdisk 1234 5</tt> Gives a VE’s a given amount of disk space == vdf == vdf <veid> the equivalent of: <tt>vzctl exec <veid> df –h</tt> == vdff == vdff runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN) == mvbackups == mvbackups <veid> <target_machine> (virt1) <target_dir> (vz1) moves backups from one location to another on the backup server, and provides you with option to remove entries from current backup.config, and simple paste command to add the config to backup.config on the target server == checkquota == checkquota for all the ve’s in the cwd (run from /vz/private, /vz1/private, etc) reports what vz quota says they’re using and what the actual usage is (as reported by du) == clearquota == clearquota <veid> Recalculates a ve’s quota, prints out the usage before and after. The equivalent of: <tt>vdf <veid>; v stop <veid>; vzquota drop <veid>; v start <veid>; vdf <veid></tt> == dprocs == dprocs Sometimes the server’s have a large number of processes get stuck in the D state- this script shows (every 3 secs) which VE’s have D procs, which procs are stuck and a running average of the top “offenders” == vzstat == vstat sort of like top for VZ. sort VEs by CPU usage by pressing 'o' and then 'c' keys == stopvirt == stopvirt will stop VEs as fast as it can, 6 at a time. May not exit when complete so you should watch [[#vzstat|vzstat]] in another window.
Summary:
Please note that all contributions to JCWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
JCWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information