<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.jcihosting.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Support</id>
	<title>JCWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.jcihosting.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Support"/>
	<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Special:Contributions/Support"/>
	<updated>2026-06-13T05:55:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Main_Page&amp;diff=1120</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Main_Page&amp;diff=1120"/>
		<updated>2013-03-15T22:54:49Z</updated>

		<summary type="html">&lt;p&gt;Support: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[Special:AllPages|All Pages]]&lt;br /&gt;
* [[Payment_System|Payment System]]&lt;br /&gt;
* [[Management_System_/_Public_Website_/_Signup_/_Account_Manager|Management System / Public Website / Signup / Account Manager]]&lt;br /&gt;
* [[New_Signups|New Signups]]&lt;br /&gt;
* [[Shutting_Down_Service|Shutting Down Service]]&lt;br /&gt;
* [[Routine_Maintenance|Routine Maintenance]]&lt;br /&gt;
* Reference&lt;br /&gt;
** [[VPS_Management|VPS Management]]&lt;br /&gt;
** [[Jail_Server_Install|Jail Server Install]]&lt;br /&gt;
** [[Virtuozzo_Server_Install|Virtuozzo Server Install]]&lt;br /&gt;
** [[Infrastructure_Machines|Infrastructure Machines]]&lt;br /&gt;
** [[Colo_Server_Setup|Colo Server Setup]]&lt;br /&gt;
** [[DNS]]&lt;br /&gt;
** [[FreeBSD_Reference|FreeBSD Reference]]&lt;br /&gt;
** [[Virtuozzo_/_Linux_Reference|Virtuozzo / Linux Reference]]&lt;br /&gt;
** [[Cabinetmap]]&lt;br /&gt;
** [[Switch_Control|Switch Control]]&lt;br /&gt;
** [[Private_IP_Mapping|Private IP Mapping]]&lt;br /&gt;
** [[Data_Center_Notes|Data Center Notes]]&lt;br /&gt;
** [[Crash_Reference|Crash Reference]]&lt;br /&gt;
** [[Hardware_Reference|Hardware Reference]]&lt;br /&gt;
** [[ATS]]&lt;br /&gt;
** [[Wiring_Reference|Wiring Reference]]&lt;br /&gt;
** [[Screen]]&lt;br /&gt;
** [[RAID_Cards|RAID Cards]]&lt;br /&gt;
** [[BigBrother]]&lt;br /&gt;
** [[Bandwidth_Management|Bandwidth Management]]&lt;br /&gt;
** [[Network_Time_(ntp)|Network Time (ntp)]]&lt;br /&gt;
** [[DRAC/RMM|DRAC/RMM]]&lt;br /&gt;
** [[Customer_Backups|Customer Backups]]&lt;br /&gt;
** [[DoS_Attacks|DoS Attacks]]&lt;br /&gt;
** [[IPKVM|IPKVM]]&lt;br /&gt;
* [[System-generated_Notifications|System-generated Notifications]]&lt;br /&gt;
* [[Customer_Interaction|Customer Interaction]]&lt;br /&gt;
* [[Backup_Accounts_(rsync.net)| Backup Accounts (rsync.net)]]&lt;br /&gt;
* [[E-Monitoring_notes|E-Monitoring notes]]&lt;br /&gt;
* [[Todo]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [https://meta.wikimedia.org/wiki/Help:Advanced_editing Advanced Editing]&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=E-Monitoring_notes&amp;diff=1119</id>
		<title>E-Monitoring notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=E-Monitoring_notes&amp;diff=1119"/>
		<updated>2013-03-15T22:54:32Z</updated>

		<summary type="html">&lt;p&gt;Support: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= isys =&lt;br /&gt;
&lt;br /&gt;
runs mail for e-monitoring.net&lt;br /&gt;
&lt;br /&gt;
the key on root@mail should let you ssh w/o pass to isys.e-monitoring.net&lt;br /&gt;
&lt;br /&gt;
isys has a mail queue problem where it gets big and we run out of inodes. we setup a cronjob to clear that out.&lt;br /&gt;
&lt;br /&gt;
== isys - out of inodes ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# ssh to root@isys.e-monitoring.net&lt;br /&gt;
# isys# cd /var/spool/mqueue&lt;br /&gt;
# isys# sh&lt;br /&gt;
# # for f in `ls`; do rm $f; done&lt;br /&gt;
&lt;br /&gt;
:(wait awhile)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;	wrote a script:&lt;br /&gt;
&lt;br /&gt;
	isys# cat &amp;gt; /root/clearqueue.sh&lt;br /&gt;
	#!/bin/sh&lt;br /&gt;
	for f in `ls /var/spool/mqueue`; do rm /var/spool/mqueue/$f; done&lt;br /&gt;
	isys# sh /root/clearqueue.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;crontabed for 3am on the 1st of the month&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= polling / magrathea = &lt;br /&gt;
== config new IP ==&lt;br /&gt;
Edit:&lt;br /&gt;
&amp;lt;pre&amp;gt;/etc/defaultrouter&lt;br /&gt;
/export/home/groundwater/bin/getit.pl&lt;br /&gt;
/etc/hosts&lt;br /&gt;
/etc/hostname.le1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On production:&lt;br /&gt;
&amp;lt;pre&amp;gt;/home/htdocs/gw/index.pl&lt;br /&gt;
/home/htdocs/isys/pollscan.pl&lt;br /&gt;
/home/gw/shipley/etc/config.pl&lt;br /&gt;
/home/gw/owrd/etc/config.pl&lt;br /&gt;
/home/dboodman/www/isys/pollscan.pl&lt;br /&gt;
Apache conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== stop it from trying to dial out ==&lt;br /&gt;
&amp;lt;pre&amp;gt;mysql&amp;gt; select * from resources;&lt;br /&gt;
+------------+------------+----------------+-------+---------+----------+&lt;br /&gt;
| resourceID | resource   | connectionType | inUse | inUseBy | inUseFor |&lt;br /&gt;
+------------+------------+----------------+-------+---------+----------+&lt;br /&gt;
|          1 | /dev/cuaa0 |              1 |  NULL |    NULL |     NULL |&lt;br /&gt;
|          2 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|          3 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|          4 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|          5 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|          6 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|          7 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|          8 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|          9 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|         10 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|         11 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
+------------+------------+----------------+-------+---------+----------+&lt;br /&gt;
11 rows in set (0.00 sec)&lt;br /&gt;
delete from resources where resourceID =1;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=DRAC/RMM&amp;diff=1059</id>
		<title>DRAC/RMM</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=DRAC/RMM&amp;diff=1059"/>
		<updated>2013-03-12T00:15:41Z</updated>

		<summary type="html">&lt;p&gt;Support: /* RMM */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRAC Notes =&lt;br /&gt;
&lt;br /&gt;
A list of all the DRAC cards and their IPs can be seen in the [[Private_IP_Mapping|ipmap]]&lt;br /&gt;
&lt;br /&gt;
To ssh in, login as root.&lt;br /&gt;
&lt;br /&gt;
Common commands:&lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
performs a reset&lt;br /&gt;
&lt;br /&gt;
 racadm serveraction powerdown&lt;br /&gt;
power off server&lt;br /&gt;
&lt;br /&gt;
 racadm serveraction powerup&lt;br /&gt;
power on server&lt;br /&gt;
&lt;br /&gt;
 racadm racreset&lt;br /&gt;
reset the DRAC card (if kvm console becomes frozen)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get virtual media plugin to install, add site to trusted list and make security low&lt;br /&gt;
&lt;br /&gt;
Installing openmanage on CEOS4:&lt;br /&gt;
&lt;br /&gt;
Mount install cd from local drive&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mount /dev/scd0 /mnt&lt;br /&gt;
cd /mnt/srvadmin/linux/RPMS/RHEL4&lt;br /&gt;
cd /mnt/srvadmin/linux/supportscripts/&lt;br /&gt;
./srvadmin-install.sh --express&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy linux to disk&lt;br /&gt;
Edit the script to make it think the os is RHEL4&lt;br /&gt;
&lt;br /&gt;
BIOS settings to enable serial:&lt;br /&gt;
Serial comm.: &amp;lt;tt&amp;gt;on with cons. Redir via com1&amp;lt;/tt&amp;gt;&lt;br /&gt;
Failsafe: &amp;lt;tt&amp;gt;115200&amp;lt;/tt&amp;gt;&lt;br /&gt;
Redir after boot: &amp;lt;tt&amp;gt;enabled&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To boot to usb, switch hd sequence in bios. &lt;br /&gt;
&lt;br /&gt;
After removing usb it will have to reorder boot seq to get virtual cd back&lt;br /&gt;
&lt;br /&gt;
Can’t get floppy/iso to boot- need to use thumb drive&lt;br /&gt;
&lt;br /&gt;
Latest f/w as of 2/16/09:&lt;br /&gt;
&amp;lt;pre&amp;gt;Bios: 2.5.0&lt;br /&gt;
Perc 6/i:  6.1.1-0047&lt;br /&gt;
Drac: 1.4&lt;br /&gt;
BMC: 2.37&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= DRAC setup =&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the settings we use when we initially setup a new DRAC.&lt;br /&gt;
&lt;br /&gt;
From within the DRAC web gui:&lt;br /&gt;
&lt;br /&gt;
Remote Access -&amp;gt; config -&amp;gt; network: enter DNS, DNS DRAC name=jailX, DNS domain=johncompanies.com&amp;lt;br&amp;gt;&lt;br /&gt;
Remote Access -&amp;gt; config -&amp;gt; services: disable SNMP&amp;lt;br&amp;gt;&lt;br /&gt;
System -&amp;gt; Alert mgmt -&amp;gt; platform events: enable&amp;lt;br&amp;gt;&lt;br /&gt;
System -&amp;gt; Alert mgmt -&amp;gt; email alert settings: smtp=69.55.230.2, add email alert 1 to support@jc, desc: jailX drac hardware alert&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RMM =&lt;br /&gt;
&lt;br /&gt;
the user/ip/pass can be set via the BIOS. If you can&#039;t here&#039;s how you&#039;d do that manually:&lt;br /&gt;
&lt;br /&gt;
boot to a usb drive that contains &amp;lt;tt&amp;gt;syscfg&amp;lt;/tt&amp;gt; utility&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;fs0:&lt;br /&gt;
cd intel\mgmt\syscfg&lt;br /&gt;
syscfg -le 3 static IP NM&lt;br /&gt;
syscfg -lc 3 12 GW&lt;br /&gt;
syscfg /u 2 &amp;quot;root&amp;quot; &amp;quot;pass&amp;quot;&lt;br /&gt;
syscfg /ue 2 enable 3&lt;br /&gt;
&lt;br /&gt;
syscfg /d user 2 3&lt;br /&gt;
syscfg /d lan 3&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=DRAC/RMM&amp;diff=1058</id>
		<title>DRAC/RMM</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=DRAC/RMM&amp;diff=1058"/>
		<updated>2013-03-12T00:14:21Z</updated>

		<summary type="html">&lt;p&gt;Support: /* DRAC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRAC Notes =&lt;br /&gt;
&lt;br /&gt;
A list of all the DRAC cards and their IPs can be seen in the [[Private_IP_Mapping|ipmap]]&lt;br /&gt;
&lt;br /&gt;
To ssh in, login as root.&lt;br /&gt;
&lt;br /&gt;
Common commands:&lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
performs a reset&lt;br /&gt;
&lt;br /&gt;
 racadm serveraction powerdown&lt;br /&gt;
power off server&lt;br /&gt;
&lt;br /&gt;
 racadm serveraction powerup&lt;br /&gt;
power on server&lt;br /&gt;
&lt;br /&gt;
 racadm racreset&lt;br /&gt;
reset the DRAC card (if kvm console becomes frozen)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get virtual media plugin to install, add site to trusted list and make security low&lt;br /&gt;
&lt;br /&gt;
Installing openmanage on CEOS4:&lt;br /&gt;
&lt;br /&gt;
Mount install cd from local drive&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mount /dev/scd0 /mnt&lt;br /&gt;
cd /mnt/srvadmin/linux/RPMS/RHEL4&lt;br /&gt;
cd /mnt/srvadmin/linux/supportscripts/&lt;br /&gt;
./srvadmin-install.sh --express&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy linux to disk&lt;br /&gt;
Edit the script to make it think the os is RHEL4&lt;br /&gt;
&lt;br /&gt;
BIOS settings to enable serial:&lt;br /&gt;
Serial comm.: &amp;lt;tt&amp;gt;on with cons. Redir via com1&amp;lt;/tt&amp;gt;&lt;br /&gt;
Failsafe: &amp;lt;tt&amp;gt;115200&amp;lt;/tt&amp;gt;&lt;br /&gt;
Redir after boot: &amp;lt;tt&amp;gt;enabled&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To boot to usb, switch hd sequence in bios. &lt;br /&gt;
&lt;br /&gt;
After removing usb it will have to reorder boot seq to get virtual cd back&lt;br /&gt;
&lt;br /&gt;
Can’t get floppy/iso to boot- need to use thumb drive&lt;br /&gt;
&lt;br /&gt;
Latest f/w as of 2/16/09:&lt;br /&gt;
&amp;lt;pre&amp;gt;Bios: 2.5.0&lt;br /&gt;
Perc 6/i:  6.1.1-0047&lt;br /&gt;
Drac: 1.4&lt;br /&gt;
BMC: 2.37&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= DRAC setup =&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the settings we use when we initially setup a new DRAC.&lt;br /&gt;
&lt;br /&gt;
From within the DRAC web gui:&lt;br /&gt;
&lt;br /&gt;
Remote Access -&amp;gt; config -&amp;gt; network: enter DNS, DNS DRAC name=jailX, DNS domain=johncompanies.com&amp;lt;br&amp;gt;&lt;br /&gt;
Remote Access -&amp;gt; config -&amp;gt; services: disable SNMP&amp;lt;br&amp;gt;&lt;br /&gt;
System -&amp;gt; Alert mgmt -&amp;gt; platform events: enable&amp;lt;br&amp;gt;&lt;br /&gt;
System -&amp;gt; Alert mgmt -&amp;gt; email alert settings: smtp=69.55.230.2, add email alert 1 to support@jc, desc: jailX drac hardware alert&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RMM =&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1057</id>
		<title>Virtuozzo / Linux Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1057"/>
		<updated>2013-03-12T00:13:17Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Installing OS via net */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Updating VZ =&lt;br /&gt;
&lt;br /&gt;
 Update Virtuozzo to version 4.0.0&lt;br /&gt;
 Apply minor updates for Virtuozzo 3.0.0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
When you get to the last screen, you will be given an option to &lt;br /&gt;
&lt;br /&gt;
 ( ) Automatically reboot after update&lt;br /&gt;
 (*) Reboot later manually&lt;br /&gt;
&lt;br /&gt;
make sure you choose to reboot later.&lt;br /&gt;
&lt;br /&gt;
= Migrating Templates =&lt;br /&gt;
One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it&#039;s now called) based on a particular ditribution on a host which may or may not share the same distribution. For instance, you could run a CT running Ubuntu while the host machine (Hardware Node or HN) is running CentOS. This is accomplished via the use of OS templates. As long as the HN contains the OS template on which a particular CT relies, it will run there. As such, if you want to move a CT from one HN to another, you will need to make sure the OS template exists there.&lt;br /&gt;
&lt;br /&gt;
Modern versions of VZ (&amp;gt;= 4.x) will check for and automatically move the OS template over to the host as you&#039;re (vz)migrating the CT over to a new HN. However we like to make sure the template is in place prior to moving the CT. &lt;br /&gt;
&lt;br /&gt;
The first step is to see if the template exists on the host. To see OS templates installed:&lt;br /&gt;
&lt;br /&gt;
2.x (shows OS and application templates):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkgls&lt;br /&gt;
mod_ssl-rh9 20040624&lt;br /&gt;
mysql-rh9 20030814 20050412&lt;br /&gt;
openwebmail-rh9 20050427&lt;br /&gt;
php-rh9 20050506&lt;br /&gt;
phpBB-rh9 20041229&lt;br /&gt;
postgresql-rh9 20050719&lt;br /&gt;
sl-webalizer-rh9 20040119&lt;br /&gt;
spamassassin-rh9 20040127&lt;br /&gt;
tomcat-rh9 20040524&lt;br /&gt;
usermin-rh9 20040116&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;= 3.x (shows just OS templates, run without -O to see application as well):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkg list -O&lt;br /&gt;
ubuntu-10.04-x86                   2010-06-01 11:39:05&lt;br /&gt;
ubuntu-11.04-x86                   2011-06-22 14:23:59&lt;br /&gt;
ubuntu-9.10-x86                    2010-03-11 17:39:51&lt;br /&gt;
centos-5-x86                       2010-03-11 17:12:27&lt;br /&gt;
debian-5.0-x86                     2010-03-11 17:33:34&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All template files are located:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1&lt;br /&gt;
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2&lt;br /&gt;
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9&lt;br /&gt;
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1&lt;br /&gt;
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2&lt;br /&gt;
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9&lt;br /&gt;
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92&lt;br /&gt;
analog-fc2      mailman-fc2           php-rh9             suse-9.2&lt;br /&gt;
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1&lt;br /&gt;
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2&lt;br /&gt;
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9&lt;br /&gt;
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92&lt;br /&gt;
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1&lt;br /&gt;
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1&lt;br /&gt;
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2&lt;br /&gt;
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9&lt;br /&gt;
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1&lt;br /&gt;
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2&lt;br /&gt;
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9&lt;br /&gt;
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3&lt;br /&gt;
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0&lt;br /&gt;
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92&lt;br /&gt;
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1&lt;br /&gt;
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2&lt;br /&gt;
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9&lt;br /&gt;
jdk-suse92      mysql-rh9             redhat-as3-minimal&lt;br /&gt;
jre-deb31       mysql-suse92          redhat-devel-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here are the base OS templates: &amp;lt;tt&amp;gt;redhat-9, fedora-core-1&amp;lt;/tt&amp;gt; and supporting application templates: &amp;lt;tt&amp;gt;postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1&amp;lt;/tt&amp;gt;. So if you wanted to copy over all of redhat 9 you&#039;d need to copy the contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls -d /vz/template/*rh9*&lt;br /&gt;
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9&lt;br /&gt;
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9&lt;br /&gt;
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9&lt;br /&gt;
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9&lt;br /&gt;
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9&lt;br /&gt;
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9&lt;br /&gt;
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9&lt;br /&gt;
/vz/template/mailman-rh9     /vz/template/postgresql-rh9&lt;br /&gt;
&lt;br /&gt;
# ls -d /vz/template/*redhat-9*&lt;br /&gt;
/vz/template/redhat-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a template from one HN to another, it simply needs to be rsync&#039;d over to the target HN. It&#039;s rsync&#039;d over in this fashion:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template&lt;br /&gt;
 rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template&lt;br /&gt;
&lt;br /&gt;
Newer (&amp;gt;= 3.x) VZ employs &amp;quot;EZ&amp;quot; templates which are organized a little differently:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc&lt;br /&gt;
centos  conf         redhat-as3-minimal  ubuntu&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/ubuntu/&lt;br /&gt;
10.04  11.04  9.10&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/&lt;br /&gt;
x86&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/cache/&lt;br /&gt;
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz&lt;br /&gt;
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz&lt;br /&gt;
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we see is the entire OS and all applications are in 1 directory, and organized by distribution and release version. So to move Ubuntu 10.04:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
and you also need to move the cache:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/&lt;br /&gt;
&lt;br /&gt;
Once the transfer is complete, you will be able to run &amp;lt;tt&amp;gt;vzpkgls&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vzpkg list -O&amp;lt;/tt&amp;gt; and see the template(s) listed on the target HN.&lt;br /&gt;
&lt;br /&gt;
So far, this all supposes template doesn&#039;t exist on the target- very simple, just copy it over. If the template exists already on the target HN, this requires closer inspection. With older templates, simply moving over the templates would be the end of it- you see the version listed when you do a &amp;lt;tt&amp;gt;vzplgls&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysql-rh9 20030814 20050412&lt;br /&gt;
&lt;br /&gt;
this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412&lt;br /&gt;
As an aside, you can&#039;t copy over just 1 of them, but if you rsync&#039;d over the &amp;lt;tt&amp;gt;mysql-rh9&amp;lt;/tt&amp;gt; directory, you&#039;d see 20030814 and 20050412 on the target HN. As long as the versions match up, you&#039;re good to go.&lt;br /&gt;
&lt;br /&gt;
With EZ templates, the versions are not as easy to decipher. When you look at the &amp;lt;tt&amp;gt;vzpkg list&amp;lt;/tt&amp;gt; output, that simply tells you when a cache was created. A cache is simply a snapshot of all the data needed for the latest versions of the OS and it&#039;s applications at the time the cache was created. It is a date, and thus tells you nothing about the versions within. So for instance, if you had a cache for Ubuntu 10.04 from 2007 and you ran &amp;lt;tt&amp;gt;vzpkg create cache ubuntu-10.04-x86&amp;lt;/tt&amp;gt; it would re-download the latest version of apache, mysql and so on. And any &#039;&#039;subsequent&#039;&#039; ubuntu 10.04 CT&#039;s created thereafter would use those newer versions, whereas older CT&#039;s based on 10.04 would use older templates. You can see how this works by looking at the files under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this template has in it 6 different versions of apache2. This means that this template was merged with other 10.04 templates and/or it has been cached a few times, each time a new apache was available. The unfortunate thing is it&#039;s almost impossible to know which CT&#039;s are using which version of apache so it&#039;s hard to try to prune this down and remove unwanted/unneeded applications.&lt;br /&gt;
&lt;br /&gt;
So, if you see another HN has Ubuntu 10.04 on it, you need to see/confirm that it has all the exact files your CT needs. You can run a test rsync to see what &#039;&#039;would&#039;&#039; be transferred (what&#039;s missing):&lt;br /&gt;
&lt;br /&gt;
 rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
Based on the amount of data you get back from the rsync, you will be able to decide whether or not to remove the -n and allow the full transfer to go through. The downside to doing the transfer is the situation described above- you&#039;ve permanently joined these templates and now you may have 10 versions of apache on the target HN. There&#039;s one other potential pitfall to this kind of merging- it will also potentially copy over shared files, for which there is no particular version, most of which are in &amp;lt;tt&amp;gt;/vz/template/ubuntu/10.04/x86/config&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
 cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
 /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
&lt;br /&gt;
Here are some specific things to look out for. Case: copying centos-5 on virt19 to virt12. We dumped the rsync output to a file so we could inspect:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
(note, that can be dangerous, better to add on full path &amp;lt;tt&amp;gt;/vz/template/centos/5&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
So in the output file we see things like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
x86/base0/cachecookie&lt;br /&gt;
x86/base0/primary.xml.gz &lt;br /&gt;
x86/base0/primary.xml.gz.sqlite &lt;br /&gt;
x86/base0/repomd.xml &lt;br /&gt;
x86/base1/cachecookie &lt;br /&gt;
x86/base1/filelists.xml.gz &lt;br /&gt;
x86/base1/filelists.xml.gz.sqlite  &lt;br /&gt;
x86/base1/primary.xml.gz &lt;br /&gt;
x86/base1/primary.xml.gz.sqlite &lt;br /&gt;
x86/base1/repomd.xml&lt;br /&gt;
x86/base2/cachecookie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which make us nervous cause those are not versioned files, i.e.:&lt;br /&gt;
 5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock&lt;br /&gt;
&lt;br /&gt;
So those files will replace existing files on v12 rather than the case of the latter where it&#039;s likely being added. So caution should be given and deference to whichever version is newer (which rsync should take care of, but that will depend on the date each file was created and perhaps not the actual data within).&lt;br /&gt;
&lt;br /&gt;
If we look further in the file we see:&lt;br /&gt;
&lt;br /&gt;
 x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.&lt;br /&gt;
9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif&lt;br /&gt;
&lt;br /&gt;
and other files looking like:&lt;br /&gt;
 5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info&lt;br /&gt;
&lt;br /&gt;
Which means plesk is here. We don&#039;t need plesk on v12 (the CT moving over doesn&#039;t use it) so we rerun the rsync and exclude it:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh --exclude=&amp;quot;plesk*&amp;quot; --exclude=&amp;quot;psa*&amp;quot; /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
and now it&#039;s much smaller:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l&lt;br /&gt;
 97104&lt;br /&gt;
&lt;br /&gt;
Before running with excludes it was:&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l &lt;br /&gt;
 238238&lt;br /&gt;
&lt;br /&gt;
So again, look at what you&#039;re doing. Generally, combining templates is fine however.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re happy with the merge, run the rsync again without the &amp;quot;-n&amp;quot; to let it actually do the transfer.&lt;br /&gt;
&lt;br /&gt;
Once done, don&#039;t forget to add the new template to the HN in Management -&amp;gt; Reference -&amp;gt; Templates&lt;br /&gt;
&lt;br /&gt;
= getting help =&lt;br /&gt;
&lt;br /&gt;
= vzup2date =&lt;br /&gt;
TODO &lt;br /&gt;
= Adding new OS/application templates =&lt;br /&gt;
&lt;br /&gt;
Virtuozzo will lag a bit behind the initial release of an OS, perhaps by a month or more. Further, a newly-released OS may be available, but there may not be many/any application templates available initially. It pays to wait a bit.&lt;br /&gt;
&lt;br /&gt;
A template is easily installed via [[#vzup2date|vzup2date]]:&lt;br /&gt;
&lt;br /&gt;
 vzup2date -z&lt;br /&gt;
&lt;br /&gt;
You will be given a list of OS&#039;s to install. Select an OS, then customize that selection by checking/unchecking the application templates we do/don&#039;t want to include/offer.&lt;br /&gt;
&lt;br /&gt;
Generally, here are the app templates we include/offer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cyrus-imap&lt;br /&gt;
devel&lt;br /&gt;
imp&lt;br /&gt;
jre&lt;br /&gt;
jsdk&lt;br /&gt;
mailman&lt;br /&gt;
mod_perl&lt;br /&gt;
mod_ssl&lt;br /&gt;
mysql&lt;br /&gt;
php&lt;br /&gt;
phpmyadmin&lt;br /&gt;
phppgadmin&lt;br /&gt;
postgresql&lt;br /&gt;
proftpd&lt;br /&gt;
spamassassin&lt;br /&gt;
squirrelmail&lt;br /&gt;
tomcat&lt;br /&gt;
vsftpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do not (any longer) offer webalizer or analog.&lt;br /&gt;
&lt;br /&gt;
After selecting and installing the OS and apps, you should ensure it&#039;s installed:&lt;br /&gt;
&lt;br /&gt;
 vzpkg list -O&lt;br /&gt;
&lt;br /&gt;
Your new OS (ex. fedora-core-13-x86_64) will be listed, without a corresponding cache date:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@virt13 /vzconf]# vzpkg list -O&lt;br /&gt;
centos-6-x86                       2011-07-22 13:24:41&lt;br /&gt;
centos-6-x86_64                    2012-03-09 20:42:22&lt;br /&gt;
centos-5-x86                       2009-07-27 16:58:24&lt;br /&gt;
centos-5-x86_64                    2012-03-09 22:38:53&lt;br /&gt;
ubuntu-11.10-x86_64                2012-03-01 23:13:33&lt;br /&gt;
ubuntu-9.04-x86                    2009-06-02 11:32:39&lt;br /&gt;
ubuntu-12.04-x86_64                2012-05-29 13:50:50&lt;br /&gt;
ubuntu-8.04-x86                    2008-09-17 21:27:20&lt;br /&gt;
ubuntu-8.10-x86                    2009-03-13 13:58:57&lt;br /&gt;
ubuntu-11.04-x86                   2011-12-05 11:15:46&lt;br /&gt;
ubuntu-7.04-x86                    2008-09-24 16:42:50&lt;br /&gt;
redhat-el6-x86_64&lt;br /&gt;
fedora-core-13-x86_64              &lt;br /&gt;
fedora-core-12-x86                 2010-02-06 13:24:32&lt;br /&gt;
fedora-core-15-x86                 2011-12-05 11:36:43&lt;br /&gt;
fedora-core-11-x86                 2009-10-01 16:30:59&lt;br /&gt;
fedora-core-14-x86&lt;br /&gt;
fedora-core-16-x86_64              2012-03-13 11:40:23&lt;br /&gt;
fedora-core-9-x86                  2008-11-29 10:52:18&lt;br /&gt;
debian-6.0-x86                     2011-07-29 16:00:35&lt;br /&gt;
debian-6.0-x86_64                  2012-03-12 19:53:33&lt;br /&gt;
debian-5.0-x86                     2009-03-12 12:39:11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also confirm the apps installed:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt13 /vzconf]# vzpkg list fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64              2013-03-08 11:39:44&lt;br /&gt;
fedora-core-13-x86_64 devel&lt;br /&gt;
fedora-core-13-x86_64 php&lt;br /&gt;
fedora-core-13-x86_64 proftpd&lt;br /&gt;
fedora-core-13-x86_64 postgresql&lt;br /&gt;
fedora-core-13-x86_64 phpmyadmin&lt;br /&gt;
fedora-core-13-x86_64 mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before you can use the OS you must cache it. To create the cache run:&lt;br /&gt;
 vzpkg cache [OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;vzpkg cache fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s ready to use. In order to be able to use it with the [[VPS_Management#vm|vm]] command, you must create a file:&lt;br /&gt;
 jctmpl-[OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;jctmpl-fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In it, on line 1 we place the OS, followed by the app names, ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;more jctmpl-fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64&lt;br /&gt;
postgresql&lt;br /&gt;
jsdk&lt;br /&gt;
mod_ssl&lt;br /&gt;
phpmyadmin&lt;br /&gt;
mod_perl&lt;br /&gt;
tomcat&lt;br /&gt;
devel&lt;br /&gt;
php&lt;br /&gt;
mailman&lt;br /&gt;
cyrus-imap&lt;br /&gt;
squirrelmail&lt;br /&gt;
proftpd&lt;br /&gt;
mysql&lt;br /&gt;
phppgadmin&lt;br /&gt;
spamassassin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The packages will be installed in that order, so any pre-req&#039;s should be handled there.&lt;br /&gt;
&lt;br /&gt;
Now, when you run [[VPS_Management#vm|vm]] it will show you the newly-added OS and you may create a CT using it.&lt;br /&gt;
&lt;br /&gt;
The last few tasks are related to mgmt:&lt;br /&gt;
&lt;br /&gt;
1. add to mgmt-&amp;gt;reference-&amp;gt;templates (use the existing templates as an example). Once added, the new template will be included with the list of OS&#039;s available for the given HN.&lt;br /&gt;
2. if this is going to be a new OS offered for ordering, it needs to be added to the order form and webpage.&lt;br /&gt;
&lt;br /&gt;
a. to get a list of applications and versions in the new OS, you should create a test CT, enter it and run &amp;lt;tt&amp;gt;dpkg -l|sort&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;rpm -aq|sort&amp;lt;/tt&amp;gt; in centos/fedora) and enter that list in the following places:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/jc_pub/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Note, you will have to move the most recent OS data from &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt; into the corresponding &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname]_old.html&amp;lt;/tt&amp;gt; updating the version links in both.&lt;br /&gt;
&lt;br /&gt;
b. to add the new OS to the order form, you will need to update &amp;lt;tt&amp;gt;/usr/local/www/signup/html/step1.html&amp;lt;/tt&amp;gt; in several places (for regular and OSS orders) as well as updating the templateID which you can get from mgmt-&amp;gt;reference-&amp;gt;templates (or [[Management_System_/_Public_Website_/_Signup_/_Account_Manager#jc:ref_templates|jc:ref_templates]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Old method to obtain the templates:&lt;br /&gt;
&lt;br /&gt;
Go to http://www.parallels.com/en/virtuozzo/templates/catalog/&lt;br /&gt;
&lt;br /&gt;
Download the RPM&#039;s and install them&lt;br /&gt;
&lt;br /&gt;
 vzpkg list&lt;br /&gt;
to see the new packages/os templates&lt;br /&gt;
&lt;br /&gt;
 vzpkg create cache &amp;quot;OS_EZ_template_name&amp;quot;&lt;br /&gt;
to create a cache&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Update OS template =&lt;br /&gt;
&lt;br /&gt;
Installation and update of the new version of OS template will not affect the existing containers. It will affect only the new containers, created after this update operation. In terms of fixing &amp;quot;vzctl enter&amp;quot; error and SSH connectivity to Ubuntu based containers, it is necessary to recreate the template and not to update it, so the commands to run are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rpm -Uhv ubuntu-8.04-x86-ez-4.0.0-9.swsoft.noarch.rpm&lt;br /&gt;
vzpkg clean ubuntu-8.04-x86&lt;br /&gt;
vzpkg remove cache ubuntu-8.04-x86&lt;br /&gt;
vzpkg create cache ubuntu-8.04-x86&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installing new SSL cert on VZCP =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;openssl req -days 1999 -new -x509 -nodes -out server.crt -keyout server.key&lt;br /&gt;
&lt;br /&gt;
US&lt;br /&gt;
CA&lt;br /&gt;
San Diego&lt;br /&gt;
johncompanies.com&lt;br /&gt;
johncompanies.com&lt;br /&gt;
virt15ohncompanies.com&lt;br /&gt;
linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.crt/server.crt /etc/httpd/conf/ssl.crt/server.crt.bak&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.key/server.key /etc/httpd/conf/ssl.key/server.key.bak&lt;br /&gt;
cp server.crt /etc/httpd/conf/ssl.crt/server.crt&lt;br /&gt;
cp server.key /etc/httpd/conf/ssl.key/server.key&lt;br /&gt;
/etc/init.d/vzcp restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Moving virt (drives) to new hardware =&lt;br /&gt;
&lt;br /&gt;
If you have a case where a virt is dead (due to hardware failure), you can move the drives to a new hardware setup.&lt;br /&gt;
Here are the steps and things to look for:&lt;br /&gt;
&lt;br /&gt;
Move the drives to the new box. Most likely, the drives will be recognized and there will be no problems booting up. On Dell PERC 5/6 cards you will need to import the new &amp;quot;foreign&amp;quot; volume via the raid BIOS.&lt;br /&gt;
&lt;br /&gt;
If the hardware (motherboard) is different, it’s possible the nic’s won’t be recognized. Look at /etc/modules.conf the ethernet drivers are either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 tg3&lt;br /&gt;
alias eth1 tg3&amp;lt;/pre&amp;gt;&lt;br /&gt;
(supermicro)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 e100&lt;br /&gt;
alias eth1 e1000&amp;lt;/pre&amp;gt;&lt;br /&gt;
(intel)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 bnx2&lt;br /&gt;
alias eth1 bnx2&amp;lt;/pre&amp;gt;&lt;br /&gt;
(dell 29500)&lt;br /&gt;
&lt;br /&gt;
Also, you may see eth0 and eth1 swapped so if after confirming the eth devices are present (may require a reboot), then you may still need to swap the green/yellow network cables in the back to get them on the right port.&lt;br /&gt;
&lt;br /&gt;
VZ will not run (for long) on the new hardware, so you will need to get the license reissued. You may create/download a temporary license via their website for the interim.&lt;br /&gt;
&lt;br /&gt;
= Updating kernel on virt =&lt;br /&gt;
&lt;br /&gt;
We now use [[#vzup2date|vzup2date]] to update systems and kernels. What follows is what we used to do when we had to download kernels and install manually on old systems:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. install kernel and modules&lt;br /&gt;
&amp;lt;pre&amp;gt;# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \&lt;br /&gt;
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm&lt;br /&gt;
vzkernel-smp          ##################################################&lt;br /&gt;
vzmodules-smp       ##################################################&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT USE the &amp;quot;rpm -Uhv&amp;quot; command to install the kernel, otherwise all the previously installed kernels may be removed from your system. &lt;br /&gt;
&lt;br /&gt;
2. update lilo/grub&lt;br /&gt;
&lt;br /&gt;
Lilo:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lilo.conf&lt;br /&gt;
 &lt;br /&gt;
rename old Virtuozzo kernel label from &amp;quot;linux+virtuozzo&amp;quot; to &amp;quot;virtuozzo_old&amp;quot;&lt;br /&gt;
and add a new entry pointing to the newly installed virtuozzo kernel image.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;prompt&lt;br /&gt;
timeout=50&lt;br /&gt;
default=linux+virtuozzo&lt;br /&gt;
append=&amp;quot;debug panic=5 console=tty console=ttyS0,38400&amp;quot;&lt;br /&gt;
boot=/dev/sda&lt;br /&gt;
map=/boot/map&lt;br /&gt;
install=/boot/boot.b&lt;br /&gt;
message=/boot/message&lt;br /&gt;
linear&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3smp&lt;br /&gt;
        label=linux&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3smp.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3&lt;br /&gt;
        label=linux-up&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise&lt;br /&gt;
        label=2.4.20-9.5.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise&lt;br /&gt;
        label=2.4.20-9.8.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise&lt;br /&gt;
        label=2.4.20-9.21.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise&lt;br /&gt;
        label=2.4.20-9.24.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise&lt;br /&gt;
        label=2.4.20-28.3.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise&lt;br /&gt;
        label=old_linux+vz&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise&lt;br /&gt;
        label=linux+virtuozzo&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label &amp;quot;old_linux+vz &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Grub:&lt;br /&gt;
&lt;br /&gt;
 vi /boot/grub /menu.lst&lt;br /&gt;
&lt;br /&gt;
Add new entry at the top.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;serial --unit=0 --speed=38400&lt;br /&gt;
terminal --timeout=10 serial console&lt;br /&gt;
default=0&lt;br /&gt;
timeout=10&lt;br /&gt;
splashimage=(hd0,0)/boot/grub/splash.xpm.gz&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Red Hat Linux (2.4.18-3smp)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3smp.img&lt;br /&gt;
title Red Hat Linux-up (2.4.18-3)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3.img&lt;br /&gt;
title Linux with Virtuozzo 2.5&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1&lt;br /&gt;
title vz-enterpriseo&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1&lt;br /&gt;
title vz-enterprise&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. run the lilo (if using lilo)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lilo&lt;br /&gt;
Added linux&lt;br /&gt;
Added linux-up&lt;br /&gt;
Added virtuozzo_old&lt;br /&gt;
Added linux+virtuozzo *&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. reboot the server&lt;br /&gt;
 shutdown -r 23:05&lt;br /&gt;
&lt;br /&gt;
when it comes time for the shutdown, run [[VPS_Management#stopvirt|stopvirt]] to get things shut down faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Remaking service VE (&amp;lt;=3.x only) =&lt;br /&gt;
&lt;br /&gt;
Occasionally the control panel for VEs (aka VZPP) will stop working and you just need to reinstall the service VE (which runs the control panels for all VEs on the HN). Here&#039;s how that&#039;s done :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop 1&lt;br /&gt;
ipdel 1 69.55.234.152&lt;br /&gt;
vzmlocal 1:2&lt;br /&gt;
vzctl set 2 --save --onboot no&lt;br /&gt;
vzsveinstall -t redhat-as3-minimal -d /root/Rel261/HW/RPMS -s 69.55.234.152 --skip-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzsveinstall -t redhat-as3-minimal -d /vz/Rel300/HW/RPMS -s 69.55.229.151 --skip-client&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzctl mount 1&lt;br /&gt;
vzctl mount 2&lt;br /&gt;
/bin/cp -aRf /vz/root/2/home/vzagent0 /vz/root/1/home&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/lib/mysql/VZADB /vz/root/1/var/lib/mysql&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/shadow /vz/root/1/etc/&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/vzcp/static/vz/skins/ /vz/root/1/var/vzcp/static/vz&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/menu.xml  /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/dashboard.xml /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
&lt;br /&gt;
vzctl umount 2&lt;br /&gt;
vzctl umount 1&lt;br /&gt;
vzctl start 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= GRUB: boot once to a new kernel =&lt;br /&gt;
&lt;br /&gt;
To use a different kernel for the next reboot only:&lt;br /&gt;
  &amp;lt;pre&amp;gt;grub --no-floppy&lt;br /&gt;
  savedefault --default=N --once&lt;br /&gt;
  (where N is the number of the kernel you want to boot once)&lt;br /&gt;
  quit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot your machine. It will boot using kernel &amp;quot;N&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 grub-reboot N&lt;br /&gt;
will do essentially the same thing and prompt to reboot the machine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Recovering from GRUB failure =&lt;br /&gt;
&lt;br /&gt;
(example from DPE 2950)&lt;br /&gt;
&lt;br /&gt;
Boot to CEOS4 server CD (original install cd). Did this example with iso mounted via drac&lt;br /&gt;
&lt;br /&gt;
 Boot: linux rescue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Make/edit an ISO on Linux =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mount file.iso /mnt/iso/ -t iso9660 -o ro,loop=/dev/loop0&lt;br /&gt;
mkdir /tmp/iso&lt;br /&gt;
cp -aR /mnt/iso/* /tmp/iso/&lt;br /&gt;
umount /mnt/iso/&lt;br /&gt;
mkisofs -iso-level 2 -o /tmp/new.iso /tmp/iso/&lt;br /&gt;
rm -fr /tmp/iso&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To mount it:&lt;br /&gt;
&lt;br /&gt;
 mount -t vfat -o loop /tmp/3wfirmware.iso /mnt/usb/&lt;br /&gt;
&lt;br /&gt;
http://www.damnsmalllinux.org/wiki/index.php/Installing_to_a_USB_Flash_Drive&lt;br /&gt;
&lt;br /&gt;
= Mount/edit USB drive on Linux =&lt;br /&gt;
&lt;br /&gt;
 mount -t vfat -o loop  /dev/sdc1 /mnt/usb/&lt;br /&gt;
&lt;br /&gt;
This example is for our floating usb drive on virt16. You should edit the device as necessary on other hardware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installing OS via net =&lt;br /&gt;
&lt;br /&gt;
Centos 5.1:&amp;lt;br&amp;gt;&lt;br /&gt;
http site name: &amp;lt;tt&amp;gt;vault.centos.org&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
dir: &amp;lt;tt&amp;gt;/5.1/os/i386/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Centos 5.4:&amp;lt;br&amp;gt;&lt;br /&gt;
http site name: &amp;lt;tt&amp;gt;mirrors.kernel.org&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
dir: &amp;lt;tt&amp;gt;/centos/5.4/os/i386/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
or&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/centos/5.4/os/x86_64/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
or&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;http://mirrors.usc.edu/pub/linux/distributions/centos/5.4/os/i386/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Centos 6.2:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;http://mirrors.usc.edu/pub/linux/distributions/centos/6.2/os/x86_64/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Single user mode (Ubuntu) =&lt;br /&gt;
&lt;br /&gt;
add to end of kernel line: &amp;lt;tt&amp;gt;init=/bin/bash rw&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FC9:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;http://linux.nssl.noaa.gov/fedora/linux/releases/9/Fedora/i386/os/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FC10:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;http://linux.nssl.noaa.gov/fedora/linux/releases/10/Fedora/i386/os/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1056</id>
		<title>Virtuozzo / Linux Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1056"/>
		<updated>2013-03-12T00:12:41Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Installing OS via net */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Updating VZ =&lt;br /&gt;
&lt;br /&gt;
 Update Virtuozzo to version 4.0.0&lt;br /&gt;
 Apply minor updates for Virtuozzo 3.0.0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
When you get to the last screen, you will be given an option to &lt;br /&gt;
&lt;br /&gt;
 ( ) Automatically reboot after update&lt;br /&gt;
 (*) Reboot later manually&lt;br /&gt;
&lt;br /&gt;
make sure you choose to reboot later.&lt;br /&gt;
&lt;br /&gt;
= Migrating Templates =&lt;br /&gt;
One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it&#039;s now called) based on a particular ditribution on a host which may or may not share the same distribution. For instance, you could run a CT running Ubuntu while the host machine (Hardware Node or HN) is running CentOS. This is accomplished via the use of OS templates. As long as the HN contains the OS template on which a particular CT relies, it will run there. As such, if you want to move a CT from one HN to another, you will need to make sure the OS template exists there.&lt;br /&gt;
&lt;br /&gt;
Modern versions of VZ (&amp;gt;= 4.x) will check for and automatically move the OS template over to the host as you&#039;re (vz)migrating the CT over to a new HN. However we like to make sure the template is in place prior to moving the CT. &lt;br /&gt;
&lt;br /&gt;
The first step is to see if the template exists on the host. To see OS templates installed:&lt;br /&gt;
&lt;br /&gt;
2.x (shows OS and application templates):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkgls&lt;br /&gt;
mod_ssl-rh9 20040624&lt;br /&gt;
mysql-rh9 20030814 20050412&lt;br /&gt;
openwebmail-rh9 20050427&lt;br /&gt;
php-rh9 20050506&lt;br /&gt;
phpBB-rh9 20041229&lt;br /&gt;
postgresql-rh9 20050719&lt;br /&gt;
sl-webalizer-rh9 20040119&lt;br /&gt;
spamassassin-rh9 20040127&lt;br /&gt;
tomcat-rh9 20040524&lt;br /&gt;
usermin-rh9 20040116&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;= 3.x (shows just OS templates, run without -O to see application as well):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkg list -O&lt;br /&gt;
ubuntu-10.04-x86                   2010-06-01 11:39:05&lt;br /&gt;
ubuntu-11.04-x86                   2011-06-22 14:23:59&lt;br /&gt;
ubuntu-9.10-x86                    2010-03-11 17:39:51&lt;br /&gt;
centos-5-x86                       2010-03-11 17:12:27&lt;br /&gt;
debian-5.0-x86                     2010-03-11 17:33:34&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All template files are located:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1&lt;br /&gt;
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2&lt;br /&gt;
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9&lt;br /&gt;
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1&lt;br /&gt;
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2&lt;br /&gt;
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9&lt;br /&gt;
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92&lt;br /&gt;
analog-fc2      mailman-fc2           php-rh9             suse-9.2&lt;br /&gt;
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1&lt;br /&gt;
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2&lt;br /&gt;
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9&lt;br /&gt;
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92&lt;br /&gt;
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1&lt;br /&gt;
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1&lt;br /&gt;
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2&lt;br /&gt;
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9&lt;br /&gt;
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1&lt;br /&gt;
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2&lt;br /&gt;
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9&lt;br /&gt;
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3&lt;br /&gt;
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0&lt;br /&gt;
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92&lt;br /&gt;
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1&lt;br /&gt;
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2&lt;br /&gt;
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9&lt;br /&gt;
jdk-suse92      mysql-rh9             redhat-as3-minimal&lt;br /&gt;
jre-deb31       mysql-suse92          redhat-devel-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here are the base OS templates: &amp;lt;tt&amp;gt;redhat-9, fedora-core-1&amp;lt;/tt&amp;gt; and supporting application templates: &amp;lt;tt&amp;gt;postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1&amp;lt;/tt&amp;gt;. So if you wanted to copy over all of redhat 9 you&#039;d need to copy the contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls -d /vz/template/*rh9*&lt;br /&gt;
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9&lt;br /&gt;
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9&lt;br /&gt;
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9&lt;br /&gt;
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9&lt;br /&gt;
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9&lt;br /&gt;
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9&lt;br /&gt;
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9&lt;br /&gt;
/vz/template/mailman-rh9     /vz/template/postgresql-rh9&lt;br /&gt;
&lt;br /&gt;
# ls -d /vz/template/*redhat-9*&lt;br /&gt;
/vz/template/redhat-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a template from one HN to another, it simply needs to be rsync&#039;d over to the target HN. It&#039;s rsync&#039;d over in this fashion:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template&lt;br /&gt;
 rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template&lt;br /&gt;
&lt;br /&gt;
Newer (&amp;gt;= 3.x) VZ employs &amp;quot;EZ&amp;quot; templates which are organized a little differently:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc&lt;br /&gt;
centos  conf         redhat-as3-minimal  ubuntu&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/ubuntu/&lt;br /&gt;
10.04  11.04  9.10&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/&lt;br /&gt;
x86&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/cache/&lt;br /&gt;
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz&lt;br /&gt;
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz&lt;br /&gt;
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we see is the entire OS and all applications are in 1 directory, and organized by distribution and release version. So to move Ubuntu 10.04:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
and you also need to move the cache:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/&lt;br /&gt;
&lt;br /&gt;
Once the transfer is complete, you will be able to run &amp;lt;tt&amp;gt;vzpkgls&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vzpkg list -O&amp;lt;/tt&amp;gt; and see the template(s) listed on the target HN.&lt;br /&gt;
&lt;br /&gt;
So far, this all supposes template doesn&#039;t exist on the target- very simple, just copy it over. If the template exists already on the target HN, this requires closer inspection. With older templates, simply moving over the templates would be the end of it- you see the version listed when you do a &amp;lt;tt&amp;gt;vzplgls&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysql-rh9 20030814 20050412&lt;br /&gt;
&lt;br /&gt;
this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412&lt;br /&gt;
As an aside, you can&#039;t copy over just 1 of them, but if you rsync&#039;d over the &amp;lt;tt&amp;gt;mysql-rh9&amp;lt;/tt&amp;gt; directory, you&#039;d see 20030814 and 20050412 on the target HN. As long as the versions match up, you&#039;re good to go.&lt;br /&gt;
&lt;br /&gt;
With EZ templates, the versions are not as easy to decipher. When you look at the &amp;lt;tt&amp;gt;vzpkg list&amp;lt;/tt&amp;gt; output, that simply tells you when a cache was created. A cache is simply a snapshot of all the data needed for the latest versions of the OS and it&#039;s applications at the time the cache was created. It is a date, and thus tells you nothing about the versions within. So for instance, if you had a cache for Ubuntu 10.04 from 2007 and you ran &amp;lt;tt&amp;gt;vzpkg create cache ubuntu-10.04-x86&amp;lt;/tt&amp;gt; it would re-download the latest version of apache, mysql and so on. And any &#039;&#039;subsequent&#039;&#039; ubuntu 10.04 CT&#039;s created thereafter would use those newer versions, whereas older CT&#039;s based on 10.04 would use older templates. You can see how this works by looking at the files under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this template has in it 6 different versions of apache2. This means that this template was merged with other 10.04 templates and/or it has been cached a few times, each time a new apache was available. The unfortunate thing is it&#039;s almost impossible to know which CT&#039;s are using which version of apache so it&#039;s hard to try to prune this down and remove unwanted/unneeded applications.&lt;br /&gt;
&lt;br /&gt;
So, if you see another HN has Ubuntu 10.04 on it, you need to see/confirm that it has all the exact files your CT needs. You can run a test rsync to see what &#039;&#039;would&#039;&#039; be transferred (what&#039;s missing):&lt;br /&gt;
&lt;br /&gt;
 rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
Based on the amount of data you get back from the rsync, you will be able to decide whether or not to remove the -n and allow the full transfer to go through. The downside to doing the transfer is the situation described above- you&#039;ve permanently joined these templates and now you may have 10 versions of apache on the target HN. There&#039;s one other potential pitfall to this kind of merging- it will also potentially copy over shared files, for which there is no particular version, most of which are in &amp;lt;tt&amp;gt;/vz/template/ubuntu/10.04/x86/config&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
 cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
 /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
&lt;br /&gt;
Here are some specific things to look out for. Case: copying centos-5 on virt19 to virt12. We dumped the rsync output to a file so we could inspect:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
(note, that can be dangerous, better to add on full path &amp;lt;tt&amp;gt;/vz/template/centos/5&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
So in the output file we see things like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
x86/base0/cachecookie&lt;br /&gt;
x86/base0/primary.xml.gz &lt;br /&gt;
x86/base0/primary.xml.gz.sqlite &lt;br /&gt;
x86/base0/repomd.xml &lt;br /&gt;
x86/base1/cachecookie &lt;br /&gt;
x86/base1/filelists.xml.gz &lt;br /&gt;
x86/base1/filelists.xml.gz.sqlite  &lt;br /&gt;
x86/base1/primary.xml.gz &lt;br /&gt;
x86/base1/primary.xml.gz.sqlite &lt;br /&gt;
x86/base1/repomd.xml&lt;br /&gt;
x86/base2/cachecookie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which make us nervous cause those are not versioned files, i.e.:&lt;br /&gt;
 5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock&lt;br /&gt;
&lt;br /&gt;
So those files will replace existing files on v12 rather than the case of the latter where it&#039;s likely being added. So caution should be given and deference to whichever version is newer (which rsync should take care of, but that will depend on the date each file was created and perhaps not the actual data within).&lt;br /&gt;
&lt;br /&gt;
If we look further in the file we see:&lt;br /&gt;
&lt;br /&gt;
 x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.&lt;br /&gt;
9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif&lt;br /&gt;
&lt;br /&gt;
and other files looking like:&lt;br /&gt;
 5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info&lt;br /&gt;
&lt;br /&gt;
Which means plesk is here. We don&#039;t need plesk on v12 (the CT moving over doesn&#039;t use it) so we rerun the rsync and exclude it:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh --exclude=&amp;quot;plesk*&amp;quot; --exclude=&amp;quot;psa*&amp;quot; /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
and now it&#039;s much smaller:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l&lt;br /&gt;
 97104&lt;br /&gt;
&lt;br /&gt;
Before running with excludes it was:&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l &lt;br /&gt;
 238238&lt;br /&gt;
&lt;br /&gt;
So again, look at what you&#039;re doing. Generally, combining templates is fine however.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re happy with the merge, run the rsync again without the &amp;quot;-n&amp;quot; to let it actually do the transfer.&lt;br /&gt;
&lt;br /&gt;
Once done, don&#039;t forget to add the new template to the HN in Management -&amp;gt; Reference -&amp;gt; Templates&lt;br /&gt;
&lt;br /&gt;
= getting help =&lt;br /&gt;
&lt;br /&gt;
= vzup2date =&lt;br /&gt;
TODO &lt;br /&gt;
= Adding new OS/application templates =&lt;br /&gt;
&lt;br /&gt;
Virtuozzo will lag a bit behind the initial release of an OS, perhaps by a month or more. Further, a newly-released OS may be available, but there may not be many/any application templates available initially. It pays to wait a bit.&lt;br /&gt;
&lt;br /&gt;
A template is easily installed via [[#vzup2date|vzup2date]]:&lt;br /&gt;
&lt;br /&gt;
 vzup2date -z&lt;br /&gt;
&lt;br /&gt;
You will be given a list of OS&#039;s to install. Select an OS, then customize that selection by checking/unchecking the application templates we do/don&#039;t want to include/offer.&lt;br /&gt;
&lt;br /&gt;
Generally, here are the app templates we include/offer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cyrus-imap&lt;br /&gt;
devel&lt;br /&gt;
imp&lt;br /&gt;
jre&lt;br /&gt;
jsdk&lt;br /&gt;
mailman&lt;br /&gt;
mod_perl&lt;br /&gt;
mod_ssl&lt;br /&gt;
mysql&lt;br /&gt;
php&lt;br /&gt;
phpmyadmin&lt;br /&gt;
phppgadmin&lt;br /&gt;
postgresql&lt;br /&gt;
proftpd&lt;br /&gt;
spamassassin&lt;br /&gt;
squirrelmail&lt;br /&gt;
tomcat&lt;br /&gt;
vsftpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do not (any longer) offer webalizer or analog.&lt;br /&gt;
&lt;br /&gt;
After selecting and installing the OS and apps, you should ensure it&#039;s installed:&lt;br /&gt;
&lt;br /&gt;
 vzpkg list -O&lt;br /&gt;
&lt;br /&gt;
Your new OS (ex. fedora-core-13-x86_64) will be listed, without a corresponding cache date:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@virt13 /vzconf]# vzpkg list -O&lt;br /&gt;
centos-6-x86                       2011-07-22 13:24:41&lt;br /&gt;
centos-6-x86_64                    2012-03-09 20:42:22&lt;br /&gt;
centos-5-x86                       2009-07-27 16:58:24&lt;br /&gt;
centos-5-x86_64                    2012-03-09 22:38:53&lt;br /&gt;
ubuntu-11.10-x86_64                2012-03-01 23:13:33&lt;br /&gt;
ubuntu-9.04-x86                    2009-06-02 11:32:39&lt;br /&gt;
ubuntu-12.04-x86_64                2012-05-29 13:50:50&lt;br /&gt;
ubuntu-8.04-x86                    2008-09-17 21:27:20&lt;br /&gt;
ubuntu-8.10-x86                    2009-03-13 13:58:57&lt;br /&gt;
ubuntu-11.04-x86                   2011-12-05 11:15:46&lt;br /&gt;
ubuntu-7.04-x86                    2008-09-24 16:42:50&lt;br /&gt;
redhat-el6-x86_64&lt;br /&gt;
fedora-core-13-x86_64              &lt;br /&gt;
fedora-core-12-x86                 2010-02-06 13:24:32&lt;br /&gt;
fedora-core-15-x86                 2011-12-05 11:36:43&lt;br /&gt;
fedora-core-11-x86                 2009-10-01 16:30:59&lt;br /&gt;
fedora-core-14-x86&lt;br /&gt;
fedora-core-16-x86_64              2012-03-13 11:40:23&lt;br /&gt;
fedora-core-9-x86                  2008-11-29 10:52:18&lt;br /&gt;
debian-6.0-x86                     2011-07-29 16:00:35&lt;br /&gt;
debian-6.0-x86_64                  2012-03-12 19:53:33&lt;br /&gt;
debian-5.0-x86                     2009-03-12 12:39:11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also confirm the apps installed:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt13 /vzconf]# vzpkg list fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64              2013-03-08 11:39:44&lt;br /&gt;
fedora-core-13-x86_64 devel&lt;br /&gt;
fedora-core-13-x86_64 php&lt;br /&gt;
fedora-core-13-x86_64 proftpd&lt;br /&gt;
fedora-core-13-x86_64 postgresql&lt;br /&gt;
fedora-core-13-x86_64 phpmyadmin&lt;br /&gt;
fedora-core-13-x86_64 mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before you can use the OS you must cache it. To create the cache run:&lt;br /&gt;
 vzpkg cache [OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;vzpkg cache fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s ready to use. In order to be able to use it with the [[VPS_Management#vm|vm]] command, you must create a file:&lt;br /&gt;
 jctmpl-[OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;jctmpl-fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In it, on line 1 we place the OS, followed by the app names, ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;more jctmpl-fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64&lt;br /&gt;
postgresql&lt;br /&gt;
jsdk&lt;br /&gt;
mod_ssl&lt;br /&gt;
phpmyadmin&lt;br /&gt;
mod_perl&lt;br /&gt;
tomcat&lt;br /&gt;
devel&lt;br /&gt;
php&lt;br /&gt;
mailman&lt;br /&gt;
cyrus-imap&lt;br /&gt;
squirrelmail&lt;br /&gt;
proftpd&lt;br /&gt;
mysql&lt;br /&gt;
phppgadmin&lt;br /&gt;
spamassassin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The packages will be installed in that order, so any pre-req&#039;s should be handled there.&lt;br /&gt;
&lt;br /&gt;
Now, when you run [[VPS_Management#vm|vm]] it will show you the newly-added OS and you may create a CT using it.&lt;br /&gt;
&lt;br /&gt;
The last few tasks are related to mgmt:&lt;br /&gt;
&lt;br /&gt;
1. add to mgmt-&amp;gt;reference-&amp;gt;templates (use the existing templates as an example). Once added, the new template will be included with the list of OS&#039;s available for the given HN.&lt;br /&gt;
2. if this is going to be a new OS offered for ordering, it needs to be added to the order form and webpage.&lt;br /&gt;
&lt;br /&gt;
a. to get a list of applications and versions in the new OS, you should create a test CT, enter it and run &amp;lt;tt&amp;gt;dpkg -l|sort&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;rpm -aq|sort&amp;lt;/tt&amp;gt; in centos/fedora) and enter that list in the following places:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/jc_pub/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Note, you will have to move the most recent OS data from &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt; into the corresponding &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname]_old.html&amp;lt;/tt&amp;gt; updating the version links in both.&lt;br /&gt;
&lt;br /&gt;
b. to add the new OS to the order form, you will need to update &amp;lt;tt&amp;gt;/usr/local/www/signup/html/step1.html&amp;lt;/tt&amp;gt; in several places (for regular and OSS orders) as well as updating the templateID which you can get from mgmt-&amp;gt;reference-&amp;gt;templates (or [[Management_System_/_Public_Website_/_Signup_/_Account_Manager#jc:ref_templates|jc:ref_templates]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Old method to obtain the templates:&lt;br /&gt;
&lt;br /&gt;
Go to http://www.parallels.com/en/virtuozzo/templates/catalog/&lt;br /&gt;
&lt;br /&gt;
Download the RPM&#039;s and install them&lt;br /&gt;
&lt;br /&gt;
 vzpkg list&lt;br /&gt;
to see the new packages/os templates&lt;br /&gt;
&lt;br /&gt;
 vzpkg create cache &amp;quot;OS_EZ_template_name&amp;quot;&lt;br /&gt;
to create a cache&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Update OS template =&lt;br /&gt;
&lt;br /&gt;
Installation and update of the new version of OS template will not affect the existing containers. It will affect only the new containers, created after this update operation. In terms of fixing &amp;quot;vzctl enter&amp;quot; error and SSH connectivity to Ubuntu based containers, it is necessary to recreate the template and not to update it, so the commands to run are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rpm -Uhv ubuntu-8.04-x86-ez-4.0.0-9.swsoft.noarch.rpm&lt;br /&gt;
vzpkg clean ubuntu-8.04-x86&lt;br /&gt;
vzpkg remove cache ubuntu-8.04-x86&lt;br /&gt;
vzpkg create cache ubuntu-8.04-x86&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installing new SSL cert on VZCP =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;openssl req -days 1999 -new -x509 -nodes -out server.crt -keyout server.key&lt;br /&gt;
&lt;br /&gt;
US&lt;br /&gt;
CA&lt;br /&gt;
San Diego&lt;br /&gt;
johncompanies.com&lt;br /&gt;
johncompanies.com&lt;br /&gt;
virt15ohncompanies.com&lt;br /&gt;
linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.crt/server.crt /etc/httpd/conf/ssl.crt/server.crt.bak&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.key/server.key /etc/httpd/conf/ssl.key/server.key.bak&lt;br /&gt;
cp server.crt /etc/httpd/conf/ssl.crt/server.crt&lt;br /&gt;
cp server.key /etc/httpd/conf/ssl.key/server.key&lt;br /&gt;
/etc/init.d/vzcp restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Moving virt (drives) to new hardware =&lt;br /&gt;
&lt;br /&gt;
If you have a case where a virt is dead (due to hardware failure), you can move the drives to a new hardware setup.&lt;br /&gt;
Here are the steps and things to look for:&lt;br /&gt;
&lt;br /&gt;
Move the drives to the new box. Most likely, the drives will be recognized and there will be no problems booting up. On Dell PERC 5/6 cards you will need to import the new &amp;quot;foreign&amp;quot; volume via the raid BIOS.&lt;br /&gt;
&lt;br /&gt;
If the hardware (motherboard) is different, it’s possible the nic’s won’t be recognized. Look at /etc/modules.conf the ethernet drivers are either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 tg3&lt;br /&gt;
alias eth1 tg3&amp;lt;/pre&amp;gt;&lt;br /&gt;
(supermicro)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 e100&lt;br /&gt;
alias eth1 e1000&amp;lt;/pre&amp;gt;&lt;br /&gt;
(intel)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 bnx2&lt;br /&gt;
alias eth1 bnx2&amp;lt;/pre&amp;gt;&lt;br /&gt;
(dell 29500)&lt;br /&gt;
&lt;br /&gt;
Also, you may see eth0 and eth1 swapped so if after confirming the eth devices are present (may require a reboot), then you may still need to swap the green/yellow network cables in the back to get them on the right port.&lt;br /&gt;
&lt;br /&gt;
VZ will not run (for long) on the new hardware, so you will need to get the license reissued. You may create/download a temporary license via their website for the interim.&lt;br /&gt;
&lt;br /&gt;
= Updating kernel on virt =&lt;br /&gt;
&lt;br /&gt;
We now use [[#vzup2date|vzup2date]] to update systems and kernels. What follows is what we used to do when we had to download kernels and install manually on old systems:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. install kernel and modules&lt;br /&gt;
&amp;lt;pre&amp;gt;# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \&lt;br /&gt;
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm&lt;br /&gt;
vzkernel-smp          ##################################################&lt;br /&gt;
vzmodules-smp       ##################################################&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT USE the &amp;quot;rpm -Uhv&amp;quot; command to install the kernel, otherwise all the previously installed kernels may be removed from your system. &lt;br /&gt;
&lt;br /&gt;
2. update lilo/grub&lt;br /&gt;
&lt;br /&gt;
Lilo:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lilo.conf&lt;br /&gt;
 &lt;br /&gt;
rename old Virtuozzo kernel label from &amp;quot;linux+virtuozzo&amp;quot; to &amp;quot;virtuozzo_old&amp;quot;&lt;br /&gt;
and add a new entry pointing to the newly installed virtuozzo kernel image.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;prompt&lt;br /&gt;
timeout=50&lt;br /&gt;
default=linux+virtuozzo&lt;br /&gt;
append=&amp;quot;debug panic=5 console=tty console=ttyS0,38400&amp;quot;&lt;br /&gt;
boot=/dev/sda&lt;br /&gt;
map=/boot/map&lt;br /&gt;
install=/boot/boot.b&lt;br /&gt;
message=/boot/message&lt;br /&gt;
linear&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3smp&lt;br /&gt;
        label=linux&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3smp.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3&lt;br /&gt;
        label=linux-up&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise&lt;br /&gt;
        label=2.4.20-9.5.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise&lt;br /&gt;
        label=2.4.20-9.8.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise&lt;br /&gt;
        label=2.4.20-9.21.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise&lt;br /&gt;
        label=2.4.20-9.24.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise&lt;br /&gt;
        label=2.4.20-28.3.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise&lt;br /&gt;
        label=old_linux+vz&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise&lt;br /&gt;
        label=linux+virtuozzo&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label &amp;quot;old_linux+vz &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Grub:&lt;br /&gt;
&lt;br /&gt;
 vi /boot/grub /menu.lst&lt;br /&gt;
&lt;br /&gt;
Add new entry at the top.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;serial --unit=0 --speed=38400&lt;br /&gt;
terminal --timeout=10 serial console&lt;br /&gt;
default=0&lt;br /&gt;
timeout=10&lt;br /&gt;
splashimage=(hd0,0)/boot/grub/splash.xpm.gz&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Red Hat Linux (2.4.18-3smp)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3smp.img&lt;br /&gt;
title Red Hat Linux-up (2.4.18-3)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3.img&lt;br /&gt;
title Linux with Virtuozzo 2.5&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1&lt;br /&gt;
title vz-enterpriseo&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1&lt;br /&gt;
title vz-enterprise&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. run the lilo (if using lilo)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lilo&lt;br /&gt;
Added linux&lt;br /&gt;
Added linux-up&lt;br /&gt;
Added virtuozzo_old&lt;br /&gt;
Added linux+virtuozzo *&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. reboot the server&lt;br /&gt;
 shutdown -r 23:05&lt;br /&gt;
&lt;br /&gt;
when it comes time for the shutdown, run [[VPS_Management#stopvirt|stopvirt]] to get things shut down faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Remaking service VE (&amp;lt;=3.x only) =&lt;br /&gt;
&lt;br /&gt;
Occasionally the control panel for VEs (aka VZPP) will stop working and you just need to reinstall the service VE (which runs the control panels for all VEs on the HN). Here&#039;s how that&#039;s done :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop 1&lt;br /&gt;
ipdel 1 69.55.234.152&lt;br /&gt;
vzmlocal 1:2&lt;br /&gt;
vzctl set 2 --save --onboot no&lt;br /&gt;
vzsveinstall -t redhat-as3-minimal -d /root/Rel261/HW/RPMS -s 69.55.234.152 --skip-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzsveinstall -t redhat-as3-minimal -d /vz/Rel300/HW/RPMS -s 69.55.229.151 --skip-client&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzctl mount 1&lt;br /&gt;
vzctl mount 2&lt;br /&gt;
/bin/cp -aRf /vz/root/2/home/vzagent0 /vz/root/1/home&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/lib/mysql/VZADB /vz/root/1/var/lib/mysql&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/shadow /vz/root/1/etc/&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/vzcp/static/vz/skins/ /vz/root/1/var/vzcp/static/vz&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/menu.xml  /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/dashboard.xml /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
&lt;br /&gt;
vzctl umount 2&lt;br /&gt;
vzctl umount 1&lt;br /&gt;
vzctl start 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= GRUB: boot once to a new kernel =&lt;br /&gt;
&lt;br /&gt;
To use a different kernel for the next reboot only:&lt;br /&gt;
  &amp;lt;pre&amp;gt;grub --no-floppy&lt;br /&gt;
  savedefault --default=N --once&lt;br /&gt;
  (where N is the number of the kernel you want to boot once)&lt;br /&gt;
  quit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot your machine. It will boot using kernel &amp;quot;N&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 grub-reboot N&lt;br /&gt;
will do essentially the same thing and prompt to reboot the machine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Recovering from GRUB failure =&lt;br /&gt;
&lt;br /&gt;
(example from DPE 2950)&lt;br /&gt;
&lt;br /&gt;
Boot to CEOS4 server CD (original install cd). Did this example with iso mounted via drac&lt;br /&gt;
&lt;br /&gt;
 Boot: linux rescue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Make/edit an ISO on Linux =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mount file.iso /mnt/iso/ -t iso9660 -o ro,loop=/dev/loop0&lt;br /&gt;
mkdir /tmp/iso&lt;br /&gt;
cp -aR /mnt/iso/* /tmp/iso/&lt;br /&gt;
umount /mnt/iso/&lt;br /&gt;
mkisofs -iso-level 2 -o /tmp/new.iso /tmp/iso/&lt;br /&gt;
rm -fr /tmp/iso&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To mount it:&lt;br /&gt;
&lt;br /&gt;
 mount -t vfat -o loop /tmp/3wfirmware.iso /mnt/usb/&lt;br /&gt;
&lt;br /&gt;
http://www.damnsmalllinux.org/wiki/index.php/Installing_to_a_USB_Flash_Drive&lt;br /&gt;
&lt;br /&gt;
= Mount/edit USB drive on Linux =&lt;br /&gt;
&lt;br /&gt;
 mount -t vfat -o loop  /dev/sdc1 /mnt/usb/&lt;br /&gt;
&lt;br /&gt;
This example is for our floating usb drive on virt16. You should edit the device as necessary on other hardware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installing OS via net =&lt;br /&gt;
&lt;br /&gt;
Centos 5.1:&amp;lt;br&amp;gt;&lt;br /&gt;
http site name: &amp;lt;tt&amp;gt;vault.centos.org&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
dir: &amp;lt;tt&amp;gt;/5.1/os/i386/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Centos 5.4:&amp;lt;br&amp;gt;&lt;br /&gt;
http site name: &amp;lt;tt&amp;gt;mirrors.kernel.org&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
dir: &amp;lt;tt&amp;gt;/centos/5.4/os/i386/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
or&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/centos/5.4/os/x86_64/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
or&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;http://mirrors.usc.edu/pub/linux/distributions/centos/5.4/os/i386/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Centos 6.2:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;http://mirrors.usc.edu/pub/linux/distributions/centos/6.2/os/x86_64/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FC9:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;http://linux.nssl.noaa.gov/fedora/linux/releases/9/Fedora/i386/os/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FC10:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;http://linux.nssl.noaa.gov/fedora/linux/releases/10/Fedora/i386/os/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1055</id>
		<title>Virtuozzo / Linux Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1055"/>
		<updated>2013-03-12T00:12:20Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Mount/edit USB drive on Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Updating VZ =&lt;br /&gt;
&lt;br /&gt;
 Update Virtuozzo to version 4.0.0&lt;br /&gt;
 Apply minor updates for Virtuozzo 3.0.0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
When you get to the last screen, you will be given an option to &lt;br /&gt;
&lt;br /&gt;
 ( ) Automatically reboot after update&lt;br /&gt;
 (*) Reboot later manually&lt;br /&gt;
&lt;br /&gt;
make sure you choose to reboot later.&lt;br /&gt;
&lt;br /&gt;
= Migrating Templates =&lt;br /&gt;
One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it&#039;s now called) based on a particular ditribution on a host which may or may not share the same distribution. For instance, you could run a CT running Ubuntu while the host machine (Hardware Node or HN) is running CentOS. This is accomplished via the use of OS templates. As long as the HN contains the OS template on which a particular CT relies, it will run there. As such, if you want to move a CT from one HN to another, you will need to make sure the OS template exists there.&lt;br /&gt;
&lt;br /&gt;
Modern versions of VZ (&amp;gt;= 4.x) will check for and automatically move the OS template over to the host as you&#039;re (vz)migrating the CT over to a new HN. However we like to make sure the template is in place prior to moving the CT. &lt;br /&gt;
&lt;br /&gt;
The first step is to see if the template exists on the host. To see OS templates installed:&lt;br /&gt;
&lt;br /&gt;
2.x (shows OS and application templates):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkgls&lt;br /&gt;
mod_ssl-rh9 20040624&lt;br /&gt;
mysql-rh9 20030814 20050412&lt;br /&gt;
openwebmail-rh9 20050427&lt;br /&gt;
php-rh9 20050506&lt;br /&gt;
phpBB-rh9 20041229&lt;br /&gt;
postgresql-rh9 20050719&lt;br /&gt;
sl-webalizer-rh9 20040119&lt;br /&gt;
spamassassin-rh9 20040127&lt;br /&gt;
tomcat-rh9 20040524&lt;br /&gt;
usermin-rh9 20040116&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;= 3.x (shows just OS templates, run without -O to see application as well):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkg list -O&lt;br /&gt;
ubuntu-10.04-x86                   2010-06-01 11:39:05&lt;br /&gt;
ubuntu-11.04-x86                   2011-06-22 14:23:59&lt;br /&gt;
ubuntu-9.10-x86                    2010-03-11 17:39:51&lt;br /&gt;
centos-5-x86                       2010-03-11 17:12:27&lt;br /&gt;
debian-5.0-x86                     2010-03-11 17:33:34&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All template files are located:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1&lt;br /&gt;
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2&lt;br /&gt;
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9&lt;br /&gt;
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1&lt;br /&gt;
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2&lt;br /&gt;
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9&lt;br /&gt;
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92&lt;br /&gt;
analog-fc2      mailman-fc2           php-rh9             suse-9.2&lt;br /&gt;
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1&lt;br /&gt;
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2&lt;br /&gt;
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9&lt;br /&gt;
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92&lt;br /&gt;
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1&lt;br /&gt;
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1&lt;br /&gt;
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2&lt;br /&gt;
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9&lt;br /&gt;
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1&lt;br /&gt;
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2&lt;br /&gt;
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9&lt;br /&gt;
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3&lt;br /&gt;
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0&lt;br /&gt;
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92&lt;br /&gt;
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1&lt;br /&gt;
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2&lt;br /&gt;
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9&lt;br /&gt;
jdk-suse92      mysql-rh9             redhat-as3-minimal&lt;br /&gt;
jre-deb31       mysql-suse92          redhat-devel-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here are the base OS templates: &amp;lt;tt&amp;gt;redhat-9, fedora-core-1&amp;lt;/tt&amp;gt; and supporting application templates: &amp;lt;tt&amp;gt;postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1&amp;lt;/tt&amp;gt;. So if you wanted to copy over all of redhat 9 you&#039;d need to copy the contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls -d /vz/template/*rh9*&lt;br /&gt;
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9&lt;br /&gt;
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9&lt;br /&gt;
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9&lt;br /&gt;
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9&lt;br /&gt;
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9&lt;br /&gt;
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9&lt;br /&gt;
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9&lt;br /&gt;
/vz/template/mailman-rh9     /vz/template/postgresql-rh9&lt;br /&gt;
&lt;br /&gt;
# ls -d /vz/template/*redhat-9*&lt;br /&gt;
/vz/template/redhat-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a template from one HN to another, it simply needs to be rsync&#039;d over to the target HN. It&#039;s rsync&#039;d over in this fashion:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template&lt;br /&gt;
 rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template&lt;br /&gt;
&lt;br /&gt;
Newer (&amp;gt;= 3.x) VZ employs &amp;quot;EZ&amp;quot; templates which are organized a little differently:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc&lt;br /&gt;
centos  conf         redhat-as3-minimal  ubuntu&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/ubuntu/&lt;br /&gt;
10.04  11.04  9.10&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/&lt;br /&gt;
x86&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/cache/&lt;br /&gt;
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz&lt;br /&gt;
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz&lt;br /&gt;
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we see is the entire OS and all applications are in 1 directory, and organized by distribution and release version. So to move Ubuntu 10.04:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
and you also need to move the cache:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/&lt;br /&gt;
&lt;br /&gt;
Once the transfer is complete, you will be able to run &amp;lt;tt&amp;gt;vzpkgls&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vzpkg list -O&amp;lt;/tt&amp;gt; and see the template(s) listed on the target HN.&lt;br /&gt;
&lt;br /&gt;
So far, this all supposes template doesn&#039;t exist on the target- very simple, just copy it over. If the template exists already on the target HN, this requires closer inspection. With older templates, simply moving over the templates would be the end of it- you see the version listed when you do a &amp;lt;tt&amp;gt;vzplgls&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysql-rh9 20030814 20050412&lt;br /&gt;
&lt;br /&gt;
this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412&lt;br /&gt;
As an aside, you can&#039;t copy over just 1 of them, but if you rsync&#039;d over the &amp;lt;tt&amp;gt;mysql-rh9&amp;lt;/tt&amp;gt; directory, you&#039;d see 20030814 and 20050412 on the target HN. As long as the versions match up, you&#039;re good to go.&lt;br /&gt;
&lt;br /&gt;
With EZ templates, the versions are not as easy to decipher. When you look at the &amp;lt;tt&amp;gt;vzpkg list&amp;lt;/tt&amp;gt; output, that simply tells you when a cache was created. A cache is simply a snapshot of all the data needed for the latest versions of the OS and it&#039;s applications at the time the cache was created. It is a date, and thus tells you nothing about the versions within. So for instance, if you had a cache for Ubuntu 10.04 from 2007 and you ran &amp;lt;tt&amp;gt;vzpkg create cache ubuntu-10.04-x86&amp;lt;/tt&amp;gt; it would re-download the latest version of apache, mysql and so on. And any &#039;&#039;subsequent&#039;&#039; ubuntu 10.04 CT&#039;s created thereafter would use those newer versions, whereas older CT&#039;s based on 10.04 would use older templates. You can see how this works by looking at the files under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this template has in it 6 different versions of apache2. This means that this template was merged with other 10.04 templates and/or it has been cached a few times, each time a new apache was available. The unfortunate thing is it&#039;s almost impossible to know which CT&#039;s are using which version of apache so it&#039;s hard to try to prune this down and remove unwanted/unneeded applications.&lt;br /&gt;
&lt;br /&gt;
So, if you see another HN has Ubuntu 10.04 on it, you need to see/confirm that it has all the exact files your CT needs. You can run a test rsync to see what &#039;&#039;would&#039;&#039; be transferred (what&#039;s missing):&lt;br /&gt;
&lt;br /&gt;
 rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
Based on the amount of data you get back from the rsync, you will be able to decide whether or not to remove the -n and allow the full transfer to go through. The downside to doing the transfer is the situation described above- you&#039;ve permanently joined these templates and now you may have 10 versions of apache on the target HN. There&#039;s one other potential pitfall to this kind of merging- it will also potentially copy over shared files, for which there is no particular version, most of which are in &amp;lt;tt&amp;gt;/vz/template/ubuntu/10.04/x86/config&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
 cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
 /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
&lt;br /&gt;
Here are some specific things to look out for. Case: copying centos-5 on virt19 to virt12. We dumped the rsync output to a file so we could inspect:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
(note, that can be dangerous, better to add on full path &amp;lt;tt&amp;gt;/vz/template/centos/5&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
So in the output file we see things like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
x86/base0/cachecookie&lt;br /&gt;
x86/base0/primary.xml.gz &lt;br /&gt;
x86/base0/primary.xml.gz.sqlite &lt;br /&gt;
x86/base0/repomd.xml &lt;br /&gt;
x86/base1/cachecookie &lt;br /&gt;
x86/base1/filelists.xml.gz &lt;br /&gt;
x86/base1/filelists.xml.gz.sqlite  &lt;br /&gt;
x86/base1/primary.xml.gz &lt;br /&gt;
x86/base1/primary.xml.gz.sqlite &lt;br /&gt;
x86/base1/repomd.xml&lt;br /&gt;
x86/base2/cachecookie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which make us nervous cause those are not versioned files, i.e.:&lt;br /&gt;
 5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock&lt;br /&gt;
&lt;br /&gt;
So those files will replace existing files on v12 rather than the case of the latter where it&#039;s likely being added. So caution should be given and deference to whichever version is newer (which rsync should take care of, but that will depend on the date each file was created and perhaps not the actual data within).&lt;br /&gt;
&lt;br /&gt;
If we look further in the file we see:&lt;br /&gt;
&lt;br /&gt;
 x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.&lt;br /&gt;
9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif&lt;br /&gt;
&lt;br /&gt;
and other files looking like:&lt;br /&gt;
 5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info&lt;br /&gt;
&lt;br /&gt;
Which means plesk is here. We don&#039;t need plesk on v12 (the CT moving over doesn&#039;t use it) so we rerun the rsync and exclude it:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh --exclude=&amp;quot;plesk*&amp;quot; --exclude=&amp;quot;psa*&amp;quot; /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
and now it&#039;s much smaller:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l&lt;br /&gt;
 97104&lt;br /&gt;
&lt;br /&gt;
Before running with excludes it was:&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l &lt;br /&gt;
 238238&lt;br /&gt;
&lt;br /&gt;
So again, look at what you&#039;re doing. Generally, combining templates is fine however.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re happy with the merge, run the rsync again without the &amp;quot;-n&amp;quot; to let it actually do the transfer.&lt;br /&gt;
&lt;br /&gt;
Once done, don&#039;t forget to add the new template to the HN in Management -&amp;gt; Reference -&amp;gt; Templates&lt;br /&gt;
&lt;br /&gt;
= getting help =&lt;br /&gt;
&lt;br /&gt;
= vzup2date =&lt;br /&gt;
TODO &lt;br /&gt;
= Adding new OS/application templates =&lt;br /&gt;
&lt;br /&gt;
Virtuozzo will lag a bit behind the initial release of an OS, perhaps by a month or more. Further, a newly-released OS may be available, but there may not be many/any application templates available initially. It pays to wait a bit.&lt;br /&gt;
&lt;br /&gt;
A template is easily installed via [[#vzup2date|vzup2date]]:&lt;br /&gt;
&lt;br /&gt;
 vzup2date -z&lt;br /&gt;
&lt;br /&gt;
You will be given a list of OS&#039;s to install. Select an OS, then customize that selection by checking/unchecking the application templates we do/don&#039;t want to include/offer.&lt;br /&gt;
&lt;br /&gt;
Generally, here are the app templates we include/offer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cyrus-imap&lt;br /&gt;
devel&lt;br /&gt;
imp&lt;br /&gt;
jre&lt;br /&gt;
jsdk&lt;br /&gt;
mailman&lt;br /&gt;
mod_perl&lt;br /&gt;
mod_ssl&lt;br /&gt;
mysql&lt;br /&gt;
php&lt;br /&gt;
phpmyadmin&lt;br /&gt;
phppgadmin&lt;br /&gt;
postgresql&lt;br /&gt;
proftpd&lt;br /&gt;
spamassassin&lt;br /&gt;
squirrelmail&lt;br /&gt;
tomcat&lt;br /&gt;
vsftpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do not (any longer) offer webalizer or analog.&lt;br /&gt;
&lt;br /&gt;
After selecting and installing the OS and apps, you should ensure it&#039;s installed:&lt;br /&gt;
&lt;br /&gt;
 vzpkg list -O&lt;br /&gt;
&lt;br /&gt;
Your new OS (ex. fedora-core-13-x86_64) will be listed, without a corresponding cache date:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@virt13 /vzconf]# vzpkg list -O&lt;br /&gt;
centos-6-x86                       2011-07-22 13:24:41&lt;br /&gt;
centos-6-x86_64                    2012-03-09 20:42:22&lt;br /&gt;
centos-5-x86                       2009-07-27 16:58:24&lt;br /&gt;
centos-5-x86_64                    2012-03-09 22:38:53&lt;br /&gt;
ubuntu-11.10-x86_64                2012-03-01 23:13:33&lt;br /&gt;
ubuntu-9.04-x86                    2009-06-02 11:32:39&lt;br /&gt;
ubuntu-12.04-x86_64                2012-05-29 13:50:50&lt;br /&gt;
ubuntu-8.04-x86                    2008-09-17 21:27:20&lt;br /&gt;
ubuntu-8.10-x86                    2009-03-13 13:58:57&lt;br /&gt;
ubuntu-11.04-x86                   2011-12-05 11:15:46&lt;br /&gt;
ubuntu-7.04-x86                    2008-09-24 16:42:50&lt;br /&gt;
redhat-el6-x86_64&lt;br /&gt;
fedora-core-13-x86_64              &lt;br /&gt;
fedora-core-12-x86                 2010-02-06 13:24:32&lt;br /&gt;
fedora-core-15-x86                 2011-12-05 11:36:43&lt;br /&gt;
fedora-core-11-x86                 2009-10-01 16:30:59&lt;br /&gt;
fedora-core-14-x86&lt;br /&gt;
fedora-core-16-x86_64              2012-03-13 11:40:23&lt;br /&gt;
fedora-core-9-x86                  2008-11-29 10:52:18&lt;br /&gt;
debian-6.0-x86                     2011-07-29 16:00:35&lt;br /&gt;
debian-6.0-x86_64                  2012-03-12 19:53:33&lt;br /&gt;
debian-5.0-x86                     2009-03-12 12:39:11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also confirm the apps installed:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt13 /vzconf]# vzpkg list fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64              2013-03-08 11:39:44&lt;br /&gt;
fedora-core-13-x86_64 devel&lt;br /&gt;
fedora-core-13-x86_64 php&lt;br /&gt;
fedora-core-13-x86_64 proftpd&lt;br /&gt;
fedora-core-13-x86_64 postgresql&lt;br /&gt;
fedora-core-13-x86_64 phpmyadmin&lt;br /&gt;
fedora-core-13-x86_64 mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before you can use the OS you must cache it. To create the cache run:&lt;br /&gt;
 vzpkg cache [OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;vzpkg cache fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s ready to use. In order to be able to use it with the [[VPS_Management#vm|vm]] command, you must create a file:&lt;br /&gt;
 jctmpl-[OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;jctmpl-fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In it, on line 1 we place the OS, followed by the app names, ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;more jctmpl-fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64&lt;br /&gt;
postgresql&lt;br /&gt;
jsdk&lt;br /&gt;
mod_ssl&lt;br /&gt;
phpmyadmin&lt;br /&gt;
mod_perl&lt;br /&gt;
tomcat&lt;br /&gt;
devel&lt;br /&gt;
php&lt;br /&gt;
mailman&lt;br /&gt;
cyrus-imap&lt;br /&gt;
squirrelmail&lt;br /&gt;
proftpd&lt;br /&gt;
mysql&lt;br /&gt;
phppgadmin&lt;br /&gt;
spamassassin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The packages will be installed in that order, so any pre-req&#039;s should be handled there.&lt;br /&gt;
&lt;br /&gt;
Now, when you run [[VPS_Management#vm|vm]] it will show you the newly-added OS and you may create a CT using it.&lt;br /&gt;
&lt;br /&gt;
The last few tasks are related to mgmt:&lt;br /&gt;
&lt;br /&gt;
1. add to mgmt-&amp;gt;reference-&amp;gt;templates (use the existing templates as an example). Once added, the new template will be included with the list of OS&#039;s available for the given HN.&lt;br /&gt;
2. if this is going to be a new OS offered for ordering, it needs to be added to the order form and webpage.&lt;br /&gt;
&lt;br /&gt;
a. to get a list of applications and versions in the new OS, you should create a test CT, enter it and run &amp;lt;tt&amp;gt;dpkg -l|sort&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;rpm -aq|sort&amp;lt;/tt&amp;gt; in centos/fedora) and enter that list in the following places:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/jc_pub/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Note, you will have to move the most recent OS data from &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt; into the corresponding &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname]_old.html&amp;lt;/tt&amp;gt; updating the version links in both.&lt;br /&gt;
&lt;br /&gt;
b. to add the new OS to the order form, you will need to update &amp;lt;tt&amp;gt;/usr/local/www/signup/html/step1.html&amp;lt;/tt&amp;gt; in several places (for regular and OSS orders) as well as updating the templateID which you can get from mgmt-&amp;gt;reference-&amp;gt;templates (or [[Management_System_/_Public_Website_/_Signup_/_Account_Manager#jc:ref_templates|jc:ref_templates]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Old method to obtain the templates:&lt;br /&gt;
&lt;br /&gt;
Go to http://www.parallels.com/en/virtuozzo/templates/catalog/&lt;br /&gt;
&lt;br /&gt;
Download the RPM&#039;s and install them&lt;br /&gt;
&lt;br /&gt;
 vzpkg list&lt;br /&gt;
to see the new packages/os templates&lt;br /&gt;
&lt;br /&gt;
 vzpkg create cache &amp;quot;OS_EZ_template_name&amp;quot;&lt;br /&gt;
to create a cache&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Update OS template =&lt;br /&gt;
&lt;br /&gt;
Installation and update of the new version of OS template will not affect the existing containers. It will affect only the new containers, created after this update operation. In terms of fixing &amp;quot;vzctl enter&amp;quot; error and SSH connectivity to Ubuntu based containers, it is necessary to recreate the template and not to update it, so the commands to run are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rpm -Uhv ubuntu-8.04-x86-ez-4.0.0-9.swsoft.noarch.rpm&lt;br /&gt;
vzpkg clean ubuntu-8.04-x86&lt;br /&gt;
vzpkg remove cache ubuntu-8.04-x86&lt;br /&gt;
vzpkg create cache ubuntu-8.04-x86&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installing new SSL cert on VZCP =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;openssl req -days 1999 -new -x509 -nodes -out server.crt -keyout server.key&lt;br /&gt;
&lt;br /&gt;
US&lt;br /&gt;
CA&lt;br /&gt;
San Diego&lt;br /&gt;
johncompanies.com&lt;br /&gt;
johncompanies.com&lt;br /&gt;
virt15ohncompanies.com&lt;br /&gt;
linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.crt/server.crt /etc/httpd/conf/ssl.crt/server.crt.bak&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.key/server.key /etc/httpd/conf/ssl.key/server.key.bak&lt;br /&gt;
cp server.crt /etc/httpd/conf/ssl.crt/server.crt&lt;br /&gt;
cp server.key /etc/httpd/conf/ssl.key/server.key&lt;br /&gt;
/etc/init.d/vzcp restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Moving virt (drives) to new hardware =&lt;br /&gt;
&lt;br /&gt;
If you have a case where a virt is dead (due to hardware failure), you can move the drives to a new hardware setup.&lt;br /&gt;
Here are the steps and things to look for:&lt;br /&gt;
&lt;br /&gt;
Move the drives to the new box. Most likely, the drives will be recognized and there will be no problems booting up. On Dell PERC 5/6 cards you will need to import the new &amp;quot;foreign&amp;quot; volume via the raid BIOS.&lt;br /&gt;
&lt;br /&gt;
If the hardware (motherboard) is different, it’s possible the nic’s won’t be recognized. Look at /etc/modules.conf the ethernet drivers are either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 tg3&lt;br /&gt;
alias eth1 tg3&amp;lt;/pre&amp;gt;&lt;br /&gt;
(supermicro)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 e100&lt;br /&gt;
alias eth1 e1000&amp;lt;/pre&amp;gt;&lt;br /&gt;
(intel)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 bnx2&lt;br /&gt;
alias eth1 bnx2&amp;lt;/pre&amp;gt;&lt;br /&gt;
(dell 29500)&lt;br /&gt;
&lt;br /&gt;
Also, you may see eth0 and eth1 swapped so if after confirming the eth devices are present (may require a reboot), then you may still need to swap the green/yellow network cables in the back to get them on the right port.&lt;br /&gt;
&lt;br /&gt;
VZ will not run (for long) on the new hardware, so you will need to get the license reissued. You may create/download a temporary license via their website for the interim.&lt;br /&gt;
&lt;br /&gt;
= Updating kernel on virt =&lt;br /&gt;
&lt;br /&gt;
We now use [[#vzup2date|vzup2date]] to update systems and kernels. What follows is what we used to do when we had to download kernels and install manually on old systems:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. install kernel and modules&lt;br /&gt;
&amp;lt;pre&amp;gt;# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \&lt;br /&gt;
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm&lt;br /&gt;
vzkernel-smp          ##################################################&lt;br /&gt;
vzmodules-smp       ##################################################&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT USE the &amp;quot;rpm -Uhv&amp;quot; command to install the kernel, otherwise all the previously installed kernels may be removed from your system. &lt;br /&gt;
&lt;br /&gt;
2. update lilo/grub&lt;br /&gt;
&lt;br /&gt;
Lilo:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lilo.conf&lt;br /&gt;
 &lt;br /&gt;
rename old Virtuozzo kernel label from &amp;quot;linux+virtuozzo&amp;quot; to &amp;quot;virtuozzo_old&amp;quot;&lt;br /&gt;
and add a new entry pointing to the newly installed virtuozzo kernel image.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;prompt&lt;br /&gt;
timeout=50&lt;br /&gt;
default=linux+virtuozzo&lt;br /&gt;
append=&amp;quot;debug panic=5 console=tty console=ttyS0,38400&amp;quot;&lt;br /&gt;
boot=/dev/sda&lt;br /&gt;
map=/boot/map&lt;br /&gt;
install=/boot/boot.b&lt;br /&gt;
message=/boot/message&lt;br /&gt;
linear&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3smp&lt;br /&gt;
        label=linux&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3smp.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3&lt;br /&gt;
        label=linux-up&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise&lt;br /&gt;
        label=2.4.20-9.5.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise&lt;br /&gt;
        label=2.4.20-9.8.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise&lt;br /&gt;
        label=2.4.20-9.21.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise&lt;br /&gt;
        label=2.4.20-9.24.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise&lt;br /&gt;
        label=2.4.20-28.3.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise&lt;br /&gt;
        label=old_linux+vz&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise&lt;br /&gt;
        label=linux+virtuozzo&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label &amp;quot;old_linux+vz &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Grub:&lt;br /&gt;
&lt;br /&gt;
 vi /boot/grub /menu.lst&lt;br /&gt;
&lt;br /&gt;
Add new entry at the top.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;serial --unit=0 --speed=38400&lt;br /&gt;
terminal --timeout=10 serial console&lt;br /&gt;
default=0&lt;br /&gt;
timeout=10&lt;br /&gt;
splashimage=(hd0,0)/boot/grub/splash.xpm.gz&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Red Hat Linux (2.4.18-3smp)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3smp.img&lt;br /&gt;
title Red Hat Linux-up (2.4.18-3)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3.img&lt;br /&gt;
title Linux with Virtuozzo 2.5&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1&lt;br /&gt;
title vz-enterpriseo&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1&lt;br /&gt;
title vz-enterprise&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. run the lilo (if using lilo)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lilo&lt;br /&gt;
Added linux&lt;br /&gt;
Added linux-up&lt;br /&gt;
Added virtuozzo_old&lt;br /&gt;
Added linux+virtuozzo *&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. reboot the server&lt;br /&gt;
 shutdown -r 23:05&lt;br /&gt;
&lt;br /&gt;
when it comes time for the shutdown, run [[VPS_Management#stopvirt|stopvirt]] to get things shut down faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Remaking service VE (&amp;lt;=3.x only) =&lt;br /&gt;
&lt;br /&gt;
Occasionally the control panel for VEs (aka VZPP) will stop working and you just need to reinstall the service VE (which runs the control panels for all VEs on the HN). Here&#039;s how that&#039;s done :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop 1&lt;br /&gt;
ipdel 1 69.55.234.152&lt;br /&gt;
vzmlocal 1:2&lt;br /&gt;
vzctl set 2 --save --onboot no&lt;br /&gt;
vzsveinstall -t redhat-as3-minimal -d /root/Rel261/HW/RPMS -s 69.55.234.152 --skip-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzsveinstall -t redhat-as3-minimal -d /vz/Rel300/HW/RPMS -s 69.55.229.151 --skip-client&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzctl mount 1&lt;br /&gt;
vzctl mount 2&lt;br /&gt;
/bin/cp -aRf /vz/root/2/home/vzagent0 /vz/root/1/home&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/lib/mysql/VZADB /vz/root/1/var/lib/mysql&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/shadow /vz/root/1/etc/&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/vzcp/static/vz/skins/ /vz/root/1/var/vzcp/static/vz&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/menu.xml  /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/dashboard.xml /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
&lt;br /&gt;
vzctl umount 2&lt;br /&gt;
vzctl umount 1&lt;br /&gt;
vzctl start 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= GRUB: boot once to a new kernel =&lt;br /&gt;
&lt;br /&gt;
To use a different kernel for the next reboot only:&lt;br /&gt;
  &amp;lt;pre&amp;gt;grub --no-floppy&lt;br /&gt;
  savedefault --default=N --once&lt;br /&gt;
  (where N is the number of the kernel you want to boot once)&lt;br /&gt;
  quit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot your machine. It will boot using kernel &amp;quot;N&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 grub-reboot N&lt;br /&gt;
will do essentially the same thing and prompt to reboot the machine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Recovering from GRUB failure =&lt;br /&gt;
&lt;br /&gt;
(example from DPE 2950)&lt;br /&gt;
&lt;br /&gt;
Boot to CEOS4 server CD (original install cd). Did this example with iso mounted via drac&lt;br /&gt;
&lt;br /&gt;
 Boot: linux rescue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Make/edit an ISO on Linux =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mount file.iso /mnt/iso/ -t iso9660 -o ro,loop=/dev/loop0&lt;br /&gt;
mkdir /tmp/iso&lt;br /&gt;
cp -aR /mnt/iso/* /tmp/iso/&lt;br /&gt;
umount /mnt/iso/&lt;br /&gt;
mkisofs -iso-level 2 -o /tmp/new.iso /tmp/iso/&lt;br /&gt;
rm -fr /tmp/iso&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To mount it:&lt;br /&gt;
&lt;br /&gt;
 mount -t vfat -o loop /tmp/3wfirmware.iso /mnt/usb/&lt;br /&gt;
&lt;br /&gt;
http://www.damnsmalllinux.org/wiki/index.php/Installing_to_a_USB_Flash_Drive&lt;br /&gt;
&lt;br /&gt;
= Mount/edit USB drive on Linux =&lt;br /&gt;
&lt;br /&gt;
 mount -t vfat -o loop  /dev/sdc1 /mnt/usb/&lt;br /&gt;
&lt;br /&gt;
This example is for our floating usb drive on virt16. You should edit the device as necessary on other hardware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installing OS via net =&lt;br /&gt;
&lt;br /&gt;
Centos 5.1:&amp;lt;br&amp;gt;&lt;br /&gt;
http site name: &amp;lt;tt&amp;gt;vault.centos.org&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
dir: &amp;lt;tt&amp;gt;/5.1/os/i386/&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Centos 5.4:&amp;lt;br&amp;gt;&lt;br /&gt;
http site name: &amp;lt;tt&amp;gt;mirrors.kernel.org&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
dir: &amp;lt;tt&amp;gt;/centos/5.4/os/i386/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
or&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/centos/5.4/os/x86_64/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
or&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;http://mirrors.usc.edu/pub/linux/distributions/centos/5.4/os/i386/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Centos 6.2:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;http://mirrors.usc.edu/pub/linux/distributions/centos/6.2/os/x86_64/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FC9:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;http://linux.nssl.noaa.gov/fedora/linux/releases/9/Fedora/i386/os/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
FC10:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;http://linux.nssl.noaa.gov/fedora/linux/releases/10/Fedora/i386/os/&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=E-Monitoring_notes&amp;diff=1054</id>
		<title>E-Monitoring notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=E-Monitoring_notes&amp;diff=1054"/>
		<updated>2013-03-12T00:09:37Z</updated>

		<summary type="html">&lt;p&gt;Support: Created page with &amp;quot;= isys =  runs mail for e-monitoring.net  the key on root@mail should let you ssh w/o pass to isys.e-monitoring.net  isys has a mail queue problem where it gets big and we run...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= isys =&lt;br /&gt;
&lt;br /&gt;
runs mail for e-monitoring.net&lt;br /&gt;
&lt;br /&gt;
the key on root@mail should let you ssh w/o pass to isys.e-monitoring.net&lt;br /&gt;
&lt;br /&gt;
isys has a mail queue problem where it gets big and we run out of inodes. we setup a cronjob to clear that out.&lt;br /&gt;
&lt;br /&gt;
= polling / magrathea = &lt;br /&gt;
== config new IP ==&lt;br /&gt;
Edit:&lt;br /&gt;
&amp;lt;pre&amp;gt;/etc/defaultrouter&lt;br /&gt;
/export/home/groundwater/bin/getit.pl&lt;br /&gt;
/etc/hosts&lt;br /&gt;
/etc/hostname.le1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On production:&lt;br /&gt;
&amp;lt;pre&amp;gt;/home/htdocs/gw/index.pl&lt;br /&gt;
/home/htdocs/isys/pollscan.pl&lt;br /&gt;
/home/gw/shipley/etc/config.pl&lt;br /&gt;
/home/gw/owrd/etc/config.pl&lt;br /&gt;
/home/dboodman/www/isys/pollscan.pl&lt;br /&gt;
Apache conf&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== stop it from trying to dial out ==&lt;br /&gt;
&amp;lt;pre&amp;gt;mysql&amp;gt; select * from resources;&lt;br /&gt;
+------------+------------+----------------+-------+---------+----------+&lt;br /&gt;
| resourceID | resource   | connectionType | inUse | inUseBy | inUseFor |&lt;br /&gt;
+------------+------------+----------------+-------+---------+----------+&lt;br /&gt;
|          1 | /dev/cuaa0 |              1 |  NULL |    NULL |     NULL |&lt;br /&gt;
|          2 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|          3 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|          4 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|          5 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|          6 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|          7 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|          8 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|          9 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|         10 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
|         11 | network    |              2 |  NULL |    NULL |     NULL |&lt;br /&gt;
+------------+------------+----------------+-------+---------+----------+&lt;br /&gt;
11 rows in set (0.00 sec)&lt;br /&gt;
delete from resources where resourceID =1;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Main_Page&amp;diff=1053</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Main_Page&amp;diff=1053"/>
		<updated>2013-03-12T00:07:38Z</updated>

		<summary type="html">&lt;p&gt;Support: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[Special:AllPages|All Pages]]&lt;br /&gt;
* [[Payment_System|Payment System]]&lt;br /&gt;
* [[Management_System_/_Public_Website_/_Signup_/_Account_Manager|Management System / Public Website / Signup / Account Manager]]&lt;br /&gt;
* [[New_Signups|New Signups]]&lt;br /&gt;
* [[Shutting_Down_Service|Shutting Down Service]]&lt;br /&gt;
* [[Routine_Maintenance|Routine Maintenance]]&lt;br /&gt;
* Reference&lt;br /&gt;
** [[VPS_Management|VPS Management]]&lt;br /&gt;
** [[Jail_Server_Install|Jail Server Install]]&lt;br /&gt;
** [[Infrastructure_Machines|Infrastructure Machines]]&lt;br /&gt;
** [[Colo_Server_Setup|Colo Server Setup]]&lt;br /&gt;
** [[DNS]]&lt;br /&gt;
** [[FreeBSD_Reference|FreeBSD Reference]]&lt;br /&gt;
** [[Virtuozzo_/_Linux_Reference|Virtuozzo / Linux Reference]]&lt;br /&gt;
** [[Cabinetmap]]&lt;br /&gt;
** [[Switch_Control|Switch Control]]&lt;br /&gt;
** [[Private_IP_Mapping|Private IP Mapping]]&lt;br /&gt;
** [[Data_Center_Notes|Data Center Notes]]&lt;br /&gt;
** [[Crash_Reference|Crash Reference]]&lt;br /&gt;
** [[Hardware_Reference|Hardware Reference]]&lt;br /&gt;
** [[ATS]]&lt;br /&gt;
** [[Wiring_Reference|Wiring Reference]]&lt;br /&gt;
** [[Screen]]&lt;br /&gt;
** [[RAID_Cards|RAID Cards]]&lt;br /&gt;
** [[BigBrother]]&lt;br /&gt;
** [[Bandwidth_Management|Bandwidth Management]]&lt;br /&gt;
** [[Network_Time_(ntp)|Network Time (ntp)]]&lt;br /&gt;
** [[Isys_-_out_of_inodes|Isys - out of inodes]]&lt;br /&gt;
** [[DRAC/RMM|DRAC/RMM]]&lt;br /&gt;
** [[Customer_Backups|Customer Backups]]&lt;br /&gt;
** [[DoS_Attacks|DoS Attacks]]&lt;br /&gt;
** [[IPKVM|IPKVM]]&lt;br /&gt;
* [[System-generated_Notifications|System-generated Notifications]]&lt;br /&gt;
* [[Customer_Interaction|Customer Interaction]]&lt;br /&gt;
* [[Backup_Accounts_(rsync.net)| Backup Accounts (rsync.net)]]&lt;br /&gt;
* [[E-Monitoring_notes|E-Monitoring notes]]&lt;br /&gt;
* [[Todo]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [https://meta.wikimedia.org/wiki/Help:Advanced_editing Advanced Editing]&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=DRAC/RMM&amp;diff=1052</id>
		<title>DRAC/RMM</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=DRAC/RMM&amp;diff=1052"/>
		<updated>2013-03-12T00:06:17Z</updated>

		<summary type="html">&lt;p&gt;Support: /* DRAC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRAC =&lt;br /&gt;
&lt;br /&gt;
A list of all the DRAC cards and their IPs can be seen in the [[Private_IP_Mapping|ipmap]]&lt;br /&gt;
&lt;br /&gt;
To ssh in, login as root.&lt;br /&gt;
&lt;br /&gt;
Common commands:&lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
performs a reset&lt;br /&gt;
&lt;br /&gt;
 racadm serveraction powerdown&lt;br /&gt;
power off server&lt;br /&gt;
&lt;br /&gt;
 racadm serveraction powerup&lt;br /&gt;
power on server&lt;br /&gt;
&lt;br /&gt;
 racadm racreset&lt;br /&gt;
reset the DRAC card (if kvm console becomes frozen)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To get virtual media plugin to install, add site to trusted list and make security low&lt;br /&gt;
&lt;br /&gt;
Installing openmanage on CEOS4:&lt;br /&gt;
&lt;br /&gt;
Mount install cd from local drive&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mount /dev/scd0 /mnt&lt;br /&gt;
cd /mnt/srvadmin/linux/RPMS/RHEL4&lt;br /&gt;
cd /mnt/srvadmin/linux/supportscripts/&lt;br /&gt;
./srvadmin-install.sh --express&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy linux to disk&lt;br /&gt;
Edit the script to make it think the os is RHEL4&lt;br /&gt;
&lt;br /&gt;
BIOS settings to enable serial:&lt;br /&gt;
Serial comm.: &amp;lt;tt&amp;gt;on with cons. Redir via com1&amp;lt;/tt&amp;gt;&lt;br /&gt;
Failsafe: &amp;lt;tt&amp;gt;115200&amp;lt;/tt&amp;gt;&lt;br /&gt;
Redir after boot: &amp;lt;tt&amp;gt;enabled&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To boot to usb, switch hd sequence in bios. &lt;br /&gt;
&lt;br /&gt;
After removing usb it will have to reorder boot seq to get virtual cd back&lt;br /&gt;
&lt;br /&gt;
Can’t get floppy/iso to boot- need to use thumb drive&lt;br /&gt;
&lt;br /&gt;
Latest f/w as of 2/16/09:&lt;br /&gt;
&amp;lt;pre&amp;gt;Bios: 2.5.0&lt;br /&gt;
Perc 6/i:  6.1.1-0047&lt;br /&gt;
Drac: 1.4&lt;br /&gt;
BMC: 2.37&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= RMM =&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=DRAC/RMM&amp;diff=1051</id>
		<title>DRAC/RMM</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=DRAC/RMM&amp;diff=1051"/>
		<updated>2013-03-12T00:02:36Z</updated>

		<summary type="html">&lt;p&gt;Support: /* DRAC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRAC =&lt;br /&gt;
&lt;br /&gt;
A list of all the DRAC cards and their IPs can be seen in the [[IPmap|ipmap]]&lt;br /&gt;
To ssh in, login as root.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When DRAC console kvm gets frozen, ssh in and&lt;br /&gt;
&lt;br /&gt;
$ racadm racreset&lt;br /&gt;
&lt;br /&gt;
To fix login bug, disable roboform&lt;br /&gt;
&lt;br /&gt;
To get virtual media plugin to install, add site to trusted list and make security low&lt;br /&gt;
-----------------&lt;br /&gt;
&lt;br /&gt;
FC4 won’t find the drives&lt;br /&gt;
&lt;br /&gt;
Installing openmanage on CEOS4:&lt;br /&gt;
&lt;br /&gt;
Mount install cd from local drive&lt;br /&gt;
&lt;br /&gt;
mount /dev/scd0 /mnt&lt;br /&gt;
&lt;br /&gt;
cd /mnt/srvadmin/linux/RPMS/RHEL4&lt;br /&gt;
cd /mnt/srvadmin/linux/supportscripts/&lt;br /&gt;
./srvadmin-install.sh --express&lt;br /&gt;
&lt;br /&gt;
Copy linux to disk&lt;br /&gt;
Edit the script to make it think the os is RHEL4&lt;br /&gt;
&lt;br /&gt;
racadm serveraction hardreset&lt;br /&gt;
racadm serveraction powerdown&lt;br /&gt;
racadm serveraction powerup&lt;br /&gt;
racadm racreset&lt;br /&gt;
&lt;br /&gt;
BIOS settings:&lt;br /&gt;
Serial comm.: on with cons. Redir via com1&lt;br /&gt;
Failsafe: 115200&lt;br /&gt;
Redir after boot: enabled&lt;br /&gt;
&lt;br /&gt;
To boot to usb, switch hd sequence in bios. &lt;br /&gt;
After removing usb it will have to reorder boot seq to get virtual cd back&lt;br /&gt;
&lt;br /&gt;
Can’t get floppy/iso to boot- need to use thumb drive&lt;br /&gt;
&lt;br /&gt;
Latest f/w as of 2/16/09:&lt;br /&gt;
Bios: 2.5.0&lt;br /&gt;
Perc 6/i:  6.1.1-0047&lt;br /&gt;
Drac: 1.4&lt;br /&gt;
BMC: 2.37&lt;br /&gt;
&lt;br /&gt;
= RMM =&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=DRAC/RMM&amp;diff=1050</id>
		<title>DRAC/RMM</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=DRAC/RMM&amp;diff=1050"/>
		<updated>2013-03-12T00:02:22Z</updated>

		<summary type="html">&lt;p&gt;Support: /* DRAC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= DRAC =&lt;br /&gt;
&lt;br /&gt;
A list of all the DRAC cards and their IPs can be seen in the [[ipmap|ipmap]]&lt;br /&gt;
To ssh in, login as root.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When DRAC console kvm gets frozen, ssh in and&lt;br /&gt;
&lt;br /&gt;
$ racadm racreset&lt;br /&gt;
&lt;br /&gt;
To fix login bug, disable roboform&lt;br /&gt;
&lt;br /&gt;
To get virtual media plugin to install, add site to trusted list and make security low&lt;br /&gt;
-----------------&lt;br /&gt;
&lt;br /&gt;
FC4 won’t find the drives&lt;br /&gt;
&lt;br /&gt;
Installing openmanage on CEOS4:&lt;br /&gt;
&lt;br /&gt;
Mount install cd from local drive&lt;br /&gt;
&lt;br /&gt;
mount /dev/scd0 /mnt&lt;br /&gt;
&lt;br /&gt;
cd /mnt/srvadmin/linux/RPMS/RHEL4&lt;br /&gt;
cd /mnt/srvadmin/linux/supportscripts/&lt;br /&gt;
./srvadmin-install.sh --express&lt;br /&gt;
&lt;br /&gt;
Copy linux to disk&lt;br /&gt;
Edit the script to make it think the os is RHEL4&lt;br /&gt;
&lt;br /&gt;
racadm serveraction hardreset&lt;br /&gt;
racadm serveraction powerdown&lt;br /&gt;
racadm serveraction powerup&lt;br /&gt;
racadm racreset&lt;br /&gt;
&lt;br /&gt;
BIOS settings:&lt;br /&gt;
Serial comm.: on with cons. Redir via com1&lt;br /&gt;
Failsafe: 115200&lt;br /&gt;
Redir after boot: enabled&lt;br /&gt;
&lt;br /&gt;
To boot to usb, switch hd sequence in bios. &lt;br /&gt;
After removing usb it will have to reorder boot seq to get virtual cd back&lt;br /&gt;
&lt;br /&gt;
Can’t get floppy/iso to boot- need to use thumb drive&lt;br /&gt;
&lt;br /&gt;
Latest f/w as of 2/16/09:&lt;br /&gt;
Bios: 2.5.0&lt;br /&gt;
Perc 6/i:  6.1.1-0047&lt;br /&gt;
Drac: 1.4&lt;br /&gt;
BMC: 2.37&lt;br /&gt;
&lt;br /&gt;
= RMM =&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1049</id>
		<title>Virtuozzo / Linux Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1049"/>
		<updated>2013-03-12T00:01:24Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Mount/edit USB drive on Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Updating VZ =&lt;br /&gt;
&lt;br /&gt;
 Update Virtuozzo to version 4.0.0&lt;br /&gt;
 Apply minor updates for Virtuozzo 3.0.0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
When you get to the last screen, you will be given an option to &lt;br /&gt;
&lt;br /&gt;
 ( ) Automatically reboot after update&lt;br /&gt;
 (*) Reboot later manually&lt;br /&gt;
&lt;br /&gt;
make sure you choose to reboot later.&lt;br /&gt;
&lt;br /&gt;
= Migrating Templates =&lt;br /&gt;
One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it&#039;s now called) based on a particular ditribution on a host which may or may not share the same distribution. For instance, you could run a CT running Ubuntu while the host machine (Hardware Node or HN) is running CentOS. This is accomplished via the use of OS templates. As long as the HN contains the OS template on which a particular CT relies, it will run there. As such, if you want to move a CT from one HN to another, you will need to make sure the OS template exists there.&lt;br /&gt;
&lt;br /&gt;
Modern versions of VZ (&amp;gt;= 4.x) will check for and automatically move the OS template over to the host as you&#039;re (vz)migrating the CT over to a new HN. However we like to make sure the template is in place prior to moving the CT. &lt;br /&gt;
&lt;br /&gt;
The first step is to see if the template exists on the host. To see OS templates installed:&lt;br /&gt;
&lt;br /&gt;
2.x (shows OS and application templates):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkgls&lt;br /&gt;
mod_ssl-rh9 20040624&lt;br /&gt;
mysql-rh9 20030814 20050412&lt;br /&gt;
openwebmail-rh9 20050427&lt;br /&gt;
php-rh9 20050506&lt;br /&gt;
phpBB-rh9 20041229&lt;br /&gt;
postgresql-rh9 20050719&lt;br /&gt;
sl-webalizer-rh9 20040119&lt;br /&gt;
spamassassin-rh9 20040127&lt;br /&gt;
tomcat-rh9 20040524&lt;br /&gt;
usermin-rh9 20040116&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;= 3.x (shows just OS templates, run without -O to see application as well):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkg list -O&lt;br /&gt;
ubuntu-10.04-x86                   2010-06-01 11:39:05&lt;br /&gt;
ubuntu-11.04-x86                   2011-06-22 14:23:59&lt;br /&gt;
ubuntu-9.10-x86                    2010-03-11 17:39:51&lt;br /&gt;
centos-5-x86                       2010-03-11 17:12:27&lt;br /&gt;
debian-5.0-x86                     2010-03-11 17:33:34&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All template files are located:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1&lt;br /&gt;
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2&lt;br /&gt;
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9&lt;br /&gt;
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1&lt;br /&gt;
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2&lt;br /&gt;
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9&lt;br /&gt;
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92&lt;br /&gt;
analog-fc2      mailman-fc2           php-rh9             suse-9.2&lt;br /&gt;
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1&lt;br /&gt;
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2&lt;br /&gt;
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9&lt;br /&gt;
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92&lt;br /&gt;
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1&lt;br /&gt;
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1&lt;br /&gt;
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2&lt;br /&gt;
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9&lt;br /&gt;
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1&lt;br /&gt;
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2&lt;br /&gt;
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9&lt;br /&gt;
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3&lt;br /&gt;
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0&lt;br /&gt;
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92&lt;br /&gt;
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1&lt;br /&gt;
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2&lt;br /&gt;
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9&lt;br /&gt;
jdk-suse92      mysql-rh9             redhat-as3-minimal&lt;br /&gt;
jre-deb31       mysql-suse92          redhat-devel-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here are the base OS templates: &amp;lt;tt&amp;gt;redhat-9, fedora-core-1&amp;lt;/tt&amp;gt; and supporting application templates: &amp;lt;tt&amp;gt;postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1&amp;lt;/tt&amp;gt;. So if you wanted to copy over all of redhat 9 you&#039;d need to copy the contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls -d /vz/template/*rh9*&lt;br /&gt;
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9&lt;br /&gt;
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9&lt;br /&gt;
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9&lt;br /&gt;
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9&lt;br /&gt;
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9&lt;br /&gt;
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9&lt;br /&gt;
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9&lt;br /&gt;
/vz/template/mailman-rh9     /vz/template/postgresql-rh9&lt;br /&gt;
&lt;br /&gt;
# ls -d /vz/template/*redhat-9*&lt;br /&gt;
/vz/template/redhat-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a template from one HN to another, it simply needs to be rsync&#039;d over to the target HN. It&#039;s rsync&#039;d over in this fashion:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template&lt;br /&gt;
 rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template&lt;br /&gt;
&lt;br /&gt;
Newer (&amp;gt;= 3.x) VZ employs &amp;quot;EZ&amp;quot; templates which are organized a little differently:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc&lt;br /&gt;
centos  conf         redhat-as3-minimal  ubuntu&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/ubuntu/&lt;br /&gt;
10.04  11.04  9.10&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/&lt;br /&gt;
x86&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/cache/&lt;br /&gt;
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz&lt;br /&gt;
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz&lt;br /&gt;
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we see is the entire OS and all applications are in 1 directory, and organized by distribution and release version. So to move Ubuntu 10.04:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
and you also need to move the cache:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/&lt;br /&gt;
&lt;br /&gt;
Once the transfer is complete, you will be able to run &amp;lt;tt&amp;gt;vzpkgls&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vzpkg list -O&amp;lt;/tt&amp;gt; and see the template(s) listed on the target HN.&lt;br /&gt;
&lt;br /&gt;
So far, this all supposes template doesn&#039;t exist on the target- very simple, just copy it over. If the template exists already on the target HN, this requires closer inspection. With older templates, simply moving over the templates would be the end of it- you see the version listed when you do a &amp;lt;tt&amp;gt;vzplgls&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysql-rh9 20030814 20050412&lt;br /&gt;
&lt;br /&gt;
this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412&lt;br /&gt;
As an aside, you can&#039;t copy over just 1 of them, but if you rsync&#039;d over the &amp;lt;tt&amp;gt;mysql-rh9&amp;lt;/tt&amp;gt; directory, you&#039;d see 20030814 and 20050412 on the target HN. As long as the versions match up, you&#039;re good to go.&lt;br /&gt;
&lt;br /&gt;
With EZ templates, the versions are not as easy to decipher. When you look at the &amp;lt;tt&amp;gt;vzpkg list&amp;lt;/tt&amp;gt; output, that simply tells you when a cache was created. A cache is simply a snapshot of all the data needed for the latest versions of the OS and it&#039;s applications at the time the cache was created. It is a date, and thus tells you nothing about the versions within. So for instance, if you had a cache for Ubuntu 10.04 from 2007 and you ran &amp;lt;tt&amp;gt;vzpkg create cache ubuntu-10.04-x86&amp;lt;/tt&amp;gt; it would re-download the latest version of apache, mysql and so on. And any &#039;&#039;subsequent&#039;&#039; ubuntu 10.04 CT&#039;s created thereafter would use those newer versions, whereas older CT&#039;s based on 10.04 would use older templates. You can see how this works by looking at the files under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this template has in it 6 different versions of apache2. This means that this template was merged with other 10.04 templates and/or it has been cached a few times, each time a new apache was available. The unfortunate thing is it&#039;s almost impossible to know which CT&#039;s are using which version of apache so it&#039;s hard to try to prune this down and remove unwanted/unneeded applications.&lt;br /&gt;
&lt;br /&gt;
So, if you see another HN has Ubuntu 10.04 on it, you need to see/confirm that it has all the exact files your CT needs. You can run a test rsync to see what &#039;&#039;would&#039;&#039; be transferred (what&#039;s missing):&lt;br /&gt;
&lt;br /&gt;
 rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
Based on the amount of data you get back from the rsync, you will be able to decide whether or not to remove the -n and allow the full transfer to go through. The downside to doing the transfer is the situation described above- you&#039;ve permanently joined these templates and now you may have 10 versions of apache on the target HN. There&#039;s one other potential pitfall to this kind of merging- it will also potentially copy over shared files, for which there is no particular version, most of which are in &amp;lt;tt&amp;gt;/vz/template/ubuntu/10.04/x86/config&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
 cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
 /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
&lt;br /&gt;
Here are some specific things to look out for. Case: copying centos-5 on virt19 to virt12. We dumped the rsync output to a file so we could inspect:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
(note, that can be dangerous, better to add on full path &amp;lt;tt&amp;gt;/vz/template/centos/5&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
So in the output file we see things like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
x86/base0/cachecookie&lt;br /&gt;
x86/base0/primary.xml.gz &lt;br /&gt;
x86/base0/primary.xml.gz.sqlite &lt;br /&gt;
x86/base0/repomd.xml &lt;br /&gt;
x86/base1/cachecookie &lt;br /&gt;
x86/base1/filelists.xml.gz &lt;br /&gt;
x86/base1/filelists.xml.gz.sqlite  &lt;br /&gt;
x86/base1/primary.xml.gz &lt;br /&gt;
x86/base1/primary.xml.gz.sqlite &lt;br /&gt;
x86/base1/repomd.xml&lt;br /&gt;
x86/base2/cachecookie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which make us nervous cause those are not versioned files, i.e.:&lt;br /&gt;
 5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock&lt;br /&gt;
&lt;br /&gt;
So those files will replace existing files on v12 rather than the case of the latter where it&#039;s likely being added. So caution should be given and deference to whichever version is newer (which rsync should take care of, but that will depend on the date each file was created and perhaps not the actual data within).&lt;br /&gt;
&lt;br /&gt;
If we look further in the file we see:&lt;br /&gt;
&lt;br /&gt;
 x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.&lt;br /&gt;
9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif&lt;br /&gt;
&lt;br /&gt;
and other files looking like:&lt;br /&gt;
 5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info&lt;br /&gt;
&lt;br /&gt;
Which means plesk is here. We don&#039;t need plesk on v12 (the CT moving over doesn&#039;t use it) so we rerun the rsync and exclude it:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh --exclude=&amp;quot;plesk*&amp;quot; --exclude=&amp;quot;psa*&amp;quot; /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
and now it&#039;s much smaller:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l&lt;br /&gt;
 97104&lt;br /&gt;
&lt;br /&gt;
Before running with excludes it was:&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l &lt;br /&gt;
 238238&lt;br /&gt;
&lt;br /&gt;
So again, look at what you&#039;re doing. Generally, combining templates is fine however.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re happy with the merge, run the rsync again without the &amp;quot;-n&amp;quot; to let it actually do the transfer.&lt;br /&gt;
&lt;br /&gt;
Once done, don&#039;t forget to add the new template to the HN in Management -&amp;gt; Reference -&amp;gt; Templates&lt;br /&gt;
&lt;br /&gt;
= getting help =&lt;br /&gt;
&lt;br /&gt;
= vzup2date =&lt;br /&gt;
TODO &lt;br /&gt;
= Adding new OS/application templates =&lt;br /&gt;
&lt;br /&gt;
Virtuozzo will lag a bit behind the initial release of an OS, perhaps by a month or more. Further, a newly-released OS may be available, but there may not be many/any application templates available initially. It pays to wait a bit.&lt;br /&gt;
&lt;br /&gt;
A template is easily installed via [[#vzup2date|vzup2date]]:&lt;br /&gt;
&lt;br /&gt;
 vzup2date -z&lt;br /&gt;
&lt;br /&gt;
You will be given a list of OS&#039;s to install. Select an OS, then customize that selection by checking/unchecking the application templates we do/don&#039;t want to include/offer.&lt;br /&gt;
&lt;br /&gt;
Generally, here are the app templates we include/offer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cyrus-imap&lt;br /&gt;
devel&lt;br /&gt;
imp&lt;br /&gt;
jre&lt;br /&gt;
jsdk&lt;br /&gt;
mailman&lt;br /&gt;
mod_perl&lt;br /&gt;
mod_ssl&lt;br /&gt;
mysql&lt;br /&gt;
php&lt;br /&gt;
phpmyadmin&lt;br /&gt;
phppgadmin&lt;br /&gt;
postgresql&lt;br /&gt;
proftpd&lt;br /&gt;
spamassassin&lt;br /&gt;
squirrelmail&lt;br /&gt;
tomcat&lt;br /&gt;
vsftpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do not (any longer) offer webalizer or analog.&lt;br /&gt;
&lt;br /&gt;
After selecting and installing the OS and apps, you should ensure it&#039;s installed:&lt;br /&gt;
&lt;br /&gt;
 vzpkg list -O&lt;br /&gt;
&lt;br /&gt;
Your new OS (ex. fedora-core-13-x86_64) will be listed, without a corresponding cache date:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@virt13 /vzconf]# vzpkg list -O&lt;br /&gt;
centos-6-x86                       2011-07-22 13:24:41&lt;br /&gt;
centos-6-x86_64                    2012-03-09 20:42:22&lt;br /&gt;
centos-5-x86                       2009-07-27 16:58:24&lt;br /&gt;
centos-5-x86_64                    2012-03-09 22:38:53&lt;br /&gt;
ubuntu-11.10-x86_64                2012-03-01 23:13:33&lt;br /&gt;
ubuntu-9.04-x86                    2009-06-02 11:32:39&lt;br /&gt;
ubuntu-12.04-x86_64                2012-05-29 13:50:50&lt;br /&gt;
ubuntu-8.04-x86                    2008-09-17 21:27:20&lt;br /&gt;
ubuntu-8.10-x86                    2009-03-13 13:58:57&lt;br /&gt;
ubuntu-11.04-x86                   2011-12-05 11:15:46&lt;br /&gt;
ubuntu-7.04-x86                    2008-09-24 16:42:50&lt;br /&gt;
redhat-el6-x86_64&lt;br /&gt;
fedora-core-13-x86_64              &lt;br /&gt;
fedora-core-12-x86                 2010-02-06 13:24:32&lt;br /&gt;
fedora-core-15-x86                 2011-12-05 11:36:43&lt;br /&gt;
fedora-core-11-x86                 2009-10-01 16:30:59&lt;br /&gt;
fedora-core-14-x86&lt;br /&gt;
fedora-core-16-x86_64              2012-03-13 11:40:23&lt;br /&gt;
fedora-core-9-x86                  2008-11-29 10:52:18&lt;br /&gt;
debian-6.0-x86                     2011-07-29 16:00:35&lt;br /&gt;
debian-6.0-x86_64                  2012-03-12 19:53:33&lt;br /&gt;
debian-5.0-x86                     2009-03-12 12:39:11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also confirm the apps installed:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt13 /vzconf]# vzpkg list fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64              2013-03-08 11:39:44&lt;br /&gt;
fedora-core-13-x86_64 devel&lt;br /&gt;
fedora-core-13-x86_64 php&lt;br /&gt;
fedora-core-13-x86_64 proftpd&lt;br /&gt;
fedora-core-13-x86_64 postgresql&lt;br /&gt;
fedora-core-13-x86_64 phpmyadmin&lt;br /&gt;
fedora-core-13-x86_64 mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before you can use the OS you must cache it. To create the cache run:&lt;br /&gt;
 vzpkg cache [OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;vzpkg cache fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s ready to use. In order to be able to use it with the [[VPS_Management#vm|vm]] command, you must create a file:&lt;br /&gt;
 jctmpl-[OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;jctmpl-fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In it, on line 1 we place the OS, followed by the app names, ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;more jctmpl-fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64&lt;br /&gt;
postgresql&lt;br /&gt;
jsdk&lt;br /&gt;
mod_ssl&lt;br /&gt;
phpmyadmin&lt;br /&gt;
mod_perl&lt;br /&gt;
tomcat&lt;br /&gt;
devel&lt;br /&gt;
php&lt;br /&gt;
mailman&lt;br /&gt;
cyrus-imap&lt;br /&gt;
squirrelmail&lt;br /&gt;
proftpd&lt;br /&gt;
mysql&lt;br /&gt;
phppgadmin&lt;br /&gt;
spamassassin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The packages will be installed in that order, so any pre-req&#039;s should be handled there.&lt;br /&gt;
&lt;br /&gt;
Now, when you run [[VPS_Management#vm|vm]] it will show you the newly-added OS and you may create a CT using it.&lt;br /&gt;
&lt;br /&gt;
The last few tasks are related to mgmt:&lt;br /&gt;
&lt;br /&gt;
1. add to mgmt-&amp;gt;reference-&amp;gt;templates (use the existing templates as an example). Once added, the new template will be included with the list of OS&#039;s available for the given HN.&lt;br /&gt;
2. if this is going to be a new OS offered for ordering, it needs to be added to the order form and webpage.&lt;br /&gt;
&lt;br /&gt;
a. to get a list of applications and versions in the new OS, you should create a test CT, enter it and run &amp;lt;tt&amp;gt;dpkg -l|sort&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;rpm -aq|sort&amp;lt;/tt&amp;gt; in centos/fedora) and enter that list in the following places:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/jc_pub/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Note, you will have to move the most recent OS data from &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt; into the corresponding &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname]_old.html&amp;lt;/tt&amp;gt; updating the version links in both.&lt;br /&gt;
&lt;br /&gt;
b. to add the new OS to the order form, you will need to update &amp;lt;tt&amp;gt;/usr/local/www/signup/html/step1.html&amp;lt;/tt&amp;gt; in several places (for regular and OSS orders) as well as updating the templateID which you can get from mgmt-&amp;gt;reference-&amp;gt;templates (or [[Management_System_/_Public_Website_/_Signup_/_Account_Manager#jc:ref_templates|jc:ref_templates]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Old method to obtain the templates:&lt;br /&gt;
&lt;br /&gt;
Go to http://www.parallels.com/en/virtuozzo/templates/catalog/&lt;br /&gt;
&lt;br /&gt;
Download the RPM&#039;s and install them&lt;br /&gt;
&lt;br /&gt;
 vzpkg list&lt;br /&gt;
to see the new packages/os templates&lt;br /&gt;
&lt;br /&gt;
 vzpkg create cache &amp;quot;OS_EZ_template_name&amp;quot;&lt;br /&gt;
to create a cache&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Update OS template =&lt;br /&gt;
&lt;br /&gt;
Installation and update of the new version of OS template will not affect the existing containers. It will affect only the new containers, created after this update operation. In terms of fixing &amp;quot;vzctl enter&amp;quot; error and SSH connectivity to Ubuntu based containers, it is necessary to recreate the template and not to update it, so the commands to run are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rpm -Uhv ubuntu-8.04-x86-ez-4.0.0-9.swsoft.noarch.rpm&lt;br /&gt;
vzpkg clean ubuntu-8.04-x86&lt;br /&gt;
vzpkg remove cache ubuntu-8.04-x86&lt;br /&gt;
vzpkg create cache ubuntu-8.04-x86&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installing new SSL cert on VZCP =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;openssl req -days 1999 -new -x509 -nodes -out server.crt -keyout server.key&lt;br /&gt;
&lt;br /&gt;
US&lt;br /&gt;
CA&lt;br /&gt;
San Diego&lt;br /&gt;
johncompanies.com&lt;br /&gt;
johncompanies.com&lt;br /&gt;
virt15ohncompanies.com&lt;br /&gt;
linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.crt/server.crt /etc/httpd/conf/ssl.crt/server.crt.bak&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.key/server.key /etc/httpd/conf/ssl.key/server.key.bak&lt;br /&gt;
cp server.crt /etc/httpd/conf/ssl.crt/server.crt&lt;br /&gt;
cp server.key /etc/httpd/conf/ssl.key/server.key&lt;br /&gt;
/etc/init.d/vzcp restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Moving virt (drives) to new hardware =&lt;br /&gt;
&lt;br /&gt;
If you have a case where a virt is dead (due to hardware failure), you can move the drives to a new hardware setup.&lt;br /&gt;
Here are the steps and things to look for:&lt;br /&gt;
&lt;br /&gt;
Move the drives to the new box. Most likely, the drives will be recognized and there will be no problems booting up. On Dell PERC 5/6 cards you will need to import the new &amp;quot;foreign&amp;quot; volume via the raid BIOS.&lt;br /&gt;
&lt;br /&gt;
If the hardware (motherboard) is different, it’s possible the nic’s won’t be recognized. Look at /etc/modules.conf the ethernet drivers are either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 tg3&lt;br /&gt;
alias eth1 tg3&amp;lt;/pre&amp;gt;&lt;br /&gt;
(supermicro)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 e100&lt;br /&gt;
alias eth1 e1000&amp;lt;/pre&amp;gt;&lt;br /&gt;
(intel)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 bnx2&lt;br /&gt;
alias eth1 bnx2&amp;lt;/pre&amp;gt;&lt;br /&gt;
(dell 29500)&lt;br /&gt;
&lt;br /&gt;
Also, you may see eth0 and eth1 swapped so if after confirming the eth devices are present (may require a reboot), then you may still need to swap the green/yellow network cables in the back to get them on the right port.&lt;br /&gt;
&lt;br /&gt;
VZ will not run (for long) on the new hardware, so you will need to get the license reissued. You may create/download a temporary license via their website for the interim.&lt;br /&gt;
&lt;br /&gt;
= Updating kernel on virt =&lt;br /&gt;
&lt;br /&gt;
We now use [[#vzup2date|vzup2date]] to update systems and kernels. What follows is what we used to do when we had to download kernels and install manually on old systems:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. install kernel and modules&lt;br /&gt;
&amp;lt;pre&amp;gt;# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \&lt;br /&gt;
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm&lt;br /&gt;
vzkernel-smp          ##################################################&lt;br /&gt;
vzmodules-smp       ##################################################&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT USE the &amp;quot;rpm -Uhv&amp;quot; command to install the kernel, otherwise all the previously installed kernels may be removed from your system. &lt;br /&gt;
&lt;br /&gt;
2. update lilo/grub&lt;br /&gt;
&lt;br /&gt;
Lilo:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lilo.conf&lt;br /&gt;
 &lt;br /&gt;
rename old Virtuozzo kernel label from &amp;quot;linux+virtuozzo&amp;quot; to &amp;quot;virtuozzo_old&amp;quot;&lt;br /&gt;
and add a new entry pointing to the newly installed virtuozzo kernel image.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;prompt&lt;br /&gt;
timeout=50&lt;br /&gt;
default=linux+virtuozzo&lt;br /&gt;
append=&amp;quot;debug panic=5 console=tty console=ttyS0,38400&amp;quot;&lt;br /&gt;
boot=/dev/sda&lt;br /&gt;
map=/boot/map&lt;br /&gt;
install=/boot/boot.b&lt;br /&gt;
message=/boot/message&lt;br /&gt;
linear&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3smp&lt;br /&gt;
        label=linux&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3smp.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3&lt;br /&gt;
        label=linux-up&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise&lt;br /&gt;
        label=2.4.20-9.5.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise&lt;br /&gt;
        label=2.4.20-9.8.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise&lt;br /&gt;
        label=2.4.20-9.21.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise&lt;br /&gt;
        label=2.4.20-9.24.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise&lt;br /&gt;
        label=2.4.20-28.3.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise&lt;br /&gt;
        label=old_linux+vz&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise&lt;br /&gt;
        label=linux+virtuozzo&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label &amp;quot;old_linux+vz &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Grub:&lt;br /&gt;
&lt;br /&gt;
 vi /boot/grub /menu.lst&lt;br /&gt;
&lt;br /&gt;
Add new entry at the top.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;serial --unit=0 --speed=38400&lt;br /&gt;
terminal --timeout=10 serial console&lt;br /&gt;
default=0&lt;br /&gt;
timeout=10&lt;br /&gt;
splashimage=(hd0,0)/boot/grub/splash.xpm.gz&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Red Hat Linux (2.4.18-3smp)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3smp.img&lt;br /&gt;
title Red Hat Linux-up (2.4.18-3)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3.img&lt;br /&gt;
title Linux with Virtuozzo 2.5&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1&lt;br /&gt;
title vz-enterpriseo&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1&lt;br /&gt;
title vz-enterprise&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. run the lilo (if using lilo)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lilo&lt;br /&gt;
Added linux&lt;br /&gt;
Added linux-up&lt;br /&gt;
Added virtuozzo_old&lt;br /&gt;
Added linux+virtuozzo *&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. reboot the server&lt;br /&gt;
 shutdown -r 23:05&lt;br /&gt;
&lt;br /&gt;
when it comes time for the shutdown, run [[VPS_Management#stopvirt|stopvirt]] to get things shut down faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Remaking service VE (&amp;lt;=3.x only) =&lt;br /&gt;
&lt;br /&gt;
Occasionally the control panel for VEs (aka VZPP) will stop working and you just need to reinstall the service VE (which runs the control panels for all VEs on the HN). Here&#039;s how that&#039;s done :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop 1&lt;br /&gt;
ipdel 1 69.55.234.152&lt;br /&gt;
vzmlocal 1:2&lt;br /&gt;
vzctl set 2 --save --onboot no&lt;br /&gt;
vzsveinstall -t redhat-as3-minimal -d /root/Rel261/HW/RPMS -s 69.55.234.152 --skip-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzsveinstall -t redhat-as3-minimal -d /vz/Rel300/HW/RPMS -s 69.55.229.151 --skip-client&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzctl mount 1&lt;br /&gt;
vzctl mount 2&lt;br /&gt;
/bin/cp -aRf /vz/root/2/home/vzagent0 /vz/root/1/home&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/lib/mysql/VZADB /vz/root/1/var/lib/mysql&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/shadow /vz/root/1/etc/&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/vzcp/static/vz/skins/ /vz/root/1/var/vzcp/static/vz&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/menu.xml  /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/dashboard.xml /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
&lt;br /&gt;
vzctl umount 2&lt;br /&gt;
vzctl umount 1&lt;br /&gt;
vzctl start 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= GRUB: boot once to a new kernel =&lt;br /&gt;
&lt;br /&gt;
To use a different kernel for the next reboot only:&lt;br /&gt;
  &amp;lt;pre&amp;gt;grub --no-floppy&lt;br /&gt;
  savedefault --default=N --once&lt;br /&gt;
  (where N is the number of the kernel you want to boot once)&lt;br /&gt;
  quit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot your machine. It will boot using kernel &amp;quot;N&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 grub-reboot N&lt;br /&gt;
will do essentially the same thing and prompt to reboot the machine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Recovering from GRUB failure =&lt;br /&gt;
&lt;br /&gt;
(example from DPE 2950)&lt;br /&gt;
&lt;br /&gt;
Boot to CEOS4 server CD (original install cd). Did this example with iso mounted via drac&lt;br /&gt;
&lt;br /&gt;
 Boot: linux rescue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Make/edit an ISO on Linux =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mount file.iso /mnt/iso/ -t iso9660 -o ro,loop=/dev/loop0&lt;br /&gt;
mkdir /tmp/iso&lt;br /&gt;
cp -aR /mnt/iso/* /tmp/iso/&lt;br /&gt;
umount /mnt/iso/&lt;br /&gt;
mkisofs -iso-level 2 -o /tmp/new.iso /tmp/iso/&lt;br /&gt;
rm -fr /tmp/iso&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To mount it:&lt;br /&gt;
&lt;br /&gt;
 mount -t vfat -o loop /tmp/3wfirmware.iso /mnt/usb/&lt;br /&gt;
&lt;br /&gt;
http://www.damnsmalllinux.org/wiki/index.php/Installing_to_a_USB_Flash_Drive&lt;br /&gt;
&lt;br /&gt;
= Mount/edit USB drive on Linux =&lt;br /&gt;
&lt;br /&gt;
 mount -t vfat -o loop  /dev/sdc1 /mnt/usb/&lt;br /&gt;
&lt;br /&gt;
This example is for our floating usb drive on virt16. You should edit the device as necessary on other hardware.&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1048</id>
		<title>Virtuozzo / Linux Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1048"/>
		<updated>2013-03-12T00:00:35Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Mount/edit USB drive on Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Updating VZ =&lt;br /&gt;
&lt;br /&gt;
 Update Virtuozzo to version 4.0.0&lt;br /&gt;
 Apply minor updates for Virtuozzo 3.0.0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
When you get to the last screen, you will be given an option to &lt;br /&gt;
&lt;br /&gt;
 ( ) Automatically reboot after update&lt;br /&gt;
 (*) Reboot later manually&lt;br /&gt;
&lt;br /&gt;
make sure you choose to reboot later.&lt;br /&gt;
&lt;br /&gt;
= Migrating Templates =&lt;br /&gt;
One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it&#039;s now called) based on a particular ditribution on a host which may or may not share the same distribution. For instance, you could run a CT running Ubuntu while the host machine (Hardware Node or HN) is running CentOS. This is accomplished via the use of OS templates. As long as the HN contains the OS template on which a particular CT relies, it will run there. As such, if you want to move a CT from one HN to another, you will need to make sure the OS template exists there.&lt;br /&gt;
&lt;br /&gt;
Modern versions of VZ (&amp;gt;= 4.x) will check for and automatically move the OS template over to the host as you&#039;re (vz)migrating the CT over to a new HN. However we like to make sure the template is in place prior to moving the CT. &lt;br /&gt;
&lt;br /&gt;
The first step is to see if the template exists on the host. To see OS templates installed:&lt;br /&gt;
&lt;br /&gt;
2.x (shows OS and application templates):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkgls&lt;br /&gt;
mod_ssl-rh9 20040624&lt;br /&gt;
mysql-rh9 20030814 20050412&lt;br /&gt;
openwebmail-rh9 20050427&lt;br /&gt;
php-rh9 20050506&lt;br /&gt;
phpBB-rh9 20041229&lt;br /&gt;
postgresql-rh9 20050719&lt;br /&gt;
sl-webalizer-rh9 20040119&lt;br /&gt;
spamassassin-rh9 20040127&lt;br /&gt;
tomcat-rh9 20040524&lt;br /&gt;
usermin-rh9 20040116&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;= 3.x (shows just OS templates, run without -O to see application as well):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkg list -O&lt;br /&gt;
ubuntu-10.04-x86                   2010-06-01 11:39:05&lt;br /&gt;
ubuntu-11.04-x86                   2011-06-22 14:23:59&lt;br /&gt;
ubuntu-9.10-x86                    2010-03-11 17:39:51&lt;br /&gt;
centos-5-x86                       2010-03-11 17:12:27&lt;br /&gt;
debian-5.0-x86                     2010-03-11 17:33:34&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All template files are located:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1&lt;br /&gt;
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2&lt;br /&gt;
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9&lt;br /&gt;
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1&lt;br /&gt;
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2&lt;br /&gt;
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9&lt;br /&gt;
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92&lt;br /&gt;
analog-fc2      mailman-fc2           php-rh9             suse-9.2&lt;br /&gt;
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1&lt;br /&gt;
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2&lt;br /&gt;
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9&lt;br /&gt;
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92&lt;br /&gt;
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1&lt;br /&gt;
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1&lt;br /&gt;
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2&lt;br /&gt;
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9&lt;br /&gt;
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1&lt;br /&gt;
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2&lt;br /&gt;
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9&lt;br /&gt;
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3&lt;br /&gt;
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0&lt;br /&gt;
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92&lt;br /&gt;
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1&lt;br /&gt;
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2&lt;br /&gt;
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9&lt;br /&gt;
jdk-suse92      mysql-rh9             redhat-as3-minimal&lt;br /&gt;
jre-deb31       mysql-suse92          redhat-devel-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here are the base OS templates: &amp;lt;tt&amp;gt;redhat-9, fedora-core-1&amp;lt;/tt&amp;gt; and supporting application templates: &amp;lt;tt&amp;gt;postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1&amp;lt;/tt&amp;gt;. So if you wanted to copy over all of redhat 9 you&#039;d need to copy the contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls -d /vz/template/*rh9*&lt;br /&gt;
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9&lt;br /&gt;
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9&lt;br /&gt;
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9&lt;br /&gt;
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9&lt;br /&gt;
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9&lt;br /&gt;
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9&lt;br /&gt;
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9&lt;br /&gt;
/vz/template/mailman-rh9     /vz/template/postgresql-rh9&lt;br /&gt;
&lt;br /&gt;
# ls -d /vz/template/*redhat-9*&lt;br /&gt;
/vz/template/redhat-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a template from one HN to another, it simply needs to be rsync&#039;d over to the target HN. It&#039;s rsync&#039;d over in this fashion:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template&lt;br /&gt;
 rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template&lt;br /&gt;
&lt;br /&gt;
Newer (&amp;gt;= 3.x) VZ employs &amp;quot;EZ&amp;quot; templates which are organized a little differently:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc&lt;br /&gt;
centos  conf         redhat-as3-minimal  ubuntu&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/ubuntu/&lt;br /&gt;
10.04  11.04  9.10&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/&lt;br /&gt;
x86&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/cache/&lt;br /&gt;
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz&lt;br /&gt;
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz&lt;br /&gt;
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we see is the entire OS and all applications are in 1 directory, and organized by distribution and release version. So to move Ubuntu 10.04:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
and you also need to move the cache:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/&lt;br /&gt;
&lt;br /&gt;
Once the transfer is complete, you will be able to run &amp;lt;tt&amp;gt;vzpkgls&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vzpkg list -O&amp;lt;/tt&amp;gt; and see the template(s) listed on the target HN.&lt;br /&gt;
&lt;br /&gt;
So far, this all supposes template doesn&#039;t exist on the target- very simple, just copy it over. If the template exists already on the target HN, this requires closer inspection. With older templates, simply moving over the templates would be the end of it- you see the version listed when you do a &amp;lt;tt&amp;gt;vzplgls&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysql-rh9 20030814 20050412&lt;br /&gt;
&lt;br /&gt;
this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412&lt;br /&gt;
As an aside, you can&#039;t copy over just 1 of them, but if you rsync&#039;d over the &amp;lt;tt&amp;gt;mysql-rh9&amp;lt;/tt&amp;gt; directory, you&#039;d see 20030814 and 20050412 on the target HN. As long as the versions match up, you&#039;re good to go.&lt;br /&gt;
&lt;br /&gt;
With EZ templates, the versions are not as easy to decipher. When you look at the &amp;lt;tt&amp;gt;vzpkg list&amp;lt;/tt&amp;gt; output, that simply tells you when a cache was created. A cache is simply a snapshot of all the data needed for the latest versions of the OS and it&#039;s applications at the time the cache was created. It is a date, and thus tells you nothing about the versions within. So for instance, if you had a cache for Ubuntu 10.04 from 2007 and you ran &amp;lt;tt&amp;gt;vzpkg create cache ubuntu-10.04-x86&amp;lt;/tt&amp;gt; it would re-download the latest version of apache, mysql and so on. And any &#039;&#039;subsequent&#039;&#039; ubuntu 10.04 CT&#039;s created thereafter would use those newer versions, whereas older CT&#039;s based on 10.04 would use older templates. You can see how this works by looking at the files under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this template has in it 6 different versions of apache2. This means that this template was merged with other 10.04 templates and/or it has been cached a few times, each time a new apache was available. The unfortunate thing is it&#039;s almost impossible to know which CT&#039;s are using which version of apache so it&#039;s hard to try to prune this down and remove unwanted/unneeded applications.&lt;br /&gt;
&lt;br /&gt;
So, if you see another HN has Ubuntu 10.04 on it, you need to see/confirm that it has all the exact files your CT needs. You can run a test rsync to see what &#039;&#039;would&#039;&#039; be transferred (what&#039;s missing):&lt;br /&gt;
&lt;br /&gt;
 rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
Based on the amount of data you get back from the rsync, you will be able to decide whether or not to remove the -n and allow the full transfer to go through. The downside to doing the transfer is the situation described above- you&#039;ve permanently joined these templates and now you may have 10 versions of apache on the target HN. There&#039;s one other potential pitfall to this kind of merging- it will also potentially copy over shared files, for which there is no particular version, most of which are in &amp;lt;tt&amp;gt;/vz/template/ubuntu/10.04/x86/config&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
 cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
 /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
&lt;br /&gt;
Here are some specific things to look out for. Case: copying centos-5 on virt19 to virt12. We dumped the rsync output to a file so we could inspect:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
(note, that can be dangerous, better to add on full path &amp;lt;tt&amp;gt;/vz/template/centos/5&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
So in the output file we see things like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
x86/base0/cachecookie&lt;br /&gt;
x86/base0/primary.xml.gz &lt;br /&gt;
x86/base0/primary.xml.gz.sqlite &lt;br /&gt;
x86/base0/repomd.xml &lt;br /&gt;
x86/base1/cachecookie &lt;br /&gt;
x86/base1/filelists.xml.gz &lt;br /&gt;
x86/base1/filelists.xml.gz.sqlite  &lt;br /&gt;
x86/base1/primary.xml.gz &lt;br /&gt;
x86/base1/primary.xml.gz.sqlite &lt;br /&gt;
x86/base1/repomd.xml&lt;br /&gt;
x86/base2/cachecookie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which make us nervous cause those are not versioned files, i.e.:&lt;br /&gt;
 5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock&lt;br /&gt;
&lt;br /&gt;
So those files will replace existing files on v12 rather than the case of the latter where it&#039;s likely being added. So caution should be given and deference to whichever version is newer (which rsync should take care of, but that will depend on the date each file was created and perhaps not the actual data within).&lt;br /&gt;
&lt;br /&gt;
If we look further in the file we see:&lt;br /&gt;
&lt;br /&gt;
 x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.&lt;br /&gt;
9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif&lt;br /&gt;
&lt;br /&gt;
and other files looking like:&lt;br /&gt;
 5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info&lt;br /&gt;
&lt;br /&gt;
Which means plesk is here. We don&#039;t need plesk on v12 (the CT moving over doesn&#039;t use it) so we rerun the rsync and exclude it:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh --exclude=&amp;quot;plesk*&amp;quot; --exclude=&amp;quot;psa*&amp;quot; /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
and now it&#039;s much smaller:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l&lt;br /&gt;
 97104&lt;br /&gt;
&lt;br /&gt;
Before running with excludes it was:&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l &lt;br /&gt;
 238238&lt;br /&gt;
&lt;br /&gt;
So again, look at what you&#039;re doing. Generally, combining templates is fine however.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re happy with the merge, run the rsync again without the &amp;quot;-n&amp;quot; to let it actually do the transfer.&lt;br /&gt;
&lt;br /&gt;
Once done, don&#039;t forget to add the new template to the HN in Management -&amp;gt; Reference -&amp;gt; Templates&lt;br /&gt;
&lt;br /&gt;
= getting help =&lt;br /&gt;
&lt;br /&gt;
= vzup2date =&lt;br /&gt;
TODO &lt;br /&gt;
= Adding new OS/application templates =&lt;br /&gt;
&lt;br /&gt;
Virtuozzo will lag a bit behind the initial release of an OS, perhaps by a month or more. Further, a newly-released OS may be available, but there may not be many/any application templates available initially. It pays to wait a bit.&lt;br /&gt;
&lt;br /&gt;
A template is easily installed via [[#vzup2date|vzup2date]]:&lt;br /&gt;
&lt;br /&gt;
 vzup2date -z&lt;br /&gt;
&lt;br /&gt;
You will be given a list of OS&#039;s to install. Select an OS, then customize that selection by checking/unchecking the application templates we do/don&#039;t want to include/offer.&lt;br /&gt;
&lt;br /&gt;
Generally, here are the app templates we include/offer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cyrus-imap&lt;br /&gt;
devel&lt;br /&gt;
imp&lt;br /&gt;
jre&lt;br /&gt;
jsdk&lt;br /&gt;
mailman&lt;br /&gt;
mod_perl&lt;br /&gt;
mod_ssl&lt;br /&gt;
mysql&lt;br /&gt;
php&lt;br /&gt;
phpmyadmin&lt;br /&gt;
phppgadmin&lt;br /&gt;
postgresql&lt;br /&gt;
proftpd&lt;br /&gt;
spamassassin&lt;br /&gt;
squirrelmail&lt;br /&gt;
tomcat&lt;br /&gt;
vsftpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do not (any longer) offer webalizer or analog.&lt;br /&gt;
&lt;br /&gt;
After selecting and installing the OS and apps, you should ensure it&#039;s installed:&lt;br /&gt;
&lt;br /&gt;
 vzpkg list -O&lt;br /&gt;
&lt;br /&gt;
Your new OS (ex. fedora-core-13-x86_64) will be listed, without a corresponding cache date:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@virt13 /vzconf]# vzpkg list -O&lt;br /&gt;
centos-6-x86                       2011-07-22 13:24:41&lt;br /&gt;
centos-6-x86_64                    2012-03-09 20:42:22&lt;br /&gt;
centos-5-x86                       2009-07-27 16:58:24&lt;br /&gt;
centos-5-x86_64                    2012-03-09 22:38:53&lt;br /&gt;
ubuntu-11.10-x86_64                2012-03-01 23:13:33&lt;br /&gt;
ubuntu-9.04-x86                    2009-06-02 11:32:39&lt;br /&gt;
ubuntu-12.04-x86_64                2012-05-29 13:50:50&lt;br /&gt;
ubuntu-8.04-x86                    2008-09-17 21:27:20&lt;br /&gt;
ubuntu-8.10-x86                    2009-03-13 13:58:57&lt;br /&gt;
ubuntu-11.04-x86                   2011-12-05 11:15:46&lt;br /&gt;
ubuntu-7.04-x86                    2008-09-24 16:42:50&lt;br /&gt;
redhat-el6-x86_64&lt;br /&gt;
fedora-core-13-x86_64              &lt;br /&gt;
fedora-core-12-x86                 2010-02-06 13:24:32&lt;br /&gt;
fedora-core-15-x86                 2011-12-05 11:36:43&lt;br /&gt;
fedora-core-11-x86                 2009-10-01 16:30:59&lt;br /&gt;
fedora-core-14-x86&lt;br /&gt;
fedora-core-16-x86_64              2012-03-13 11:40:23&lt;br /&gt;
fedora-core-9-x86                  2008-11-29 10:52:18&lt;br /&gt;
debian-6.0-x86                     2011-07-29 16:00:35&lt;br /&gt;
debian-6.0-x86_64                  2012-03-12 19:53:33&lt;br /&gt;
debian-5.0-x86                     2009-03-12 12:39:11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also confirm the apps installed:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt13 /vzconf]# vzpkg list fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64              2013-03-08 11:39:44&lt;br /&gt;
fedora-core-13-x86_64 devel&lt;br /&gt;
fedora-core-13-x86_64 php&lt;br /&gt;
fedora-core-13-x86_64 proftpd&lt;br /&gt;
fedora-core-13-x86_64 postgresql&lt;br /&gt;
fedora-core-13-x86_64 phpmyadmin&lt;br /&gt;
fedora-core-13-x86_64 mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before you can use the OS you must cache it. To create the cache run:&lt;br /&gt;
 vzpkg cache [OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;vzpkg cache fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s ready to use. In order to be able to use it with the [[VPS_Management#vm|vm]] command, you must create a file:&lt;br /&gt;
 jctmpl-[OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;jctmpl-fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In it, on line 1 we place the OS, followed by the app names, ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;more jctmpl-fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64&lt;br /&gt;
postgresql&lt;br /&gt;
jsdk&lt;br /&gt;
mod_ssl&lt;br /&gt;
phpmyadmin&lt;br /&gt;
mod_perl&lt;br /&gt;
tomcat&lt;br /&gt;
devel&lt;br /&gt;
php&lt;br /&gt;
mailman&lt;br /&gt;
cyrus-imap&lt;br /&gt;
squirrelmail&lt;br /&gt;
proftpd&lt;br /&gt;
mysql&lt;br /&gt;
phppgadmin&lt;br /&gt;
spamassassin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The packages will be installed in that order, so any pre-req&#039;s should be handled there.&lt;br /&gt;
&lt;br /&gt;
Now, when you run [[VPS_Management#vm|vm]] it will show you the newly-added OS and you may create a CT using it.&lt;br /&gt;
&lt;br /&gt;
The last few tasks are related to mgmt:&lt;br /&gt;
&lt;br /&gt;
1. add to mgmt-&amp;gt;reference-&amp;gt;templates (use the existing templates as an example). Once added, the new template will be included with the list of OS&#039;s available for the given HN.&lt;br /&gt;
2. if this is going to be a new OS offered for ordering, it needs to be added to the order form and webpage.&lt;br /&gt;
&lt;br /&gt;
a. to get a list of applications and versions in the new OS, you should create a test CT, enter it and run &amp;lt;tt&amp;gt;dpkg -l|sort&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;rpm -aq|sort&amp;lt;/tt&amp;gt; in centos/fedora) and enter that list in the following places:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/jc_pub/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Note, you will have to move the most recent OS data from &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt; into the corresponding &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname]_old.html&amp;lt;/tt&amp;gt; updating the version links in both.&lt;br /&gt;
&lt;br /&gt;
b. to add the new OS to the order form, you will need to update &amp;lt;tt&amp;gt;/usr/local/www/signup/html/step1.html&amp;lt;/tt&amp;gt; in several places (for regular and OSS orders) as well as updating the templateID which you can get from mgmt-&amp;gt;reference-&amp;gt;templates (or [[Management_System_/_Public_Website_/_Signup_/_Account_Manager#jc:ref_templates|jc:ref_templates]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Old method to obtain the templates:&lt;br /&gt;
&lt;br /&gt;
Go to http://www.parallels.com/en/virtuozzo/templates/catalog/&lt;br /&gt;
&lt;br /&gt;
Download the RPM&#039;s and install them&lt;br /&gt;
&lt;br /&gt;
 vzpkg list&lt;br /&gt;
to see the new packages/os templates&lt;br /&gt;
&lt;br /&gt;
 vzpkg create cache &amp;quot;OS_EZ_template_name&amp;quot;&lt;br /&gt;
to create a cache&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Update OS template =&lt;br /&gt;
&lt;br /&gt;
Installation and update of the new version of OS template will not affect the existing containers. It will affect only the new containers, created after this update operation. In terms of fixing &amp;quot;vzctl enter&amp;quot; error and SSH connectivity to Ubuntu based containers, it is necessary to recreate the template and not to update it, so the commands to run are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rpm -Uhv ubuntu-8.04-x86-ez-4.0.0-9.swsoft.noarch.rpm&lt;br /&gt;
vzpkg clean ubuntu-8.04-x86&lt;br /&gt;
vzpkg remove cache ubuntu-8.04-x86&lt;br /&gt;
vzpkg create cache ubuntu-8.04-x86&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installing new SSL cert on VZCP =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;openssl req -days 1999 -new -x509 -nodes -out server.crt -keyout server.key&lt;br /&gt;
&lt;br /&gt;
US&lt;br /&gt;
CA&lt;br /&gt;
San Diego&lt;br /&gt;
johncompanies.com&lt;br /&gt;
johncompanies.com&lt;br /&gt;
virt15ohncompanies.com&lt;br /&gt;
linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.crt/server.crt /etc/httpd/conf/ssl.crt/server.crt.bak&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.key/server.key /etc/httpd/conf/ssl.key/server.key.bak&lt;br /&gt;
cp server.crt /etc/httpd/conf/ssl.crt/server.crt&lt;br /&gt;
cp server.key /etc/httpd/conf/ssl.key/server.key&lt;br /&gt;
/etc/init.d/vzcp restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Moving virt (drives) to new hardware =&lt;br /&gt;
&lt;br /&gt;
If you have a case where a virt is dead (due to hardware failure), you can move the drives to a new hardware setup.&lt;br /&gt;
Here are the steps and things to look for:&lt;br /&gt;
&lt;br /&gt;
Move the drives to the new box. Most likely, the drives will be recognized and there will be no problems booting up. On Dell PERC 5/6 cards you will need to import the new &amp;quot;foreign&amp;quot; volume via the raid BIOS.&lt;br /&gt;
&lt;br /&gt;
If the hardware (motherboard) is different, it’s possible the nic’s won’t be recognized. Look at /etc/modules.conf the ethernet drivers are either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 tg3&lt;br /&gt;
alias eth1 tg3&amp;lt;/pre&amp;gt;&lt;br /&gt;
(supermicro)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 e100&lt;br /&gt;
alias eth1 e1000&amp;lt;/pre&amp;gt;&lt;br /&gt;
(intel)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 bnx2&lt;br /&gt;
alias eth1 bnx2&amp;lt;/pre&amp;gt;&lt;br /&gt;
(dell 29500)&lt;br /&gt;
&lt;br /&gt;
Also, you may see eth0 and eth1 swapped so if after confirming the eth devices are present (may require a reboot), then you may still need to swap the green/yellow network cables in the back to get them on the right port.&lt;br /&gt;
&lt;br /&gt;
VZ will not run (for long) on the new hardware, so you will need to get the license reissued. You may create/download a temporary license via their website for the interim.&lt;br /&gt;
&lt;br /&gt;
= Updating kernel on virt =&lt;br /&gt;
&lt;br /&gt;
We now use [[#vzup2date|vzup2date]] to update systems and kernels. What follows is what we used to do when we had to download kernels and install manually on old systems:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. install kernel and modules&lt;br /&gt;
&amp;lt;pre&amp;gt;# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \&lt;br /&gt;
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm&lt;br /&gt;
vzkernel-smp          ##################################################&lt;br /&gt;
vzmodules-smp       ##################################################&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT USE the &amp;quot;rpm -Uhv&amp;quot; command to install the kernel, otherwise all the previously installed kernels may be removed from your system. &lt;br /&gt;
&lt;br /&gt;
2. update lilo/grub&lt;br /&gt;
&lt;br /&gt;
Lilo:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lilo.conf&lt;br /&gt;
 &lt;br /&gt;
rename old Virtuozzo kernel label from &amp;quot;linux+virtuozzo&amp;quot; to &amp;quot;virtuozzo_old&amp;quot;&lt;br /&gt;
and add a new entry pointing to the newly installed virtuozzo kernel image.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;prompt&lt;br /&gt;
timeout=50&lt;br /&gt;
default=linux+virtuozzo&lt;br /&gt;
append=&amp;quot;debug panic=5 console=tty console=ttyS0,38400&amp;quot;&lt;br /&gt;
boot=/dev/sda&lt;br /&gt;
map=/boot/map&lt;br /&gt;
install=/boot/boot.b&lt;br /&gt;
message=/boot/message&lt;br /&gt;
linear&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3smp&lt;br /&gt;
        label=linux&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3smp.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3&lt;br /&gt;
        label=linux-up&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise&lt;br /&gt;
        label=2.4.20-9.5.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise&lt;br /&gt;
        label=2.4.20-9.8.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise&lt;br /&gt;
        label=2.4.20-9.21.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise&lt;br /&gt;
        label=2.4.20-9.24.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise&lt;br /&gt;
        label=2.4.20-28.3.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise&lt;br /&gt;
        label=old_linux+vz&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise&lt;br /&gt;
        label=linux+virtuozzo&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label &amp;quot;old_linux+vz &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Grub:&lt;br /&gt;
&lt;br /&gt;
 vi /boot/grub /menu.lst&lt;br /&gt;
&lt;br /&gt;
Add new entry at the top.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;serial --unit=0 --speed=38400&lt;br /&gt;
terminal --timeout=10 serial console&lt;br /&gt;
default=0&lt;br /&gt;
timeout=10&lt;br /&gt;
splashimage=(hd0,0)/boot/grub/splash.xpm.gz&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Red Hat Linux (2.4.18-3smp)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3smp.img&lt;br /&gt;
title Red Hat Linux-up (2.4.18-3)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3.img&lt;br /&gt;
title Linux with Virtuozzo 2.5&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1&lt;br /&gt;
title vz-enterpriseo&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1&lt;br /&gt;
title vz-enterprise&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. run the lilo (if using lilo)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lilo&lt;br /&gt;
Added linux&lt;br /&gt;
Added linux-up&lt;br /&gt;
Added virtuozzo_old&lt;br /&gt;
Added linux+virtuozzo *&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. reboot the server&lt;br /&gt;
 shutdown -r 23:05&lt;br /&gt;
&lt;br /&gt;
when it comes time for the shutdown, run [[VPS_Management#stopvirt|stopvirt]] to get things shut down faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Remaking service VE (&amp;lt;=3.x only) =&lt;br /&gt;
&lt;br /&gt;
Occasionally the control panel for VEs (aka VZPP) will stop working and you just need to reinstall the service VE (which runs the control panels for all VEs on the HN). Here&#039;s how that&#039;s done :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop 1&lt;br /&gt;
ipdel 1 69.55.234.152&lt;br /&gt;
vzmlocal 1:2&lt;br /&gt;
vzctl set 2 --save --onboot no&lt;br /&gt;
vzsveinstall -t redhat-as3-minimal -d /root/Rel261/HW/RPMS -s 69.55.234.152 --skip-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzsveinstall -t redhat-as3-minimal -d /vz/Rel300/HW/RPMS -s 69.55.229.151 --skip-client&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzctl mount 1&lt;br /&gt;
vzctl mount 2&lt;br /&gt;
/bin/cp -aRf /vz/root/2/home/vzagent0 /vz/root/1/home&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/lib/mysql/VZADB /vz/root/1/var/lib/mysql&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/shadow /vz/root/1/etc/&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/vzcp/static/vz/skins/ /vz/root/1/var/vzcp/static/vz&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/menu.xml  /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/dashboard.xml /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
&lt;br /&gt;
vzctl umount 2&lt;br /&gt;
vzctl umount 1&lt;br /&gt;
vzctl start 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= GRUB: boot once to a new kernel =&lt;br /&gt;
&lt;br /&gt;
To use a different kernel for the next reboot only:&lt;br /&gt;
  &amp;lt;pre&amp;gt;grub --no-floppy&lt;br /&gt;
  savedefault --default=N --once&lt;br /&gt;
  (where N is the number of the kernel you want to boot once)&lt;br /&gt;
  quit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot your machine. It will boot using kernel &amp;quot;N&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 grub-reboot N&lt;br /&gt;
will do essentially the same thing and prompt to reboot the machine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Recovering from GRUB failure =&lt;br /&gt;
&lt;br /&gt;
(example from DPE 2950)&lt;br /&gt;
&lt;br /&gt;
Boot to CEOS4 server CD (original install cd). Did this example with iso mounted via drac&lt;br /&gt;
&lt;br /&gt;
 Boot: linux rescue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Make/edit an ISO on Linux =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mount file.iso /mnt/iso/ -t iso9660 -o ro,loop=/dev/loop0&lt;br /&gt;
mkdir /tmp/iso&lt;br /&gt;
cp -aR /mnt/iso/* /tmp/iso/&lt;br /&gt;
umount /mnt/iso/&lt;br /&gt;
mkisofs -iso-level 2 -o /tmp/new.iso /tmp/iso/&lt;br /&gt;
rm -fr /tmp/iso&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To mount it:&lt;br /&gt;
&lt;br /&gt;
 mount -t vfat -o loop /tmp/3wfirmware.iso /mnt/usb/&lt;br /&gt;
&lt;br /&gt;
http://www.damnsmalllinux.org/wiki/index.php/Installing_to_a_USB_Flash_Drive&lt;br /&gt;
&lt;br /&gt;
= Mount/edit USB drive on Linux =&lt;br /&gt;
&lt;br /&gt;
 mount -t vfat -o loop  /dev/sdc1 /mnt/usb/&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1047</id>
		<title>Virtuozzo / Linux Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1047"/>
		<updated>2013-03-11T23:59:28Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Make/edit an ISO on Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Updating VZ =&lt;br /&gt;
&lt;br /&gt;
 Update Virtuozzo to version 4.0.0&lt;br /&gt;
 Apply minor updates for Virtuozzo 3.0.0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
When you get to the last screen, you will be given an option to &lt;br /&gt;
&lt;br /&gt;
 ( ) Automatically reboot after update&lt;br /&gt;
 (*) Reboot later manually&lt;br /&gt;
&lt;br /&gt;
make sure you choose to reboot later.&lt;br /&gt;
&lt;br /&gt;
= Migrating Templates =&lt;br /&gt;
One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it&#039;s now called) based on a particular ditribution on a host which may or may not share the same distribution. For instance, you could run a CT running Ubuntu while the host machine (Hardware Node or HN) is running CentOS. This is accomplished via the use of OS templates. As long as the HN contains the OS template on which a particular CT relies, it will run there. As such, if you want to move a CT from one HN to another, you will need to make sure the OS template exists there.&lt;br /&gt;
&lt;br /&gt;
Modern versions of VZ (&amp;gt;= 4.x) will check for and automatically move the OS template over to the host as you&#039;re (vz)migrating the CT over to a new HN. However we like to make sure the template is in place prior to moving the CT. &lt;br /&gt;
&lt;br /&gt;
The first step is to see if the template exists on the host. To see OS templates installed:&lt;br /&gt;
&lt;br /&gt;
2.x (shows OS and application templates):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkgls&lt;br /&gt;
mod_ssl-rh9 20040624&lt;br /&gt;
mysql-rh9 20030814 20050412&lt;br /&gt;
openwebmail-rh9 20050427&lt;br /&gt;
php-rh9 20050506&lt;br /&gt;
phpBB-rh9 20041229&lt;br /&gt;
postgresql-rh9 20050719&lt;br /&gt;
sl-webalizer-rh9 20040119&lt;br /&gt;
spamassassin-rh9 20040127&lt;br /&gt;
tomcat-rh9 20040524&lt;br /&gt;
usermin-rh9 20040116&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;= 3.x (shows just OS templates, run without -O to see application as well):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkg list -O&lt;br /&gt;
ubuntu-10.04-x86                   2010-06-01 11:39:05&lt;br /&gt;
ubuntu-11.04-x86                   2011-06-22 14:23:59&lt;br /&gt;
ubuntu-9.10-x86                    2010-03-11 17:39:51&lt;br /&gt;
centos-5-x86                       2010-03-11 17:12:27&lt;br /&gt;
debian-5.0-x86                     2010-03-11 17:33:34&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All template files are located:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1&lt;br /&gt;
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2&lt;br /&gt;
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9&lt;br /&gt;
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1&lt;br /&gt;
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2&lt;br /&gt;
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9&lt;br /&gt;
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92&lt;br /&gt;
analog-fc2      mailman-fc2           php-rh9             suse-9.2&lt;br /&gt;
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1&lt;br /&gt;
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2&lt;br /&gt;
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9&lt;br /&gt;
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92&lt;br /&gt;
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1&lt;br /&gt;
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1&lt;br /&gt;
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2&lt;br /&gt;
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9&lt;br /&gt;
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1&lt;br /&gt;
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2&lt;br /&gt;
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9&lt;br /&gt;
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3&lt;br /&gt;
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0&lt;br /&gt;
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92&lt;br /&gt;
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1&lt;br /&gt;
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2&lt;br /&gt;
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9&lt;br /&gt;
jdk-suse92      mysql-rh9             redhat-as3-minimal&lt;br /&gt;
jre-deb31       mysql-suse92          redhat-devel-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here are the base OS templates: &amp;lt;tt&amp;gt;redhat-9, fedora-core-1&amp;lt;/tt&amp;gt; and supporting application templates: &amp;lt;tt&amp;gt;postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1&amp;lt;/tt&amp;gt;. So if you wanted to copy over all of redhat 9 you&#039;d need to copy the contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls -d /vz/template/*rh9*&lt;br /&gt;
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9&lt;br /&gt;
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9&lt;br /&gt;
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9&lt;br /&gt;
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9&lt;br /&gt;
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9&lt;br /&gt;
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9&lt;br /&gt;
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9&lt;br /&gt;
/vz/template/mailman-rh9     /vz/template/postgresql-rh9&lt;br /&gt;
&lt;br /&gt;
# ls -d /vz/template/*redhat-9*&lt;br /&gt;
/vz/template/redhat-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a template from one HN to another, it simply needs to be rsync&#039;d over to the target HN. It&#039;s rsync&#039;d over in this fashion:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template&lt;br /&gt;
 rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template&lt;br /&gt;
&lt;br /&gt;
Newer (&amp;gt;= 3.x) VZ employs &amp;quot;EZ&amp;quot; templates which are organized a little differently:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc&lt;br /&gt;
centos  conf         redhat-as3-minimal  ubuntu&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/ubuntu/&lt;br /&gt;
10.04  11.04  9.10&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/&lt;br /&gt;
x86&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/cache/&lt;br /&gt;
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz&lt;br /&gt;
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz&lt;br /&gt;
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we see is the entire OS and all applications are in 1 directory, and organized by distribution and release version. So to move Ubuntu 10.04:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
and you also need to move the cache:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/&lt;br /&gt;
&lt;br /&gt;
Once the transfer is complete, you will be able to run &amp;lt;tt&amp;gt;vzpkgls&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vzpkg list -O&amp;lt;/tt&amp;gt; and see the template(s) listed on the target HN.&lt;br /&gt;
&lt;br /&gt;
So far, this all supposes template doesn&#039;t exist on the target- very simple, just copy it over. If the template exists already on the target HN, this requires closer inspection. With older templates, simply moving over the templates would be the end of it- you see the version listed when you do a &amp;lt;tt&amp;gt;vzplgls&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysql-rh9 20030814 20050412&lt;br /&gt;
&lt;br /&gt;
this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412&lt;br /&gt;
As an aside, you can&#039;t copy over just 1 of them, but if you rsync&#039;d over the &amp;lt;tt&amp;gt;mysql-rh9&amp;lt;/tt&amp;gt; directory, you&#039;d see 20030814 and 20050412 on the target HN. As long as the versions match up, you&#039;re good to go.&lt;br /&gt;
&lt;br /&gt;
With EZ templates, the versions are not as easy to decipher. When you look at the &amp;lt;tt&amp;gt;vzpkg list&amp;lt;/tt&amp;gt; output, that simply tells you when a cache was created. A cache is simply a snapshot of all the data needed for the latest versions of the OS and it&#039;s applications at the time the cache was created. It is a date, and thus tells you nothing about the versions within. So for instance, if you had a cache for Ubuntu 10.04 from 2007 and you ran &amp;lt;tt&amp;gt;vzpkg create cache ubuntu-10.04-x86&amp;lt;/tt&amp;gt; it would re-download the latest version of apache, mysql and so on. And any &#039;&#039;subsequent&#039;&#039; ubuntu 10.04 CT&#039;s created thereafter would use those newer versions, whereas older CT&#039;s based on 10.04 would use older templates. You can see how this works by looking at the files under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this template has in it 6 different versions of apache2. This means that this template was merged with other 10.04 templates and/or it has been cached a few times, each time a new apache was available. The unfortunate thing is it&#039;s almost impossible to know which CT&#039;s are using which version of apache so it&#039;s hard to try to prune this down and remove unwanted/unneeded applications.&lt;br /&gt;
&lt;br /&gt;
So, if you see another HN has Ubuntu 10.04 on it, you need to see/confirm that it has all the exact files your CT needs. You can run a test rsync to see what &#039;&#039;would&#039;&#039; be transferred (what&#039;s missing):&lt;br /&gt;
&lt;br /&gt;
 rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
Based on the amount of data you get back from the rsync, you will be able to decide whether or not to remove the -n and allow the full transfer to go through. The downside to doing the transfer is the situation described above- you&#039;ve permanently joined these templates and now you may have 10 versions of apache on the target HN. There&#039;s one other potential pitfall to this kind of merging- it will also potentially copy over shared files, for which there is no particular version, most of which are in &amp;lt;tt&amp;gt;/vz/template/ubuntu/10.04/x86/config&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
 cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
 /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
&lt;br /&gt;
Here are some specific things to look out for. Case: copying centos-5 on virt19 to virt12. We dumped the rsync output to a file so we could inspect:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
(note, that can be dangerous, better to add on full path &amp;lt;tt&amp;gt;/vz/template/centos/5&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
So in the output file we see things like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
x86/base0/cachecookie&lt;br /&gt;
x86/base0/primary.xml.gz &lt;br /&gt;
x86/base0/primary.xml.gz.sqlite &lt;br /&gt;
x86/base0/repomd.xml &lt;br /&gt;
x86/base1/cachecookie &lt;br /&gt;
x86/base1/filelists.xml.gz &lt;br /&gt;
x86/base1/filelists.xml.gz.sqlite  &lt;br /&gt;
x86/base1/primary.xml.gz &lt;br /&gt;
x86/base1/primary.xml.gz.sqlite &lt;br /&gt;
x86/base1/repomd.xml&lt;br /&gt;
x86/base2/cachecookie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which make us nervous cause those are not versioned files, i.e.:&lt;br /&gt;
 5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock&lt;br /&gt;
&lt;br /&gt;
So those files will replace existing files on v12 rather than the case of the latter where it&#039;s likely being added. So caution should be given and deference to whichever version is newer (which rsync should take care of, but that will depend on the date each file was created and perhaps not the actual data within).&lt;br /&gt;
&lt;br /&gt;
If we look further in the file we see:&lt;br /&gt;
&lt;br /&gt;
 x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.&lt;br /&gt;
9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif&lt;br /&gt;
&lt;br /&gt;
and other files looking like:&lt;br /&gt;
 5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info&lt;br /&gt;
&lt;br /&gt;
Which means plesk is here. We don&#039;t need plesk on v12 (the CT moving over doesn&#039;t use it) so we rerun the rsync and exclude it:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh --exclude=&amp;quot;plesk*&amp;quot; --exclude=&amp;quot;psa*&amp;quot; /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
and now it&#039;s much smaller:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l&lt;br /&gt;
 97104&lt;br /&gt;
&lt;br /&gt;
Before running with excludes it was:&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l &lt;br /&gt;
 238238&lt;br /&gt;
&lt;br /&gt;
So again, look at what you&#039;re doing. Generally, combining templates is fine however.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re happy with the merge, run the rsync again without the &amp;quot;-n&amp;quot; to let it actually do the transfer.&lt;br /&gt;
&lt;br /&gt;
Once done, don&#039;t forget to add the new template to the HN in Management -&amp;gt; Reference -&amp;gt; Templates&lt;br /&gt;
&lt;br /&gt;
= getting help =&lt;br /&gt;
&lt;br /&gt;
= vzup2date =&lt;br /&gt;
TODO &lt;br /&gt;
= Adding new OS/application templates =&lt;br /&gt;
&lt;br /&gt;
Virtuozzo will lag a bit behind the initial release of an OS, perhaps by a month or more. Further, a newly-released OS may be available, but there may not be many/any application templates available initially. It pays to wait a bit.&lt;br /&gt;
&lt;br /&gt;
A template is easily installed via [[#vzup2date|vzup2date]]:&lt;br /&gt;
&lt;br /&gt;
 vzup2date -z&lt;br /&gt;
&lt;br /&gt;
You will be given a list of OS&#039;s to install. Select an OS, then customize that selection by checking/unchecking the application templates we do/don&#039;t want to include/offer.&lt;br /&gt;
&lt;br /&gt;
Generally, here are the app templates we include/offer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cyrus-imap&lt;br /&gt;
devel&lt;br /&gt;
imp&lt;br /&gt;
jre&lt;br /&gt;
jsdk&lt;br /&gt;
mailman&lt;br /&gt;
mod_perl&lt;br /&gt;
mod_ssl&lt;br /&gt;
mysql&lt;br /&gt;
php&lt;br /&gt;
phpmyadmin&lt;br /&gt;
phppgadmin&lt;br /&gt;
postgresql&lt;br /&gt;
proftpd&lt;br /&gt;
spamassassin&lt;br /&gt;
squirrelmail&lt;br /&gt;
tomcat&lt;br /&gt;
vsftpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do not (any longer) offer webalizer or analog.&lt;br /&gt;
&lt;br /&gt;
After selecting and installing the OS and apps, you should ensure it&#039;s installed:&lt;br /&gt;
&lt;br /&gt;
 vzpkg list -O&lt;br /&gt;
&lt;br /&gt;
Your new OS (ex. fedora-core-13-x86_64) will be listed, without a corresponding cache date:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@virt13 /vzconf]# vzpkg list -O&lt;br /&gt;
centos-6-x86                       2011-07-22 13:24:41&lt;br /&gt;
centos-6-x86_64                    2012-03-09 20:42:22&lt;br /&gt;
centos-5-x86                       2009-07-27 16:58:24&lt;br /&gt;
centos-5-x86_64                    2012-03-09 22:38:53&lt;br /&gt;
ubuntu-11.10-x86_64                2012-03-01 23:13:33&lt;br /&gt;
ubuntu-9.04-x86                    2009-06-02 11:32:39&lt;br /&gt;
ubuntu-12.04-x86_64                2012-05-29 13:50:50&lt;br /&gt;
ubuntu-8.04-x86                    2008-09-17 21:27:20&lt;br /&gt;
ubuntu-8.10-x86                    2009-03-13 13:58:57&lt;br /&gt;
ubuntu-11.04-x86                   2011-12-05 11:15:46&lt;br /&gt;
ubuntu-7.04-x86                    2008-09-24 16:42:50&lt;br /&gt;
redhat-el6-x86_64&lt;br /&gt;
fedora-core-13-x86_64              &lt;br /&gt;
fedora-core-12-x86                 2010-02-06 13:24:32&lt;br /&gt;
fedora-core-15-x86                 2011-12-05 11:36:43&lt;br /&gt;
fedora-core-11-x86                 2009-10-01 16:30:59&lt;br /&gt;
fedora-core-14-x86&lt;br /&gt;
fedora-core-16-x86_64              2012-03-13 11:40:23&lt;br /&gt;
fedora-core-9-x86                  2008-11-29 10:52:18&lt;br /&gt;
debian-6.0-x86                     2011-07-29 16:00:35&lt;br /&gt;
debian-6.0-x86_64                  2012-03-12 19:53:33&lt;br /&gt;
debian-5.0-x86                     2009-03-12 12:39:11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also confirm the apps installed:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt13 /vzconf]# vzpkg list fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64              2013-03-08 11:39:44&lt;br /&gt;
fedora-core-13-x86_64 devel&lt;br /&gt;
fedora-core-13-x86_64 php&lt;br /&gt;
fedora-core-13-x86_64 proftpd&lt;br /&gt;
fedora-core-13-x86_64 postgresql&lt;br /&gt;
fedora-core-13-x86_64 phpmyadmin&lt;br /&gt;
fedora-core-13-x86_64 mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before you can use the OS you must cache it. To create the cache run:&lt;br /&gt;
 vzpkg cache [OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;vzpkg cache fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s ready to use. In order to be able to use it with the [[VPS_Management#vm|vm]] command, you must create a file:&lt;br /&gt;
 jctmpl-[OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;jctmpl-fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In it, on line 1 we place the OS, followed by the app names, ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;more jctmpl-fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64&lt;br /&gt;
postgresql&lt;br /&gt;
jsdk&lt;br /&gt;
mod_ssl&lt;br /&gt;
phpmyadmin&lt;br /&gt;
mod_perl&lt;br /&gt;
tomcat&lt;br /&gt;
devel&lt;br /&gt;
php&lt;br /&gt;
mailman&lt;br /&gt;
cyrus-imap&lt;br /&gt;
squirrelmail&lt;br /&gt;
proftpd&lt;br /&gt;
mysql&lt;br /&gt;
phppgadmin&lt;br /&gt;
spamassassin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The packages will be installed in that order, so any pre-req&#039;s should be handled there.&lt;br /&gt;
&lt;br /&gt;
Now, when you run [[VPS_Management#vm|vm]] it will show you the newly-added OS and you may create a CT using it.&lt;br /&gt;
&lt;br /&gt;
The last few tasks are related to mgmt:&lt;br /&gt;
&lt;br /&gt;
1. add to mgmt-&amp;gt;reference-&amp;gt;templates (use the existing templates as an example). Once added, the new template will be included with the list of OS&#039;s available for the given HN.&lt;br /&gt;
2. if this is going to be a new OS offered for ordering, it needs to be added to the order form and webpage.&lt;br /&gt;
&lt;br /&gt;
a. to get a list of applications and versions in the new OS, you should create a test CT, enter it and run &amp;lt;tt&amp;gt;dpkg -l|sort&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;rpm -aq|sort&amp;lt;/tt&amp;gt; in centos/fedora) and enter that list in the following places:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/jc_pub/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Note, you will have to move the most recent OS data from &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt; into the corresponding &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname]_old.html&amp;lt;/tt&amp;gt; updating the version links in both.&lt;br /&gt;
&lt;br /&gt;
b. to add the new OS to the order form, you will need to update &amp;lt;tt&amp;gt;/usr/local/www/signup/html/step1.html&amp;lt;/tt&amp;gt; in several places (for regular and OSS orders) as well as updating the templateID which you can get from mgmt-&amp;gt;reference-&amp;gt;templates (or [[Management_System_/_Public_Website_/_Signup_/_Account_Manager#jc:ref_templates|jc:ref_templates]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Old method to obtain the templates:&lt;br /&gt;
&lt;br /&gt;
Go to http://www.parallels.com/en/virtuozzo/templates/catalog/&lt;br /&gt;
&lt;br /&gt;
Download the RPM&#039;s and install them&lt;br /&gt;
&lt;br /&gt;
 vzpkg list&lt;br /&gt;
to see the new packages/os templates&lt;br /&gt;
&lt;br /&gt;
 vzpkg create cache &amp;quot;OS_EZ_template_name&amp;quot;&lt;br /&gt;
to create a cache&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Update OS template =&lt;br /&gt;
&lt;br /&gt;
Installation and update of the new version of OS template will not affect the existing containers. It will affect only the new containers, created after this update operation. In terms of fixing &amp;quot;vzctl enter&amp;quot; error and SSH connectivity to Ubuntu based containers, it is necessary to recreate the template and not to update it, so the commands to run are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rpm -Uhv ubuntu-8.04-x86-ez-4.0.0-9.swsoft.noarch.rpm&lt;br /&gt;
vzpkg clean ubuntu-8.04-x86&lt;br /&gt;
vzpkg remove cache ubuntu-8.04-x86&lt;br /&gt;
vzpkg create cache ubuntu-8.04-x86&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installing new SSL cert on VZCP =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;openssl req -days 1999 -new -x509 -nodes -out server.crt -keyout server.key&lt;br /&gt;
&lt;br /&gt;
US&lt;br /&gt;
CA&lt;br /&gt;
San Diego&lt;br /&gt;
johncompanies.com&lt;br /&gt;
johncompanies.com&lt;br /&gt;
virt15ohncompanies.com&lt;br /&gt;
linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.crt/server.crt /etc/httpd/conf/ssl.crt/server.crt.bak&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.key/server.key /etc/httpd/conf/ssl.key/server.key.bak&lt;br /&gt;
cp server.crt /etc/httpd/conf/ssl.crt/server.crt&lt;br /&gt;
cp server.key /etc/httpd/conf/ssl.key/server.key&lt;br /&gt;
/etc/init.d/vzcp restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Moving virt (drives) to new hardware =&lt;br /&gt;
&lt;br /&gt;
If you have a case where a virt is dead (due to hardware failure), you can move the drives to a new hardware setup.&lt;br /&gt;
Here are the steps and things to look for:&lt;br /&gt;
&lt;br /&gt;
Move the drives to the new box. Most likely, the drives will be recognized and there will be no problems booting up. On Dell PERC 5/6 cards you will need to import the new &amp;quot;foreign&amp;quot; volume via the raid BIOS.&lt;br /&gt;
&lt;br /&gt;
If the hardware (motherboard) is different, it’s possible the nic’s won’t be recognized. Look at /etc/modules.conf the ethernet drivers are either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 tg3&lt;br /&gt;
alias eth1 tg3&amp;lt;/pre&amp;gt;&lt;br /&gt;
(supermicro)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 e100&lt;br /&gt;
alias eth1 e1000&amp;lt;/pre&amp;gt;&lt;br /&gt;
(intel)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 bnx2&lt;br /&gt;
alias eth1 bnx2&amp;lt;/pre&amp;gt;&lt;br /&gt;
(dell 29500)&lt;br /&gt;
&lt;br /&gt;
Also, you may see eth0 and eth1 swapped so if after confirming the eth devices are present (may require a reboot), then you may still need to swap the green/yellow network cables in the back to get them on the right port.&lt;br /&gt;
&lt;br /&gt;
VZ will not run (for long) on the new hardware, so you will need to get the license reissued. You may create/download a temporary license via their website for the interim.&lt;br /&gt;
&lt;br /&gt;
= Updating kernel on virt =&lt;br /&gt;
&lt;br /&gt;
We now use [[#vzup2date|vzup2date]] to update systems and kernels. What follows is what we used to do when we had to download kernels and install manually on old systems:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. install kernel and modules&lt;br /&gt;
&amp;lt;pre&amp;gt;# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \&lt;br /&gt;
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm&lt;br /&gt;
vzkernel-smp          ##################################################&lt;br /&gt;
vzmodules-smp       ##################################################&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT USE the &amp;quot;rpm -Uhv&amp;quot; command to install the kernel, otherwise all the previously installed kernels may be removed from your system. &lt;br /&gt;
&lt;br /&gt;
2. update lilo/grub&lt;br /&gt;
&lt;br /&gt;
Lilo:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lilo.conf&lt;br /&gt;
 &lt;br /&gt;
rename old Virtuozzo kernel label from &amp;quot;linux+virtuozzo&amp;quot; to &amp;quot;virtuozzo_old&amp;quot;&lt;br /&gt;
and add a new entry pointing to the newly installed virtuozzo kernel image.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;prompt&lt;br /&gt;
timeout=50&lt;br /&gt;
default=linux+virtuozzo&lt;br /&gt;
append=&amp;quot;debug panic=5 console=tty console=ttyS0,38400&amp;quot;&lt;br /&gt;
boot=/dev/sda&lt;br /&gt;
map=/boot/map&lt;br /&gt;
install=/boot/boot.b&lt;br /&gt;
message=/boot/message&lt;br /&gt;
linear&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3smp&lt;br /&gt;
        label=linux&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3smp.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3&lt;br /&gt;
        label=linux-up&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise&lt;br /&gt;
        label=2.4.20-9.5.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise&lt;br /&gt;
        label=2.4.20-9.8.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise&lt;br /&gt;
        label=2.4.20-9.21.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise&lt;br /&gt;
        label=2.4.20-9.24.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise&lt;br /&gt;
        label=2.4.20-28.3.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise&lt;br /&gt;
        label=old_linux+vz&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise&lt;br /&gt;
        label=linux+virtuozzo&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label &amp;quot;old_linux+vz &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Grub:&lt;br /&gt;
&lt;br /&gt;
 vi /boot/grub /menu.lst&lt;br /&gt;
&lt;br /&gt;
Add new entry at the top.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;serial --unit=0 --speed=38400&lt;br /&gt;
terminal --timeout=10 serial console&lt;br /&gt;
default=0&lt;br /&gt;
timeout=10&lt;br /&gt;
splashimage=(hd0,0)/boot/grub/splash.xpm.gz&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Red Hat Linux (2.4.18-3smp)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3smp.img&lt;br /&gt;
title Red Hat Linux-up (2.4.18-3)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3.img&lt;br /&gt;
title Linux with Virtuozzo 2.5&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1&lt;br /&gt;
title vz-enterpriseo&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1&lt;br /&gt;
title vz-enterprise&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. run the lilo (if using lilo)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lilo&lt;br /&gt;
Added linux&lt;br /&gt;
Added linux-up&lt;br /&gt;
Added virtuozzo_old&lt;br /&gt;
Added linux+virtuozzo *&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. reboot the server&lt;br /&gt;
 shutdown -r 23:05&lt;br /&gt;
&lt;br /&gt;
when it comes time for the shutdown, run [[VPS_Management#stopvirt|stopvirt]] to get things shut down faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Remaking service VE (&amp;lt;=3.x only) =&lt;br /&gt;
&lt;br /&gt;
Occasionally the control panel for VEs (aka VZPP) will stop working and you just need to reinstall the service VE (which runs the control panels for all VEs on the HN). Here&#039;s how that&#039;s done :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop 1&lt;br /&gt;
ipdel 1 69.55.234.152&lt;br /&gt;
vzmlocal 1:2&lt;br /&gt;
vzctl set 2 --save --onboot no&lt;br /&gt;
vzsveinstall -t redhat-as3-minimal -d /root/Rel261/HW/RPMS -s 69.55.234.152 --skip-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzsveinstall -t redhat-as3-minimal -d /vz/Rel300/HW/RPMS -s 69.55.229.151 --skip-client&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzctl mount 1&lt;br /&gt;
vzctl mount 2&lt;br /&gt;
/bin/cp -aRf /vz/root/2/home/vzagent0 /vz/root/1/home&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/lib/mysql/VZADB /vz/root/1/var/lib/mysql&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/shadow /vz/root/1/etc/&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/vzcp/static/vz/skins/ /vz/root/1/var/vzcp/static/vz&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/menu.xml  /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/dashboard.xml /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
&lt;br /&gt;
vzctl umount 2&lt;br /&gt;
vzctl umount 1&lt;br /&gt;
vzctl start 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= GRUB: boot once to a new kernel =&lt;br /&gt;
&lt;br /&gt;
To use a different kernel for the next reboot only:&lt;br /&gt;
  &amp;lt;pre&amp;gt;grub --no-floppy&lt;br /&gt;
  savedefault --default=N --once&lt;br /&gt;
  (where N is the number of the kernel you want to boot once)&lt;br /&gt;
  quit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot your machine. It will boot using kernel &amp;quot;N&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 grub-reboot N&lt;br /&gt;
will do essentially the same thing and prompt to reboot the machine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Recovering from GRUB failure =&lt;br /&gt;
&lt;br /&gt;
(example from DPE 2950)&lt;br /&gt;
&lt;br /&gt;
Boot to CEOS4 server CD (original install cd). Did this example with iso mounted via drac&lt;br /&gt;
&lt;br /&gt;
 Boot: linux rescue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Make/edit an ISO on Linux =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mount file.iso /mnt/iso/ -t iso9660 -o ro,loop=/dev/loop0&lt;br /&gt;
mkdir /tmp/iso&lt;br /&gt;
cp -aR /mnt/iso/* /tmp/iso/&lt;br /&gt;
umount /mnt/iso/&lt;br /&gt;
mkisofs -iso-level 2 -o /tmp/new.iso /tmp/iso/&lt;br /&gt;
rm -fr /tmp/iso&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To mount it:&lt;br /&gt;
&lt;br /&gt;
 mount -t vfat -o loop /tmp/3wfirmware.iso /mnt/usb/&lt;br /&gt;
&lt;br /&gt;
http://www.damnsmalllinux.org/wiki/index.php/Installing_to_a_USB_Flash_Drive&lt;br /&gt;
&lt;br /&gt;
= Mount/edit USB drive on Linux =&lt;br /&gt;
&lt;br /&gt;
  mount -t vfat -o loop /tmp/3wfirmware.iso /mnt/usb/&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Data_Center_Notes&amp;diff=1046</id>
		<title>Data Center Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Data_Center_Notes&amp;diff=1046"/>
		<updated>2013-03-11T23:59:03Z</updated>

		<summary type="html">&lt;p&gt;Support: /* USB drive */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Castle =&lt;br /&gt;
&lt;br /&gt;
== Spare serial console ==&lt;br /&gt;
There is a blue spare serial console cable (with adapter) hanging in cabinet 3-5. Connect to it with &amp;lt;tt&amp;gt;tip spare&amp;lt;/tt&amp;gt; on the console server. You may need to adjust the speed in the &amp;lt;tt&amp;gt;/etc/remote&amp;lt;/tt&amp;gt; file first. The cable is long enough to reach a few cabinets away.&lt;br /&gt;
&lt;br /&gt;
== cable color coding ==&lt;br /&gt;
* blue &amp;amp; white pair: trunk lines from remote switches to p1a/b, A/B drops from castle&lt;br /&gt;
* white: cross connects&lt;br /&gt;
* yellow: public network&lt;br /&gt;
* green: private network&lt;br /&gt;
* orange: serial console&lt;br /&gt;
* red: special&lt;br /&gt;
&lt;br /&gt;
== cross connect mapping ==&lt;br /&gt;
(this is out of date, many probably aren&#039;t there any longer)&lt;br /&gt;
&lt;br /&gt;
230809 &amp;lt;-&amp;gt; 220809&amp;lt;br /&amp;gt;&lt;br /&gt;
130903 &amp;lt;-&amp;gt; 220808&amp;lt;br /&amp;gt;&lt;br /&gt;
130902 &amp;lt;-&amp;gt; 220807&amp;lt;br /&amp;gt;&lt;br /&gt;
120302 &amp;lt;-&amp;gt; 110502&amp;lt;br /&amp;gt;&lt;br /&gt;
120303 &amp;lt;-&amp;gt; 120803?&amp;lt;br /&amp;gt;&lt;br /&gt;
130703 &amp;lt;-&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
230709 &amp;lt;-&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
220308 &amp;lt;-&amp;gt; 231008&amp;lt;br /&amp;gt;&lt;br /&gt;
220309 &amp;lt;-&amp;gt; 231009&amp;lt;br /&amp;gt;&lt;br /&gt;
230708 &amp;lt;-&amp;gt; 240908 (switch P10)&amp;lt;br /&amp;gt;&lt;br /&gt;
131002 &amp;lt;-&amp;gt; 140902 (serial switch P10)&amp;lt;br /&amp;gt;&lt;br /&gt;
131003 &amp;lt;-&amp;gt; 140703 (serial console)&amp;lt;br /&amp;gt;&lt;br /&gt;
230607 &amp;lt;-&amp;gt; 260407 (serial switch P11)&amp;lt;br /&amp;gt;&lt;br /&gt;
230608 &amp;lt;-&amp;gt; 260508 (serial switch P12)&amp;lt;br /&amp;gt;&lt;br /&gt;
230609 &amp;lt;-&amp;gt; 260409 (switch P1 cross connect)&amp;lt;br /&amp;gt;&lt;br /&gt;
231007 &amp;lt;-&amp;gt; 261707 (serial switch P14)&amp;lt;br /&amp;gt;&lt;br /&gt;
130702 &amp;lt;-&amp;gt; 161603 (switch P13)&amp;lt;br /&amp;gt;&lt;br /&gt;
230707 &amp;lt;-&amp;gt; 261607 (serial switch P13)&amp;lt;br /&amp;gt;&lt;br /&gt;
130603 &amp;lt;-&amp;gt; 140803 (serial switch P15)&amp;lt;br /&amp;gt;&lt;br /&gt;
161602 &amp;lt;-&amp;gt; 130602&amp;lt;br /&amp;gt;&lt;br /&gt;
Cabinet 06-17 port 1 to cabinet 04-08 port 1 ??&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Open ports&lt;br /&gt;
&lt;br /&gt;
3-6&amp;lt;br /&amp;gt;&lt;br /&gt;
130601 2&lt;br /&gt;
&lt;br /&gt;
3-5&amp;lt;br /&amp;gt;&lt;br /&gt;
all open&lt;br /&gt;
&lt;br /&gt;
== spare drives ==&lt;br /&gt;
(in 3-6)&lt;br /&gt;
&lt;br /&gt;
st373307LC white sled #5&amp;lt;br /&amp;gt;&lt;br /&gt;
st373307LC white sled #4&amp;lt;br /&amp;gt;&lt;br /&gt;
ST3146807LC no sled&amp;lt;br /&amp;gt;&lt;br /&gt;
ST373455SS dell sled&amp;lt;br /&amp;gt;&lt;br /&gt;
ST373307LC white sled #0&amp;lt;br /&amp;gt;&lt;br /&gt;
ST373307LC white sled #1&amp;lt;br /&amp;gt;&lt;br /&gt;
146G SAS&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== IP allocation ==&lt;br /&gt;
&lt;br /&gt;
We own the following IP block: 69.55.224.0/20&lt;br /&gt;
Which consists of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;69.55.224.0/24&lt;br /&gt;
69.55.225.0/24&lt;br /&gt;
69.55.226.0/24&lt;br /&gt;
69.55.227.0/24&lt;br /&gt;
69.55.228.0/24&lt;br /&gt;
69.55.229.0/24 (announced at i2b)&lt;br /&gt;
69.55.230.0/24 (internal use and “temp IPs”)&lt;br /&gt;
69.55.231.0/24 (announced at i2b)&lt;br /&gt;
69.55.232.0/24&lt;br /&gt;
69.55.233.0/24 (dedicated customers, internal use)&lt;br /&gt;
69.55.234.0/24&lt;br /&gt;
69.55.235.0/24&lt;br /&gt;
69.55.236.0/24&lt;br /&gt;
69.55.237.0/24&lt;br /&gt;
69.55.238.0/24&lt;br /&gt;
69.55.239.0/24 (“bad boy” block)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All class C blocks above are subnetted as 255.255.255.0 and have their gateway at .1 (i.e. 69.55.224.12’s gateway is 69.55.224.1)&lt;br /&gt;
&lt;br /&gt;
The exception to this the 233 block which is subnetted up for use by dedicated customers and for some of our internal  (routing) equipment. Here’s how that block is chopped up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Range		Mask	Slash	Hosts	Usage&lt;br /&gt;
0-127		.128	25	126	dedicated’s (so any customer on this block has a DG of .1 and NM of 255.255.255.128)&lt;br /&gt;
128-143	.240	28	14	&lt;br /&gt;
144-151	.248	29	6	&lt;br /&gt;
152-159	.248	29	6	fw external&lt;br /&gt;
160-167	.248	29	6	fw internal&lt;br /&gt;
168-183	.240	28	14		&lt;br /&gt;
184-191	.248	29	6	&lt;br /&gt;
192-223	.224	27	30	nat&lt;br /&gt;
224-255	.224	27	30	dedicated’s	DG: 69.55.233.225 (unverified)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== D800 laptop ==&lt;br /&gt;
&lt;br /&gt;
There is a Dell D800 laptop in cabinet 3-6 for use when at Castle (and to access via RDP when needed).&lt;br /&gt;
&lt;br /&gt;
It is nat&#039;d as follows:&lt;br /&gt;
&lt;br /&gt;
69.55.233.197 &amp;lt;=&amp;gt; 10.1.4.240&lt;br /&gt;
&lt;br /&gt;
(it&#039;s on the private net)&lt;br /&gt;
&lt;br /&gt;
== USB drive ==&lt;br /&gt;
&lt;br /&gt;
We have a floating USB drive at castle, used for booting machines up in order to do BIOS updates or whatever.&lt;br /&gt;
&lt;br /&gt;
It lives on virt16&lt;br /&gt;
&lt;br /&gt;
See [[Virtuozzo_/_Linux_Reference#Mount.2Fedit_USB_drive_on_Linux|edit USB drive on Linux]] for more info.&lt;br /&gt;
&lt;br /&gt;
= i2b =&lt;br /&gt;
&lt;br /&gt;
== cable color coding ==&lt;br /&gt;
* white: drops from i2b, i2b network&lt;br /&gt;
* yellow: public JC network&lt;br /&gt;
* green: private network&lt;br /&gt;
* orange: serial console&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Data_Center_Notes&amp;diff=1045</id>
		<title>Data Center Notes</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Data_Center_Notes&amp;diff=1045"/>
		<updated>2013-03-11T23:58:51Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Castle */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Castle =&lt;br /&gt;
&lt;br /&gt;
== Spare serial console ==&lt;br /&gt;
There is a blue spare serial console cable (with adapter) hanging in cabinet 3-5. Connect to it with &amp;lt;tt&amp;gt;tip spare&amp;lt;/tt&amp;gt; on the console server. You may need to adjust the speed in the &amp;lt;tt&amp;gt;/etc/remote&amp;lt;/tt&amp;gt; file first. The cable is long enough to reach a few cabinets away.&lt;br /&gt;
&lt;br /&gt;
== cable color coding ==&lt;br /&gt;
* blue &amp;amp; white pair: trunk lines from remote switches to p1a/b, A/B drops from castle&lt;br /&gt;
* white: cross connects&lt;br /&gt;
* yellow: public network&lt;br /&gt;
* green: private network&lt;br /&gt;
* orange: serial console&lt;br /&gt;
* red: special&lt;br /&gt;
&lt;br /&gt;
== cross connect mapping ==&lt;br /&gt;
(this is out of date, many probably aren&#039;t there any longer)&lt;br /&gt;
&lt;br /&gt;
230809 &amp;lt;-&amp;gt; 220809&amp;lt;br /&amp;gt;&lt;br /&gt;
130903 &amp;lt;-&amp;gt; 220808&amp;lt;br /&amp;gt;&lt;br /&gt;
130902 &amp;lt;-&amp;gt; 220807&amp;lt;br /&amp;gt;&lt;br /&gt;
120302 &amp;lt;-&amp;gt; 110502&amp;lt;br /&amp;gt;&lt;br /&gt;
120303 &amp;lt;-&amp;gt; 120803?&amp;lt;br /&amp;gt;&lt;br /&gt;
130703 &amp;lt;-&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
230709 &amp;lt;-&amp;gt; &amp;lt;br /&amp;gt;&lt;br /&gt;
220308 &amp;lt;-&amp;gt; 231008&amp;lt;br /&amp;gt;&lt;br /&gt;
220309 &amp;lt;-&amp;gt; 231009&amp;lt;br /&amp;gt;&lt;br /&gt;
230708 &amp;lt;-&amp;gt; 240908 (switch P10)&amp;lt;br /&amp;gt;&lt;br /&gt;
131002 &amp;lt;-&amp;gt; 140902 (serial switch P10)&amp;lt;br /&amp;gt;&lt;br /&gt;
131003 &amp;lt;-&amp;gt; 140703 (serial console)&amp;lt;br /&amp;gt;&lt;br /&gt;
230607 &amp;lt;-&amp;gt; 260407 (serial switch P11)&amp;lt;br /&amp;gt;&lt;br /&gt;
230608 &amp;lt;-&amp;gt; 260508 (serial switch P12)&amp;lt;br /&amp;gt;&lt;br /&gt;
230609 &amp;lt;-&amp;gt; 260409 (switch P1 cross connect)&amp;lt;br /&amp;gt;&lt;br /&gt;
231007 &amp;lt;-&amp;gt; 261707 (serial switch P14)&amp;lt;br /&amp;gt;&lt;br /&gt;
130702 &amp;lt;-&amp;gt; 161603 (switch P13)&amp;lt;br /&amp;gt;&lt;br /&gt;
230707 &amp;lt;-&amp;gt; 261607 (serial switch P13)&amp;lt;br /&amp;gt;&lt;br /&gt;
130603 &amp;lt;-&amp;gt; 140803 (serial switch P15)&amp;lt;br /&amp;gt;&lt;br /&gt;
161602 &amp;lt;-&amp;gt; 130602&amp;lt;br /&amp;gt;&lt;br /&gt;
Cabinet 06-17 port 1 to cabinet 04-08 port 1 ??&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Open ports&lt;br /&gt;
&lt;br /&gt;
3-6&amp;lt;br /&amp;gt;&lt;br /&gt;
130601 2&lt;br /&gt;
&lt;br /&gt;
3-5&amp;lt;br /&amp;gt;&lt;br /&gt;
all open&lt;br /&gt;
&lt;br /&gt;
== spare drives ==&lt;br /&gt;
(in 3-6)&lt;br /&gt;
&lt;br /&gt;
st373307LC white sled #5&amp;lt;br /&amp;gt;&lt;br /&gt;
st373307LC white sled #4&amp;lt;br /&amp;gt;&lt;br /&gt;
ST3146807LC no sled&amp;lt;br /&amp;gt;&lt;br /&gt;
ST373455SS dell sled&amp;lt;br /&amp;gt;&lt;br /&gt;
ST373307LC white sled #0&amp;lt;br /&amp;gt;&lt;br /&gt;
ST373307LC white sled #1&amp;lt;br /&amp;gt;&lt;br /&gt;
146G SAS&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== IP allocation ==&lt;br /&gt;
&lt;br /&gt;
We own the following IP block: 69.55.224.0/20&lt;br /&gt;
Which consists of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;69.55.224.0/24&lt;br /&gt;
69.55.225.0/24&lt;br /&gt;
69.55.226.0/24&lt;br /&gt;
69.55.227.0/24&lt;br /&gt;
69.55.228.0/24&lt;br /&gt;
69.55.229.0/24 (announced at i2b)&lt;br /&gt;
69.55.230.0/24 (internal use and “temp IPs”)&lt;br /&gt;
69.55.231.0/24 (announced at i2b)&lt;br /&gt;
69.55.232.0/24&lt;br /&gt;
69.55.233.0/24 (dedicated customers, internal use)&lt;br /&gt;
69.55.234.0/24&lt;br /&gt;
69.55.235.0/24&lt;br /&gt;
69.55.236.0/24&lt;br /&gt;
69.55.237.0/24&lt;br /&gt;
69.55.238.0/24&lt;br /&gt;
69.55.239.0/24 (“bad boy” block)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All class C blocks above are subnetted as 255.255.255.0 and have their gateway at .1 (i.e. 69.55.224.12’s gateway is 69.55.224.1)&lt;br /&gt;
&lt;br /&gt;
The exception to this the 233 block which is subnetted up for use by dedicated customers and for some of our internal  (routing) equipment. Here’s how that block is chopped up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Range		Mask	Slash	Hosts	Usage&lt;br /&gt;
0-127		.128	25	126	dedicated’s (so any customer on this block has a DG of .1 and NM of 255.255.255.128)&lt;br /&gt;
128-143	.240	28	14	&lt;br /&gt;
144-151	.248	29	6	&lt;br /&gt;
152-159	.248	29	6	fw external&lt;br /&gt;
160-167	.248	29	6	fw internal&lt;br /&gt;
168-183	.240	28	14		&lt;br /&gt;
184-191	.248	29	6	&lt;br /&gt;
192-223	.224	27	30	nat&lt;br /&gt;
224-255	.224	27	30	dedicated’s	DG: 69.55.233.225 (unverified)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== D800 laptop ==&lt;br /&gt;
&lt;br /&gt;
There is a Dell D800 laptop in cabinet 3-6 for use when at Castle (and to access via RDP when needed).&lt;br /&gt;
&lt;br /&gt;
It is nat&#039;d as follows:&lt;br /&gt;
&lt;br /&gt;
69.55.233.197 &amp;lt;=&amp;gt; 10.1.4.240&lt;br /&gt;
&lt;br /&gt;
(it&#039;s on the private net)&lt;br /&gt;
&lt;br /&gt;
== USB drive ==&lt;br /&gt;
&lt;br /&gt;
We have a floating USB drive at castle, used for booting machines up in order to do BIOS updates or whatever.&lt;br /&gt;
&lt;br /&gt;
It lives on virt16&lt;br /&gt;
&lt;br /&gt;
See [[Virtuozzo_/_Linux_Reference#Mount.2Fedit_USB_drive_on_Linux|edit_USB_drive_on_Linux]] for more info.&lt;br /&gt;
&lt;br /&gt;
= i2b =&lt;br /&gt;
&lt;br /&gt;
== cable color coding ==&lt;br /&gt;
* white: drops from i2b, i2b network&lt;br /&gt;
* yellow: public JC network&lt;br /&gt;
* green: private network&lt;br /&gt;
* orange: serial console&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1044</id>
		<title>Virtuozzo / Linux Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1044"/>
		<updated>2013-03-11T23:56:30Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Recovering from GRUB failure */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Updating VZ =&lt;br /&gt;
&lt;br /&gt;
 Update Virtuozzo to version 4.0.0&lt;br /&gt;
 Apply minor updates for Virtuozzo 3.0.0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
When you get to the last screen, you will be given an option to &lt;br /&gt;
&lt;br /&gt;
 ( ) Automatically reboot after update&lt;br /&gt;
 (*) Reboot later manually&lt;br /&gt;
&lt;br /&gt;
make sure you choose to reboot later.&lt;br /&gt;
&lt;br /&gt;
= Migrating Templates =&lt;br /&gt;
One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it&#039;s now called) based on a particular ditribution on a host which may or may not share the same distribution. For instance, you could run a CT running Ubuntu while the host machine (Hardware Node or HN) is running CentOS. This is accomplished via the use of OS templates. As long as the HN contains the OS template on which a particular CT relies, it will run there. As such, if you want to move a CT from one HN to another, you will need to make sure the OS template exists there.&lt;br /&gt;
&lt;br /&gt;
Modern versions of VZ (&amp;gt;= 4.x) will check for and automatically move the OS template over to the host as you&#039;re (vz)migrating the CT over to a new HN. However we like to make sure the template is in place prior to moving the CT. &lt;br /&gt;
&lt;br /&gt;
The first step is to see if the template exists on the host. To see OS templates installed:&lt;br /&gt;
&lt;br /&gt;
2.x (shows OS and application templates):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkgls&lt;br /&gt;
mod_ssl-rh9 20040624&lt;br /&gt;
mysql-rh9 20030814 20050412&lt;br /&gt;
openwebmail-rh9 20050427&lt;br /&gt;
php-rh9 20050506&lt;br /&gt;
phpBB-rh9 20041229&lt;br /&gt;
postgresql-rh9 20050719&lt;br /&gt;
sl-webalizer-rh9 20040119&lt;br /&gt;
spamassassin-rh9 20040127&lt;br /&gt;
tomcat-rh9 20040524&lt;br /&gt;
usermin-rh9 20040116&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;= 3.x (shows just OS templates, run without -O to see application as well):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkg list -O&lt;br /&gt;
ubuntu-10.04-x86                   2010-06-01 11:39:05&lt;br /&gt;
ubuntu-11.04-x86                   2011-06-22 14:23:59&lt;br /&gt;
ubuntu-9.10-x86                    2010-03-11 17:39:51&lt;br /&gt;
centos-5-x86                       2010-03-11 17:12:27&lt;br /&gt;
debian-5.0-x86                     2010-03-11 17:33:34&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All template files are located:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1&lt;br /&gt;
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2&lt;br /&gt;
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9&lt;br /&gt;
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1&lt;br /&gt;
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2&lt;br /&gt;
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9&lt;br /&gt;
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92&lt;br /&gt;
analog-fc2      mailman-fc2           php-rh9             suse-9.2&lt;br /&gt;
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1&lt;br /&gt;
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2&lt;br /&gt;
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9&lt;br /&gt;
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92&lt;br /&gt;
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1&lt;br /&gt;
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1&lt;br /&gt;
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2&lt;br /&gt;
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9&lt;br /&gt;
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1&lt;br /&gt;
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2&lt;br /&gt;
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9&lt;br /&gt;
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3&lt;br /&gt;
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0&lt;br /&gt;
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92&lt;br /&gt;
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1&lt;br /&gt;
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2&lt;br /&gt;
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9&lt;br /&gt;
jdk-suse92      mysql-rh9             redhat-as3-minimal&lt;br /&gt;
jre-deb31       mysql-suse92          redhat-devel-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here are the base OS templates: &amp;lt;tt&amp;gt;redhat-9, fedora-core-1&amp;lt;/tt&amp;gt; and supporting application templates: &amp;lt;tt&amp;gt;postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1&amp;lt;/tt&amp;gt;. So if you wanted to copy over all of redhat 9 you&#039;d need to copy the contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls -d /vz/template/*rh9*&lt;br /&gt;
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9&lt;br /&gt;
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9&lt;br /&gt;
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9&lt;br /&gt;
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9&lt;br /&gt;
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9&lt;br /&gt;
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9&lt;br /&gt;
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9&lt;br /&gt;
/vz/template/mailman-rh9     /vz/template/postgresql-rh9&lt;br /&gt;
&lt;br /&gt;
# ls -d /vz/template/*redhat-9*&lt;br /&gt;
/vz/template/redhat-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a template from one HN to another, it simply needs to be rsync&#039;d over to the target HN. It&#039;s rsync&#039;d over in this fashion:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template&lt;br /&gt;
 rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template&lt;br /&gt;
&lt;br /&gt;
Newer (&amp;gt;= 3.x) VZ employs &amp;quot;EZ&amp;quot; templates which are organized a little differently:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc&lt;br /&gt;
centos  conf         redhat-as3-minimal  ubuntu&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/ubuntu/&lt;br /&gt;
10.04  11.04  9.10&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/&lt;br /&gt;
x86&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/cache/&lt;br /&gt;
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz&lt;br /&gt;
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz&lt;br /&gt;
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we see is the entire OS and all applications are in 1 directory, and organized by distribution and release version. So to move Ubuntu 10.04:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
and you also need to move the cache:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/&lt;br /&gt;
&lt;br /&gt;
Once the transfer is complete, you will be able to run &amp;lt;tt&amp;gt;vzpkgls&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vzpkg list -O&amp;lt;/tt&amp;gt; and see the template(s) listed on the target HN.&lt;br /&gt;
&lt;br /&gt;
So far, this all supposes template doesn&#039;t exist on the target- very simple, just copy it over. If the template exists already on the target HN, this requires closer inspection. With older templates, simply moving over the templates would be the end of it- you see the version listed when you do a &amp;lt;tt&amp;gt;vzplgls&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysql-rh9 20030814 20050412&lt;br /&gt;
&lt;br /&gt;
this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412&lt;br /&gt;
As an aside, you can&#039;t copy over just 1 of them, but if you rsync&#039;d over the &amp;lt;tt&amp;gt;mysql-rh9&amp;lt;/tt&amp;gt; directory, you&#039;d see 20030814 and 20050412 on the target HN. As long as the versions match up, you&#039;re good to go.&lt;br /&gt;
&lt;br /&gt;
With EZ templates, the versions are not as easy to decipher. When you look at the &amp;lt;tt&amp;gt;vzpkg list&amp;lt;/tt&amp;gt; output, that simply tells you when a cache was created. A cache is simply a snapshot of all the data needed for the latest versions of the OS and it&#039;s applications at the time the cache was created. It is a date, and thus tells you nothing about the versions within. So for instance, if you had a cache for Ubuntu 10.04 from 2007 and you ran &amp;lt;tt&amp;gt;vzpkg create cache ubuntu-10.04-x86&amp;lt;/tt&amp;gt; it would re-download the latest version of apache, mysql and so on. And any &#039;&#039;subsequent&#039;&#039; ubuntu 10.04 CT&#039;s created thereafter would use those newer versions, whereas older CT&#039;s based on 10.04 would use older templates. You can see how this works by looking at the files under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this template has in it 6 different versions of apache2. This means that this template was merged with other 10.04 templates and/or it has been cached a few times, each time a new apache was available. The unfortunate thing is it&#039;s almost impossible to know which CT&#039;s are using which version of apache so it&#039;s hard to try to prune this down and remove unwanted/unneeded applications.&lt;br /&gt;
&lt;br /&gt;
So, if you see another HN has Ubuntu 10.04 on it, you need to see/confirm that it has all the exact files your CT needs. You can run a test rsync to see what &#039;&#039;would&#039;&#039; be transferred (what&#039;s missing):&lt;br /&gt;
&lt;br /&gt;
 rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
Based on the amount of data you get back from the rsync, you will be able to decide whether or not to remove the -n and allow the full transfer to go through. The downside to doing the transfer is the situation described above- you&#039;ve permanently joined these templates and now you may have 10 versions of apache on the target HN. There&#039;s one other potential pitfall to this kind of merging- it will also potentially copy over shared files, for which there is no particular version, most of which are in &amp;lt;tt&amp;gt;/vz/template/ubuntu/10.04/x86/config&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
 cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
 /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
&lt;br /&gt;
Here are some specific things to look out for. Case: copying centos-5 on virt19 to virt12. We dumped the rsync output to a file so we could inspect:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
(note, that can be dangerous, better to add on full path &amp;lt;tt&amp;gt;/vz/template/centos/5&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
So in the output file we see things like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
x86/base0/cachecookie&lt;br /&gt;
x86/base0/primary.xml.gz &lt;br /&gt;
x86/base0/primary.xml.gz.sqlite &lt;br /&gt;
x86/base0/repomd.xml &lt;br /&gt;
x86/base1/cachecookie &lt;br /&gt;
x86/base1/filelists.xml.gz &lt;br /&gt;
x86/base1/filelists.xml.gz.sqlite  &lt;br /&gt;
x86/base1/primary.xml.gz &lt;br /&gt;
x86/base1/primary.xml.gz.sqlite &lt;br /&gt;
x86/base1/repomd.xml&lt;br /&gt;
x86/base2/cachecookie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which make us nervous cause those are not versioned files, i.e.:&lt;br /&gt;
 5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock&lt;br /&gt;
&lt;br /&gt;
So those files will replace existing files on v12 rather than the case of the latter where it&#039;s likely being added. So caution should be given and deference to whichever version is newer (which rsync should take care of, but that will depend on the date each file was created and perhaps not the actual data within).&lt;br /&gt;
&lt;br /&gt;
If we look further in the file we see:&lt;br /&gt;
&lt;br /&gt;
 x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.&lt;br /&gt;
9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif&lt;br /&gt;
&lt;br /&gt;
and other files looking like:&lt;br /&gt;
 5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info&lt;br /&gt;
&lt;br /&gt;
Which means plesk is here. We don&#039;t need plesk on v12 (the CT moving over doesn&#039;t use it) so we rerun the rsync and exclude it:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh --exclude=&amp;quot;plesk*&amp;quot; --exclude=&amp;quot;psa*&amp;quot; /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
and now it&#039;s much smaller:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l&lt;br /&gt;
 97104&lt;br /&gt;
&lt;br /&gt;
Before running with excludes it was:&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l &lt;br /&gt;
 238238&lt;br /&gt;
&lt;br /&gt;
So again, look at what you&#039;re doing. Generally, combining templates is fine however.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re happy with the merge, run the rsync again without the &amp;quot;-n&amp;quot; to let it actually do the transfer.&lt;br /&gt;
&lt;br /&gt;
Once done, don&#039;t forget to add the new template to the HN in Management -&amp;gt; Reference -&amp;gt; Templates&lt;br /&gt;
&lt;br /&gt;
= getting help =&lt;br /&gt;
&lt;br /&gt;
= vzup2date =&lt;br /&gt;
TODO &lt;br /&gt;
= Adding new OS/application templates =&lt;br /&gt;
&lt;br /&gt;
Virtuozzo will lag a bit behind the initial release of an OS, perhaps by a month or more. Further, a newly-released OS may be available, but there may not be many/any application templates available initially. It pays to wait a bit.&lt;br /&gt;
&lt;br /&gt;
A template is easily installed via [[#vzup2date|vzup2date]]:&lt;br /&gt;
&lt;br /&gt;
 vzup2date -z&lt;br /&gt;
&lt;br /&gt;
You will be given a list of OS&#039;s to install. Select an OS, then customize that selection by checking/unchecking the application templates we do/don&#039;t want to include/offer.&lt;br /&gt;
&lt;br /&gt;
Generally, here are the app templates we include/offer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cyrus-imap&lt;br /&gt;
devel&lt;br /&gt;
imp&lt;br /&gt;
jre&lt;br /&gt;
jsdk&lt;br /&gt;
mailman&lt;br /&gt;
mod_perl&lt;br /&gt;
mod_ssl&lt;br /&gt;
mysql&lt;br /&gt;
php&lt;br /&gt;
phpmyadmin&lt;br /&gt;
phppgadmin&lt;br /&gt;
postgresql&lt;br /&gt;
proftpd&lt;br /&gt;
spamassassin&lt;br /&gt;
squirrelmail&lt;br /&gt;
tomcat&lt;br /&gt;
vsftpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do not (any longer) offer webalizer or analog.&lt;br /&gt;
&lt;br /&gt;
After selecting and installing the OS and apps, you should ensure it&#039;s installed:&lt;br /&gt;
&lt;br /&gt;
 vzpkg list -O&lt;br /&gt;
&lt;br /&gt;
Your new OS (ex. fedora-core-13-x86_64) will be listed, without a corresponding cache date:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@virt13 /vzconf]# vzpkg list -O&lt;br /&gt;
centos-6-x86                       2011-07-22 13:24:41&lt;br /&gt;
centos-6-x86_64                    2012-03-09 20:42:22&lt;br /&gt;
centos-5-x86                       2009-07-27 16:58:24&lt;br /&gt;
centos-5-x86_64                    2012-03-09 22:38:53&lt;br /&gt;
ubuntu-11.10-x86_64                2012-03-01 23:13:33&lt;br /&gt;
ubuntu-9.04-x86                    2009-06-02 11:32:39&lt;br /&gt;
ubuntu-12.04-x86_64                2012-05-29 13:50:50&lt;br /&gt;
ubuntu-8.04-x86                    2008-09-17 21:27:20&lt;br /&gt;
ubuntu-8.10-x86                    2009-03-13 13:58:57&lt;br /&gt;
ubuntu-11.04-x86                   2011-12-05 11:15:46&lt;br /&gt;
ubuntu-7.04-x86                    2008-09-24 16:42:50&lt;br /&gt;
redhat-el6-x86_64&lt;br /&gt;
fedora-core-13-x86_64              &lt;br /&gt;
fedora-core-12-x86                 2010-02-06 13:24:32&lt;br /&gt;
fedora-core-15-x86                 2011-12-05 11:36:43&lt;br /&gt;
fedora-core-11-x86                 2009-10-01 16:30:59&lt;br /&gt;
fedora-core-14-x86&lt;br /&gt;
fedora-core-16-x86_64              2012-03-13 11:40:23&lt;br /&gt;
fedora-core-9-x86                  2008-11-29 10:52:18&lt;br /&gt;
debian-6.0-x86                     2011-07-29 16:00:35&lt;br /&gt;
debian-6.0-x86_64                  2012-03-12 19:53:33&lt;br /&gt;
debian-5.0-x86                     2009-03-12 12:39:11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also confirm the apps installed:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt13 /vzconf]# vzpkg list fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64              2013-03-08 11:39:44&lt;br /&gt;
fedora-core-13-x86_64 devel&lt;br /&gt;
fedora-core-13-x86_64 php&lt;br /&gt;
fedora-core-13-x86_64 proftpd&lt;br /&gt;
fedora-core-13-x86_64 postgresql&lt;br /&gt;
fedora-core-13-x86_64 phpmyadmin&lt;br /&gt;
fedora-core-13-x86_64 mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before you can use the OS you must cache it. To create the cache run:&lt;br /&gt;
 vzpkg cache [OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;vzpkg cache fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s ready to use. In order to be able to use it with the [[VPS_Management#vm|vm]] command, you must create a file:&lt;br /&gt;
 jctmpl-[OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;jctmpl-fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In it, on line 1 we place the OS, followed by the app names, ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;more jctmpl-fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64&lt;br /&gt;
postgresql&lt;br /&gt;
jsdk&lt;br /&gt;
mod_ssl&lt;br /&gt;
phpmyadmin&lt;br /&gt;
mod_perl&lt;br /&gt;
tomcat&lt;br /&gt;
devel&lt;br /&gt;
php&lt;br /&gt;
mailman&lt;br /&gt;
cyrus-imap&lt;br /&gt;
squirrelmail&lt;br /&gt;
proftpd&lt;br /&gt;
mysql&lt;br /&gt;
phppgadmin&lt;br /&gt;
spamassassin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The packages will be installed in that order, so any pre-req&#039;s should be handled there.&lt;br /&gt;
&lt;br /&gt;
Now, when you run [[VPS_Management#vm|vm]] it will show you the newly-added OS and you may create a CT using it.&lt;br /&gt;
&lt;br /&gt;
The last few tasks are related to mgmt:&lt;br /&gt;
&lt;br /&gt;
1. add to mgmt-&amp;gt;reference-&amp;gt;templates (use the existing templates as an example). Once added, the new template will be included with the list of OS&#039;s available for the given HN.&lt;br /&gt;
2. if this is going to be a new OS offered for ordering, it needs to be added to the order form and webpage.&lt;br /&gt;
&lt;br /&gt;
a. to get a list of applications and versions in the new OS, you should create a test CT, enter it and run &amp;lt;tt&amp;gt;dpkg -l|sort&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;rpm -aq|sort&amp;lt;/tt&amp;gt; in centos/fedora) and enter that list in the following places:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/jc_pub/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Note, you will have to move the most recent OS data from &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt; into the corresponding &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname]_old.html&amp;lt;/tt&amp;gt; updating the version links in both.&lt;br /&gt;
&lt;br /&gt;
b. to add the new OS to the order form, you will need to update &amp;lt;tt&amp;gt;/usr/local/www/signup/html/step1.html&amp;lt;/tt&amp;gt; in several places (for regular and OSS orders) as well as updating the templateID which you can get from mgmt-&amp;gt;reference-&amp;gt;templates (or [[Management_System_/_Public_Website_/_Signup_/_Account_Manager#jc:ref_templates|jc:ref_templates]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Old method to obtain the templates:&lt;br /&gt;
&lt;br /&gt;
Go to http://www.parallels.com/en/virtuozzo/templates/catalog/&lt;br /&gt;
&lt;br /&gt;
Download the RPM&#039;s and install them&lt;br /&gt;
&lt;br /&gt;
 vzpkg list&lt;br /&gt;
to see the new packages/os templates&lt;br /&gt;
&lt;br /&gt;
 vzpkg create cache &amp;quot;OS_EZ_template_name&amp;quot;&lt;br /&gt;
to create a cache&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Update OS template =&lt;br /&gt;
&lt;br /&gt;
Installation and update of the new version of OS template will not affect the existing containers. It will affect only the new containers, created after this update operation. In terms of fixing &amp;quot;vzctl enter&amp;quot; error and SSH connectivity to Ubuntu based containers, it is necessary to recreate the template and not to update it, so the commands to run are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rpm -Uhv ubuntu-8.04-x86-ez-4.0.0-9.swsoft.noarch.rpm&lt;br /&gt;
vzpkg clean ubuntu-8.04-x86&lt;br /&gt;
vzpkg remove cache ubuntu-8.04-x86&lt;br /&gt;
vzpkg create cache ubuntu-8.04-x86&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installing new SSL cert on VZCP =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;openssl req -days 1999 -new -x509 -nodes -out server.crt -keyout server.key&lt;br /&gt;
&lt;br /&gt;
US&lt;br /&gt;
CA&lt;br /&gt;
San Diego&lt;br /&gt;
johncompanies.com&lt;br /&gt;
johncompanies.com&lt;br /&gt;
virt15ohncompanies.com&lt;br /&gt;
linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.crt/server.crt /etc/httpd/conf/ssl.crt/server.crt.bak&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.key/server.key /etc/httpd/conf/ssl.key/server.key.bak&lt;br /&gt;
cp server.crt /etc/httpd/conf/ssl.crt/server.crt&lt;br /&gt;
cp server.key /etc/httpd/conf/ssl.key/server.key&lt;br /&gt;
/etc/init.d/vzcp restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Moving virt (drives) to new hardware =&lt;br /&gt;
&lt;br /&gt;
If you have a case where a virt is dead (due to hardware failure), you can move the drives to a new hardware setup.&lt;br /&gt;
Here are the steps and things to look for:&lt;br /&gt;
&lt;br /&gt;
Move the drives to the new box. Most likely, the drives will be recognized and there will be no problems booting up. On Dell PERC 5/6 cards you will need to import the new &amp;quot;foreign&amp;quot; volume via the raid BIOS.&lt;br /&gt;
&lt;br /&gt;
If the hardware (motherboard) is different, it’s possible the nic’s won’t be recognized. Look at /etc/modules.conf the ethernet drivers are either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 tg3&lt;br /&gt;
alias eth1 tg3&amp;lt;/pre&amp;gt;&lt;br /&gt;
(supermicro)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 e100&lt;br /&gt;
alias eth1 e1000&amp;lt;/pre&amp;gt;&lt;br /&gt;
(intel)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 bnx2&lt;br /&gt;
alias eth1 bnx2&amp;lt;/pre&amp;gt;&lt;br /&gt;
(dell 29500)&lt;br /&gt;
&lt;br /&gt;
Also, you may see eth0 and eth1 swapped so if after confirming the eth devices are present (may require a reboot), then you may still need to swap the green/yellow network cables in the back to get them on the right port.&lt;br /&gt;
&lt;br /&gt;
VZ will not run (for long) on the new hardware, so you will need to get the license reissued. You may create/download a temporary license via their website for the interim.&lt;br /&gt;
&lt;br /&gt;
= Updating kernel on virt =&lt;br /&gt;
&lt;br /&gt;
We now use [[#vzup2date|vzup2date]] to update systems and kernels. What follows is what we used to do when we had to download kernels and install manually on old systems:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. install kernel and modules&lt;br /&gt;
&amp;lt;pre&amp;gt;# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \&lt;br /&gt;
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm&lt;br /&gt;
vzkernel-smp          ##################################################&lt;br /&gt;
vzmodules-smp       ##################################################&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT USE the &amp;quot;rpm -Uhv&amp;quot; command to install the kernel, otherwise all the previously installed kernels may be removed from your system. &lt;br /&gt;
&lt;br /&gt;
2. update lilo/grub&lt;br /&gt;
&lt;br /&gt;
Lilo:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lilo.conf&lt;br /&gt;
 &lt;br /&gt;
rename old Virtuozzo kernel label from &amp;quot;linux+virtuozzo&amp;quot; to &amp;quot;virtuozzo_old&amp;quot;&lt;br /&gt;
and add a new entry pointing to the newly installed virtuozzo kernel image.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;prompt&lt;br /&gt;
timeout=50&lt;br /&gt;
default=linux+virtuozzo&lt;br /&gt;
append=&amp;quot;debug panic=5 console=tty console=ttyS0,38400&amp;quot;&lt;br /&gt;
boot=/dev/sda&lt;br /&gt;
map=/boot/map&lt;br /&gt;
install=/boot/boot.b&lt;br /&gt;
message=/boot/message&lt;br /&gt;
linear&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3smp&lt;br /&gt;
        label=linux&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3smp.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3&lt;br /&gt;
        label=linux-up&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise&lt;br /&gt;
        label=2.4.20-9.5.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise&lt;br /&gt;
        label=2.4.20-9.8.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise&lt;br /&gt;
        label=2.4.20-9.21.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise&lt;br /&gt;
        label=2.4.20-9.24.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise&lt;br /&gt;
        label=2.4.20-28.3.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise&lt;br /&gt;
        label=old_linux+vz&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise&lt;br /&gt;
        label=linux+virtuozzo&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label &amp;quot;old_linux+vz &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Grub:&lt;br /&gt;
&lt;br /&gt;
 vi /boot/grub /menu.lst&lt;br /&gt;
&lt;br /&gt;
Add new entry at the top.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;serial --unit=0 --speed=38400&lt;br /&gt;
terminal --timeout=10 serial console&lt;br /&gt;
default=0&lt;br /&gt;
timeout=10&lt;br /&gt;
splashimage=(hd0,0)/boot/grub/splash.xpm.gz&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Red Hat Linux (2.4.18-3smp)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3smp.img&lt;br /&gt;
title Red Hat Linux-up (2.4.18-3)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3.img&lt;br /&gt;
title Linux with Virtuozzo 2.5&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1&lt;br /&gt;
title vz-enterpriseo&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1&lt;br /&gt;
title vz-enterprise&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. run the lilo (if using lilo)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lilo&lt;br /&gt;
Added linux&lt;br /&gt;
Added linux-up&lt;br /&gt;
Added virtuozzo_old&lt;br /&gt;
Added linux+virtuozzo *&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. reboot the server&lt;br /&gt;
 shutdown -r 23:05&lt;br /&gt;
&lt;br /&gt;
when it comes time for the shutdown, run [[VPS_Management#stopvirt|stopvirt]] to get things shut down faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Remaking service VE (&amp;lt;=3.x only) =&lt;br /&gt;
&lt;br /&gt;
Occasionally the control panel for VEs (aka VZPP) will stop working and you just need to reinstall the service VE (which runs the control panels for all VEs on the HN). Here&#039;s how that&#039;s done :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop 1&lt;br /&gt;
ipdel 1 69.55.234.152&lt;br /&gt;
vzmlocal 1:2&lt;br /&gt;
vzctl set 2 --save --onboot no&lt;br /&gt;
vzsveinstall -t redhat-as3-minimal -d /root/Rel261/HW/RPMS -s 69.55.234.152 --skip-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzsveinstall -t redhat-as3-minimal -d /vz/Rel300/HW/RPMS -s 69.55.229.151 --skip-client&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzctl mount 1&lt;br /&gt;
vzctl mount 2&lt;br /&gt;
/bin/cp -aRf /vz/root/2/home/vzagent0 /vz/root/1/home&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/lib/mysql/VZADB /vz/root/1/var/lib/mysql&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/shadow /vz/root/1/etc/&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/vzcp/static/vz/skins/ /vz/root/1/var/vzcp/static/vz&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/menu.xml  /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/dashboard.xml /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
&lt;br /&gt;
vzctl umount 2&lt;br /&gt;
vzctl umount 1&lt;br /&gt;
vzctl start 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= GRUB: boot once to a new kernel =&lt;br /&gt;
&lt;br /&gt;
To use a different kernel for the next reboot only:&lt;br /&gt;
  &amp;lt;pre&amp;gt;grub --no-floppy&lt;br /&gt;
  savedefault --default=N --once&lt;br /&gt;
  (where N is the number of the kernel you want to boot once)&lt;br /&gt;
  quit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot your machine. It will boot using kernel &amp;quot;N&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 grub-reboot N&lt;br /&gt;
will do essentially the same thing and prompt to reboot the machine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Recovering from GRUB failure =&lt;br /&gt;
&lt;br /&gt;
(example from DPE 2950)&lt;br /&gt;
&lt;br /&gt;
Boot to CEOS4 server CD (original install cd). Did this example with iso mounted via drac&lt;br /&gt;
&lt;br /&gt;
 Boot: linux rescue&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Make/edit an ISO on Linux =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mount file.iso /mnt/iso/ -t iso9660 -o ro,loop=/dev/loop0&lt;br /&gt;
mkdir /tmp/iso&lt;br /&gt;
cp -aR /mnt/iso/* /tmp/iso/&lt;br /&gt;
umount /mnt/iso/&lt;br /&gt;
mkisofs -iso-level 2 -o /tmp/new.iso /tmp/iso/&lt;br /&gt;
rm -fr /tmp/iso&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://www.damnsmalllinux.org/wiki/index.php/Installing_to_a_USB_Flash_Drive&lt;br /&gt;
&lt;br /&gt;
= Mount/edit USB drive on Linux =&lt;br /&gt;
&lt;br /&gt;
  mount -t vfat -o loop /tmp/3wfirmware.iso /mnt/usb/&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Management_System_/_Public_Website_/_Signup_/_Account_Manager&amp;diff=1043</id>
		<title>Management System / Public Website / Signup / Account Manager</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Management_System_/_Public_Website_/_Signup_/_Account_Manager&amp;diff=1043"/>
		<updated>2013-03-11T23:55:24Z</updated>

		<summary type="html">&lt;p&gt;Support: /* layout */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
These systems are all running under the same apache instance on the mail server.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main ingredients are: apache 1.3.31, mysql, perl, mod_perl and template toolkit.&lt;br /&gt;
&lt;br /&gt;
Apache is listening on 69.55.230.9 ports 80 and 443&lt;br /&gt;
&lt;br /&gt;
The webserver can be stopped with:&lt;br /&gt;
 apachectl stop&lt;br /&gt;
&lt;br /&gt;
and must be started with:&lt;br /&gt;
 apachectl startssl&lt;br /&gt;
&lt;br /&gt;
If you run &amp;lt;tt&amp;gt;apachectl start&amp;lt;/tt&amp;gt; none of the ssl-enabled pages will work.&lt;br /&gt;
&lt;br /&gt;
The database may be stopped and started as follows:&lt;br /&gt;
 /usr/local/etc/rc.d/mysql-server.sh stop&lt;br /&gt;
 /usr/local/etc/rc.d/mysql-server.sh start&lt;br /&gt;
&lt;br /&gt;
* webroot: &amp;lt;tt&amp;gt;/usr/local/www/&amp;lt;/tt&amp;gt;&lt;br /&gt;
* logs: &amp;lt;tt&amp;gt;/var/log/httpd-error.log /var/log/httpd-access.log&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Apache config: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/local/etc/apache/httpd.conf:&lt;br /&gt;
&lt;br /&gt;
-SNIP-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Directory /usr/local/www&amp;gt;&lt;br /&gt;
 Options none&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *&amp;gt;&lt;br /&gt;
  SSLDisable&lt;br /&gt;
  DocumentRoot /usr/local/www/jc_pub&lt;br /&gt;
  ServerName johncompanies.com&lt;br /&gt;
  ServerAlias www.johncompanies.com&lt;br /&gt;
  ServerAlias newwww.johncompanies.com&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/jc_pub&amp;gt;&lt;br /&gt;
    Options FollowSymLinks&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  Redirect /collocation http://www.johncompanies.com&lt;br /&gt;
  Redirect /colocation http://www.johncompanies.com&lt;br /&gt;
&lt;br /&gt;
  ScriptAlias /cgi-bin/ &amp;quot;/usr/local/www/jc_pub/cgi-bin/&amp;quot;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/jc_pub/cgi-bin&amp;gt;&lt;br /&gt;
    AllowOverride None&lt;br /&gt;
    Options None&lt;br /&gt;
    Order allow,deny&lt;br /&gt;
    Allow from all&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *&amp;gt;&lt;br /&gt;
  ServerName mini.johncompanies.com&lt;br /&gt;
  SSLDisable&lt;br /&gt;
  DocumentRoot /usr/local/www/mini&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/mini&amp;gt;&lt;br /&gt;
    Options FollowSymLinks&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  DocumentRoot &amp;quot;/usr/local/www&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  DocumentRoot /usr/local/www&lt;br /&gt;
  &amp;lt;Directory /usr/local/www&amp;gt;&lt;br /&gt;
    Deny from All&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/mgmt&amp;gt;&lt;br /&gt;
    Allow from All&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/am&amp;gt;&lt;br /&gt;
    Allow from All&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/signup&amp;gt;&lt;br /&gt;
    Allow from All&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/images&amp;gt;&lt;br /&gt;
    Allow from All&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/media&amp;gt;&lt;br /&gt;
    Allow from All&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Files favicon.ico&amp;gt;&lt;br /&gt;
    Allow from All&lt;br /&gt;
  &amp;lt;/Files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  SSLEngine on&lt;br /&gt;
  SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL&lt;br /&gt;
&lt;br /&gt;
#  SSLCertificateFile         /usr/local/etc/apache/mail.cert&lt;br /&gt;
#  SSLCertificateKeyFile     /usr/local/etc/apache/mail.key&lt;br /&gt;
  #SSLCertificateFile         /usr/local/etc/apache/ssl.crt/secure.crt&lt;br /&gt;
  SSLCertificateFile         /usr/local/etc/apache/ssl.crt/secure.johncompanies.com.crt&lt;br /&gt;
  SSLCertificateChainFile    /usr/local/etc/apache/ssl.crt/gd_bundle.crt&lt;br /&gt;
  SSLCertificateKeyFile     /usr/local/etc/apache/ssl.key/secure.key&lt;br /&gt;
&lt;br /&gt;
  PerlModule Apache&lt;br /&gt;
&lt;br /&gt;
  # debug stuff&lt;br /&gt;
  PerlWarn On&lt;br /&gt;
  PerlTaintCheck Off&lt;br /&gt;
  PerlModule Apache::StatINC&lt;br /&gt;
  PerlInitHandler Apache::Reload&lt;br /&gt;
# CustomLog /usr/local/apache/logs/access_log.mgmt common&lt;br /&gt;
# ErrorLog /usr/local/apache/logs/error_log.mgmt&lt;br /&gt;
&lt;br /&gt;
  PerlModule Apache::DBI&lt;br /&gt;
#  PerlModule Mgmt&lt;br /&gt;
#  PerlModule Auth&lt;br /&gt;
&lt;br /&gt;
  PerlSetEnv MGMT_BASE /usr/local/www/mgmt&lt;br /&gt;
  PerlSetEnv COMMON_BASE  /usr/local/www/common&lt;br /&gt;
  PerlSetEnv SIGNUP_BASE  /usr/local/www/signup&lt;br /&gt;
  PerlSetEnv AM_BASE /usr/local/www/am&lt;br /&gt;
  PerlSetEnv MGMT_INDEX /mgmt/index.html&lt;br /&gt;
  PerlSetEnv SIGNUP_INDEX /signup/step1.html&lt;br /&gt;
  PerlSetEnv AM_INDEX /am/dashboard.html&lt;br /&gt;
  PerlSetEnv MGMT_LOG_LEVEL debug&lt;br /&gt;
  PerlSetEnv MGMT_LOG_FILE /usr/local/www/mgmt/Log/mgmt.log&lt;br /&gt;
  PerlSetEnv SIGNUP_LOG_LEVEL info&lt;br /&gt;
  PerlSetEnv SIGNUP_LOG_FILE /usr/local/www/signup/Log/signup.log&lt;br /&gt;
  PerlSetEnv AM_LOG_LEVEL debug&lt;br /&gt;
  PerlSetEnv AM_LOG_FILE /usr/local/www/am/Log/am.log&lt;br /&gt;
  PerlSetEnv PP_AUTH_TOKEN Pe3aLk5GdMblAyyLAv5vNYqipcynWdZJKdw1CmcGcIdOz74ujMrDYIov27i&lt;br /&gt;
  PerlSetEnv PP_URL &#039;https://www.paypal.com/cgi-bin/webscr&#039;&lt;br /&gt;
  PerlSetEnv PP_EMAIL &#039;payments@johncompanies.com&#039;&lt;br /&gt;
  PerlSetEnv JC_DOMAIN &#039;secure.johncompanies.com&#039;&lt;br /&gt;
  PerlSetEnv CC_LOG_FILE /usr/local/www/mgmt/Log/cc.log&lt;br /&gt;
  PerlSetEnv DEV 0&lt;br /&gt;
  PerlRequire /usr/local/www/common/conf/startup.pl&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory &amp;quot;/usr/local/www/mgmt&amp;quot;&amp;gt;&lt;br /&gt;
    SetHandler perl-script&lt;br /&gt;
    PerlHandler Mgmt&lt;br /&gt;
    PerlSetVar JCMGMTPath /mgmt&lt;br /&gt;
    PerlSetVar JCMGMTLoginScript /mgmt/login.html&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;Files LOGIN&amp;gt;&lt;br /&gt;
      AuthType Auth&lt;br /&gt;
      AuthName JCMGMT&lt;br /&gt;
      SetHandler perl-script&lt;br /&gt;
      PerlHandler Auth-&amp;gt;login&lt;br /&gt;
    &amp;lt;/Files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;FilesMatch &amp;quot;.*\.html$|.*\.cgi|.*\.png&amp;quot;&amp;gt;&lt;br /&gt;
      AuthType Auth&lt;br /&gt;
      AuthName JCMGMT&lt;br /&gt;
      PerlAuthenHandler Auth-&amp;gt;authenticate&lt;br /&gt;
      PerlAuthzHandler  Auth-&amp;gt;authorize&lt;br /&gt;
      require valid-user&lt;br /&gt;
    &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory &amp;quot;/usr/local/www/am&amp;quot;&amp;gt;&lt;br /&gt;
    SetHandler perl-script&lt;br /&gt;
    PerlHandler AM&lt;br /&gt;
    PerlSetVar JCAMPath /am&lt;br /&gt;
    PerlSetVar JCAMLoginScript /am/login.html&lt;br /&gt;
    #PerlSetVar JCAMExpires +1m&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;Files LOGINAM&amp;gt;&lt;br /&gt;
     AuthType AMAuth&lt;br /&gt;
     AuthName JCAM&lt;br /&gt;
     SetHandler perl-script&lt;br /&gt;
     PerlHandler AMAuth-&amp;gt;login&lt;br /&gt;
    &amp;lt;/Files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;Files PASSRESET&amp;gt;&lt;br /&gt;
     SetHandler perl-script&lt;br /&gt;
     PerlHandler AMPassR&lt;br /&gt;
    &amp;lt;/Files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;FilesMatch &amp;quot;.*\.html$|.*\.cgi&amp;quot;&amp;gt;&lt;br /&gt;
     AuthType AMAuth&lt;br /&gt;
     AuthName JCAM&lt;br /&gt;
     PerlAuthenHandler AMAuth-&amp;gt;authenticate&lt;br /&gt;
     PerlAuthzHandler AMAuth-&amp;gt;authorize&lt;br /&gt;
     require valid-user&lt;br /&gt;
    &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/mgmt/static&amp;gt;&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/am/static&amp;gt;&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/mgmt/bwgraphs&amp;gt;&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/am/bwgraphs&amp;gt;&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/images&amp;gt;&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/media&amp;gt;&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www&amp;gt;&lt;br /&gt;
    Options FollowSymlinks&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  ScriptAlias /mgmt/cgi/ &amp;quot;/usr/local/www/mgmt/cgi/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/mgmt/cgi&amp;gt;&lt;br /&gt;
    AllowOverride None&lt;br /&gt;
    Options None&lt;br /&gt;
    Order allow,deny&lt;br /&gt;
    Allow from all&lt;br /&gt;
    SetHandler None&lt;br /&gt;
    AuthType Auth&lt;br /&gt;
    AuthName JCMGMT&lt;br /&gt;
    PerlAuthenHandler Auth-&amp;gt;authenticate&lt;br /&gt;
    PerlAuthzHandler  Auth-&amp;gt;authorize&lt;br /&gt;
    require valid-user&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory &amp;quot;/usr/local/www/signup&amp;quot;&amp;gt;&lt;br /&gt;
    SetHandler perl-script&lt;br /&gt;
    PerlHandler Signup&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  Alias /mgmt/mrtg &amp;quot;/usr/local/www/mgmt/mrtg/data&amp;quot;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/mgmt/mrtg/data/&amp;gt;&lt;br /&gt;
    DirectoryIndex index.cgi&lt;br /&gt;
    SetHandler None&lt;br /&gt;
    Options ExecCGI&lt;br /&gt;
    AddHandler cgi-script .cgi&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  Alias /mgmt/rrd &amp;quot;/usr/local/www/mgmt/mrtg/rrd&amp;quot;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/mgmt/mrtg/rrd/&amp;gt;&lt;br /&gt;
    DirectoryIndex index.html&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  ScriptAlias /mgmt/bb/cgi-bin/ /usr/home/bb/bbsrc/bb1.9i-btf/web/&lt;br /&gt;
  Alias /mgmt/bb &amp;quot;/usr/home/bb/bbsrc/bb1.9i-btf/www&amp;quot;&lt;br /&gt;
  &amp;lt;Directory /usr/home/bb/bbsrc/bb1.9i-btf/www/gifs&amp;gt;&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Directory /usr/home/bb/bbsrc/bb1.9i-btf/web&amp;gt;&lt;br /&gt;
    AllowOverride None&lt;br /&gt;
    Options None&lt;br /&gt;
    Order allow,deny&lt;br /&gt;
    Allow from all&lt;br /&gt;
    PerlSetVar JCMGMTLoginScript /mgmt/login.html&lt;br /&gt;
    AuthType Auth&lt;br /&gt;
    AuthName JCMGMT&lt;br /&gt;
    PerlAuthenHandler Auth-&amp;gt;authenticate&lt;br /&gt;
    PerlAuthzHandler  Auth-&amp;gt;authorize&lt;br /&gt;
    require valid-user&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Directory /usr/home/bb/bbsrc/bb1.9i-btf/www&amp;gt;&lt;br /&gt;
    PerlSetVar JCMGMTLoginScript /mgmt/login.html&lt;br /&gt;
    AuthType Auth&lt;br /&gt;
    AuthName JCMGMT&lt;br /&gt;
    PerlAuthenHandler Auth-&amp;gt;authenticate&lt;br /&gt;
    PerlAuthzHandler  Auth-&amp;gt;authorize&lt;br /&gt;
    require valid-user&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  Alias /mgmt/awstatsclasses &amp;quot;/usr/local/www/mgmt/awstats/wwwroot/classes/&amp;quot;&lt;br /&gt;
  Alias /mgmt/awstatscss &amp;quot;/usr/local/www/mgmt/awstats/wwwroot/css/&amp;quot;&lt;br /&gt;
  Alias /mgmt/awstatsicons &amp;quot;/usr/local/www/mgmt/awstats/wwwroot/icon/&amp;quot;&lt;br /&gt;
  ScriptAlias /mgmt/awstats/ &amp;quot;/usr/local/www/mgmt/awstats/wwwroot/cgi-bin/&amp;quot;&lt;br /&gt;
  Alias /mgmt/icon/ &amp;quot;/usr/local/www/mgmt/awstats/wwwroot/icon/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory &amp;quot;/usr/local/www/mgmt/awstats/wwwroot/icon&amp;quot;&amp;gt;&lt;br /&gt;
    SetHandler None&lt;br /&gt;
    Options Indexes MultiViews&lt;br /&gt;
    AllowOverride None&lt;br /&gt;
    Order allow,deny&lt;br /&gt;
    Allow from all&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory &amp;quot;/usr/local/www/mgmt/awstats/wwwroot&amp;quot;&amp;gt;&lt;br /&gt;
    PerlSetVar JCMGMTLoginScript /mgmt/login.html&lt;br /&gt;
    AuthType Auth&lt;br /&gt;
    AuthName JCMGMT&lt;br /&gt;
    PerlAuthenHandler Auth-&amp;gt;authenticate&lt;br /&gt;
    PerlAuthzHandler  Auth-&amp;gt;authorize&lt;br /&gt;
    require valid-user&lt;br /&gt;
    SetHandler None&lt;br /&gt;
    Options None&lt;br /&gt;
    AllowOverride None&lt;br /&gt;
    Order allow,deny&lt;br /&gt;
    Allow from all&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Template Toolkit ==&lt;br /&gt;
&lt;br /&gt;
http://www.template-toolkit.org/docs/manual/index.html&lt;br /&gt;
&lt;br /&gt;
All our dynamic content pages (i.e. anything but jcpub) makes use of the Template Toolkit (TT) framework to create/display our pages. This package allows us to create customied apache handlers via the use of mod_perl. The result is an easy to deploy, easy to develop, flexible and efficient platform.&lt;br /&gt;
&lt;br /&gt;
All these sites are organized under &amp;lt;tt&amp;gt;/usr/local/www&amp;lt;/tt&amp;gt; and consist/rely on several components:&lt;br /&gt;
&lt;br /&gt;
* common/conf/startup.pl - this contains all the use/require code that brings in all the required libraries and modules required to run our sites and TT. It is run once as apache starts up and applies to all sites.&lt;br /&gt;
&lt;br /&gt;
* common/conf/Lib - this directory contains all common libraries, primarly those dealing with database access and access to individual tables. &lt;br /&gt;
&lt;br /&gt;
* mysql:jc - the main table containing everything for mgmt/am/signup sites is contained in the &amp;lt;tt&amp;gt;jc&amp;lt;/tt&amp;gt; database. All data is accessed via the mysql user &amp;lt;tt&amp;gt;jc&amp;lt;/tt&amp;gt; - this is so we can impose restrictions on what that user may do. That access info is stored in &amp;lt;tt&amp;gt;common/Lib/DBI.pm&amp;lt;/tt&amp;gt;&lt;br /&gt;
The exception to that is the &amp;lt;tt&amp;gt;traffic&amp;lt;/tt&amp;gt; database which used to be stored on mail, but has since been exported to run locally on the bwdb server itself. i.e. mgmt/am contact the remote traffic database running elsewhere for that data. That access data is stored in &amp;lt;tt&amp;gt;common/Lib/DBI_BWDB.pm&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Part of TT&#039;s efficiency comes from static and natively compiled code/pages. Those pages are stored in:&lt;br /&gt;
* mgmt: &amp;lt;tt&amp;gt;/tmp/mgmt_templates/&amp;lt;/tt&amp;gt;&lt;br /&gt;
* am: &amp;lt;tt&amp;gt;/tmp/am_templates&amp;lt;/tt&amp;gt;&lt;br /&gt;
* signup: &amp;lt;tt&amp;gt;/tmp/signup_templates&amp;lt;/tt&amp;gt;&lt;br /&gt;
You could safely delete all of these and apache will just recreate them - though the directory holding the templates must exist, with the right permissions.&lt;br /&gt;
&lt;br /&gt;
To make editing of pages easier we enable apache modules/directives which direct apache to rebuild these pages when it notices there&#039;s a difference (httpd.conf):&lt;br /&gt;
  PerlModule Apache::StatINC&lt;br /&gt;
  PerlInitHandler Apache::Reload&lt;br /&gt;
&lt;br /&gt;
However, any changes made to anything under &amp;lt;tt&amp;gt;Lib&amp;lt;/tt&amp;gt; requires an immediate apache restart to take effect and to keep the site running- any changes w/o a restart will break the site.&lt;br /&gt;
&lt;br /&gt;
Among the directives in httpd.conf you will see a series of variables which are important as they, among other things, direct the mod_perl handlers where certain data is stored:&lt;br /&gt;
&lt;br /&gt;
This is where all the files for a particular set of pages and unique handler are located:&lt;br /&gt;
  PerlSetEnv MGMT_BASE /usr/local/www/mgmt&lt;br /&gt;
  PerlSetEnv COMMON_BASE  /usr/local/www/common&lt;br /&gt;
  PerlSetEnv SIGNUP_BASE  /usr/local/www/signup&lt;br /&gt;
  PerlSetEnv AM_BASE /usr/local/www/am&lt;br /&gt;
&lt;br /&gt;
This is the default page to present, if none is specified:&lt;br /&gt;
  PerlSetEnv MGMT_INDEX /mgmt/index.html&lt;br /&gt;
  PerlSetEnv SIGNUP_INDEX /signup/step1.html&lt;br /&gt;
  PerlSetEnv AM_INDEX /am/dashboard.html&lt;br /&gt;
&lt;br /&gt;
Indicates the verbosity and location of the handler logfile (these log files only contain logging which we do internally from our code- these differ from the apache logs which log simple hits and server errors):&lt;br /&gt;
  PerlSetEnv MGMT_LOG_LEVEL debug&lt;br /&gt;
  PerlSetEnv MGMT_LOG_FILE /usr/local/www/mgmt/Log/mgmt.log&lt;br /&gt;
  PerlSetEnv SIGNUP_LOG_LEVEL info&lt;br /&gt;
  PerlSetEnv SIGNUP_LOG_FILE /usr/local/www/signup/Log/signup.log&lt;br /&gt;
  PerlSetEnv AM_LOG_LEVEL debug&lt;br /&gt;
  PerlSetEnv AM_LOG_FILE /usr/local/www/am/Log/am.log&lt;br /&gt;
&lt;br /&gt;
Variables used for pp API access:&lt;br /&gt;
  PerlSetEnv PP_AUTH_TOKEN Pe3aLk5GdMblAyyLAv5vNYqipcynWdZJKdw1CmcGcIdOz74ujMrDYIov27i&lt;br /&gt;
  PerlSetEnv PP_URL &#039;https://www.paypal.com/cgi-bin/webscr&#039;&lt;br /&gt;
  PerlSetEnv PP_EMAIL &#039;payments@johncompanies.com&#039;&lt;br /&gt;
&lt;br /&gt;
Our base url:&lt;br /&gt;
  PerlSetEnv JC_DOMAIN &#039;secure.johncompanies.com&#039;&lt;br /&gt;
&lt;br /&gt;
Our credit card info logging file:&lt;br /&gt;
  PerlSetEnv CC_LOG_FILE /usr/local/www/mgmt/Log/cc.log&lt;br /&gt;
&lt;br /&gt;
Indicates we are/not in a dev environment:&lt;br /&gt;
  PerlSetEnv DEV 0&lt;br /&gt;
&lt;br /&gt;
= Public Website (jcpub) =&lt;br /&gt;
&lt;br /&gt;
* domain: &amp;lt;tt&amp;gt;http://www.johncompanies.com http://johncompanies.com&amp;lt;/tt&amp;gt;&lt;br /&gt;
* webroot: &amp;lt;tt&amp;gt;/usr/local/www/jc_pub&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our public-facing website is all static, standard HTML. We have some light javascripting on some pages, but by in large it&#039;s a very WYSIWYG site setup.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Signup (signup) =&lt;br /&gt;
== Setup / organization / notes ==&lt;br /&gt;
&lt;br /&gt;
* domain: &amp;lt;tt&amp;gt;https://secure.johncompanies.com/signup/step1.html&amp;lt;/tt&amp;gt;&lt;br /&gt;
* webroot: &amp;lt;tt&amp;gt;/usr/local/www/signup&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Directory structure:&lt;br /&gt;
* am: contains the main handler &amp;lt;tt&amp;gt;Signup.pm&amp;lt;/tt&amp;gt; and the ipn activity log &amp;lt;tt&amp;gt;ipn.log&amp;lt;/tt&amp;gt;&lt;br /&gt;
* signup/Lib: contains the log module &amp;lt;tt&amp;gt;SLog.pm&amp;lt;/tt&amp;gt;&lt;br /&gt;
* signup/Log: contains the log &amp;lt;tt&amp;gt;signup.log&amp;lt;/tt&amp;gt;, and cardit card activity log &amp;lt;tt&amp;gt;cc.log&amp;lt;/tt&amp;gt;&lt;br /&gt;
* signup/Plugin: contains the plugin module &amp;lt;tt&amp;gt;AMP.pm&amp;lt;/tt&amp;gt; and the form fill in module &amp;lt;tt&amp;gt;FillInForm.pm&amp;lt;/tt&amp;gt;&lt;br /&gt;
* signup/html: contains all web pages&lt;br /&gt;
&lt;br /&gt;
=== Usage - server order ===&lt;br /&gt;
&lt;br /&gt;
Once a customer leaves our public site and visits any page under https://secure.johncompanies.com/signup/ they are in the signup section of our site. There isn&#039;t a strict rule that all these pages are signup-related, for instance there are some pages related to payments that run in the signup namespace. This is for convenience since this codebase doesn&#039;t require a login/authentication.&lt;br /&gt;
&lt;br /&gt;
The signup code primarly deals with the ordering process. Customers entering the signup process via https://secure.johncompanies.com/signup/step1.html will have the ability to order any product. Several links throughout our site pass optional parameters to this page to pre-select the product the customer has selected. For instance, a link to order a linux package looks like https://secure.johncompanies.com/signup/step1.html?svc=linux&lt;br /&gt;
&lt;br /&gt;
In step 1 the customer is prompted to select the package/service level, their OS, any backup space (a la carte), ownership info and contact info. All customers must provide a billing and admin (technical) contact- both may be the same person. They may also (optionally) provide an alternate contact for the billing and admin contacts. What this means is if we are unable to reach them (perhaps due to some outage on their server, where their primary email is hosted) this is how we&#039;d reach them. They must provide at least 1 non-alternate billing and admin contact (i.e. if they provide just 1 contact and mark it billing and admin, it cannot also be marked alternate. They would need to add another contact and mark it as alternate.)&lt;br /&gt;
&lt;br /&gt;
To update the packages available or OS choices for colo&#039;s, edit:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;signup/html/step1.html&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When editing the OS templates for VPSs, make sure the values for the input options matches the existing template_id (jc:ref_templates.template_id). Also remember that there are 2 sets of linux and freebsd order options to edit (1 normal and 1 oss discount).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In step 2 the customer is prompted for more info based upon their service selection:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
any server:&lt;br /&gt;
* hostname&lt;br /&gt;
* ips - if the package allows add-on ips they are given the option to purchase more&lt;br /&gt;
* bandwidth - they are given the option to purchase additional bandwidth&lt;br /&gt;
* bandwidth overage - they are prompted to choose from 3 options for when they use all their bandwidth in a given month: 1. stop traffic, 2. bill for additional usage up to an amount they specify, 3. allow unlimited bandwidth and bill accordingly&lt;br /&gt;
* payment method (cc, paypal, echeck (paypal), invoice)&lt;br /&gt;
* existing customer - we ask if they are an existing customer so we know if this server order is new or a replacement on an existing account or if it is to be set up under a new account&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vps:&lt;br /&gt;
* disk space - if the package allows add-on space they are given the option to purchase more&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
colo: &lt;br /&gt;
* time zone to set the server to&lt;br /&gt;
* # ips to assign initially, and a reason to assign more&lt;br /&gt;
* disk partitioning (this should add up to the amount of the disk included with the system)&lt;br /&gt;
* special instructions&lt;br /&gt;
* (nfs) backup space - provided the option to purchase extra a la carte&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In step 3 they are shown the total price for the selected services and given the choice of billing intervals: 1/6/12 months. Discounts and savings are displayed. They are requested to tell us how they found us here. However, if they indicated they were an existing customer on step 2 and they are replacing or adding to an existing account, they are also prompted for info:&lt;br /&gt;
* hostname/ip of the server being replaced or the account to which we are adding the server&lt;br /&gt;
* selection of a new, permanent ip or a temporary ip&lt;br /&gt;
* how to handle the information provided in the signup in regards to existing data on file (replace/merge)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In step 4 they are shown a summary of the entire order, and prompted to accept our TOS.&lt;br /&gt;
Once they submit this page, their signup is registered regardless of whether they go on to make payment.&lt;br /&gt;
&lt;br /&gt;
The next step depends on their selected payment option. If they are paying via credit card they are prompted to enter their card info, then shown a payment confirmation screen upon successful payment.&lt;br /&gt;
&lt;br /&gt;
If they are paying via paypal, they&#039;re sent off to paypal to setup payment, then returned to our site to complete the payment and shown a payment confirmation screen upon successful payment.&lt;br /&gt;
&lt;br /&gt;
Note on payment- they can reload this page and it will not result in a reorder, in fact they cannot go back and accidentally reorder at all. If the customer is ording a colo no payment is taken, rather we do an authorization or setup their paypal payment, but we don&#039;t actually take funds until the server is in service.&lt;br /&gt;
&lt;br /&gt;
=== Usage - colo quote ===&lt;br /&gt;
&lt;br /&gt;
Another facility provided by the signup code is our colo quote tool. A customer visiting this page https://secure.johncompanies.com/signup/colo_quote.html is able to request a quote on a customized server. The requests end up in the New Signups section of mgmt. Once responded to, the customer is given a special signup link which leads them into the signup process where they may order the customized server.&lt;br /&gt;
&lt;br /&gt;
In the colo quote tool they are asked to provide:&lt;br /&gt;
* processor&lt;br /&gt;
* RAM&lt;br /&gt;
* raid level&lt;br /&gt;
* drive size&lt;br /&gt;
* IPs&lt;br /&gt;
* bandwidth&lt;br /&gt;
* nfs backup space&lt;br /&gt;
* OS&lt;br /&gt;
* requested delivery date&lt;br /&gt;
* OS install option (JC-installed or self-install via IPKVM)&lt;br /&gt;
* current customer Y/N&lt;br /&gt;
* referral source&lt;br /&gt;
* comments/questions&lt;br /&gt;
&lt;br /&gt;
To update the list of OS&#039;s or the hardware options, you&#039;ll edit:&lt;br /&gt;
&amp;lt;tt&amp;gt;signup/html/colo_quote.html&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As long as the field names don&#039;t change, this will not break compatibility with the quote build tool in mgmt.&lt;br /&gt;
&lt;br /&gt;
= Management System (mgmt) =&lt;br /&gt;
== Setup / organization / notes ==&lt;br /&gt;
&lt;br /&gt;
* domain: &amp;lt;tt&amp;gt;https://secure.johncompanies.com/mgmt&amp;lt;/tt&amp;gt;&lt;br /&gt;
* webroot: &amp;lt;tt&amp;gt;/usr/local/www/mgmt&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Directory structure:&lt;br /&gt;
* mgmt: contains the main handler &amp;lt;tt&amp;gt;Mgmt.pm&amp;lt;/tt&amp;gt; and the authentication (&amp;lt;tt&amp;gt;Auth.pm&amp;lt;/tt&amp;gt;) handler, the bigbrother status file &amp;lt;tt&amp;gt;bb.html&amp;lt;/tt&amp;gt;, the credit card gpg key &amp;lt;tt&amp;gt;pubring.gpg&amp;lt;/tt&amp;gt;&lt;br /&gt;
* mgmt/Lib: contains the log module &amp;lt;tt&amp;gt;MLog.pm&amp;lt;/tt&amp;gt;&lt;br /&gt;
* mgmt/Log: contains the log &amp;lt;tt&amp;gt;am.log&amp;lt;/tt&amp;gt;, and ats activity log &amp;lt;tt&amp;gt;ats.log&amp;lt;/tt&amp;gt;&lt;br /&gt;
* mgmt/Plugin: contains the plugins required for the various mgmt pages&lt;br /&gt;
* mgmt/html: contains all web pages&lt;br /&gt;
* mgmt/static: contains static, non-interpreted content like graphics and javascripts&lt;br /&gt;
* mgmt/awstats: our stats package. Not controlled by TT, just lives here so you have to authenticate in mgmt to see it&lt;br /&gt;
* mgmt/bwgraphs: deprecated? b/w graphing libraries and code&lt;br /&gt;
* mgmt/mrtg: mrtg graphs. Not controlled by TT, just lives here so you have to authenticate in mgmt to see it&lt;br /&gt;
&lt;br /&gt;
All functions located in mgmt are password-protected. Once you&#039;re logged in, as long as you keep your browser open (maintain session cookie) you will not need to login again. Users are authenticated via table: &amp;lt;tt&amp;gt;jc.users&amp;lt;/tt&amp;gt; To add users or change password, update this table.&lt;br /&gt;
&lt;br /&gt;
=== menu ===&lt;br /&gt;
&lt;br /&gt;
==== layout ====&lt;br /&gt;
&lt;br /&gt;
* Pastes&lt;br /&gt;
This link is twofold: first it is a dropdown menu of some frequently-used responses to customer questions. Clicking on any of these items will copy the text of the response into your clipboard- provided you are running in a compatible browser (IE). Clicking on the &amp;quot;Pastes&amp;quot; button itself will open up a new window containing many more pastes. Clicking on the links at the top will also copy in the text, which you may review in the page below. &lt;br /&gt;
&lt;br /&gt;
Updating: &amp;lt;tt&amp;gt;mgmt/html/pastes.html&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Load  &lt;br /&gt;
Opens up a new window showing mrtg-style load figures for all our hardware, and network traffic for several important servers (firewall, backup). Clicking on each graph drills down for more data.&amp;lt;br&amp;gt;&lt;br /&gt;
See [[#mrtg|mrtg]]&lt;br /&gt;
&lt;br /&gt;
* BigBrother &lt;br /&gt;
Opens up a new window to the Big Brother monitoring system.&amp;lt;br&amp;gt;&lt;br /&gt;
See [[BigBrother|BigBrother]]&lt;br /&gt;
&lt;br /&gt;
* New Signups &lt;br /&gt;
Opens up a new window to the order processing page.&amp;lt;br&amp;gt;&lt;br /&gt;
See [[#New_Signups|New Signups]]&lt;br /&gt;
&lt;br /&gt;
* PayFlow&lt;br /&gt;
Opens up a new window to the the PayFlow manager.&lt;br /&gt;
See [[Payment_System#PayFlow|PayFlow]]&lt;br /&gt;
&lt;br /&gt;
* Cabinet map&lt;br /&gt;
Opens up a new window to the [[Cabinetmap|cabinet map]] in this wiki&lt;br /&gt;
&lt;br /&gt;
* Monitoring&lt;br /&gt;
Opens up windows to monitor the following:&amp;lt;br&amp;gt;&lt;br /&gt;
ATS - monitor/manage ATSs at i2b. See [[#ats|ATS control]]&amp;lt;br&amp;gt;&lt;br /&gt;
Backups - monitor the size and timing of backups running from our servers to backup1. See [[#backupmonitor|backup monitoring]]&amp;lt;br&amp;gt;&lt;br /&gt;
Colo Monitor - a bb instance that only monitors customers who have requested/receive the service. See [[BigBrother#monitor.johncompanies.com|monitor.johncompanies.com]]&amp;lt;br&amp;gt;&lt;br /&gt;
ATS-n - the web-based interface for the ATS. See [[ATS|ATS]]&amp;lt;br&amp;gt;&lt;br /&gt;
Switches - mrtg pages for our switches&amp;lt;br&amp;gt;&lt;br /&gt;
System Counts - display&#039;s how many VPSs are on each system (according to the database- may not be 100% accurate)&amp;lt;br&amp;gt;&lt;br /&gt;
XX VZPP - VZPP (Virtuozzo Power Panel) for each server. See [[Virtuozzo_Reference|Virtuozzo Reference]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Payments&lt;br /&gt;
Paypal history - takes you to the paypal page where you can do advanced searches based on email/subid/txnid&amp;lt;br&amp;gt;&lt;br /&gt;
2Checkout V2 - 2Checkout site&amp;lt;br&amp;gt;&lt;br /&gt;
Invoice Pmt Entry - allows easy entry of payments for any customer paying via invoice&amp;lt;br&amp;gt;&lt;br /&gt;
Arrears list - shows customers who have a balance due&amp;lt;br&amp;gt;&lt;br /&gt;
Pmt notices - shows outstanding payment invoices, primarily for customers paying via paypal&amp;lt;br&amp;gt;&lt;br /&gt;
Pfp batch - shows items pending processing via payflow. See [[#pfp_batch|pfp_batch]]&amp;lt;br&amp;gt;&lt;br /&gt;
Payment links - deprecated&amp;lt;br&amp;gt;&lt;br /&gt;
Payment audit - show(ed) discrepancies between pp sub and billing sub&amp;lt;br&amp;gt;&lt;br /&gt;
Packages - shows all our current/past packages. See [[#pkgs|packages]]&amp;lt;br&amp;gt;&lt;br /&gt;
Orphaned R.pmts - shows all paypal subs in the system which are not associated with an account. These should only/all be from people who signed up for payment fraudulently, and all subs should be in cancelled/disabled state. The only real reason to visit this page is in the case of a customer who is adding a server and who&#039;s signed up, you would link his paypal sub to his account here.&amp;lt;br&amp;gt;&lt;br /&gt;
IPN Input - allows you to manually input a paypal IPN into our system&amp;lt;br&amp;gt;&lt;br /&gt;
Request pmt - broken. ??&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Reference&lt;br /&gt;
IPKVM - links to our IPKVMs. See [[IPKVM|IPKVM]]&amp;lt;br&amp;gt;&lt;br /&gt;
VZ Ticket - submit a trouble ticket for help with VZ. See [[Virtuozzo_/_Linux_Reference#getting_help|getting help]]&amp;lt;br&amp;gt;&lt;br /&gt;
IP Map - display&#039;s ip allocation information. See [[#ipmap|ipmap]]&amp;lt;br&amp;gt;&lt;br /&gt;
Acct Mgr - quick link to the [[#Account_Manager_.28AM.29|Account Manager]]&amp;lt;br&amp;gt;&lt;br /&gt;
Asset DB - our asset database. See [[#asset_database|asset database]]&amp;lt;br&amp;gt;&lt;br /&gt;
Bandwidth - bandwidth query page. See [[Bandwidth_Management#Reporting|Reporting]]&amp;lt;br&amp;gt;&lt;br /&gt;
Web stats - awstats page&amp;lt;br&amp;gt;&lt;br /&gt;
Domaintools - handy whois resource&amp;lt;br&amp;gt;&lt;br /&gt;
CrashLog - tool to log the details of a crash. See [[#crash_log|crash log]]&amp;lt;br&amp;gt;&lt;br /&gt;
DosLog - tool to log the details of a dos attack. See [[#dos_log|dos log]]&amp;lt;br&amp;gt;&lt;br /&gt;
URL: Linux VPS - takes you right to the linux vps order page&amp;lt;br&amp;gt;&lt;br /&gt;
URL: FreeBSD VPS - takes you right to the linux freebsd order page&amp;lt;br&amp;gt;&lt;br /&gt;
URL: Dedicated - takes you right to the dedicated server order page&amp;lt;br&amp;gt;&lt;br /&gt;
Notices - takes you to the notices tool. See [[#notices|notices]]&amp;lt;br&amp;gt;&lt;br /&gt;
Templates - template management/tracking. See [[#templates|templates]]&amp;lt;br&amp;gt;&lt;br /&gt;
VZ Reference - VZ reference/knowledge base at the parallels website&amp;lt;br&amp;gt;&lt;br /&gt;
VZ Templates - template repository at parallels website. The best method for installing new templates is &amp;lt;tt&amp;gt;vzup2date&amp;lt;/tt&amp;gt;. See [[Virtuozzo_Reference#adding_new_templates|adding new templates]]&amp;lt;br&amp;gt;&lt;br /&gt;
Bugzilla - our bugzilla site&amp;lt;br&amp;gt;&lt;br /&gt;
redit.com - customer portal at redit. Get realtime bandwidth and cabinet power usage&amp;lt;br&amp;gt;&lt;br /&gt;
Manual - old/deprecated&amp;lt;br&amp;gt;&lt;br /&gt;
johncompanies.com - our website&amp;lt;br&amp;gt;&lt;br /&gt;
Linux welcome - generic welcome email&amp;lt;br&amp;gt;&lt;br /&gt;
BSD welcome - freebsd welcome email&amp;lt;br&amp;gt;&lt;br /&gt;
Debian welcome - debian/ubuntu welcome email&amp;lt;br&amp;gt;&lt;br /&gt;
Spam check - site to check if an ip is blacklisted&amp;lt;br&amp;gt;&lt;br /&gt;
DEV mgmt - mgmt site on dev server&amp;lt;br&amp;gt;&lt;br /&gt;
DEV am - AM on dev server&amp;lt;br&amp;gt;&lt;br /&gt;
DEV jcpub - public site on dev server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Wiki&lt;br /&gt;
This.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== editing ====&lt;br /&gt;
The dropdown menu is driven by a couple files:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mgmt/static/HM_Arrays.js&amp;lt;br&amp;gt;&lt;br /&gt;
mgmt/static/HM_Loader.js&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to change or add menu items, edit HM_Arrays.js&amp;lt;br&amp;gt;&lt;br /&gt;
covering every topic would be lengthy but here are some tips:&lt;br /&gt;
&lt;br /&gt;
* in each section, each entry but the last must end with a comma&lt;br /&gt;
* each entry is formatted: &amp;lt;tt&amp;gt;[&amp;quot;name&amp;quot;, action, 1,0,N]&amp;lt;/tt&amp;gt; where N is 0 that means this is a simple button, when N is 1 it is a dropdown and another menu is attached.&lt;br /&gt;
* in the case of the first, top-level group:&lt;br /&gt;
&amp;lt;pre&amp;gt;[&amp;quot;Pastes&amp;quot;,&amp;quot;JavaScript:win1=window.open(&#039;&#039;,&#039;win1&#039;); win1.location=&#039;https://secure.johncompanies.com/mgmt/pastes.html&#039;; void(0)&amp;quot;,1,0,1],&lt;br /&gt;
[&amp;quot;Load&amp;quot;,&amp;quot;JavaScript:win7=window.open(&#039;&#039;,&#039;win7&#039;); win7.location=&#039;https://secure.johncompanies.com/mgmt/mrtg/index.cgi&#039;; void(0)&amp;quot;,1,0,0],&lt;br /&gt;
[&amp;quot;BigBrother&amp;quot;,&amp;quot;JavaScript:win9=window.open(&#039;&#039;,&#039;win9&#039;); win9.location=&#039;https://secure.johncompanies.com/mgmt/bb/&#039;; void(0)&amp;quot;,1,0,0],&lt;br /&gt;
[&amp;quot;New Signups&amp;quot;,&amp;quot;https://secure.johncompanies.com/mgmt/pending.html&amp;quot;,1,0,0],&lt;br /&gt;
[&amp;quot;PayFlow&amp;quot;,&amp;quot;JavaScript:winpf=window.open(&#039;&#039;,&#039;winpf&#039;); winpf.location=&#039;https://manager.paypal.com/&#039;; void(0)&amp;quot;,1,0,0],&lt;br /&gt;
[&amp;quot;Cabinet map&amp;quot;,&amp;quot;JavaScript:win25=window.open(&#039;&#039;,&#039;win25&#039;); win25.location=&#039;https://secure.johncompanies.com/mgmt/cabinetmap.html&#039;; void(0)&amp;quot;,1,0,0],&lt;br /&gt;
[&amp;quot;Monitoring&amp;quot;,&amp;quot;&amp;quot;,1,0,1],&lt;br /&gt;
[&amp;quot;Payments&amp;quot;,&amp;quot;&amp;quot;,1,0,1],&lt;br /&gt;
[&amp;quot;Reference&amp;quot;,&amp;quot;&amp;quot;,1,0,1],&lt;br /&gt;
[&amp;quot;Wiki&amp;quot;,&amp;quot;JavaScript:winwiki=window.open(&#039;&#039;,&#039;winwiki&#039;); winwiki.location=&#039;https://wiki.johncompanies.com/&#039;; void(0)&amp;quot;,1,0,0]&lt;br /&gt;
],&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You see that Pastes is the first menu item and that it has a submenu. That submenu is defined in the &amp;lt;tt&amp;gt;HM_Array2_1&amp;lt;/tt&amp;gt; array. Likewise, the 7th menu item, Monitoring, has a submenu defined in &amp;lt;tt&amp;gt;HM_Array2_7&amp;lt;/tt&amp;gt;. And that furter has nested menus, the first item in the Monitoring dropdown has a nested menu in &amp;lt;tt&amp;gt;HM_Array2_7_1&amp;lt;/tt&amp;gt; , and the 13th item in &amp;lt;tt&amp;gt;HM_Array2_7_13&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* when setting a window to open a new window (most menu items) it&#039;s important to keep track of the window name if you want each link to open a unique window. i.e. &amp;lt;tt&amp;gt;JavaScript:win10a=window.open(&#039;&#039;,&#039;win10a&#039;...&amp;lt;/tt&amp;gt; make the &amp;lt;tt&amp;gt;win10a&amp;lt;/tt&amp;gt; name is unique.&lt;br /&gt;
&lt;br /&gt;
== Searching ==&lt;br /&gt;
&lt;br /&gt;
== Customer main view page ==&lt;br /&gt;
Most interaction in mgmt is done on or from the main customer page. This is the main landing page you&#039;ll get if you&#039;re searching for a customer. From this page you can see and edit:&lt;br /&gt;
&lt;br /&gt;
* systems/services &lt;br /&gt;
* ownership info&lt;br /&gt;
* bandwidth usage info&lt;br /&gt;
* contact info&lt;br /&gt;
* billing info&lt;br /&gt;
&lt;br /&gt;
=== Systems ===&lt;br /&gt;
This table displays the systems and services to which a customer has subscribed. Depending on the type of system, certain data will appear. Namely:&lt;br /&gt;
* hostname&lt;br /&gt;
* root directory (VPS only)&lt;br /&gt;
* OS (VPS only)&lt;br /&gt;
* disk space allocated (VPS only)&lt;br /&gt;
* CT id (linux VPS only)&lt;br /&gt;
* sysid&lt;br /&gt;
* IPs &lt;br /&gt;
* dates of start/cancel/stop&lt;br /&gt;
* package ID/smount+interval/next bill date&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Any item black and underlined (this goes for anything in mgmt) is clickable and will copy into your clipboard (IE only). Items in this table with special background coloring indicates:&lt;br /&gt;
* grey = cancelled system. To un-stop a system, databases need to be manually edited- so be careful.&lt;br /&gt;
* blue = monotired by castle. If you uncheck and save the monitor flag (in the system edit screen), you must also update the tracking sheet (a0, p4). Before setting up a probe with castle, make sure that there are no notes indicating the customer has previously requested not to be monitored (&amp;quot;don&#039;t monitor&amp;quot;), or “can&#039;t monitor” which means castle just can&#039;t monitor them for some reason. &lt;br /&gt;
* yellow = pending shutdown  (cancel date set)&lt;br /&gt;
&lt;br /&gt;
To setup the system for (future) cancel, click the &amp;quot;cancel&amp;quot; link. You will be prompted to provide a cancel date. This will indicate the date you intend to shut down the system. Usually this is in the future since the customer pre-pays for service. Also, you want to set at least 1 day in the future to allow the customer to get the &amp;quot;[[System-generated_Notifications#.22IMPORTANT_REMINDER_-_SYSTEM_SHUT_DOWN_TODAY.22|Shutdown today]]&amp;quot; email, clueing them in to the fact that their server is going away. The 2 quick links for 5-days and 10-days will set the date in the future (5 or 10 days), both optimized to allow the customer to receive the shutdown reminder notices. If you want the customer not to receive shutdown reminder notices, you should set that field to no. If you want to un-cancel a system, go into the edit screen and remove/clear the cancel date.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When a system has been shut down (or pulled from the rack in the case of a colo), click the &amp;quot;stop&amp;quot; link and set the date it was stopped. If this is the last active system on the account, it will mark the customer cancelled &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To edit aspects of the system click the &amp;quot;edit&amp;quot; link under the &amp;quot;actions&amp;quot; column.&lt;br /&gt;
&lt;br /&gt;
==== edit ====&lt;br /&gt;
From this screen you may edit most if not all aspects of the system in question. &lt;br /&gt;
* machine - pretty simple, what host is the VPS on or is this a (jc owned) managedcolo or (customer owned) colo &lt;br /&gt;
* directory - (VPS only) where the VPS is located on the host&lt;br /&gt;
* disk - (VPS only) how much they actually have. If you need to set this higher, edit systems.disk&lt;br /&gt;
* hostname&lt;br /&gt;
* veid - linux (VPS only) aka CT id&lt;br /&gt;
* os tempalte - (VPS only) this will auto-populate with the templates/os on the host selected in the machine field. To add templates you need to do so via the [[#Templates|Templates]] page&lt;br /&gt;
* password - (VPS only) if this is not set this system was setup with our universal/standard password: p455agfa or 8ico2987&lt;br /&gt;
* ats port - (colo only) port and ATS to which this server is connected&lt;br /&gt;
* cabinet - (colo only) location of colo&lt;br /&gt;
* ips - ips assigned to server and the ability to assign more (space delimited if adding mult). A handy link will open ipmap and clicking ips should copy back the ip to the new ip field.&lt;br /&gt;
* dates - start/stop/cancel&lt;br /&gt;
* monitored - indicate whether this system is on castle&#039;s probe map&lt;br /&gt;
* base, disk, ip packages - adjust all aspects of packages. If a field is red that means there&#039;s a mismatch between what the customer has and what the package covers. i.e. if they have 50 GB of disk and the package only gives 30, you&#039;d need to add a disk package for 20 GB or adjust the base package to include 50 GB. Anything yellow indicates an altered/custom value. i.e. if the package comes with 6 IPs and you set it to 5, that will be highlighted in yellow. Or if the price was $19 and you make it $17, prices will be yellow&#039;d. Green fields in the Totals row indicate a good matchup for the given attribute (i.e. disk allocated to server is the same as disk provided by package(s)). &lt;br /&gt;
&lt;br /&gt;
If you are moving a customer to a new machine, that may be done here- the old machine will be marked as stopped and show up as an additional row in the view screen. So really that is a stop and add operation behind the scenes in mgmt.&lt;br /&gt;
&lt;br /&gt;
==== add ====&lt;br /&gt;
&lt;br /&gt;
This works very similar to edit, and like it implies will add a new system to the customer.&lt;br /&gt;
&lt;br /&gt;
=== Owner Info ===&lt;br /&gt;
&lt;br /&gt;
=== Contact Info ===&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
&lt;br /&gt;
=== Bandwidth ===&lt;br /&gt;
&lt;br /&gt;
=== Billing History ===&lt;br /&gt;
&lt;br /&gt;
=== Payment Sources ===&lt;br /&gt;
&lt;br /&gt;
=== Outstanding Invoices ===&lt;br /&gt;
&lt;br /&gt;
=== (Legacy) Billing ===&lt;br /&gt;
&lt;br /&gt;
=== (Legacy) Recurring Payments ===&lt;br /&gt;
&lt;br /&gt;
== ats ==&lt;br /&gt;
&lt;br /&gt;
== backupmonitor ==&lt;br /&gt;
&lt;br /&gt;
== asset database ==&lt;br /&gt;
&lt;br /&gt;
== crash log ==&lt;br /&gt;
&lt;br /&gt;
== dos log ==&lt;br /&gt;
&lt;br /&gt;
== notices ==&lt;br /&gt;
&lt;br /&gt;
== New Signups ==&lt;br /&gt;
&lt;br /&gt;
== Templates ==&lt;br /&gt;
&lt;br /&gt;
== mrtg ==&lt;br /&gt;
* domain: &amp;lt;tt&amp;gt;https://secure.johncompanies.com/mgmt/mrtg/index.cgi/ https://secure.johncompanies.com/mgmt/mrtg/switch.cgi?s=switch-p3&amp;amp;path=&amp;lt;/tt&amp;gt;&lt;br /&gt;
* webroot: &amp;lt;tt&amp;gt;/usr/local/www/mgmt/mrtg&amp;lt;/tt&amp;gt;&lt;br /&gt;
All configuration is done via *.cfg files. The main load graph is found in mrtg1.cfg&lt;br /&gt;
All other config files are for various switches. Switch config files are rebuilt out of a cron jobs running on mail. This ensures if we change a port name (desc) that the mrtg we look at has the latest info. So if you want to change port naming, please do it in the switch itself. If you have problems getting new devices setup or change existing devices you may need to change permissions on the cfg file as well as the data file in &amp;lt;tt&amp;gt;/usr/local/www/mgmt/mrtg/data&amp;lt;/tt&amp;gt;, including removal of the rrd file if necessary.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Lock wait timeout exceeded&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
delete error - Can&#039;t delete a2206e24: DBD::mysql::st execute failed: Lock wait timeout exceeded; try restarting transaction [for Statement &amp;quot;DELETE FROM invoice WHERE inv_ref=? &amp;quot;] at /usr/local/lib/perl5/site_perl/5.6.1/DBIx/ContextualFetch.pm line 51. at /usr/local/www/mgmt/Plugin/Billing.pm line 1934&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result of an unclean submit/commit. Usually from an error or a double click on something that should have been single click. To clear this up, restart the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mail /usr/local/www/scripts# /usr/local/etc/rc.d/mysql-server.sh stop&lt;br /&gt;
mysqldmail /usr/local/www/scripts#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It takes a minute to shutdown. I keep running the command until it says it isn&#039;t running, then I start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mail /usr/local/www/scripts# /usr/local/etc/rc.d/mysql-server.sh stop&lt;br /&gt;
 mysqldmail /usr/local/www/scripts# /usr/local/etc/rc.d/mysql-server.sh stop&lt;br /&gt;
 mysqldmail /usr/local/www/scripts# /usr/local/etc/rc.d/mysql-server.sh stop&lt;br /&gt;
mysql-server isn&#039;t running&lt;br /&gt;
mail /usr/local/www/scripts# /usr/local/etc/rc.d/mysql-server.sh start&lt;br /&gt;
 mysqldmail /usr/local/www/scripts#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Account Manager (AM) =&lt;br /&gt;
== Setup / organization / notes ==&lt;br /&gt;
&lt;br /&gt;
* domain: &amp;lt;tt&amp;gt;https://secure.johncompanies.com/am&amp;lt;/tt&amp;gt;&lt;br /&gt;
* webroot: &amp;lt;tt&amp;gt;/usr/local/www/am&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Directory structure:&lt;br /&gt;
* am: contains the main handler &amp;lt;tt&amp;gt;AM.pm&amp;lt;/tt&amp;gt;, the authentication (&amp;lt;tt&amp;gt;AMAuth.pm&amp;lt;/tt&amp;gt;), and password reset (&amp;lt;tt&amp;gt;AMPassR.pm&amp;lt;/tt&amp;gt;) handlers&lt;br /&gt;
* am/Lib: contains the log module &amp;lt;tt&amp;gt;AMLog.pm&amp;lt;/tt&amp;gt;&lt;br /&gt;
* am/Log: contains the log &amp;lt;tt&amp;gt;am.log&amp;lt;/tt&amp;gt;, and ats activity log &amp;lt;tt&amp;gt;ats.log&amp;lt;/tt&amp;gt;&lt;br /&gt;
* am/Plugin: contains the plugin module &amp;lt;tt&amp;gt;AMP.pm&amp;lt;/tt&amp;gt; and the form fill in module &amp;lt;tt&amp;gt;FillInForm.pm&amp;lt;/tt&amp;gt;&lt;br /&gt;
* am/html: contains all web pages&lt;br /&gt;
* am/static: contains static, non-interpreted content like graphics and javascripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Account Manager was designed and intended to allow customers to do the following:&lt;br /&gt;
* see their services and various details about it&lt;br /&gt;
** IP&lt;br /&gt;
** type service&lt;br /&gt;
** cost of service&lt;br /&gt;
** link to control panel (virtuozzo CT only)&lt;br /&gt;
* to manage their service level&lt;br /&gt;
* to power cycle their server (if at i2b)&lt;br /&gt;
* to see their bandwidth usage and allocation&lt;br /&gt;
* to manage their contact info&lt;br /&gt;
* to review their billing history&lt;br /&gt;
* to update their billing method info&lt;br /&gt;
&lt;br /&gt;
It is accessed via our secure website. Customers must login using their CID (colNNNNN) and a password which is created specifically for use with the AM. It is not tied in any way to their server, though some customers may be confused by that or think that changing the password in one location will affect the other.&lt;br /&gt;
&lt;br /&gt;
JC staff may login to any customer&#039;s AM by using a special (all access) password.&lt;br /&gt;
&lt;br /&gt;
In order to access the AM for any given customer, a few things must be in place:&lt;br /&gt;
# they must have a password issued for their AM access. In order to determine if a password has been set you can look at the &amp;quot;AM pass&amp;quot; (jc:customers.am_auth) field in the customer&#039;s page in mgmt. If it says &amp;quot;(hidden)&amp;quot; a password has been established. If instead you see 3 links:&amp;lt;br&amp;gt;reset activate&amp;lt;br&amp;gt;activate+email&amp;lt;br&amp;gt;that means the customer has no password and access has not been enabled.&lt;br /&gt;
# the &amp;quot;owner email&amp;quot; (jc:customers.owner_email) field must contain the owner&#039;s email address. If a customer has been issued the pass to their AM but an owner email has not been selected, they will be prompted to select one from the existing contacts upon logging in for the first time. The selected owner will be emailed. It&#039;s for this reason that if you access the AM for a customer with the global pass, you should make sure a owner has been selected before hand (enter the info in mgmt) and don&#039;t select it in the AM, lest you want them to get a random email.&lt;br /&gt;
&lt;br /&gt;
If no password has been established (or it has been forgotten- it&#039;s stored as a 1 way hash) it must be reset. The customer may do this themselves via the password reset page (linked off the AM login page). This will require them to have on file and use/match the owner_email field. You can also reset the password via mgmt via 2 methods:&lt;br /&gt;
# reset: will just reset their password and show it to you in mgmt. It will also give you handy instructions (commands) on how to place their CID and AM password in a file on their VPS. We prefer to do it this way since we then don&#039;t have to decide if the person requesting access is authorized or not. If we place the CID/password in a file on their VPS and make it viewable by root only, then only someone with root access could get to that and if you have root access, you&#039;re considered authorized.&lt;br /&gt;
# activate+email: this will set/reset their password and send an email to the customer with access instructions and it will instruct them to find the AM access info in the &amp;lt;tt&amp;gt;/root/ampass&amp;lt;/tt&amp;gt; on their VPS- which you will create for them as soon as you click this link. If the customer has only colo&#039;s, the site will recognize that and email them the instructions/password.&lt;br /&gt;
# activate: this will enable AM access. The customer may then use the password reset function to get a password set for access.&lt;br /&gt;
&lt;br /&gt;
There is lots of contextual/hover help throughout the AM to help customers understand what they&#039;re looking at.&lt;br /&gt;
&lt;br /&gt;
Note - if a(n old) customer with no AM access gets a new VPS, the welcome email will indicate they have AM access established- this isn&#039;t true. You will need to at least activate the AM for them and possibly also reset their pass and update the ampass file accordingly.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Dashboard ===&lt;br /&gt;
This is the main/landing page for the AM. It has several sections:&lt;br /&gt;
&lt;br /&gt;
* Announcements: This is where we make available any announcement we might have for the customer. If the customer had a billing issue, it would be listed here.&lt;br /&gt;
&lt;br /&gt;
* Services: lists the services (servers) which the customer has and basic info about it (service type, IP, hostname, OS)&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: shows condensed usage/allocation, overage and how we deal with overage (per the customer&#039;s preference).&lt;br /&gt;
&lt;br /&gt;
* Contacts: shows the contacts on file for the account and their role.&lt;br /&gt;
&lt;br /&gt;
=== Services ===&lt;br /&gt;
&lt;br /&gt;
This page shows in detail what services they have with us. For instance, their package and what it comes with in terms of IP, disk space, bandwidth, price. There is a link for them to change service on this page- this just trigger&#039;s an email to support so they can&#039;t actually change their service instantly.&lt;br /&gt;
&lt;br /&gt;
If they have a colo @ i2b, the power controls are available on this page.&lt;br /&gt;
The status of the power outlet to which their server is connected is displayed (&amp;quot;Current Status&amp;quot;) and if the ATS is responding (see below) 2 radio options are given for controlling the port: &amp;quot;Off&amp;quot; and &amp;quot;On&amp;quot;. Pretty self explanatory, &amp;quot;Off&amp;quot; turns the port off and &amp;quot;On&amp;quot; turns it on. In order to power cycle the server, the will need to first select the &amp;quot;Off&amp;quot; option and click the &amp;quot;Submit&amp;quot; button. A window will popup and display the status of the port until the status switches to off (it will auto refresh every 10sec). To power back on, they just need to set the option to &amp;quot;On&amp;quot; and click &amp;quot;Submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If the customer has a virtuozzo VPS, the link to their VZ control panel is provided.&lt;br /&gt;
&lt;br /&gt;
=== Bandwidth ===&lt;br /&gt;
&lt;br /&gt;
This page allows the customer to pull up bandwidth usage statistics. The reporting of those statistics is available in several flavors and can be customized to show data based on:&lt;br /&gt;
* date range&lt;br /&gt;
* server&lt;br /&gt;
* IP(s)&lt;br /&gt;
* data flowing in a particular direction&lt;br /&gt;
* protocol (ICMP, TCP, UDP) &lt;br /&gt;
* port(s)&lt;br /&gt;
&lt;br /&gt;
Further, data can be output as:&lt;br /&gt;
* daily bar graph&lt;br /&gt;
* 15min granularity bar graph&lt;br /&gt;
* pie chart&lt;br /&gt;
* table/raw&lt;br /&gt;
&lt;br /&gt;
The only thing to keep in mind here is that anything but the daily bar graph query will take up a bit more time as all other queries come from much larger tables and thus require more time to seek through the database.&lt;br /&gt;
&lt;br /&gt;
The graphs generated by this activity actually generate files which live on the server for a period of time, and are removed by cronjob.&lt;br /&gt;
&lt;br /&gt;
=== Billing ===&lt;br /&gt;
&lt;br /&gt;
This screen displays the payment method currently active for the customer, and allows them to update that info (in the case of credit card payments). &lt;br /&gt;
&lt;br /&gt;
It also lists their payment history, oldest to newest, and their outstanding balance.&lt;br /&gt;
&lt;br /&gt;
It displays their ongoing JC charges.&lt;br /&gt;
&lt;br /&gt;
If they have a paypal subscription setup it displays that.&lt;br /&gt;
&lt;br /&gt;
Finally, if they have an outstanding (paypal) invoice, it will display here and give them a link to (pay) it.&lt;br /&gt;
&lt;br /&gt;
=== Account Info ===&lt;br /&gt;
&lt;br /&gt;
Allows the customer to see / update:&lt;br /&gt;
* account owner info&lt;br /&gt;
* contact info&lt;br /&gt;
* the account manager password&lt;br /&gt;
* bandwidth preferences&lt;br /&gt;
&lt;br /&gt;
Any modifications to these settings will require the user to request a security token to be emailed to the owner (jc:customers.owner_email) which they are required to provide in order to make updates to this page. Once the customer provides this key and goes on to edit the info it is no longer valid and any subsequent visit to the edit page will require the generation of a new security token. Obviously, this requires the customer to have the ability to retrieve email at the owner&#039;s email address on file.&lt;br /&gt;
&lt;br /&gt;
=== Support ===&lt;br /&gt;
&lt;br /&gt;
This page allows the customer to quickly send us a message. They are allowed to send it as/from one of the contacts on file (or provide a new one) and they can indicate which server the issue is regarding. The email is cc&#039;d back to the customer for their records. This form is intelligent and will send the email to the right place based on the server/product they select- support@ or linux@&lt;br /&gt;
&lt;br /&gt;
== Problems ==&lt;br /&gt;
=== Power management: Status and control temporarily unavailable ===&lt;br /&gt;
&lt;br /&gt;
ATS isn&#039;t responding. See [[ATS#Rebooting_and_Recovering|Rebooting and Recovering ]]&lt;br /&gt;
&lt;br /&gt;
=== Power control doesn&#039;t work ===&lt;br /&gt;
&lt;br /&gt;
If after requesting a change in power status, the popup status window never reflects a change to the requested status, that means the ATS isn&#039;t responding and the customer should try setting the power again. If that still doesn&#039;t work, the ATS is out and needs to be reset. See [[ATS#Rebooting and Recovering|Rebooting and Recovering]]&lt;br /&gt;
&lt;br /&gt;
= Database =&lt;br /&gt;
&lt;br /&gt;
The database behind AM/Signup/MGMT runs on mysql on the [[Infrastructure_Machines#mail|mail]] server.&lt;br /&gt;
&lt;br /&gt;
== jc:billing_history ==&lt;br /&gt;
&lt;br /&gt;
== jc:ref_templates ==&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_Reference&amp;diff=1042</id>
		<title>Virtuozzo Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_Reference&amp;diff=1042"/>
		<updated>2013-03-11T23:55:00Z</updated>

		<summary type="html">&lt;p&gt;Support: Support moved page Virtuozzo Reference to Virtuozzo / Linux Reference&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Virtuozzo / Linux Reference]]&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1041</id>
		<title>Virtuozzo / Linux Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1041"/>
		<updated>2013-03-11T23:55:00Z</updated>

		<summary type="html">&lt;p&gt;Support: Support moved page Virtuozzo Reference to Virtuozzo / Linux Reference&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Updating VZ =&lt;br /&gt;
&lt;br /&gt;
 Update Virtuozzo to version 4.0.0&lt;br /&gt;
 Apply minor updates for Virtuozzo 3.0.0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
When you get to the last screen, you will be given an option to &lt;br /&gt;
&lt;br /&gt;
 ( ) Automatically reboot after update&lt;br /&gt;
 (*) Reboot later manually&lt;br /&gt;
&lt;br /&gt;
make sure you choose to reboot later.&lt;br /&gt;
&lt;br /&gt;
= Migrating Templates =&lt;br /&gt;
One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it&#039;s now called) based on a particular ditribution on a host which may or may not share the same distribution. For instance, you could run a CT running Ubuntu while the host machine (Hardware Node or HN) is running CentOS. This is accomplished via the use of OS templates. As long as the HN contains the OS template on which a particular CT relies, it will run there. As such, if you want to move a CT from one HN to another, you will need to make sure the OS template exists there.&lt;br /&gt;
&lt;br /&gt;
Modern versions of VZ (&amp;gt;= 4.x) will check for and automatically move the OS template over to the host as you&#039;re (vz)migrating the CT over to a new HN. However we like to make sure the template is in place prior to moving the CT. &lt;br /&gt;
&lt;br /&gt;
The first step is to see if the template exists on the host. To see OS templates installed:&lt;br /&gt;
&lt;br /&gt;
2.x (shows OS and application templates):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkgls&lt;br /&gt;
mod_ssl-rh9 20040624&lt;br /&gt;
mysql-rh9 20030814 20050412&lt;br /&gt;
openwebmail-rh9 20050427&lt;br /&gt;
php-rh9 20050506&lt;br /&gt;
phpBB-rh9 20041229&lt;br /&gt;
postgresql-rh9 20050719&lt;br /&gt;
sl-webalizer-rh9 20040119&lt;br /&gt;
spamassassin-rh9 20040127&lt;br /&gt;
tomcat-rh9 20040524&lt;br /&gt;
usermin-rh9 20040116&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;= 3.x (shows just OS templates, run without -O to see application as well):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkg list -O&lt;br /&gt;
ubuntu-10.04-x86                   2010-06-01 11:39:05&lt;br /&gt;
ubuntu-11.04-x86                   2011-06-22 14:23:59&lt;br /&gt;
ubuntu-9.10-x86                    2010-03-11 17:39:51&lt;br /&gt;
centos-5-x86                       2010-03-11 17:12:27&lt;br /&gt;
debian-5.0-x86                     2010-03-11 17:33:34&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All template files are located:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1&lt;br /&gt;
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2&lt;br /&gt;
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9&lt;br /&gt;
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1&lt;br /&gt;
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2&lt;br /&gt;
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9&lt;br /&gt;
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92&lt;br /&gt;
analog-fc2      mailman-fc2           php-rh9             suse-9.2&lt;br /&gt;
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1&lt;br /&gt;
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2&lt;br /&gt;
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9&lt;br /&gt;
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92&lt;br /&gt;
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1&lt;br /&gt;
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1&lt;br /&gt;
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2&lt;br /&gt;
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9&lt;br /&gt;
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1&lt;br /&gt;
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2&lt;br /&gt;
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9&lt;br /&gt;
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3&lt;br /&gt;
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0&lt;br /&gt;
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92&lt;br /&gt;
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1&lt;br /&gt;
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2&lt;br /&gt;
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9&lt;br /&gt;
jdk-suse92      mysql-rh9             redhat-as3-minimal&lt;br /&gt;
jre-deb31       mysql-suse92          redhat-devel-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here are the base OS templates: &amp;lt;tt&amp;gt;redhat-9, fedora-core-1&amp;lt;/tt&amp;gt; and supporting application templates: &amp;lt;tt&amp;gt;postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1&amp;lt;/tt&amp;gt;. So if you wanted to copy over all of redhat 9 you&#039;d need to copy the contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls -d /vz/template/*rh9*&lt;br /&gt;
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9&lt;br /&gt;
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9&lt;br /&gt;
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9&lt;br /&gt;
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9&lt;br /&gt;
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9&lt;br /&gt;
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9&lt;br /&gt;
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9&lt;br /&gt;
/vz/template/mailman-rh9     /vz/template/postgresql-rh9&lt;br /&gt;
&lt;br /&gt;
# ls -d /vz/template/*redhat-9*&lt;br /&gt;
/vz/template/redhat-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a template from one HN to another, it simply needs to be rsync&#039;d over to the target HN. It&#039;s rsync&#039;d over in this fashion:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template&lt;br /&gt;
 rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template&lt;br /&gt;
&lt;br /&gt;
Newer (&amp;gt;= 3.x) VZ employs &amp;quot;EZ&amp;quot; templates which are organized a little differently:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc&lt;br /&gt;
centos  conf         redhat-as3-minimal  ubuntu&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/ubuntu/&lt;br /&gt;
10.04  11.04  9.10&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/&lt;br /&gt;
x86&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/cache/&lt;br /&gt;
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz&lt;br /&gt;
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz&lt;br /&gt;
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we see is the entire OS and all applications are in 1 directory, and organized by distribution and release version. So to move Ubuntu 10.04:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
and you also need to move the cache:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/&lt;br /&gt;
&lt;br /&gt;
Once the transfer is complete, you will be able to run &amp;lt;tt&amp;gt;vzpkgls&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vzpkg list -O&amp;lt;/tt&amp;gt; and see the template(s) listed on the target HN.&lt;br /&gt;
&lt;br /&gt;
So far, this all supposes template doesn&#039;t exist on the target- very simple, just copy it over. If the template exists already on the target HN, this requires closer inspection. With older templates, simply moving over the templates would be the end of it- you see the version listed when you do a &amp;lt;tt&amp;gt;vzplgls&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysql-rh9 20030814 20050412&lt;br /&gt;
&lt;br /&gt;
this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412&lt;br /&gt;
As an aside, you can&#039;t copy over just 1 of them, but if you rsync&#039;d over the &amp;lt;tt&amp;gt;mysql-rh9&amp;lt;/tt&amp;gt; directory, you&#039;d see 20030814 and 20050412 on the target HN. As long as the versions match up, you&#039;re good to go.&lt;br /&gt;
&lt;br /&gt;
With EZ templates, the versions are not as easy to decipher. When you look at the &amp;lt;tt&amp;gt;vzpkg list&amp;lt;/tt&amp;gt; output, that simply tells you when a cache was created. A cache is simply a snapshot of all the data needed for the latest versions of the OS and it&#039;s applications at the time the cache was created. It is a date, and thus tells you nothing about the versions within. So for instance, if you had a cache for Ubuntu 10.04 from 2007 and you ran &amp;lt;tt&amp;gt;vzpkg create cache ubuntu-10.04-x86&amp;lt;/tt&amp;gt; it would re-download the latest version of apache, mysql and so on. And any &#039;&#039;subsequent&#039;&#039; ubuntu 10.04 CT&#039;s created thereafter would use those newer versions, whereas older CT&#039;s based on 10.04 would use older templates. You can see how this works by looking at the files under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this template has in it 6 different versions of apache2. This means that this template was merged with other 10.04 templates and/or it has been cached a few times, each time a new apache was available. The unfortunate thing is it&#039;s almost impossible to know which CT&#039;s are using which version of apache so it&#039;s hard to try to prune this down and remove unwanted/unneeded applications.&lt;br /&gt;
&lt;br /&gt;
So, if you see another HN has Ubuntu 10.04 on it, you need to see/confirm that it has all the exact files your CT needs. You can run a test rsync to see what &#039;&#039;would&#039;&#039; be transferred (what&#039;s missing):&lt;br /&gt;
&lt;br /&gt;
 rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
Based on the amount of data you get back from the rsync, you will be able to decide whether or not to remove the -n and allow the full transfer to go through. The downside to doing the transfer is the situation described above- you&#039;ve permanently joined these templates and now you may have 10 versions of apache on the target HN. There&#039;s one other potential pitfall to this kind of merging- it will also potentially copy over shared files, for which there is no particular version, most of which are in &amp;lt;tt&amp;gt;/vz/template/ubuntu/10.04/x86/config&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
 cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
 /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
&lt;br /&gt;
Here are some specific things to look out for. Case: copying centos-5 on virt19 to virt12. We dumped the rsync output to a file so we could inspect:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
(note, that can be dangerous, better to add on full path &amp;lt;tt&amp;gt;/vz/template/centos/5&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
So in the output file we see things like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
x86/base0/cachecookie&lt;br /&gt;
x86/base0/primary.xml.gz &lt;br /&gt;
x86/base0/primary.xml.gz.sqlite &lt;br /&gt;
x86/base0/repomd.xml &lt;br /&gt;
x86/base1/cachecookie &lt;br /&gt;
x86/base1/filelists.xml.gz &lt;br /&gt;
x86/base1/filelists.xml.gz.sqlite  &lt;br /&gt;
x86/base1/primary.xml.gz &lt;br /&gt;
x86/base1/primary.xml.gz.sqlite &lt;br /&gt;
x86/base1/repomd.xml&lt;br /&gt;
x86/base2/cachecookie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which make us nervous cause those are not versioned files, i.e.:&lt;br /&gt;
 5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock&lt;br /&gt;
&lt;br /&gt;
So those files will replace existing files on v12 rather than the case of the latter where it&#039;s likely being added. So caution should be given and deference to whichever version is newer (which rsync should take care of, but that will depend on the date each file was created and perhaps not the actual data within).&lt;br /&gt;
&lt;br /&gt;
If we look further in the file we see:&lt;br /&gt;
&lt;br /&gt;
 x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.&lt;br /&gt;
9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif&lt;br /&gt;
&lt;br /&gt;
and other files looking like:&lt;br /&gt;
 5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info&lt;br /&gt;
&lt;br /&gt;
Which means plesk is here. We don&#039;t need plesk on v12 (the CT moving over doesn&#039;t use it) so we rerun the rsync and exclude it:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh --exclude=&amp;quot;plesk*&amp;quot; --exclude=&amp;quot;psa*&amp;quot; /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
and now it&#039;s much smaller:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l&lt;br /&gt;
 97104&lt;br /&gt;
&lt;br /&gt;
Before running with excludes it was:&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l &lt;br /&gt;
 238238&lt;br /&gt;
&lt;br /&gt;
So again, look at what you&#039;re doing. Generally, combining templates is fine however.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re happy with the merge, run the rsync again without the &amp;quot;-n&amp;quot; to let it actually do the transfer.&lt;br /&gt;
&lt;br /&gt;
Once done, don&#039;t forget to add the new template to the HN in Management -&amp;gt; Reference -&amp;gt; Templates&lt;br /&gt;
&lt;br /&gt;
= getting help =&lt;br /&gt;
&lt;br /&gt;
= vzup2date =&lt;br /&gt;
TODO &lt;br /&gt;
= Adding new OS/application templates =&lt;br /&gt;
&lt;br /&gt;
Virtuozzo will lag a bit behind the initial release of an OS, perhaps by a month or more. Further, a newly-released OS may be available, but there may not be many/any application templates available initially. It pays to wait a bit.&lt;br /&gt;
&lt;br /&gt;
A template is easily installed via [[#vzup2date|vzup2date]]:&lt;br /&gt;
&lt;br /&gt;
 vzup2date -z&lt;br /&gt;
&lt;br /&gt;
You will be given a list of OS&#039;s to install. Select an OS, then customize that selection by checking/unchecking the application templates we do/don&#039;t want to include/offer.&lt;br /&gt;
&lt;br /&gt;
Generally, here are the app templates we include/offer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cyrus-imap&lt;br /&gt;
devel&lt;br /&gt;
imp&lt;br /&gt;
jre&lt;br /&gt;
jsdk&lt;br /&gt;
mailman&lt;br /&gt;
mod_perl&lt;br /&gt;
mod_ssl&lt;br /&gt;
mysql&lt;br /&gt;
php&lt;br /&gt;
phpmyadmin&lt;br /&gt;
phppgadmin&lt;br /&gt;
postgresql&lt;br /&gt;
proftpd&lt;br /&gt;
spamassassin&lt;br /&gt;
squirrelmail&lt;br /&gt;
tomcat&lt;br /&gt;
vsftpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do not (any longer) offer webalizer or analog.&lt;br /&gt;
&lt;br /&gt;
After selecting and installing the OS and apps, you should ensure it&#039;s installed:&lt;br /&gt;
&lt;br /&gt;
 vzpkg list -O&lt;br /&gt;
&lt;br /&gt;
Your new OS (ex. fedora-core-13-x86_64) will be listed, without a corresponding cache date:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@virt13 /vzconf]# vzpkg list -O&lt;br /&gt;
centos-6-x86                       2011-07-22 13:24:41&lt;br /&gt;
centos-6-x86_64                    2012-03-09 20:42:22&lt;br /&gt;
centos-5-x86                       2009-07-27 16:58:24&lt;br /&gt;
centos-5-x86_64                    2012-03-09 22:38:53&lt;br /&gt;
ubuntu-11.10-x86_64                2012-03-01 23:13:33&lt;br /&gt;
ubuntu-9.04-x86                    2009-06-02 11:32:39&lt;br /&gt;
ubuntu-12.04-x86_64                2012-05-29 13:50:50&lt;br /&gt;
ubuntu-8.04-x86                    2008-09-17 21:27:20&lt;br /&gt;
ubuntu-8.10-x86                    2009-03-13 13:58:57&lt;br /&gt;
ubuntu-11.04-x86                   2011-12-05 11:15:46&lt;br /&gt;
ubuntu-7.04-x86                    2008-09-24 16:42:50&lt;br /&gt;
redhat-el6-x86_64&lt;br /&gt;
fedora-core-13-x86_64              &lt;br /&gt;
fedora-core-12-x86                 2010-02-06 13:24:32&lt;br /&gt;
fedora-core-15-x86                 2011-12-05 11:36:43&lt;br /&gt;
fedora-core-11-x86                 2009-10-01 16:30:59&lt;br /&gt;
fedora-core-14-x86&lt;br /&gt;
fedora-core-16-x86_64              2012-03-13 11:40:23&lt;br /&gt;
fedora-core-9-x86                  2008-11-29 10:52:18&lt;br /&gt;
debian-6.0-x86                     2011-07-29 16:00:35&lt;br /&gt;
debian-6.0-x86_64                  2012-03-12 19:53:33&lt;br /&gt;
debian-5.0-x86                     2009-03-12 12:39:11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also confirm the apps installed:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt13 /vzconf]# vzpkg list fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64              2013-03-08 11:39:44&lt;br /&gt;
fedora-core-13-x86_64 devel&lt;br /&gt;
fedora-core-13-x86_64 php&lt;br /&gt;
fedora-core-13-x86_64 proftpd&lt;br /&gt;
fedora-core-13-x86_64 postgresql&lt;br /&gt;
fedora-core-13-x86_64 phpmyadmin&lt;br /&gt;
fedora-core-13-x86_64 mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before you can use the OS you must cache it. To create the cache run:&lt;br /&gt;
 vzpkg cache [OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;vzpkg cache fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s ready to use. In order to be able to use it with the [[VPS_Management#vm|vm]] command, you must create a file:&lt;br /&gt;
 jctmpl-[OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;jctmpl-fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In it, on line 1 we place the OS, followed by the app names, ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;more jctmpl-fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64&lt;br /&gt;
postgresql&lt;br /&gt;
jsdk&lt;br /&gt;
mod_ssl&lt;br /&gt;
phpmyadmin&lt;br /&gt;
mod_perl&lt;br /&gt;
tomcat&lt;br /&gt;
devel&lt;br /&gt;
php&lt;br /&gt;
mailman&lt;br /&gt;
cyrus-imap&lt;br /&gt;
squirrelmail&lt;br /&gt;
proftpd&lt;br /&gt;
mysql&lt;br /&gt;
phppgadmin&lt;br /&gt;
spamassassin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The packages will be installed in that order, so any pre-req&#039;s should be handled there.&lt;br /&gt;
&lt;br /&gt;
Now, when you run [[VPS_Management#vm|vm]] it will show you the newly-added OS and you may create a CT using it.&lt;br /&gt;
&lt;br /&gt;
The last few tasks are related to mgmt:&lt;br /&gt;
&lt;br /&gt;
1. add to mgmt-&amp;gt;reference-&amp;gt;templates (use the existing templates as an example). Once added, the new template will be included with the list of OS&#039;s available for the given HN.&lt;br /&gt;
2. if this is going to be a new OS offered for ordering, it needs to be added to the order form and webpage.&lt;br /&gt;
&lt;br /&gt;
a. to get a list of applications and versions in the new OS, you should create a test CT, enter it and run &amp;lt;tt&amp;gt;dpkg -l|sort&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;rpm -aq|sort&amp;lt;/tt&amp;gt; in centos/fedora) and enter that list in the following places:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/jc_pub/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Note, you will have to move the most recent OS data from &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt; into the corresponding &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname]_old.html&amp;lt;/tt&amp;gt; updating the version links in both.&lt;br /&gt;
&lt;br /&gt;
b. to add the new OS to the order form, you will need to update &amp;lt;tt&amp;gt;/usr/local/www/signup/html/step1.html&amp;lt;/tt&amp;gt; in several places (for regular and OSS orders) as well as updating the templateID which you can get from mgmt-&amp;gt;reference-&amp;gt;templates (or [[Management_System_/_Public_Website_/_Signup_/_Account_Manager#jc:ref_templates|jc:ref_templates]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Old method to obtain the templates:&lt;br /&gt;
&lt;br /&gt;
Go to http://www.parallels.com/en/virtuozzo/templates/catalog/&lt;br /&gt;
&lt;br /&gt;
Download the RPM&#039;s and install them&lt;br /&gt;
&lt;br /&gt;
 vzpkg list&lt;br /&gt;
to see the new packages/os templates&lt;br /&gt;
&lt;br /&gt;
 vzpkg create cache &amp;quot;OS_EZ_template_name&amp;quot;&lt;br /&gt;
to create a cache&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Update OS template =&lt;br /&gt;
&lt;br /&gt;
Installation and update of the new version of OS template will not affect the existing containers. It will affect only the new containers, created after this update operation. In terms of fixing &amp;quot;vzctl enter&amp;quot; error and SSH connectivity to Ubuntu based containers, it is necessary to recreate the template and not to update it, so the commands to run are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rpm -Uhv ubuntu-8.04-x86-ez-4.0.0-9.swsoft.noarch.rpm&lt;br /&gt;
vzpkg clean ubuntu-8.04-x86&lt;br /&gt;
vzpkg remove cache ubuntu-8.04-x86&lt;br /&gt;
vzpkg create cache ubuntu-8.04-x86&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installing new SSL cert on VZCP =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;openssl req -days 1999 -new -x509 -nodes -out server.crt -keyout server.key&lt;br /&gt;
&lt;br /&gt;
US&lt;br /&gt;
CA&lt;br /&gt;
San Diego&lt;br /&gt;
johncompanies.com&lt;br /&gt;
johncompanies.com&lt;br /&gt;
virt15ohncompanies.com&lt;br /&gt;
linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.crt/server.crt /etc/httpd/conf/ssl.crt/server.crt.bak&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.key/server.key /etc/httpd/conf/ssl.key/server.key.bak&lt;br /&gt;
cp server.crt /etc/httpd/conf/ssl.crt/server.crt&lt;br /&gt;
cp server.key /etc/httpd/conf/ssl.key/server.key&lt;br /&gt;
/etc/init.d/vzcp restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Moving virt (drives) to new hardware =&lt;br /&gt;
&lt;br /&gt;
If you have a case where a virt is dead (due to hardware failure), you can move the drives to a new hardware setup.&lt;br /&gt;
Here are the steps and things to look for:&lt;br /&gt;
&lt;br /&gt;
Move the drives to the new box. Most likely, the drives will be recognized and there will be no problems booting up. On Dell PERC 5/6 cards you will need to import the new &amp;quot;foreign&amp;quot; volume via the raid BIOS.&lt;br /&gt;
&lt;br /&gt;
If the hardware (motherboard) is different, it’s possible the nic’s won’t be recognized. Look at /etc/modules.conf the ethernet drivers are either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 tg3&lt;br /&gt;
alias eth1 tg3&amp;lt;/pre&amp;gt;&lt;br /&gt;
(supermicro)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 e100&lt;br /&gt;
alias eth1 e1000&amp;lt;/pre&amp;gt;&lt;br /&gt;
(intel)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 bnx2&lt;br /&gt;
alias eth1 bnx2&amp;lt;/pre&amp;gt;&lt;br /&gt;
(dell 29500)&lt;br /&gt;
&lt;br /&gt;
Also, you may see eth0 and eth1 swapped so if after confirming the eth devices are present (may require a reboot), then you may still need to swap the green/yellow network cables in the back to get them on the right port.&lt;br /&gt;
&lt;br /&gt;
VZ will not run (for long) on the new hardware, so you will need to get the license reissued. You may create/download a temporary license via their website for the interim.&lt;br /&gt;
&lt;br /&gt;
= Updating kernel on virt =&lt;br /&gt;
&lt;br /&gt;
We now use [[#vzup2date|vzup2date]] to update systems and kernels. What follows is what we used to do when we had to download kernels and install manually on old systems:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. install kernel and modules&lt;br /&gt;
&amp;lt;pre&amp;gt;# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \&lt;br /&gt;
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm&lt;br /&gt;
vzkernel-smp          ##################################################&lt;br /&gt;
vzmodules-smp       ##################################################&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT USE the &amp;quot;rpm -Uhv&amp;quot; command to install the kernel, otherwise all the previously installed kernels may be removed from your system. &lt;br /&gt;
&lt;br /&gt;
2. update lilo/grub&lt;br /&gt;
&lt;br /&gt;
Lilo:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lilo.conf&lt;br /&gt;
 &lt;br /&gt;
rename old Virtuozzo kernel label from &amp;quot;linux+virtuozzo&amp;quot; to &amp;quot;virtuozzo_old&amp;quot;&lt;br /&gt;
and add a new entry pointing to the newly installed virtuozzo kernel image.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;prompt&lt;br /&gt;
timeout=50&lt;br /&gt;
default=linux+virtuozzo&lt;br /&gt;
append=&amp;quot;debug panic=5 console=tty console=ttyS0,38400&amp;quot;&lt;br /&gt;
boot=/dev/sda&lt;br /&gt;
map=/boot/map&lt;br /&gt;
install=/boot/boot.b&lt;br /&gt;
message=/boot/message&lt;br /&gt;
linear&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3smp&lt;br /&gt;
        label=linux&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3smp.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3&lt;br /&gt;
        label=linux-up&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise&lt;br /&gt;
        label=2.4.20-9.5.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise&lt;br /&gt;
        label=2.4.20-9.8.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise&lt;br /&gt;
        label=2.4.20-9.21.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise&lt;br /&gt;
        label=2.4.20-9.24.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise&lt;br /&gt;
        label=2.4.20-28.3.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise&lt;br /&gt;
        label=old_linux+vz&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise&lt;br /&gt;
        label=linux+virtuozzo&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label &amp;quot;old_linux+vz &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Grub:&lt;br /&gt;
&lt;br /&gt;
 vi /boot/grub /menu.lst&lt;br /&gt;
&lt;br /&gt;
Add new entry at the top.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;serial --unit=0 --speed=38400&lt;br /&gt;
terminal --timeout=10 serial console&lt;br /&gt;
default=0&lt;br /&gt;
timeout=10&lt;br /&gt;
splashimage=(hd0,0)/boot/grub/splash.xpm.gz&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Red Hat Linux (2.4.18-3smp)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3smp.img&lt;br /&gt;
title Red Hat Linux-up (2.4.18-3)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3.img&lt;br /&gt;
title Linux with Virtuozzo 2.5&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1&lt;br /&gt;
title vz-enterpriseo&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1&lt;br /&gt;
title vz-enterprise&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. run the lilo (if using lilo)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lilo&lt;br /&gt;
Added linux&lt;br /&gt;
Added linux-up&lt;br /&gt;
Added virtuozzo_old&lt;br /&gt;
Added linux+virtuozzo *&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. reboot the server&lt;br /&gt;
 shutdown -r 23:05&lt;br /&gt;
&lt;br /&gt;
when it comes time for the shutdown, run [[VPS_Management#stopvirt|stopvirt]] to get things shut down faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Remaking service VE (&amp;lt;=3.x only) =&lt;br /&gt;
&lt;br /&gt;
Occasionally the control panel for VEs (aka VZPP) will stop working and you just need to reinstall the service VE (which runs the control panels for all VEs on the HN). Here&#039;s how that&#039;s done :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop 1&lt;br /&gt;
ipdel 1 69.55.234.152&lt;br /&gt;
vzmlocal 1:2&lt;br /&gt;
vzctl set 2 --save --onboot no&lt;br /&gt;
vzsveinstall -t redhat-as3-minimal -d /root/Rel261/HW/RPMS -s 69.55.234.152 --skip-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzsveinstall -t redhat-as3-minimal -d /vz/Rel300/HW/RPMS -s 69.55.229.151 --skip-client&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzctl mount 1&lt;br /&gt;
vzctl mount 2&lt;br /&gt;
/bin/cp -aRf /vz/root/2/home/vzagent0 /vz/root/1/home&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/lib/mysql/VZADB /vz/root/1/var/lib/mysql&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/shadow /vz/root/1/etc/&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/vzcp/static/vz/skins/ /vz/root/1/var/vzcp/static/vz&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/menu.xml  /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/dashboard.xml /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
&lt;br /&gt;
vzctl umount 2&lt;br /&gt;
vzctl umount 1&lt;br /&gt;
vzctl start 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= GRUB: boot once to a new kernel =&lt;br /&gt;
&lt;br /&gt;
To use a different kernel for the next reboot only:&lt;br /&gt;
  &amp;lt;pre&amp;gt;grub --no-floppy&lt;br /&gt;
  savedefault --default=N --once&lt;br /&gt;
  (where N is the number of the kernel you want to boot once)&lt;br /&gt;
  quit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot your machine. It will boot using kernel &amp;quot;N&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 grub-reboot N&lt;br /&gt;
will do essentially the same thing and prompt to reboot the machine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Recovering from GRUB failure =&lt;br /&gt;
&lt;br /&gt;
(example from DPE 2950)&lt;br /&gt;
&lt;br /&gt;
Boot to CEOS4 server CD (original install cd). Did this example with iso mounted via drac&lt;br /&gt;
&lt;br /&gt;
 Boot: linux rescue&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Main_Page&amp;diff=1040</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Main_Page&amp;diff=1040"/>
		<updated>2013-03-11T23:53:56Z</updated>

		<summary type="html">&lt;p&gt;Support: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[Special:AllPages|All Pages]]&lt;br /&gt;
* [[Payment_System|Payment System]]&lt;br /&gt;
* [[Management_System_/_Public_Website_/_Signup_/_Account_Manager|Management System / Public Website / Signup / Account Manager]]&lt;br /&gt;
* [[New_Signups|New Signups]]&lt;br /&gt;
* [[Shutting_Down_Service|Shutting Down Service]]&lt;br /&gt;
* [[Routine_Maintenance|Routine Maintenance]]&lt;br /&gt;
* Reference&lt;br /&gt;
** [[VPS_Management|VPS Management]]&lt;br /&gt;
** [[Jail_Server_Install|Jail Server Install]]&lt;br /&gt;
** [[Infrastructure_Machines|Infrastructure Machines]]&lt;br /&gt;
** [[Colo_Server_Setup|Colo Server Setup]]&lt;br /&gt;
** [[DNS]]&lt;br /&gt;
** [[FreeBSD_Reference|FreeBSD Reference]]&lt;br /&gt;
** [[Virtuozzo_/_Linux_Reference|Virtuozzo / Linux Reference]]&lt;br /&gt;
** [[Cabinetmap]]&lt;br /&gt;
** [[Switch_Control|Switch Control]]&lt;br /&gt;
** [[Private_IP_Mapping|Private IP Mapping]]&lt;br /&gt;
** [[Data_Center_Notes|Data Center Notes]]&lt;br /&gt;
** [[Crash_Reference|Crash Reference]]&lt;br /&gt;
** [[Hardware_Reference|Hardware Reference]]&lt;br /&gt;
** [[ATS]]&lt;br /&gt;
** [[Wiring_Reference|Wiring Reference]]&lt;br /&gt;
** [[Screen]]&lt;br /&gt;
** [[RAID_Cards|RAID Cards]]&lt;br /&gt;
** [[BigBrother]]&lt;br /&gt;
** [[Bandwidth_Management|Bandwidth Management]]&lt;br /&gt;
** [[Network_Time_(ntp)|Network Time (ntp)]]&lt;br /&gt;
** [[Isys_-_out_of_inodes|Isys - out of inodes]]&lt;br /&gt;
** [[DRAC/RMM|DRAC/RMM]]&lt;br /&gt;
** [[Customer_Backups|Customer Backups]]&lt;br /&gt;
** [[DoS_Attacks|DoS Attacks]]&lt;br /&gt;
** [[IPKVM|IPKVM]]&lt;br /&gt;
* [[System-generated_Notifications|System-generated Notifications]]&lt;br /&gt;
* [[Customer_Interaction|Customer Interaction]]&lt;br /&gt;
* [[Backup_Accounts_(rsync.net)| Backup Accounts (rsync.net)]]&lt;br /&gt;
* [[Todo]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [https://meta.wikimedia.org/wiki/Help:Advanced_editing Advanced Editing]&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1039</id>
		<title>Virtuozzo / Linux Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1039"/>
		<updated>2013-03-11T23:52:10Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Remaking service VE (&amp;lt;=3.x only) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Updating VZ =&lt;br /&gt;
&lt;br /&gt;
 Update Virtuozzo to version 4.0.0&lt;br /&gt;
 Apply minor updates for Virtuozzo 3.0.0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
When you get to the last screen, you will be given an option to &lt;br /&gt;
&lt;br /&gt;
 ( ) Automatically reboot after update&lt;br /&gt;
 (*) Reboot later manually&lt;br /&gt;
&lt;br /&gt;
make sure you choose to reboot later.&lt;br /&gt;
&lt;br /&gt;
= Migrating Templates =&lt;br /&gt;
One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it&#039;s now called) based on a particular ditribution on a host which may or may not share the same distribution. For instance, you could run a CT running Ubuntu while the host machine (Hardware Node or HN) is running CentOS. This is accomplished via the use of OS templates. As long as the HN contains the OS template on which a particular CT relies, it will run there. As such, if you want to move a CT from one HN to another, you will need to make sure the OS template exists there.&lt;br /&gt;
&lt;br /&gt;
Modern versions of VZ (&amp;gt;= 4.x) will check for and automatically move the OS template over to the host as you&#039;re (vz)migrating the CT over to a new HN. However we like to make sure the template is in place prior to moving the CT. &lt;br /&gt;
&lt;br /&gt;
The first step is to see if the template exists on the host. To see OS templates installed:&lt;br /&gt;
&lt;br /&gt;
2.x (shows OS and application templates):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkgls&lt;br /&gt;
mod_ssl-rh9 20040624&lt;br /&gt;
mysql-rh9 20030814 20050412&lt;br /&gt;
openwebmail-rh9 20050427&lt;br /&gt;
php-rh9 20050506&lt;br /&gt;
phpBB-rh9 20041229&lt;br /&gt;
postgresql-rh9 20050719&lt;br /&gt;
sl-webalizer-rh9 20040119&lt;br /&gt;
spamassassin-rh9 20040127&lt;br /&gt;
tomcat-rh9 20040524&lt;br /&gt;
usermin-rh9 20040116&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;= 3.x (shows just OS templates, run without -O to see application as well):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkg list -O&lt;br /&gt;
ubuntu-10.04-x86                   2010-06-01 11:39:05&lt;br /&gt;
ubuntu-11.04-x86                   2011-06-22 14:23:59&lt;br /&gt;
ubuntu-9.10-x86                    2010-03-11 17:39:51&lt;br /&gt;
centos-5-x86                       2010-03-11 17:12:27&lt;br /&gt;
debian-5.0-x86                     2010-03-11 17:33:34&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All template files are located:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1&lt;br /&gt;
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2&lt;br /&gt;
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9&lt;br /&gt;
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1&lt;br /&gt;
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2&lt;br /&gt;
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9&lt;br /&gt;
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92&lt;br /&gt;
analog-fc2      mailman-fc2           php-rh9             suse-9.2&lt;br /&gt;
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1&lt;br /&gt;
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2&lt;br /&gt;
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9&lt;br /&gt;
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92&lt;br /&gt;
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1&lt;br /&gt;
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1&lt;br /&gt;
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2&lt;br /&gt;
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9&lt;br /&gt;
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1&lt;br /&gt;
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2&lt;br /&gt;
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9&lt;br /&gt;
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3&lt;br /&gt;
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0&lt;br /&gt;
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92&lt;br /&gt;
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1&lt;br /&gt;
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2&lt;br /&gt;
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9&lt;br /&gt;
jdk-suse92      mysql-rh9             redhat-as3-minimal&lt;br /&gt;
jre-deb31       mysql-suse92          redhat-devel-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here are the base OS templates: &amp;lt;tt&amp;gt;redhat-9, fedora-core-1&amp;lt;/tt&amp;gt; and supporting application templates: &amp;lt;tt&amp;gt;postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1&amp;lt;/tt&amp;gt;. So if you wanted to copy over all of redhat 9 you&#039;d need to copy the contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls -d /vz/template/*rh9*&lt;br /&gt;
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9&lt;br /&gt;
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9&lt;br /&gt;
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9&lt;br /&gt;
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9&lt;br /&gt;
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9&lt;br /&gt;
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9&lt;br /&gt;
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9&lt;br /&gt;
/vz/template/mailman-rh9     /vz/template/postgresql-rh9&lt;br /&gt;
&lt;br /&gt;
# ls -d /vz/template/*redhat-9*&lt;br /&gt;
/vz/template/redhat-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a template from one HN to another, it simply needs to be rsync&#039;d over to the target HN. It&#039;s rsync&#039;d over in this fashion:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template&lt;br /&gt;
 rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template&lt;br /&gt;
&lt;br /&gt;
Newer (&amp;gt;= 3.x) VZ employs &amp;quot;EZ&amp;quot; templates which are organized a little differently:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc&lt;br /&gt;
centos  conf         redhat-as3-minimal  ubuntu&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/ubuntu/&lt;br /&gt;
10.04  11.04  9.10&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/&lt;br /&gt;
x86&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/cache/&lt;br /&gt;
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz&lt;br /&gt;
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz&lt;br /&gt;
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we see is the entire OS and all applications are in 1 directory, and organized by distribution and release version. So to move Ubuntu 10.04:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
and you also need to move the cache:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/&lt;br /&gt;
&lt;br /&gt;
Once the transfer is complete, you will be able to run &amp;lt;tt&amp;gt;vzpkgls&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vzpkg list -O&amp;lt;/tt&amp;gt; and see the template(s) listed on the target HN.&lt;br /&gt;
&lt;br /&gt;
So far, this all supposes template doesn&#039;t exist on the target- very simple, just copy it over. If the template exists already on the target HN, this requires closer inspection. With older templates, simply moving over the templates would be the end of it- you see the version listed when you do a &amp;lt;tt&amp;gt;vzplgls&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysql-rh9 20030814 20050412&lt;br /&gt;
&lt;br /&gt;
this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412&lt;br /&gt;
As an aside, you can&#039;t copy over just 1 of them, but if you rsync&#039;d over the &amp;lt;tt&amp;gt;mysql-rh9&amp;lt;/tt&amp;gt; directory, you&#039;d see 20030814 and 20050412 on the target HN. As long as the versions match up, you&#039;re good to go.&lt;br /&gt;
&lt;br /&gt;
With EZ templates, the versions are not as easy to decipher. When you look at the &amp;lt;tt&amp;gt;vzpkg list&amp;lt;/tt&amp;gt; output, that simply tells you when a cache was created. A cache is simply a snapshot of all the data needed for the latest versions of the OS and it&#039;s applications at the time the cache was created. It is a date, and thus tells you nothing about the versions within. So for instance, if you had a cache for Ubuntu 10.04 from 2007 and you ran &amp;lt;tt&amp;gt;vzpkg create cache ubuntu-10.04-x86&amp;lt;/tt&amp;gt; it would re-download the latest version of apache, mysql and so on. And any &#039;&#039;subsequent&#039;&#039; ubuntu 10.04 CT&#039;s created thereafter would use those newer versions, whereas older CT&#039;s based on 10.04 would use older templates. You can see how this works by looking at the files under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this template has in it 6 different versions of apache2. This means that this template was merged with other 10.04 templates and/or it has been cached a few times, each time a new apache was available. The unfortunate thing is it&#039;s almost impossible to know which CT&#039;s are using which version of apache so it&#039;s hard to try to prune this down and remove unwanted/unneeded applications.&lt;br /&gt;
&lt;br /&gt;
So, if you see another HN has Ubuntu 10.04 on it, you need to see/confirm that it has all the exact files your CT needs. You can run a test rsync to see what &#039;&#039;would&#039;&#039; be transferred (what&#039;s missing):&lt;br /&gt;
&lt;br /&gt;
 rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
Based on the amount of data you get back from the rsync, you will be able to decide whether or not to remove the -n and allow the full transfer to go through. The downside to doing the transfer is the situation described above- you&#039;ve permanently joined these templates and now you may have 10 versions of apache on the target HN. There&#039;s one other potential pitfall to this kind of merging- it will also potentially copy over shared files, for which there is no particular version, most of which are in &amp;lt;tt&amp;gt;/vz/template/ubuntu/10.04/x86/config&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
 cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
 /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
&lt;br /&gt;
Here are some specific things to look out for. Case: copying centos-5 on virt19 to virt12. We dumped the rsync output to a file so we could inspect:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
(note, that can be dangerous, better to add on full path &amp;lt;tt&amp;gt;/vz/template/centos/5&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
So in the output file we see things like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
x86/base0/cachecookie&lt;br /&gt;
x86/base0/primary.xml.gz &lt;br /&gt;
x86/base0/primary.xml.gz.sqlite &lt;br /&gt;
x86/base0/repomd.xml &lt;br /&gt;
x86/base1/cachecookie &lt;br /&gt;
x86/base1/filelists.xml.gz &lt;br /&gt;
x86/base1/filelists.xml.gz.sqlite  &lt;br /&gt;
x86/base1/primary.xml.gz &lt;br /&gt;
x86/base1/primary.xml.gz.sqlite &lt;br /&gt;
x86/base1/repomd.xml&lt;br /&gt;
x86/base2/cachecookie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which make us nervous cause those are not versioned files, i.e.:&lt;br /&gt;
 5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock&lt;br /&gt;
&lt;br /&gt;
So those files will replace existing files on v12 rather than the case of the latter where it&#039;s likely being added. So caution should be given and deference to whichever version is newer (which rsync should take care of, but that will depend on the date each file was created and perhaps not the actual data within).&lt;br /&gt;
&lt;br /&gt;
If we look further in the file we see:&lt;br /&gt;
&lt;br /&gt;
 x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.&lt;br /&gt;
9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif&lt;br /&gt;
&lt;br /&gt;
and other files looking like:&lt;br /&gt;
 5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info&lt;br /&gt;
&lt;br /&gt;
Which means plesk is here. We don&#039;t need plesk on v12 (the CT moving over doesn&#039;t use it) so we rerun the rsync and exclude it:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh --exclude=&amp;quot;plesk*&amp;quot; --exclude=&amp;quot;psa*&amp;quot; /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
and now it&#039;s much smaller:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l&lt;br /&gt;
 97104&lt;br /&gt;
&lt;br /&gt;
Before running with excludes it was:&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l &lt;br /&gt;
 238238&lt;br /&gt;
&lt;br /&gt;
So again, look at what you&#039;re doing. Generally, combining templates is fine however.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re happy with the merge, run the rsync again without the &amp;quot;-n&amp;quot; to let it actually do the transfer.&lt;br /&gt;
&lt;br /&gt;
Once done, don&#039;t forget to add the new template to the HN in Management -&amp;gt; Reference -&amp;gt; Templates&lt;br /&gt;
&lt;br /&gt;
= getting help =&lt;br /&gt;
&lt;br /&gt;
= vzup2date =&lt;br /&gt;
TODO &lt;br /&gt;
= Adding new OS/application templates =&lt;br /&gt;
&lt;br /&gt;
Virtuozzo will lag a bit behind the initial release of an OS, perhaps by a month or more. Further, a newly-released OS may be available, but there may not be many/any application templates available initially. It pays to wait a bit.&lt;br /&gt;
&lt;br /&gt;
A template is easily installed via [[#vzup2date|vzup2date]]:&lt;br /&gt;
&lt;br /&gt;
 vzup2date -z&lt;br /&gt;
&lt;br /&gt;
You will be given a list of OS&#039;s to install. Select an OS, then customize that selection by checking/unchecking the application templates we do/don&#039;t want to include/offer.&lt;br /&gt;
&lt;br /&gt;
Generally, here are the app templates we include/offer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cyrus-imap&lt;br /&gt;
devel&lt;br /&gt;
imp&lt;br /&gt;
jre&lt;br /&gt;
jsdk&lt;br /&gt;
mailman&lt;br /&gt;
mod_perl&lt;br /&gt;
mod_ssl&lt;br /&gt;
mysql&lt;br /&gt;
php&lt;br /&gt;
phpmyadmin&lt;br /&gt;
phppgadmin&lt;br /&gt;
postgresql&lt;br /&gt;
proftpd&lt;br /&gt;
spamassassin&lt;br /&gt;
squirrelmail&lt;br /&gt;
tomcat&lt;br /&gt;
vsftpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do not (any longer) offer webalizer or analog.&lt;br /&gt;
&lt;br /&gt;
After selecting and installing the OS and apps, you should ensure it&#039;s installed:&lt;br /&gt;
&lt;br /&gt;
 vzpkg list -O&lt;br /&gt;
&lt;br /&gt;
Your new OS (ex. fedora-core-13-x86_64) will be listed, without a corresponding cache date:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@virt13 /vzconf]# vzpkg list -O&lt;br /&gt;
centos-6-x86                       2011-07-22 13:24:41&lt;br /&gt;
centos-6-x86_64                    2012-03-09 20:42:22&lt;br /&gt;
centos-5-x86                       2009-07-27 16:58:24&lt;br /&gt;
centos-5-x86_64                    2012-03-09 22:38:53&lt;br /&gt;
ubuntu-11.10-x86_64                2012-03-01 23:13:33&lt;br /&gt;
ubuntu-9.04-x86                    2009-06-02 11:32:39&lt;br /&gt;
ubuntu-12.04-x86_64                2012-05-29 13:50:50&lt;br /&gt;
ubuntu-8.04-x86                    2008-09-17 21:27:20&lt;br /&gt;
ubuntu-8.10-x86                    2009-03-13 13:58:57&lt;br /&gt;
ubuntu-11.04-x86                   2011-12-05 11:15:46&lt;br /&gt;
ubuntu-7.04-x86                    2008-09-24 16:42:50&lt;br /&gt;
redhat-el6-x86_64&lt;br /&gt;
fedora-core-13-x86_64              &lt;br /&gt;
fedora-core-12-x86                 2010-02-06 13:24:32&lt;br /&gt;
fedora-core-15-x86                 2011-12-05 11:36:43&lt;br /&gt;
fedora-core-11-x86                 2009-10-01 16:30:59&lt;br /&gt;
fedora-core-14-x86&lt;br /&gt;
fedora-core-16-x86_64              2012-03-13 11:40:23&lt;br /&gt;
fedora-core-9-x86                  2008-11-29 10:52:18&lt;br /&gt;
debian-6.0-x86                     2011-07-29 16:00:35&lt;br /&gt;
debian-6.0-x86_64                  2012-03-12 19:53:33&lt;br /&gt;
debian-5.0-x86                     2009-03-12 12:39:11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also confirm the apps installed:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt13 /vzconf]# vzpkg list fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64              2013-03-08 11:39:44&lt;br /&gt;
fedora-core-13-x86_64 devel&lt;br /&gt;
fedora-core-13-x86_64 php&lt;br /&gt;
fedora-core-13-x86_64 proftpd&lt;br /&gt;
fedora-core-13-x86_64 postgresql&lt;br /&gt;
fedora-core-13-x86_64 phpmyadmin&lt;br /&gt;
fedora-core-13-x86_64 mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before you can use the OS you must cache it. To create the cache run:&lt;br /&gt;
 vzpkg cache [OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;vzpkg cache fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s ready to use. In order to be able to use it with the [[VPS_Management#vm|vm]] command, you must create a file:&lt;br /&gt;
 jctmpl-[OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;jctmpl-fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In it, on line 1 we place the OS, followed by the app names, ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;more jctmpl-fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64&lt;br /&gt;
postgresql&lt;br /&gt;
jsdk&lt;br /&gt;
mod_ssl&lt;br /&gt;
phpmyadmin&lt;br /&gt;
mod_perl&lt;br /&gt;
tomcat&lt;br /&gt;
devel&lt;br /&gt;
php&lt;br /&gt;
mailman&lt;br /&gt;
cyrus-imap&lt;br /&gt;
squirrelmail&lt;br /&gt;
proftpd&lt;br /&gt;
mysql&lt;br /&gt;
phppgadmin&lt;br /&gt;
spamassassin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The packages will be installed in that order, so any pre-req&#039;s should be handled there.&lt;br /&gt;
&lt;br /&gt;
Now, when you run [[VPS_Management#vm|vm]] it will show you the newly-added OS and you may create a CT using it.&lt;br /&gt;
&lt;br /&gt;
The last few tasks are related to mgmt:&lt;br /&gt;
&lt;br /&gt;
1. add to mgmt-&amp;gt;reference-&amp;gt;templates (use the existing templates as an example). Once added, the new template will be included with the list of OS&#039;s available for the given HN.&lt;br /&gt;
2. if this is going to be a new OS offered for ordering, it needs to be added to the order form and webpage.&lt;br /&gt;
&lt;br /&gt;
a. to get a list of applications and versions in the new OS, you should create a test CT, enter it and run &amp;lt;tt&amp;gt;dpkg -l|sort&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;rpm -aq|sort&amp;lt;/tt&amp;gt; in centos/fedora) and enter that list in the following places:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/jc_pub/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Note, you will have to move the most recent OS data from &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt; into the corresponding &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname]_old.html&amp;lt;/tt&amp;gt; updating the version links in both.&lt;br /&gt;
&lt;br /&gt;
b. to add the new OS to the order form, you will need to update &amp;lt;tt&amp;gt;/usr/local/www/signup/html/step1.html&amp;lt;/tt&amp;gt; in several places (for regular and OSS orders) as well as updating the templateID which you can get from mgmt-&amp;gt;reference-&amp;gt;templates (or [[Management_System_/_Public_Website_/_Signup_/_Account_Manager#jc:ref_templates|jc:ref_templates]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Old method to obtain the templates:&lt;br /&gt;
&lt;br /&gt;
Go to http://www.parallels.com/en/virtuozzo/templates/catalog/&lt;br /&gt;
&lt;br /&gt;
Download the RPM&#039;s and install them&lt;br /&gt;
&lt;br /&gt;
 vzpkg list&lt;br /&gt;
to see the new packages/os templates&lt;br /&gt;
&lt;br /&gt;
 vzpkg create cache &amp;quot;OS_EZ_template_name&amp;quot;&lt;br /&gt;
to create a cache&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Update OS template =&lt;br /&gt;
&lt;br /&gt;
Installation and update of the new version of OS template will not affect the existing containers. It will affect only the new containers, created after this update operation. In terms of fixing &amp;quot;vzctl enter&amp;quot; error and SSH connectivity to Ubuntu based containers, it is necessary to recreate the template and not to update it, so the commands to run are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rpm -Uhv ubuntu-8.04-x86-ez-4.0.0-9.swsoft.noarch.rpm&lt;br /&gt;
vzpkg clean ubuntu-8.04-x86&lt;br /&gt;
vzpkg remove cache ubuntu-8.04-x86&lt;br /&gt;
vzpkg create cache ubuntu-8.04-x86&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installing new SSL cert on VZCP =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;openssl req -days 1999 -new -x509 -nodes -out server.crt -keyout server.key&lt;br /&gt;
&lt;br /&gt;
US&lt;br /&gt;
CA&lt;br /&gt;
San Diego&lt;br /&gt;
johncompanies.com&lt;br /&gt;
johncompanies.com&lt;br /&gt;
virt15ohncompanies.com&lt;br /&gt;
linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.crt/server.crt /etc/httpd/conf/ssl.crt/server.crt.bak&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.key/server.key /etc/httpd/conf/ssl.key/server.key.bak&lt;br /&gt;
cp server.crt /etc/httpd/conf/ssl.crt/server.crt&lt;br /&gt;
cp server.key /etc/httpd/conf/ssl.key/server.key&lt;br /&gt;
/etc/init.d/vzcp restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Moving virt (drives) to new hardware =&lt;br /&gt;
&lt;br /&gt;
If you have a case where a virt is dead (due to hardware failure), you can move the drives to a new hardware setup.&lt;br /&gt;
Here are the steps and things to look for:&lt;br /&gt;
&lt;br /&gt;
Move the drives to the new box. Most likely, the drives will be recognized and there will be no problems booting up. On Dell PERC 5/6 cards you will need to import the new &amp;quot;foreign&amp;quot; volume via the raid BIOS.&lt;br /&gt;
&lt;br /&gt;
If the hardware (motherboard) is different, it’s possible the nic’s won’t be recognized. Look at /etc/modules.conf the ethernet drivers are either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 tg3&lt;br /&gt;
alias eth1 tg3&amp;lt;/pre&amp;gt;&lt;br /&gt;
(supermicro)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 e100&lt;br /&gt;
alias eth1 e1000&amp;lt;/pre&amp;gt;&lt;br /&gt;
(intel)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 bnx2&lt;br /&gt;
alias eth1 bnx2&amp;lt;/pre&amp;gt;&lt;br /&gt;
(dell 29500)&lt;br /&gt;
&lt;br /&gt;
Also, you may see eth0 and eth1 swapped so if after confirming the eth devices are present (may require a reboot), then you may still need to swap the green/yellow network cables in the back to get them on the right port.&lt;br /&gt;
&lt;br /&gt;
VZ will not run (for long) on the new hardware, so you will need to get the license reissued. You may create/download a temporary license via their website for the interim.&lt;br /&gt;
&lt;br /&gt;
= Updating kernel on virt =&lt;br /&gt;
&lt;br /&gt;
We now use [[#vzup2date|vzup2date]] to update systems and kernels. What follows is what we used to do when we had to download kernels and install manually on old systems:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. install kernel and modules&lt;br /&gt;
&amp;lt;pre&amp;gt;# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \&lt;br /&gt;
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm&lt;br /&gt;
vzkernel-smp          ##################################################&lt;br /&gt;
vzmodules-smp       ##################################################&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT USE the &amp;quot;rpm -Uhv&amp;quot; command to install the kernel, otherwise all the previously installed kernels may be removed from your system. &lt;br /&gt;
&lt;br /&gt;
2. update lilo/grub&lt;br /&gt;
&lt;br /&gt;
Lilo:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lilo.conf&lt;br /&gt;
 &lt;br /&gt;
rename old Virtuozzo kernel label from &amp;quot;linux+virtuozzo&amp;quot; to &amp;quot;virtuozzo_old&amp;quot;&lt;br /&gt;
and add a new entry pointing to the newly installed virtuozzo kernel image.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;prompt&lt;br /&gt;
timeout=50&lt;br /&gt;
default=linux+virtuozzo&lt;br /&gt;
append=&amp;quot;debug panic=5 console=tty console=ttyS0,38400&amp;quot;&lt;br /&gt;
boot=/dev/sda&lt;br /&gt;
map=/boot/map&lt;br /&gt;
install=/boot/boot.b&lt;br /&gt;
message=/boot/message&lt;br /&gt;
linear&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3smp&lt;br /&gt;
        label=linux&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3smp.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3&lt;br /&gt;
        label=linux-up&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise&lt;br /&gt;
        label=2.4.20-9.5.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise&lt;br /&gt;
        label=2.4.20-9.8.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise&lt;br /&gt;
        label=2.4.20-9.21.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise&lt;br /&gt;
        label=2.4.20-9.24.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise&lt;br /&gt;
        label=2.4.20-28.3.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise&lt;br /&gt;
        label=old_linux+vz&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise&lt;br /&gt;
        label=linux+virtuozzo&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label &amp;quot;old_linux+vz &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Grub:&lt;br /&gt;
&lt;br /&gt;
 vi /boot/grub /menu.lst&lt;br /&gt;
&lt;br /&gt;
Add new entry at the top.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;serial --unit=0 --speed=38400&lt;br /&gt;
terminal --timeout=10 serial console&lt;br /&gt;
default=0&lt;br /&gt;
timeout=10&lt;br /&gt;
splashimage=(hd0,0)/boot/grub/splash.xpm.gz&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Red Hat Linux (2.4.18-3smp)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3smp.img&lt;br /&gt;
title Red Hat Linux-up (2.4.18-3)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3.img&lt;br /&gt;
title Linux with Virtuozzo 2.5&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1&lt;br /&gt;
title vz-enterpriseo&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1&lt;br /&gt;
title vz-enterprise&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. run the lilo (if using lilo)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lilo&lt;br /&gt;
Added linux&lt;br /&gt;
Added linux-up&lt;br /&gt;
Added virtuozzo_old&lt;br /&gt;
Added linux+virtuozzo *&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. reboot the server&lt;br /&gt;
 shutdown -r 23:05&lt;br /&gt;
&lt;br /&gt;
when it comes time for the shutdown, run [[VPS_Management#stopvirt|stopvirt]] to get things shut down faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Remaking service VE (&amp;lt;=3.x only) =&lt;br /&gt;
&lt;br /&gt;
Occasionally the control panel for VEs (aka VZPP) will stop working and you just need to reinstall the service VE (which runs the control panels for all VEs on the HN). Here&#039;s how that&#039;s done :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop 1&lt;br /&gt;
ipdel 1 69.55.234.152&lt;br /&gt;
vzmlocal 1:2&lt;br /&gt;
vzctl set 2 --save --onboot no&lt;br /&gt;
vzsveinstall -t redhat-as3-minimal -d /root/Rel261/HW/RPMS -s 69.55.234.152 --skip-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzsveinstall -t redhat-as3-minimal -d /vz/Rel300/HW/RPMS -s 69.55.229.151 --skip-client&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzctl mount 1&lt;br /&gt;
vzctl mount 2&lt;br /&gt;
/bin/cp -aRf /vz/root/2/home/vzagent0 /vz/root/1/home&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/lib/mysql/VZADB /vz/root/1/var/lib/mysql&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/shadow /vz/root/1/etc/&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/vzcp/static/vz/skins/ /vz/root/1/var/vzcp/static/vz&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/menu.xml  /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/dashboard.xml /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
&lt;br /&gt;
vzctl umount 2&lt;br /&gt;
vzctl umount 1&lt;br /&gt;
vzctl start 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= GRUB: boot once to a new kernel =&lt;br /&gt;
&lt;br /&gt;
To use a different kernel for the next reboot only:&lt;br /&gt;
  &amp;lt;pre&amp;gt;grub --no-floppy&lt;br /&gt;
  savedefault --default=N --once&lt;br /&gt;
  (where N is the number of the kernel you want to boot once)&lt;br /&gt;
  quit&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reboot your machine. It will boot using kernel &amp;quot;N&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
 grub-reboot N&lt;br /&gt;
will do essentially the same thing and prompt to reboot the machine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Recovering from GRUB failure =&lt;br /&gt;
&lt;br /&gt;
(example from DPE 2950)&lt;br /&gt;
&lt;br /&gt;
Boot to CEOS4 server CD (original install cd). Did this example with iso mounted via drac&lt;br /&gt;
&lt;br /&gt;
 Boot: linux rescue&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1038</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1038"/>
		<updated>2013-03-11T23:49:46Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Making new customer VE (vm) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
== Making new customer VE (vm) ==&lt;br /&gt;
&lt;br /&gt;
This applies only to new virts &amp;gt;= 4.x&lt;br /&gt;
&lt;br /&gt;
grab ip from ipmap (if opened from the pending cust screen it should take you to the right block). You can also run vzlist -a to see what block is in use, generally. Try to find an IP that&#039;s in the same block of class C IP&#039;s already on the box.&lt;br /&gt;
&lt;br /&gt;
1. confirm ip you want to use isn’t in use via Mgmt. -&amp;gt; IP Map in management screens&lt;br /&gt;
&lt;br /&gt;
2. put CT on whichever partition has more space&lt;br /&gt;
&lt;br /&gt;
3.  vm CID IP hostname /vz[1|2] email[,email] template ( &amp;lt;LB|LBP|LS|LM|LMP|LP&amp;gt; [disk] | &amp;lt;gb_disk/mb_ram/gb_burst&amp;gt; ) &lt;br /&gt;
 vm col00009 69.55.230.238 centos.testdave.com /vz1 dsmith@n2.net centos-6-x86_64 LM&lt;br /&gt;
&lt;br /&gt;
4. copy veid, dir, ip and password to pending customer screen. activate customer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Making new customer VE (vemakexxx) ==&lt;br /&gt;
&lt;br /&gt;
This applies to older virts with old templates. This should probably not be used at all anymore.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. look thru hist for ip&lt;br /&gt;
&lt;br /&gt;
2. confirm ip you want to use isn’t in use via Mgmt. -&amp;gt; IP Map in management screens&lt;br /&gt;
&lt;br /&gt;
3. put ve on whichever partition has more space&lt;br /&gt;
 vemakerh9 &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; &amp;lt;hostname&amp;gt; &amp;lt;mount&amp;gt; &amp;lt;email&amp;gt; [gb disk]; &amp;lt;256|384|512&amp;gt; &amp;lt;veid&amp;gt;&lt;br /&gt;
 vemakerh9 866 69.55.226.109 ngentu.com /vz1 ayo@ngantu.com,asd@asd.com 5; 256 866&lt;br /&gt;
&lt;br /&gt;
4. copy (veid), dir, and ip to pending customer screen (pass set to p455agfa)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrateonline/migrate failures (migrate manually) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. If it fails with [[#migrateonline|migrateonline]], you should try [[#migrate|migrate]] (which will reboot the customer, so notify them ahead of time).&lt;br /&gt;
&lt;br /&gt;
You may want to run a [[#pre-seeding_a_migration|pre-seed]] rsync to see if you can find the problem. On older virts, we&#039;ve seen this problem due to a large logfile (which you can find and encourage the customer to remove/compress):&lt;br /&gt;
 for f in `find / -size +1048576k`; do ls -lh $f; done&lt;br /&gt;
&lt;br /&gt;
You may also see migration failing due to quota issues.&lt;br /&gt;
&lt;br /&gt;
You can try to resolve by copying any quota file into the file you need:&lt;br /&gt;
&lt;br /&gt;
 cp /var/vzquota/quota.1 /var/vzquota/quota.xxx&lt;br /&gt;
&lt;br /&gt;
If it complains about quota running you should then be able to stop it&lt;br /&gt;
&lt;br /&gt;
 vzquota off xxxx&lt;br /&gt;
&lt;br /&gt;
If all else fails, migrate to a new VEID&lt;br /&gt;
i.e. 1234 becomes 12341&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the rsync or [[#migrate|migrate]] fails, you can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE on the same virt ==&lt;br /&gt;
&lt;br /&gt;
Easy way:&amp;lt;br&amp;gt;&lt;br /&gt;
Scenario 1: ve 123 is to be renamed 1231 and moved from vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:1231:/vz/private/1231:/vz/root/1231&lt;br /&gt;
&lt;br /&gt;
Scenario 2: ve 123 is to be moved vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:123:/vz/private/123:/vz/root/123&lt;br /&gt;
&lt;br /&gt;
vzmlocal will reboot the ve at the end of the move&lt;br /&gt;
&lt;br /&gt;
Manual/old way:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;tt&amp;gt;vzctl stop 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2) &amp;lt;tt&amp;gt;mv /vz1/private/123 /vz/private/.&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(or cp -a if you want to copy)&lt;br /&gt;
3) in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts/123.conf&amp;lt;/tt&amp;gt; change value&amp;lt;br&amp;gt;&lt;br /&gt;
of &#039;&amp;lt;tt&amp;gt;VE_PRIVATE&amp;lt;/tt&amp;gt;&#039; variable to point to a new private area location&lt;br /&gt;
4) &amp;lt;tt&amp;gt;vzctl start 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
5) update backups if needed: &amp;lt;tt&amp;gt;mvbackups 123 virtX virt1 vz&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
6) update management scerens&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: a) absolute path to private area is stored in quota file &amp;lt;tt&amp;gt;/var/vzquota/quota.123&amp;lt;/tt&amp;gt; - so during first startup quota will be recalculated.&amp;lt;br&amp;gt;&lt;br /&gt;
b) if you&#039;re going to write some script to do a job, you MUST be sure that $VEID won&#039;t be expanded to &#039;&#039; in ve config file - ie. you need to escape &#039;$&#039;. Otherwise you might have:&lt;br /&gt;
&lt;br /&gt;
 VE_PRIVATE=&amp;quot;/vz/private/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in config, and &#039;vzctl destroy&#039; for this VE ID &#039;&#039;&#039;will remove everything under /vz/private/ directory&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Adding a veth device to a VE ==&lt;br /&gt;
&lt;br /&gt;
Not totally sure what this is, but a customer asked for it and here&#039;s what we did (as instructed by vz support):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;v set 99 --netif_add eth99  --save&lt;br /&gt;
ipdel 99 69.55.230.58&lt;br /&gt;
v set 99 --ifname eth99 --ipadd 69.55.230.58 --save&lt;br /&gt;
v set 99 --ifname eth99 --gateway 69.55.230.1 --save&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active      eth0              veth77.77,veth99.99&lt;br /&gt;
veth_net          active&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
br99             bridge     net99&lt;br /&gt;
veth99.99        veth       net99&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        net99            69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br0 eth0&lt;br /&gt;
&lt;br /&gt;
(will remove 99 from orig net and move to veth_net)&lt;br /&gt;
vznetcfg net addif veth_net veth99.99&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
(delete the old crap)&lt;br /&gt;
vznetcfg net del net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, to add another device in&lt;br /&gt;
&lt;br /&gt;
v set 77 --netif_add eth77  --save&lt;br /&gt;
ipdel 77 69.55.230.78&lt;br /&gt;
v set 77 --ifname eth77 --ipadd 69.55.230.78 --save&lt;br /&gt;
v set 77 --ifname eth77 --gateway 69.55.230.1 --save&lt;br /&gt;
v set 77 --save --ifname eth77 --network veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif veth_net veth77.77&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth       veth_net&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
another example&lt;br /&gt;
&lt;br /&gt;
v set 1182 --netif_add eth1182  --save&lt;br /&gt;
ipdel 1182 69.55.236.217&lt;br /&gt;
v set 1182 --ifname eth1182 --ipadd 69.55.236.217 --save&lt;br /&gt;
v set 1182 --ifname eth1182 --gateway 69.55.236.1 --save&lt;br /&gt;
vznetcfg net addif veth_net veth1182.1182&lt;br /&gt;
v set 1182 --save --ifname eth1182 --network veth_net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unused/not working commands:&lt;br /&gt;
ifconfig veth99.0 0&lt;br /&gt;
vznetcfg net list&lt;br /&gt;
vznetcfg br new br99 net99&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg br show&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
vznetcfg br new br1182 net1182&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif eth0 net1182&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&lt;br /&gt;
--- 8&amp;lt; ---&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new net&lt;br /&gt;
# vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vzctl set 99 --save --netif_add eth0 (at this stage veth99.0 interface have to appear&lt;br /&gt;
on node)&lt;br /&gt;
# vzctl set 99 --save --ifname eth0 --ipadd 69.55.230.58 (and probably few more arguments&lt;br /&gt;
here - see &#039;man vzctl&#039;)&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assigning/remove ip from a VE ==&lt;br /&gt;
&lt;br /&gt;
1. Add or remove ips:&lt;br /&gt;
 ipdel 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
 ipadd 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
&lt;br /&gt;
2. update Mgmt screens&lt;br /&gt;
&lt;br /&gt;
3. offer to update any DNS we do for them&lt;br /&gt;
&lt;br /&gt;
4. check to see if we had rules for old IP in firwall&lt;br /&gt;
&lt;br /&gt;
== Enabling tun device for a ve ==&lt;br /&gt;
Note, there’s a command for this: [[#addtun|addtun]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
Make sure the tun.o module is already loaded before Virtuozzo is started: &lt;br /&gt;
 lsmod &lt;br /&gt;
Allow the VPS to use the TUN/TAP device: &lt;br /&gt;
 vzctl set 101 --devices c:10:200:rw --save &lt;br /&gt;
Create the corresponding device inside the VPS and set the proper permissions: &lt;br /&gt;
 vzctl exec 101 mkdir -p /dev/net &lt;br /&gt;
 vzctl exec 101 mknod /dev/net/tun c 10 200 &lt;br /&gt;
 vzctl exec 101 chmod 600 /dev/net/tun&lt;br /&gt;
&lt;br /&gt;
== Remaking a system (on same virt) ==&lt;br /&gt;
&lt;br /&gt;
1. [[#cancelve|cancelve]] (or v destroy x - ONLY if you&#039;re POSITIVE no data needs to be saved)&lt;br /&gt;
&lt;br /&gt;
2. [[#vemake|vemake]] using same veid&lt;br /&gt;
&lt;br /&gt;
3. [[#mvbackups|mvbackups]] or [[#vb|vb]] (if new mount point)&lt;br /&gt;
&lt;br /&gt;
4. update mgmt with new dir/ip &lt;br /&gt;
&lt;br /&gt;
5. update firewall if changed ip&lt;br /&gt;
&lt;br /&gt;
== Re-initialize quota for a VE ==&lt;br /&gt;
&lt;br /&gt;
There’s a commamd for this now: [[#clearquota|clearquota]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzquota drop 1&lt;br /&gt;
vzctl start 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;br /&gt;
&lt;br /&gt;
== stopvirt ==&lt;br /&gt;
 stopvirt&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1037</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1037"/>
		<updated>2013-03-11T23:49:14Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Making new customer VE (vemakexxx) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
== Making new customer VE (vm) ==&lt;br /&gt;
&lt;br /&gt;
This applies only to new virts &amp;gt;= 4.x&lt;br /&gt;
&lt;br /&gt;
grab ip from ipmap (if opened from the pending cust screen it should take you to the right block). You can also run vzlist -a to see what block is in use, generally. Try to find an IP that&#039;s in the same block of class C IP&#039;s already on the box.&lt;br /&gt;
&lt;br /&gt;
1. confirm ip you want to use isn’t in use via Mgmt. -&amp;gt; IP Map in management screens&lt;br /&gt;
&lt;br /&gt;
2. put CT on whichever partition has more space&lt;br /&gt;
&lt;br /&gt;
3.  vm CID IP hostname /vz[1|2] email[,email] template ( &amp;lt;LB|LBP|LS|LM|LMP|LP&amp;gt; [disk] | &amp;lt;gb_disk/mb_ram/gb_burst&amp;gt; ) &lt;br /&gt;
 vm col00009 69.55.230.238 centos.testdave.com /vz1 dsmith@n2.net centos-6-x86_64 LM&lt;br /&gt;
&lt;br /&gt;
4. copy veid, dir, ip and password to pending customer screen. activate customer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrateonline/migrate failures (migrate manually) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. If it fails with [[#migrateonline|migrateonline]], you should try [[#migrate|migrate]] (which will reboot the customer, so notify them ahead of time).&lt;br /&gt;
&lt;br /&gt;
You may want to run a [[#pre-seeding_a_migration|pre-seed]] rsync to see if you can find the problem. On older virts, we&#039;ve seen this problem due to a large logfile (which you can find and encourage the customer to remove/compress):&lt;br /&gt;
 for f in `find / -size +1048576k`; do ls -lh $f; done&lt;br /&gt;
&lt;br /&gt;
You may also see migration failing due to quota issues.&lt;br /&gt;
&lt;br /&gt;
You can try to resolve by copying any quota file into the file you need:&lt;br /&gt;
&lt;br /&gt;
 cp /var/vzquota/quota.1 /var/vzquota/quota.xxx&lt;br /&gt;
&lt;br /&gt;
If it complains about quota running you should then be able to stop it&lt;br /&gt;
&lt;br /&gt;
 vzquota off xxxx&lt;br /&gt;
&lt;br /&gt;
If all else fails, migrate to a new VEID&lt;br /&gt;
i.e. 1234 becomes 12341&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the rsync or [[#migrate|migrate]] fails, you can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE on the same virt ==&lt;br /&gt;
&lt;br /&gt;
Easy way:&amp;lt;br&amp;gt;&lt;br /&gt;
Scenario 1: ve 123 is to be renamed 1231 and moved from vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:1231:/vz/private/1231:/vz/root/1231&lt;br /&gt;
&lt;br /&gt;
Scenario 2: ve 123 is to be moved vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:123:/vz/private/123:/vz/root/123&lt;br /&gt;
&lt;br /&gt;
vzmlocal will reboot the ve at the end of the move&lt;br /&gt;
&lt;br /&gt;
Manual/old way:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;tt&amp;gt;vzctl stop 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2) &amp;lt;tt&amp;gt;mv /vz1/private/123 /vz/private/.&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(or cp -a if you want to copy)&lt;br /&gt;
3) in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts/123.conf&amp;lt;/tt&amp;gt; change value&amp;lt;br&amp;gt;&lt;br /&gt;
of &#039;&amp;lt;tt&amp;gt;VE_PRIVATE&amp;lt;/tt&amp;gt;&#039; variable to point to a new private area location&lt;br /&gt;
4) &amp;lt;tt&amp;gt;vzctl start 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
5) update backups if needed: &amp;lt;tt&amp;gt;mvbackups 123 virtX virt1 vz&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
6) update management scerens&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: a) absolute path to private area is stored in quota file &amp;lt;tt&amp;gt;/var/vzquota/quota.123&amp;lt;/tt&amp;gt; - so during first startup quota will be recalculated.&amp;lt;br&amp;gt;&lt;br /&gt;
b) if you&#039;re going to write some script to do a job, you MUST be sure that $VEID won&#039;t be expanded to &#039;&#039; in ve config file - ie. you need to escape &#039;$&#039;. Otherwise you might have:&lt;br /&gt;
&lt;br /&gt;
 VE_PRIVATE=&amp;quot;/vz/private/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in config, and &#039;vzctl destroy&#039; for this VE ID &#039;&#039;&#039;will remove everything under /vz/private/ directory&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Adding a veth device to a VE ==&lt;br /&gt;
&lt;br /&gt;
Not totally sure what this is, but a customer asked for it and here&#039;s what we did (as instructed by vz support):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;v set 99 --netif_add eth99  --save&lt;br /&gt;
ipdel 99 69.55.230.58&lt;br /&gt;
v set 99 --ifname eth99 --ipadd 69.55.230.58 --save&lt;br /&gt;
v set 99 --ifname eth99 --gateway 69.55.230.1 --save&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active      eth0              veth77.77,veth99.99&lt;br /&gt;
veth_net          active&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
br99             bridge     net99&lt;br /&gt;
veth99.99        veth       net99&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        net99            69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br0 eth0&lt;br /&gt;
&lt;br /&gt;
(will remove 99 from orig net and move to veth_net)&lt;br /&gt;
vznetcfg net addif veth_net veth99.99&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
(delete the old crap)&lt;br /&gt;
vznetcfg net del net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, to add another device in&lt;br /&gt;
&lt;br /&gt;
v set 77 --netif_add eth77  --save&lt;br /&gt;
ipdel 77 69.55.230.78&lt;br /&gt;
v set 77 --ifname eth77 --ipadd 69.55.230.78 --save&lt;br /&gt;
v set 77 --ifname eth77 --gateway 69.55.230.1 --save&lt;br /&gt;
v set 77 --save --ifname eth77 --network veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif veth_net veth77.77&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth       veth_net&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
another example&lt;br /&gt;
&lt;br /&gt;
v set 1182 --netif_add eth1182  --save&lt;br /&gt;
ipdel 1182 69.55.236.217&lt;br /&gt;
v set 1182 --ifname eth1182 --ipadd 69.55.236.217 --save&lt;br /&gt;
v set 1182 --ifname eth1182 --gateway 69.55.236.1 --save&lt;br /&gt;
vznetcfg net addif veth_net veth1182.1182&lt;br /&gt;
v set 1182 --save --ifname eth1182 --network veth_net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unused/not working commands:&lt;br /&gt;
ifconfig veth99.0 0&lt;br /&gt;
vznetcfg net list&lt;br /&gt;
vznetcfg br new br99 net99&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg br show&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
vznetcfg br new br1182 net1182&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif eth0 net1182&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&lt;br /&gt;
--- 8&amp;lt; ---&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new net&lt;br /&gt;
# vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vzctl set 99 --save --netif_add eth0 (at this stage veth99.0 interface have to appear&lt;br /&gt;
on node)&lt;br /&gt;
# vzctl set 99 --save --ifname eth0 --ipadd 69.55.230.58 (and probably few more arguments&lt;br /&gt;
here - see &#039;man vzctl&#039;)&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assigning/remove ip from a VE ==&lt;br /&gt;
&lt;br /&gt;
1. Add or remove ips:&lt;br /&gt;
 ipdel 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
 ipadd 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
&lt;br /&gt;
2. update Mgmt screens&lt;br /&gt;
&lt;br /&gt;
3. offer to update any DNS we do for them&lt;br /&gt;
&lt;br /&gt;
4. check to see if we had rules for old IP in firwall&lt;br /&gt;
&lt;br /&gt;
== Enabling tun device for a ve ==&lt;br /&gt;
Note, there’s a command for this: [[#addtun|addtun]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
Make sure the tun.o module is already loaded before Virtuozzo is started: &lt;br /&gt;
 lsmod &lt;br /&gt;
Allow the VPS to use the TUN/TAP device: &lt;br /&gt;
 vzctl set 101 --devices c:10:200:rw --save &lt;br /&gt;
Create the corresponding device inside the VPS and set the proper permissions: &lt;br /&gt;
 vzctl exec 101 mkdir -p /dev/net &lt;br /&gt;
 vzctl exec 101 mknod /dev/net/tun c 10 200 &lt;br /&gt;
 vzctl exec 101 chmod 600 /dev/net/tun&lt;br /&gt;
&lt;br /&gt;
== Remaking a system (on same virt) ==&lt;br /&gt;
&lt;br /&gt;
1. [[#cancelve|cancelve]] (or v destroy x - ONLY if you&#039;re POSITIVE no data needs to be saved)&lt;br /&gt;
&lt;br /&gt;
2. [[#vemake|vemake]] using same veid&lt;br /&gt;
&lt;br /&gt;
3. [[#mvbackups|mvbackups]] or [[#vb|vb]] (if new mount point)&lt;br /&gt;
&lt;br /&gt;
4. update mgmt with new dir/ip &lt;br /&gt;
&lt;br /&gt;
5. update firewall if changed ip&lt;br /&gt;
&lt;br /&gt;
== Re-initialize quota for a VE ==&lt;br /&gt;
&lt;br /&gt;
There’s a commamd for this now: [[#clearquota|clearquota]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzquota drop 1&lt;br /&gt;
vzctl start 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;br /&gt;
&lt;br /&gt;
== stopvirt ==&lt;br /&gt;
 stopvirt&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1036</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1036"/>
		<updated>2013-03-11T23:49:00Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Virtuozzo VPS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
== Making new customer VE (vemakexxx) ==&lt;br /&gt;
&lt;br /&gt;
This applies to older virts with old templates. This should probably not be used at all anymore.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. look thru hist for ip&lt;br /&gt;
&lt;br /&gt;
2. confirm ip you want to use isn’t in use via Mgmt. -&amp;gt; IP Map in management screens&lt;br /&gt;
&lt;br /&gt;
3. put ve on whichever partition has more space&lt;br /&gt;
 vemakerh9 &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; &amp;lt;hostname&amp;gt; &amp;lt;mount&amp;gt; &amp;lt;email&amp;gt; [gb disk]; &amp;lt;256|384|512&amp;gt; &amp;lt;veid&amp;gt;&lt;br /&gt;
 vemakerh9 866 69.55.226.109 ngentu.com /vz1 ayo@ngantu.com,asd@asd.com 5; 256 866&lt;br /&gt;
&lt;br /&gt;
4. copy (veid), dir, and ip to pending customer screen (pass set to p455agfa)&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
== Making new customer VE (vm) ==&lt;br /&gt;
&lt;br /&gt;
This applies only to new virts &amp;gt;= 4.x&lt;br /&gt;
&lt;br /&gt;
grab ip from ipmap (if opened from the pending cust screen it should take you to the right block). You can also run vzlist -a to see what block is in use, generally. Try to find an IP that&#039;s in the same block of class C IP&#039;s already on the box.&lt;br /&gt;
&lt;br /&gt;
1. confirm ip you want to use isn’t in use via Mgmt. -&amp;gt; IP Map in management screens&lt;br /&gt;
&lt;br /&gt;
2. put CT on whichever partition has more space&lt;br /&gt;
&lt;br /&gt;
3.  vm CID IP hostname /vz[1|2] email[,email] template ( &amp;lt;LB|LBP|LS|LM|LMP|LP&amp;gt; [disk] | &amp;lt;gb_disk/mb_ram/gb_burst&amp;gt; ) &lt;br /&gt;
 vm col00009 69.55.230.238 centos.testdave.com /vz1 dsmith@n2.net centos-6-x86_64 LM&lt;br /&gt;
&lt;br /&gt;
4. copy veid, dir, ip and password to pending customer screen. activate customer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrateonline/migrate failures (migrate manually) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. If it fails with [[#migrateonline|migrateonline]], you should try [[#migrate|migrate]] (which will reboot the customer, so notify them ahead of time).&lt;br /&gt;
&lt;br /&gt;
You may want to run a [[#pre-seeding_a_migration|pre-seed]] rsync to see if you can find the problem. On older virts, we&#039;ve seen this problem due to a large logfile (which you can find and encourage the customer to remove/compress):&lt;br /&gt;
 for f in `find / -size +1048576k`; do ls -lh $f; done&lt;br /&gt;
&lt;br /&gt;
You may also see migration failing due to quota issues.&lt;br /&gt;
&lt;br /&gt;
You can try to resolve by copying any quota file into the file you need:&lt;br /&gt;
&lt;br /&gt;
 cp /var/vzquota/quota.1 /var/vzquota/quota.xxx&lt;br /&gt;
&lt;br /&gt;
If it complains about quota running you should then be able to stop it&lt;br /&gt;
&lt;br /&gt;
 vzquota off xxxx&lt;br /&gt;
&lt;br /&gt;
If all else fails, migrate to a new VEID&lt;br /&gt;
i.e. 1234 becomes 12341&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the rsync or [[#migrate|migrate]] fails, you can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE on the same virt ==&lt;br /&gt;
&lt;br /&gt;
Easy way:&amp;lt;br&amp;gt;&lt;br /&gt;
Scenario 1: ve 123 is to be renamed 1231 and moved from vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:1231:/vz/private/1231:/vz/root/1231&lt;br /&gt;
&lt;br /&gt;
Scenario 2: ve 123 is to be moved vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:123:/vz/private/123:/vz/root/123&lt;br /&gt;
&lt;br /&gt;
vzmlocal will reboot the ve at the end of the move&lt;br /&gt;
&lt;br /&gt;
Manual/old way:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;tt&amp;gt;vzctl stop 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2) &amp;lt;tt&amp;gt;mv /vz1/private/123 /vz/private/.&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(or cp -a if you want to copy)&lt;br /&gt;
3) in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts/123.conf&amp;lt;/tt&amp;gt; change value&amp;lt;br&amp;gt;&lt;br /&gt;
of &#039;&amp;lt;tt&amp;gt;VE_PRIVATE&amp;lt;/tt&amp;gt;&#039; variable to point to a new private area location&lt;br /&gt;
4) &amp;lt;tt&amp;gt;vzctl start 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
5) update backups if needed: &amp;lt;tt&amp;gt;mvbackups 123 virtX virt1 vz&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
6) update management scerens&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: a) absolute path to private area is stored in quota file &amp;lt;tt&amp;gt;/var/vzquota/quota.123&amp;lt;/tt&amp;gt; - so during first startup quota will be recalculated.&amp;lt;br&amp;gt;&lt;br /&gt;
b) if you&#039;re going to write some script to do a job, you MUST be sure that $VEID won&#039;t be expanded to &#039;&#039; in ve config file - ie. you need to escape &#039;$&#039;. Otherwise you might have:&lt;br /&gt;
&lt;br /&gt;
 VE_PRIVATE=&amp;quot;/vz/private/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in config, and &#039;vzctl destroy&#039; for this VE ID &#039;&#039;&#039;will remove everything under /vz/private/ directory&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Adding a veth device to a VE ==&lt;br /&gt;
&lt;br /&gt;
Not totally sure what this is, but a customer asked for it and here&#039;s what we did (as instructed by vz support):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;v set 99 --netif_add eth99  --save&lt;br /&gt;
ipdel 99 69.55.230.58&lt;br /&gt;
v set 99 --ifname eth99 --ipadd 69.55.230.58 --save&lt;br /&gt;
v set 99 --ifname eth99 --gateway 69.55.230.1 --save&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active      eth0              veth77.77,veth99.99&lt;br /&gt;
veth_net          active&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
br99             bridge     net99&lt;br /&gt;
veth99.99        veth       net99&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        net99            69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br0 eth0&lt;br /&gt;
&lt;br /&gt;
(will remove 99 from orig net and move to veth_net)&lt;br /&gt;
vznetcfg net addif veth_net veth99.99&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
(delete the old crap)&lt;br /&gt;
vznetcfg net del net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, to add another device in&lt;br /&gt;
&lt;br /&gt;
v set 77 --netif_add eth77  --save&lt;br /&gt;
ipdel 77 69.55.230.78&lt;br /&gt;
v set 77 --ifname eth77 --ipadd 69.55.230.78 --save&lt;br /&gt;
v set 77 --ifname eth77 --gateway 69.55.230.1 --save&lt;br /&gt;
v set 77 --save --ifname eth77 --network veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif veth_net veth77.77&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth       veth_net&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
another example&lt;br /&gt;
&lt;br /&gt;
v set 1182 --netif_add eth1182  --save&lt;br /&gt;
ipdel 1182 69.55.236.217&lt;br /&gt;
v set 1182 --ifname eth1182 --ipadd 69.55.236.217 --save&lt;br /&gt;
v set 1182 --ifname eth1182 --gateway 69.55.236.1 --save&lt;br /&gt;
vznetcfg net addif veth_net veth1182.1182&lt;br /&gt;
v set 1182 --save --ifname eth1182 --network veth_net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unused/not working commands:&lt;br /&gt;
ifconfig veth99.0 0&lt;br /&gt;
vznetcfg net list&lt;br /&gt;
vznetcfg br new br99 net99&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg br show&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
vznetcfg br new br1182 net1182&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif eth0 net1182&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&lt;br /&gt;
--- 8&amp;lt; ---&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new net&lt;br /&gt;
# vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vzctl set 99 --save --netif_add eth0 (at this stage veth99.0 interface have to appear&lt;br /&gt;
on node)&lt;br /&gt;
# vzctl set 99 --save --ifname eth0 --ipadd 69.55.230.58 (and probably few more arguments&lt;br /&gt;
here - see &#039;man vzctl&#039;)&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assigning/remove ip from a VE ==&lt;br /&gt;
&lt;br /&gt;
1. Add or remove ips:&lt;br /&gt;
 ipdel 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
 ipadd 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
&lt;br /&gt;
2. update Mgmt screens&lt;br /&gt;
&lt;br /&gt;
3. offer to update any DNS we do for them&lt;br /&gt;
&lt;br /&gt;
4. check to see if we had rules for old IP in firwall&lt;br /&gt;
&lt;br /&gt;
== Enabling tun device for a ve ==&lt;br /&gt;
Note, there’s a command for this: [[#addtun|addtun]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
Make sure the tun.o module is already loaded before Virtuozzo is started: &lt;br /&gt;
 lsmod &lt;br /&gt;
Allow the VPS to use the TUN/TAP device: &lt;br /&gt;
 vzctl set 101 --devices c:10:200:rw --save &lt;br /&gt;
Create the corresponding device inside the VPS and set the proper permissions: &lt;br /&gt;
 vzctl exec 101 mkdir -p /dev/net &lt;br /&gt;
 vzctl exec 101 mknod /dev/net/tun c 10 200 &lt;br /&gt;
 vzctl exec 101 chmod 600 /dev/net/tun&lt;br /&gt;
&lt;br /&gt;
== Remaking a system (on same virt) ==&lt;br /&gt;
&lt;br /&gt;
1. [[#cancelve|cancelve]] (or v destroy x - ONLY if you&#039;re POSITIVE no data needs to be saved)&lt;br /&gt;
&lt;br /&gt;
2. [[#vemake|vemake]] using same veid&lt;br /&gt;
&lt;br /&gt;
3. [[#mvbackups|mvbackups]] or [[#vb|vb]] (if new mount point)&lt;br /&gt;
&lt;br /&gt;
4. update mgmt with new dir/ip &lt;br /&gt;
&lt;br /&gt;
5. update firewall if changed ip&lt;br /&gt;
&lt;br /&gt;
== Re-initialize quota for a VE ==&lt;br /&gt;
&lt;br /&gt;
There’s a commamd for this now: [[#clearquota|clearquota]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzquota drop 1&lt;br /&gt;
vzctl start 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;br /&gt;
&lt;br /&gt;
== stopvirt ==&lt;br /&gt;
 stopvirt&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1035</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1035"/>
		<updated>2013-03-11T23:48:46Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Making new customer VE (vm) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
== Making new customer VE (vemakexxx) ==&lt;br /&gt;
&lt;br /&gt;
This applies to older virts with old templates. This should probably not be used at all anymore.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. look thru hist for ip&lt;br /&gt;
&lt;br /&gt;
2. confirm ip you want to use isn’t in use via Mgmt. -&amp;gt; IP Map in management screens&lt;br /&gt;
&lt;br /&gt;
3. put ve on whichever partition has more space&lt;br /&gt;
 vemakerh9 &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; &amp;lt;hostname&amp;gt; &amp;lt;mount&amp;gt; &amp;lt;email&amp;gt; [gb disk]; &amp;lt;256|384|512&amp;gt; &amp;lt;veid&amp;gt;&lt;br /&gt;
 vemakerh9 866 69.55.226.109 ngentu.com /vz1 ayo@ngantu.com,asd@asd.com 5; 256 866&lt;br /&gt;
&lt;br /&gt;
4. copy (veid), dir, and ip to pending customer screen (pass set to p455agfa)&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrateonline/migrate failures (migrate manually) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. If it fails with [[#migrateonline|migrateonline]], you should try [[#migrate|migrate]] (which will reboot the customer, so notify them ahead of time).&lt;br /&gt;
&lt;br /&gt;
You may want to run a [[#pre-seeding_a_migration|pre-seed]] rsync to see if you can find the problem. On older virts, we&#039;ve seen this problem due to a large logfile (which you can find and encourage the customer to remove/compress):&lt;br /&gt;
 for f in `find / -size +1048576k`; do ls -lh $f; done&lt;br /&gt;
&lt;br /&gt;
You may also see migration failing due to quota issues.&lt;br /&gt;
&lt;br /&gt;
You can try to resolve by copying any quota file into the file you need:&lt;br /&gt;
&lt;br /&gt;
 cp /var/vzquota/quota.1 /var/vzquota/quota.xxx&lt;br /&gt;
&lt;br /&gt;
If it complains about quota running you should then be able to stop it&lt;br /&gt;
&lt;br /&gt;
 vzquota off xxxx&lt;br /&gt;
&lt;br /&gt;
If all else fails, migrate to a new VEID&lt;br /&gt;
i.e. 1234 becomes 12341&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the rsync or [[#migrate|migrate]] fails, you can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE on the same virt ==&lt;br /&gt;
&lt;br /&gt;
Easy way:&amp;lt;br&amp;gt;&lt;br /&gt;
Scenario 1: ve 123 is to be renamed 1231 and moved from vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:1231:/vz/private/1231:/vz/root/1231&lt;br /&gt;
&lt;br /&gt;
Scenario 2: ve 123 is to be moved vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:123:/vz/private/123:/vz/root/123&lt;br /&gt;
&lt;br /&gt;
vzmlocal will reboot the ve at the end of the move&lt;br /&gt;
&lt;br /&gt;
Manual/old way:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;tt&amp;gt;vzctl stop 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2) &amp;lt;tt&amp;gt;mv /vz1/private/123 /vz/private/.&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(or cp -a if you want to copy)&lt;br /&gt;
3) in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts/123.conf&amp;lt;/tt&amp;gt; change value&amp;lt;br&amp;gt;&lt;br /&gt;
of &#039;&amp;lt;tt&amp;gt;VE_PRIVATE&amp;lt;/tt&amp;gt;&#039; variable to point to a new private area location&lt;br /&gt;
4) &amp;lt;tt&amp;gt;vzctl start 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
5) update backups if needed: &amp;lt;tt&amp;gt;mvbackups 123 virtX virt1 vz&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
6) update management scerens&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: a) absolute path to private area is stored in quota file &amp;lt;tt&amp;gt;/var/vzquota/quota.123&amp;lt;/tt&amp;gt; - so during first startup quota will be recalculated.&amp;lt;br&amp;gt;&lt;br /&gt;
b) if you&#039;re going to write some script to do a job, you MUST be sure that $VEID won&#039;t be expanded to &#039;&#039; in ve config file - ie. you need to escape &#039;$&#039;. Otherwise you might have:&lt;br /&gt;
&lt;br /&gt;
 VE_PRIVATE=&amp;quot;/vz/private/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in config, and &#039;vzctl destroy&#039; for this VE ID &#039;&#039;&#039;will remove everything under /vz/private/ directory&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Adding a veth device to a VE ==&lt;br /&gt;
&lt;br /&gt;
Not totally sure what this is, but a customer asked for it and here&#039;s what we did (as instructed by vz support):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;v set 99 --netif_add eth99  --save&lt;br /&gt;
ipdel 99 69.55.230.58&lt;br /&gt;
v set 99 --ifname eth99 --ipadd 69.55.230.58 --save&lt;br /&gt;
v set 99 --ifname eth99 --gateway 69.55.230.1 --save&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active      eth0              veth77.77,veth99.99&lt;br /&gt;
veth_net          active&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
br99             bridge     net99&lt;br /&gt;
veth99.99        veth       net99&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        net99            69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br0 eth0&lt;br /&gt;
&lt;br /&gt;
(will remove 99 from orig net and move to veth_net)&lt;br /&gt;
vznetcfg net addif veth_net veth99.99&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
(delete the old crap)&lt;br /&gt;
vznetcfg net del net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, to add another device in&lt;br /&gt;
&lt;br /&gt;
v set 77 --netif_add eth77  --save&lt;br /&gt;
ipdel 77 69.55.230.78&lt;br /&gt;
v set 77 --ifname eth77 --ipadd 69.55.230.78 --save&lt;br /&gt;
v set 77 --ifname eth77 --gateway 69.55.230.1 --save&lt;br /&gt;
v set 77 --save --ifname eth77 --network veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif veth_net veth77.77&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth       veth_net&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
another example&lt;br /&gt;
&lt;br /&gt;
v set 1182 --netif_add eth1182  --save&lt;br /&gt;
ipdel 1182 69.55.236.217&lt;br /&gt;
v set 1182 --ifname eth1182 --ipadd 69.55.236.217 --save&lt;br /&gt;
v set 1182 --ifname eth1182 --gateway 69.55.236.1 --save&lt;br /&gt;
vznetcfg net addif veth_net veth1182.1182&lt;br /&gt;
v set 1182 --save --ifname eth1182 --network veth_net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unused/not working commands:&lt;br /&gt;
ifconfig veth99.0 0&lt;br /&gt;
vznetcfg net list&lt;br /&gt;
vznetcfg br new br99 net99&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg br show&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
vznetcfg br new br1182 net1182&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif eth0 net1182&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&lt;br /&gt;
--- 8&amp;lt; ---&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new net&lt;br /&gt;
# vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vzctl set 99 --save --netif_add eth0 (at this stage veth99.0 interface have to appear&lt;br /&gt;
on node)&lt;br /&gt;
# vzctl set 99 --save --ifname eth0 --ipadd 69.55.230.58 (and probably few more arguments&lt;br /&gt;
here - see &#039;man vzctl&#039;)&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assigning/remove ip from a VE ==&lt;br /&gt;
&lt;br /&gt;
1. Add or remove ips:&lt;br /&gt;
 ipdel 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
 ipadd 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
&lt;br /&gt;
2. update Mgmt screens&lt;br /&gt;
&lt;br /&gt;
3. offer to update any DNS we do for them&lt;br /&gt;
&lt;br /&gt;
4. check to see if we had rules for old IP in firwall&lt;br /&gt;
&lt;br /&gt;
== Enabling tun device for a ve ==&lt;br /&gt;
Note, there’s a command for this: [[#addtun|addtun]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
Make sure the tun.o module is already loaded before Virtuozzo is started: &lt;br /&gt;
 lsmod &lt;br /&gt;
Allow the VPS to use the TUN/TAP device: &lt;br /&gt;
 vzctl set 101 --devices c:10:200:rw --save &lt;br /&gt;
Create the corresponding device inside the VPS and set the proper permissions: &lt;br /&gt;
 vzctl exec 101 mkdir -p /dev/net &lt;br /&gt;
 vzctl exec 101 mknod /dev/net/tun c 10 200 &lt;br /&gt;
 vzctl exec 101 chmod 600 /dev/net/tun&lt;br /&gt;
&lt;br /&gt;
== Remaking a system (on same virt) ==&lt;br /&gt;
&lt;br /&gt;
1. [[#cancelve|cancelve]] (or v destroy x - ONLY if you&#039;re POSITIVE no data needs to be saved)&lt;br /&gt;
&lt;br /&gt;
2. [[#vemake|vemake]] using same veid&lt;br /&gt;
&lt;br /&gt;
3. [[#mvbackups|mvbackups]] or [[#vb|vb]] (if new mount point)&lt;br /&gt;
&lt;br /&gt;
4. update mgmt with new dir/ip &lt;br /&gt;
&lt;br /&gt;
5. update firewall if changed ip&lt;br /&gt;
&lt;br /&gt;
== Re-initialize quota for a VE ==&lt;br /&gt;
&lt;br /&gt;
There’s a commamd for this now: [[#clearquota|clearquota]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzquota drop 1&lt;br /&gt;
vzctl start 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;br /&gt;
&lt;br /&gt;
== stopvirt ==&lt;br /&gt;
 stopvirt&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1034</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1034"/>
		<updated>2013-03-11T23:48:32Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Making new customer VE (vm) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
== Making new customer VE (vm) ==&lt;br /&gt;
&lt;br /&gt;
This applies only to new virts &amp;gt;= 4.x&lt;br /&gt;
&lt;br /&gt;
grab ip from ipmap (if opened from the pending cust screen it should take you to the right block). You can also run vzlist -a to see what block is in use, generally. Try to find an IP that&#039;s in the same block of class C IP&#039;s already on the box.&lt;br /&gt;
&lt;br /&gt;
1. confirm ip you want to use isn’t in use via Mgmt. -&amp;gt; IP Map in management screens&lt;br /&gt;
&lt;br /&gt;
2. put CT on whichever partition has more space&lt;br /&gt;
&lt;br /&gt;
3.  vm CID IP hostname /vz[1|2] email[,email] template ( &amp;lt;LB|LBP|LS|LM|LMP|LP&amp;gt; [disk] | &amp;lt;gb_disk/mb_ram/gb_burst&amp;gt; ) &lt;br /&gt;
 vm col00009 69.55.230.238 centos.testdave.com /vz1 dsmith@n2.net centos-6-x86_64 LM&lt;br /&gt;
&lt;br /&gt;
4. copy veid, dir, ip and password to pending customer screen. activate customer&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Making new customer VE (vemakexxx) ==&lt;br /&gt;
&lt;br /&gt;
This applies to older virts with old templates. This should probably not be used at all anymore.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. look thru hist for ip&lt;br /&gt;
&lt;br /&gt;
2. confirm ip you want to use isn’t in use via Mgmt. -&amp;gt; IP Map in management screens&lt;br /&gt;
&lt;br /&gt;
3. put ve on whichever partition has more space&lt;br /&gt;
 vemakerh9 &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; &amp;lt;hostname&amp;gt; &amp;lt;mount&amp;gt; &amp;lt;email&amp;gt; [gb disk]; &amp;lt;256|384|512&amp;gt; &amp;lt;veid&amp;gt;&lt;br /&gt;
 vemakerh9 866 69.55.226.109 ngentu.com /vz1 ayo@ngantu.com,asd@asd.com 5; 256 866&lt;br /&gt;
&lt;br /&gt;
4. copy (veid), dir, and ip to pending customer screen (pass set to p455agfa)&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrateonline/migrate failures (migrate manually) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. If it fails with [[#migrateonline|migrateonline]], you should try [[#migrate|migrate]] (which will reboot the customer, so notify them ahead of time).&lt;br /&gt;
&lt;br /&gt;
You may want to run a [[#pre-seeding_a_migration|pre-seed]] rsync to see if you can find the problem. On older virts, we&#039;ve seen this problem due to a large logfile (which you can find and encourage the customer to remove/compress):&lt;br /&gt;
 for f in `find / -size +1048576k`; do ls -lh $f; done&lt;br /&gt;
&lt;br /&gt;
You may also see migration failing due to quota issues.&lt;br /&gt;
&lt;br /&gt;
You can try to resolve by copying any quota file into the file you need:&lt;br /&gt;
&lt;br /&gt;
 cp /var/vzquota/quota.1 /var/vzquota/quota.xxx&lt;br /&gt;
&lt;br /&gt;
If it complains about quota running you should then be able to stop it&lt;br /&gt;
&lt;br /&gt;
 vzquota off xxxx&lt;br /&gt;
&lt;br /&gt;
If all else fails, migrate to a new VEID&lt;br /&gt;
i.e. 1234 becomes 12341&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the rsync or [[#migrate|migrate]] fails, you can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE on the same virt ==&lt;br /&gt;
&lt;br /&gt;
Easy way:&amp;lt;br&amp;gt;&lt;br /&gt;
Scenario 1: ve 123 is to be renamed 1231 and moved from vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:1231:/vz/private/1231:/vz/root/1231&lt;br /&gt;
&lt;br /&gt;
Scenario 2: ve 123 is to be moved vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:123:/vz/private/123:/vz/root/123&lt;br /&gt;
&lt;br /&gt;
vzmlocal will reboot the ve at the end of the move&lt;br /&gt;
&lt;br /&gt;
Manual/old way:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;tt&amp;gt;vzctl stop 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2) &amp;lt;tt&amp;gt;mv /vz1/private/123 /vz/private/.&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(or cp -a if you want to copy)&lt;br /&gt;
3) in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts/123.conf&amp;lt;/tt&amp;gt; change value&amp;lt;br&amp;gt;&lt;br /&gt;
of &#039;&amp;lt;tt&amp;gt;VE_PRIVATE&amp;lt;/tt&amp;gt;&#039; variable to point to a new private area location&lt;br /&gt;
4) &amp;lt;tt&amp;gt;vzctl start 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
5) update backups if needed: &amp;lt;tt&amp;gt;mvbackups 123 virtX virt1 vz&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
6) update management scerens&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: a) absolute path to private area is stored in quota file &amp;lt;tt&amp;gt;/var/vzquota/quota.123&amp;lt;/tt&amp;gt; - so during first startup quota will be recalculated.&amp;lt;br&amp;gt;&lt;br /&gt;
b) if you&#039;re going to write some script to do a job, you MUST be sure that $VEID won&#039;t be expanded to &#039;&#039; in ve config file - ie. you need to escape &#039;$&#039;. Otherwise you might have:&lt;br /&gt;
&lt;br /&gt;
 VE_PRIVATE=&amp;quot;/vz/private/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in config, and &#039;vzctl destroy&#039; for this VE ID &#039;&#039;&#039;will remove everything under /vz/private/ directory&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Adding a veth device to a VE ==&lt;br /&gt;
&lt;br /&gt;
Not totally sure what this is, but a customer asked for it and here&#039;s what we did (as instructed by vz support):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;v set 99 --netif_add eth99  --save&lt;br /&gt;
ipdel 99 69.55.230.58&lt;br /&gt;
v set 99 --ifname eth99 --ipadd 69.55.230.58 --save&lt;br /&gt;
v set 99 --ifname eth99 --gateway 69.55.230.1 --save&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active      eth0              veth77.77,veth99.99&lt;br /&gt;
veth_net          active&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
br99             bridge     net99&lt;br /&gt;
veth99.99        veth       net99&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        net99            69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br0 eth0&lt;br /&gt;
&lt;br /&gt;
(will remove 99 from orig net and move to veth_net)&lt;br /&gt;
vznetcfg net addif veth_net veth99.99&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
(delete the old crap)&lt;br /&gt;
vznetcfg net del net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, to add another device in&lt;br /&gt;
&lt;br /&gt;
v set 77 --netif_add eth77  --save&lt;br /&gt;
ipdel 77 69.55.230.78&lt;br /&gt;
v set 77 --ifname eth77 --ipadd 69.55.230.78 --save&lt;br /&gt;
v set 77 --ifname eth77 --gateway 69.55.230.1 --save&lt;br /&gt;
v set 77 --save --ifname eth77 --network veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif veth_net veth77.77&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth       veth_net&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
another example&lt;br /&gt;
&lt;br /&gt;
v set 1182 --netif_add eth1182  --save&lt;br /&gt;
ipdel 1182 69.55.236.217&lt;br /&gt;
v set 1182 --ifname eth1182 --ipadd 69.55.236.217 --save&lt;br /&gt;
v set 1182 --ifname eth1182 --gateway 69.55.236.1 --save&lt;br /&gt;
vznetcfg net addif veth_net veth1182.1182&lt;br /&gt;
v set 1182 --save --ifname eth1182 --network veth_net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unused/not working commands:&lt;br /&gt;
ifconfig veth99.0 0&lt;br /&gt;
vznetcfg net list&lt;br /&gt;
vznetcfg br new br99 net99&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg br show&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
vznetcfg br new br1182 net1182&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif eth0 net1182&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&lt;br /&gt;
--- 8&amp;lt; ---&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new net&lt;br /&gt;
# vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vzctl set 99 --save --netif_add eth0 (at this stage veth99.0 interface have to appear&lt;br /&gt;
on node)&lt;br /&gt;
# vzctl set 99 --save --ifname eth0 --ipadd 69.55.230.58 (and probably few more arguments&lt;br /&gt;
here - see &#039;man vzctl&#039;)&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assigning/remove ip from a VE ==&lt;br /&gt;
&lt;br /&gt;
1. Add or remove ips:&lt;br /&gt;
 ipdel 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
 ipadd 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
&lt;br /&gt;
2. update Mgmt screens&lt;br /&gt;
&lt;br /&gt;
3. offer to update any DNS we do for them&lt;br /&gt;
&lt;br /&gt;
4. check to see if we had rules for old IP in firwall&lt;br /&gt;
&lt;br /&gt;
== Enabling tun device for a ve ==&lt;br /&gt;
Note, there’s a command for this: [[#addtun|addtun]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
Make sure the tun.o module is already loaded before Virtuozzo is started: &lt;br /&gt;
 lsmod &lt;br /&gt;
Allow the VPS to use the TUN/TAP device: &lt;br /&gt;
 vzctl set 101 --devices c:10:200:rw --save &lt;br /&gt;
Create the corresponding device inside the VPS and set the proper permissions: &lt;br /&gt;
 vzctl exec 101 mkdir -p /dev/net &lt;br /&gt;
 vzctl exec 101 mknod /dev/net/tun c 10 200 &lt;br /&gt;
 vzctl exec 101 chmod 600 /dev/net/tun&lt;br /&gt;
&lt;br /&gt;
== Remaking a system (on same virt) ==&lt;br /&gt;
&lt;br /&gt;
1. [[#cancelve|cancelve]] (or v destroy x - ONLY if you&#039;re POSITIVE no data needs to be saved)&lt;br /&gt;
&lt;br /&gt;
2. [[#vemake|vemake]] using same veid&lt;br /&gt;
&lt;br /&gt;
3. [[#mvbackups|mvbackups]] or [[#vb|vb]] (if new mount point)&lt;br /&gt;
&lt;br /&gt;
4. update mgmt with new dir/ip &lt;br /&gt;
&lt;br /&gt;
5. update firewall if changed ip&lt;br /&gt;
&lt;br /&gt;
== Re-initialize quota for a VE ==&lt;br /&gt;
&lt;br /&gt;
There’s a commamd for this now: [[#clearquota|clearquota]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzquota drop 1&lt;br /&gt;
vzctl start 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;br /&gt;
&lt;br /&gt;
== stopvirt ==&lt;br /&gt;
 stopvirt&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1033</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1033"/>
		<updated>2013-03-11T23:46:18Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Making new customer VE (vm) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
= Making new customer VE (vm) =&lt;br /&gt;
&lt;br /&gt;
This applies only to new virts &amp;gt;= 4.x&lt;br /&gt;
&lt;br /&gt;
grab ip from ipmap (if opened from the pending cust screen it should take you to the right block). You can also run vzlist -a to see what block is in use, generally. Try to find an IP that&#039;s in the same block of class C IP&#039;s already on the box.&lt;br /&gt;
&lt;br /&gt;
1. confirm ip you want to use isn’t in use via Mgmt. -&amp;gt; IP Map in management screens&lt;br /&gt;
&lt;br /&gt;
2. put CT on whichever partition has more space&lt;br /&gt;
&lt;br /&gt;
3.  vm CID IP hostname /vz[1|2] email[,email] template ( &amp;lt;LB|LBP|LS|LM|LMP|LP&amp;gt; [disk] | &amp;lt;gb_disk/mb_ram/gb_burst&amp;gt; ) &lt;br /&gt;
 vm col00009 69.55.230.238 centos.testdave.com /vz1 dsmith@n2.net centos-6-x86_64 LM&lt;br /&gt;
&lt;br /&gt;
4. copy veid, dir, ip and password to pending customer screen. activate customer&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrateonline/migrate failures (migrate manually) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. If it fails with [[#migrateonline|migrateonline]], you should try [[#migrate|migrate]] (which will reboot the customer, so notify them ahead of time).&lt;br /&gt;
&lt;br /&gt;
You may want to run a [[#pre-seeding_a_migration|pre-seed]] rsync to see if you can find the problem. On older virts, we&#039;ve seen this problem due to a large logfile (which you can find and encourage the customer to remove/compress):&lt;br /&gt;
 for f in `find / -size +1048576k`; do ls -lh $f; done&lt;br /&gt;
&lt;br /&gt;
You may also see migration failing due to quota issues.&lt;br /&gt;
&lt;br /&gt;
You can try to resolve by copying any quota file into the file you need:&lt;br /&gt;
&lt;br /&gt;
 cp /var/vzquota/quota.1 /var/vzquota/quota.xxx&lt;br /&gt;
&lt;br /&gt;
If it complains about quota running you should then be able to stop it&lt;br /&gt;
&lt;br /&gt;
 vzquota off xxxx&lt;br /&gt;
&lt;br /&gt;
If all else fails, migrate to a new VEID&lt;br /&gt;
i.e. 1234 becomes 12341&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the rsync or [[#migrate|migrate]] fails, you can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE on the same virt ==&lt;br /&gt;
&lt;br /&gt;
Easy way:&amp;lt;br&amp;gt;&lt;br /&gt;
Scenario 1: ve 123 is to be renamed 1231 and moved from vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:1231:/vz/private/1231:/vz/root/1231&lt;br /&gt;
&lt;br /&gt;
Scenario 2: ve 123 is to be moved vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:123:/vz/private/123:/vz/root/123&lt;br /&gt;
&lt;br /&gt;
vzmlocal will reboot the ve at the end of the move&lt;br /&gt;
&lt;br /&gt;
Manual/old way:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;tt&amp;gt;vzctl stop 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2) &amp;lt;tt&amp;gt;mv /vz1/private/123 /vz/private/.&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(or cp -a if you want to copy)&lt;br /&gt;
3) in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts/123.conf&amp;lt;/tt&amp;gt; change value&amp;lt;br&amp;gt;&lt;br /&gt;
of &#039;&amp;lt;tt&amp;gt;VE_PRIVATE&amp;lt;/tt&amp;gt;&#039; variable to point to a new private area location&lt;br /&gt;
4) &amp;lt;tt&amp;gt;vzctl start 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
5) update backups if needed: &amp;lt;tt&amp;gt;mvbackups 123 virtX virt1 vz&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
6) update management scerens&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: a) absolute path to private area is stored in quota file &amp;lt;tt&amp;gt;/var/vzquota/quota.123&amp;lt;/tt&amp;gt; - so during first startup quota will be recalculated.&amp;lt;br&amp;gt;&lt;br /&gt;
b) if you&#039;re going to write some script to do a job, you MUST be sure that $VEID won&#039;t be expanded to &#039;&#039; in ve config file - ie. you need to escape &#039;$&#039;. Otherwise you might have:&lt;br /&gt;
&lt;br /&gt;
 VE_PRIVATE=&amp;quot;/vz/private/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in config, and &#039;vzctl destroy&#039; for this VE ID &#039;&#039;&#039;will remove everything under /vz/private/ directory&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Adding a veth device to a VE ==&lt;br /&gt;
&lt;br /&gt;
Not totally sure what this is, but a customer asked for it and here&#039;s what we did (as instructed by vz support):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;v set 99 --netif_add eth99  --save&lt;br /&gt;
ipdel 99 69.55.230.58&lt;br /&gt;
v set 99 --ifname eth99 --ipadd 69.55.230.58 --save&lt;br /&gt;
v set 99 --ifname eth99 --gateway 69.55.230.1 --save&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active      eth0              veth77.77,veth99.99&lt;br /&gt;
veth_net          active&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
br99             bridge     net99&lt;br /&gt;
veth99.99        veth       net99&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        net99            69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br0 eth0&lt;br /&gt;
&lt;br /&gt;
(will remove 99 from orig net and move to veth_net)&lt;br /&gt;
vznetcfg net addif veth_net veth99.99&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
(delete the old crap)&lt;br /&gt;
vznetcfg net del net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, to add another device in&lt;br /&gt;
&lt;br /&gt;
v set 77 --netif_add eth77  --save&lt;br /&gt;
ipdel 77 69.55.230.78&lt;br /&gt;
v set 77 --ifname eth77 --ipadd 69.55.230.78 --save&lt;br /&gt;
v set 77 --ifname eth77 --gateway 69.55.230.1 --save&lt;br /&gt;
v set 77 --save --ifname eth77 --network veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif veth_net veth77.77&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth       veth_net&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
another example&lt;br /&gt;
&lt;br /&gt;
v set 1182 --netif_add eth1182  --save&lt;br /&gt;
ipdel 1182 69.55.236.217&lt;br /&gt;
v set 1182 --ifname eth1182 --ipadd 69.55.236.217 --save&lt;br /&gt;
v set 1182 --ifname eth1182 --gateway 69.55.236.1 --save&lt;br /&gt;
vznetcfg net addif veth_net veth1182.1182&lt;br /&gt;
v set 1182 --save --ifname eth1182 --network veth_net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unused/not working commands:&lt;br /&gt;
ifconfig veth99.0 0&lt;br /&gt;
vznetcfg net list&lt;br /&gt;
vznetcfg br new br99 net99&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg br show&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
vznetcfg br new br1182 net1182&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif eth0 net1182&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&lt;br /&gt;
--- 8&amp;lt; ---&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new net&lt;br /&gt;
# vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vzctl set 99 --save --netif_add eth0 (at this stage veth99.0 interface have to appear&lt;br /&gt;
on node)&lt;br /&gt;
# vzctl set 99 --save --ifname eth0 --ipadd 69.55.230.58 (and probably few more arguments&lt;br /&gt;
here - see &#039;man vzctl&#039;)&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assigning/remove ip from a VE ==&lt;br /&gt;
&lt;br /&gt;
1. Add or remove ips:&lt;br /&gt;
 ipdel 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
 ipadd 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
&lt;br /&gt;
2. update Mgmt screens&lt;br /&gt;
&lt;br /&gt;
3. offer to update any DNS we do for them&lt;br /&gt;
&lt;br /&gt;
4. check to see if we had rules for old IP in firwall&lt;br /&gt;
&lt;br /&gt;
== Enabling tun device for a ve ==&lt;br /&gt;
Note, there’s a command for this: [[#addtun|addtun]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
Make sure the tun.o module is already loaded before Virtuozzo is started: &lt;br /&gt;
 lsmod &lt;br /&gt;
Allow the VPS to use the TUN/TAP device: &lt;br /&gt;
 vzctl set 101 --devices c:10:200:rw --save &lt;br /&gt;
Create the corresponding device inside the VPS and set the proper permissions: &lt;br /&gt;
 vzctl exec 101 mkdir -p /dev/net &lt;br /&gt;
 vzctl exec 101 mknod /dev/net/tun c 10 200 &lt;br /&gt;
 vzctl exec 101 chmod 600 /dev/net/tun&lt;br /&gt;
&lt;br /&gt;
== Remaking a system (on same virt) ==&lt;br /&gt;
&lt;br /&gt;
1. [[#cancelve|cancelve]] (or v destroy x - ONLY if you&#039;re POSITIVE no data needs to be saved)&lt;br /&gt;
&lt;br /&gt;
2. [[#vemake|vemake]] using same veid&lt;br /&gt;
&lt;br /&gt;
3. [[#mvbackups|mvbackups]] or [[#vb|vb]] (if new mount point)&lt;br /&gt;
&lt;br /&gt;
4. update mgmt with new dir/ip &lt;br /&gt;
&lt;br /&gt;
5. update firewall if changed ip&lt;br /&gt;
&lt;br /&gt;
== Re-initialize quota for a VE ==&lt;br /&gt;
&lt;br /&gt;
There’s a commamd for this now: [[#clearquota|clearquota]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzquota drop 1&lt;br /&gt;
vzctl start 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;br /&gt;
&lt;br /&gt;
== stopvirt ==&lt;br /&gt;
 stopvirt&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1032</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1032"/>
		<updated>2013-03-11T23:44:32Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Virtuozzo VPS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
= Making new customer VE (vm) =&lt;br /&gt;
&lt;br /&gt;
This applies only to new virts &amp;gt;= 4.x&lt;br /&gt;
&lt;br /&gt;
grab ip from ipmap (if opened from the pending cust screen it should take you to the right block). You can also run vzlist -a to see what block is in use, generally. &lt;br /&gt;
#	confirm ip you want to use isn’t in use via Mgmt. -&amp;gt; IP Map in management screens&lt;br /&gt;
#	put CT on opposite on whichever partition has more space&lt;br /&gt;
#	vm &amp;lt;CID&amp;gt; &amp;lt;IP&amp;gt; &amp;lt;hostname&amp;gt; &amp;lt;mountpoint&amp;gt; &amp;lt;email&amp;gt; &amp;lt;template&amp;gt; &amp;lt;256|384|512|768&amp;gt; [disk] &lt;br /&gt;
vm col01959 69.55.236.214 gemini /vz1 finbar@arrivell.com ubuntu-9.04 256&lt;br /&gt;
#	copy veid, dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrateonline/migrate failures (migrate manually) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. If it fails with [[#migrateonline|migrateonline]], you should try [[#migrate|migrate]] (which will reboot the customer, so notify them ahead of time).&lt;br /&gt;
&lt;br /&gt;
You may want to run a [[#pre-seeding_a_migration|pre-seed]] rsync to see if you can find the problem. On older virts, we&#039;ve seen this problem due to a large logfile (which you can find and encourage the customer to remove/compress):&lt;br /&gt;
 for f in `find / -size +1048576k`; do ls -lh $f; done&lt;br /&gt;
&lt;br /&gt;
You may also see migration failing due to quota issues.&lt;br /&gt;
&lt;br /&gt;
You can try to resolve by copying any quota file into the file you need:&lt;br /&gt;
&lt;br /&gt;
 cp /var/vzquota/quota.1 /var/vzquota/quota.xxx&lt;br /&gt;
&lt;br /&gt;
If it complains about quota running you should then be able to stop it&lt;br /&gt;
&lt;br /&gt;
 vzquota off xxxx&lt;br /&gt;
&lt;br /&gt;
If all else fails, migrate to a new VEID&lt;br /&gt;
i.e. 1234 becomes 12341&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the rsync or [[#migrate|migrate]] fails, you can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE on the same virt ==&lt;br /&gt;
&lt;br /&gt;
Easy way:&amp;lt;br&amp;gt;&lt;br /&gt;
Scenario 1: ve 123 is to be renamed 1231 and moved from vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:1231:/vz/private/1231:/vz/root/1231&lt;br /&gt;
&lt;br /&gt;
Scenario 2: ve 123 is to be moved vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:123:/vz/private/123:/vz/root/123&lt;br /&gt;
&lt;br /&gt;
vzmlocal will reboot the ve at the end of the move&lt;br /&gt;
&lt;br /&gt;
Manual/old way:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;tt&amp;gt;vzctl stop 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2) &amp;lt;tt&amp;gt;mv /vz1/private/123 /vz/private/.&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(or cp -a if you want to copy)&lt;br /&gt;
3) in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts/123.conf&amp;lt;/tt&amp;gt; change value&amp;lt;br&amp;gt;&lt;br /&gt;
of &#039;&amp;lt;tt&amp;gt;VE_PRIVATE&amp;lt;/tt&amp;gt;&#039; variable to point to a new private area location&lt;br /&gt;
4) &amp;lt;tt&amp;gt;vzctl start 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
5) update backups if needed: &amp;lt;tt&amp;gt;mvbackups 123 virtX virt1 vz&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
6) update management scerens&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: a) absolute path to private area is stored in quota file &amp;lt;tt&amp;gt;/var/vzquota/quota.123&amp;lt;/tt&amp;gt; - so during first startup quota will be recalculated.&amp;lt;br&amp;gt;&lt;br /&gt;
b) if you&#039;re going to write some script to do a job, you MUST be sure that $VEID won&#039;t be expanded to &#039;&#039; in ve config file - ie. you need to escape &#039;$&#039;. Otherwise you might have:&lt;br /&gt;
&lt;br /&gt;
 VE_PRIVATE=&amp;quot;/vz/private/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in config, and &#039;vzctl destroy&#039; for this VE ID &#039;&#039;&#039;will remove everything under /vz/private/ directory&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Adding a veth device to a VE ==&lt;br /&gt;
&lt;br /&gt;
Not totally sure what this is, but a customer asked for it and here&#039;s what we did (as instructed by vz support):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;v set 99 --netif_add eth99  --save&lt;br /&gt;
ipdel 99 69.55.230.58&lt;br /&gt;
v set 99 --ifname eth99 --ipadd 69.55.230.58 --save&lt;br /&gt;
v set 99 --ifname eth99 --gateway 69.55.230.1 --save&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active      eth0              veth77.77,veth99.99&lt;br /&gt;
veth_net          active&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
br99             bridge     net99&lt;br /&gt;
veth99.99        veth       net99&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        net99            69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br0 eth0&lt;br /&gt;
&lt;br /&gt;
(will remove 99 from orig net and move to veth_net)&lt;br /&gt;
vznetcfg net addif veth_net veth99.99&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
(delete the old crap)&lt;br /&gt;
vznetcfg net del net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, to add another device in&lt;br /&gt;
&lt;br /&gt;
v set 77 --netif_add eth77  --save&lt;br /&gt;
ipdel 77 69.55.230.78&lt;br /&gt;
v set 77 --ifname eth77 --ipadd 69.55.230.78 --save&lt;br /&gt;
v set 77 --ifname eth77 --gateway 69.55.230.1 --save&lt;br /&gt;
v set 77 --save --ifname eth77 --network veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif veth_net veth77.77&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth       veth_net&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
another example&lt;br /&gt;
&lt;br /&gt;
v set 1182 --netif_add eth1182  --save&lt;br /&gt;
ipdel 1182 69.55.236.217&lt;br /&gt;
v set 1182 --ifname eth1182 --ipadd 69.55.236.217 --save&lt;br /&gt;
v set 1182 --ifname eth1182 --gateway 69.55.236.1 --save&lt;br /&gt;
vznetcfg net addif veth_net veth1182.1182&lt;br /&gt;
v set 1182 --save --ifname eth1182 --network veth_net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unused/not working commands:&lt;br /&gt;
ifconfig veth99.0 0&lt;br /&gt;
vznetcfg net list&lt;br /&gt;
vznetcfg br new br99 net99&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg br show&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
vznetcfg br new br1182 net1182&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif eth0 net1182&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&lt;br /&gt;
--- 8&amp;lt; ---&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new net&lt;br /&gt;
# vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vzctl set 99 --save --netif_add eth0 (at this stage veth99.0 interface have to appear&lt;br /&gt;
on node)&lt;br /&gt;
# vzctl set 99 --save --ifname eth0 --ipadd 69.55.230.58 (and probably few more arguments&lt;br /&gt;
here - see &#039;man vzctl&#039;)&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assigning/remove ip from a VE ==&lt;br /&gt;
&lt;br /&gt;
1. Add or remove ips:&lt;br /&gt;
 ipdel 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
 ipadd 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
&lt;br /&gt;
2. update Mgmt screens&lt;br /&gt;
&lt;br /&gt;
3. offer to update any DNS we do for them&lt;br /&gt;
&lt;br /&gt;
4. check to see if we had rules for old IP in firwall&lt;br /&gt;
&lt;br /&gt;
== Enabling tun device for a ve ==&lt;br /&gt;
Note, there’s a command for this: [[#addtun|addtun]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
Make sure the tun.o module is already loaded before Virtuozzo is started: &lt;br /&gt;
 lsmod &lt;br /&gt;
Allow the VPS to use the TUN/TAP device: &lt;br /&gt;
 vzctl set 101 --devices c:10:200:rw --save &lt;br /&gt;
Create the corresponding device inside the VPS and set the proper permissions: &lt;br /&gt;
 vzctl exec 101 mkdir -p /dev/net &lt;br /&gt;
 vzctl exec 101 mknod /dev/net/tun c 10 200 &lt;br /&gt;
 vzctl exec 101 chmod 600 /dev/net/tun&lt;br /&gt;
&lt;br /&gt;
== Remaking a system (on same virt) ==&lt;br /&gt;
&lt;br /&gt;
1. [[#cancelve|cancelve]] (or v destroy x - ONLY if you&#039;re POSITIVE no data needs to be saved)&lt;br /&gt;
&lt;br /&gt;
2. [[#vemake|vemake]] using same veid&lt;br /&gt;
&lt;br /&gt;
3. [[#mvbackups|mvbackups]] or [[#vb|vb]] (if new mount point)&lt;br /&gt;
&lt;br /&gt;
4. update mgmt with new dir/ip &lt;br /&gt;
&lt;br /&gt;
5. update firewall if changed ip&lt;br /&gt;
&lt;br /&gt;
== Re-initialize quota for a VE ==&lt;br /&gt;
&lt;br /&gt;
There’s a commamd for this now: [[#clearquota|clearquota]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzquota drop 1&lt;br /&gt;
vzctl start 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;br /&gt;
&lt;br /&gt;
== stopvirt ==&lt;br /&gt;
 stopvirt&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1031</id>
		<title>Virtuozzo / Linux Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1031"/>
		<updated>2013-03-11T23:43:01Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Moving virt (drives) to new hardware */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Updating VZ =&lt;br /&gt;
&lt;br /&gt;
 Update Virtuozzo to version 4.0.0&lt;br /&gt;
 Apply minor updates for Virtuozzo 3.0.0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
When you get to the last screen, you will be given an option to &lt;br /&gt;
&lt;br /&gt;
 ( ) Automatically reboot after update&lt;br /&gt;
 (*) Reboot later manually&lt;br /&gt;
&lt;br /&gt;
make sure you choose to reboot later.&lt;br /&gt;
&lt;br /&gt;
= Migrating Templates =&lt;br /&gt;
One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it&#039;s now called) based on a particular ditribution on a host which may or may not share the same distribution. For instance, you could run a CT running Ubuntu while the host machine (Hardware Node or HN) is running CentOS. This is accomplished via the use of OS templates. As long as the HN contains the OS template on which a particular CT relies, it will run there. As such, if you want to move a CT from one HN to another, you will need to make sure the OS template exists there.&lt;br /&gt;
&lt;br /&gt;
Modern versions of VZ (&amp;gt;= 4.x) will check for and automatically move the OS template over to the host as you&#039;re (vz)migrating the CT over to a new HN. However we like to make sure the template is in place prior to moving the CT. &lt;br /&gt;
&lt;br /&gt;
The first step is to see if the template exists on the host. To see OS templates installed:&lt;br /&gt;
&lt;br /&gt;
2.x (shows OS and application templates):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkgls&lt;br /&gt;
mod_ssl-rh9 20040624&lt;br /&gt;
mysql-rh9 20030814 20050412&lt;br /&gt;
openwebmail-rh9 20050427&lt;br /&gt;
php-rh9 20050506&lt;br /&gt;
phpBB-rh9 20041229&lt;br /&gt;
postgresql-rh9 20050719&lt;br /&gt;
sl-webalizer-rh9 20040119&lt;br /&gt;
spamassassin-rh9 20040127&lt;br /&gt;
tomcat-rh9 20040524&lt;br /&gt;
usermin-rh9 20040116&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;= 3.x (shows just OS templates, run without -O to see application as well):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkg list -O&lt;br /&gt;
ubuntu-10.04-x86                   2010-06-01 11:39:05&lt;br /&gt;
ubuntu-11.04-x86                   2011-06-22 14:23:59&lt;br /&gt;
ubuntu-9.10-x86                    2010-03-11 17:39:51&lt;br /&gt;
centos-5-x86                       2010-03-11 17:12:27&lt;br /&gt;
debian-5.0-x86                     2010-03-11 17:33:34&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All template files are located:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1&lt;br /&gt;
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2&lt;br /&gt;
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9&lt;br /&gt;
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1&lt;br /&gt;
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2&lt;br /&gt;
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9&lt;br /&gt;
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92&lt;br /&gt;
analog-fc2      mailman-fc2           php-rh9             suse-9.2&lt;br /&gt;
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1&lt;br /&gt;
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2&lt;br /&gt;
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9&lt;br /&gt;
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92&lt;br /&gt;
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1&lt;br /&gt;
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1&lt;br /&gt;
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2&lt;br /&gt;
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9&lt;br /&gt;
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1&lt;br /&gt;
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2&lt;br /&gt;
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9&lt;br /&gt;
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3&lt;br /&gt;
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0&lt;br /&gt;
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92&lt;br /&gt;
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1&lt;br /&gt;
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2&lt;br /&gt;
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9&lt;br /&gt;
jdk-suse92      mysql-rh9             redhat-as3-minimal&lt;br /&gt;
jre-deb31       mysql-suse92          redhat-devel-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here are the base OS templates: &amp;lt;tt&amp;gt;redhat-9, fedora-core-1&amp;lt;/tt&amp;gt; and supporting application templates: &amp;lt;tt&amp;gt;postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1&amp;lt;/tt&amp;gt;. So if you wanted to copy over all of redhat 9 you&#039;d need to copy the contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls -d /vz/template/*rh9*&lt;br /&gt;
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9&lt;br /&gt;
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9&lt;br /&gt;
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9&lt;br /&gt;
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9&lt;br /&gt;
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9&lt;br /&gt;
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9&lt;br /&gt;
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9&lt;br /&gt;
/vz/template/mailman-rh9     /vz/template/postgresql-rh9&lt;br /&gt;
&lt;br /&gt;
# ls -d /vz/template/*redhat-9*&lt;br /&gt;
/vz/template/redhat-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a template from one HN to another, it simply needs to be rsync&#039;d over to the target HN. It&#039;s rsync&#039;d over in this fashion:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template&lt;br /&gt;
 rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template&lt;br /&gt;
&lt;br /&gt;
Newer (&amp;gt;= 3.x) VZ employs &amp;quot;EZ&amp;quot; templates which are organized a little differently:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc&lt;br /&gt;
centos  conf         redhat-as3-minimal  ubuntu&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/ubuntu/&lt;br /&gt;
10.04  11.04  9.10&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/&lt;br /&gt;
x86&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/cache/&lt;br /&gt;
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz&lt;br /&gt;
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz&lt;br /&gt;
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we see is the entire OS and all applications are in 1 directory, and organized by distribution and release version. So to move Ubuntu 10.04:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
and you also need to move the cache:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/&lt;br /&gt;
&lt;br /&gt;
Once the transfer is complete, you will be able to run &amp;lt;tt&amp;gt;vzpkgls&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vzpkg list -O&amp;lt;/tt&amp;gt; and see the template(s) listed on the target HN.&lt;br /&gt;
&lt;br /&gt;
So far, this all supposes template doesn&#039;t exist on the target- very simple, just copy it over. If the template exists already on the target HN, this requires closer inspection. With older templates, simply moving over the templates would be the end of it- you see the version listed when you do a &amp;lt;tt&amp;gt;vzplgls&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysql-rh9 20030814 20050412&lt;br /&gt;
&lt;br /&gt;
this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412&lt;br /&gt;
As an aside, you can&#039;t copy over just 1 of them, but if you rsync&#039;d over the &amp;lt;tt&amp;gt;mysql-rh9&amp;lt;/tt&amp;gt; directory, you&#039;d see 20030814 and 20050412 on the target HN. As long as the versions match up, you&#039;re good to go.&lt;br /&gt;
&lt;br /&gt;
With EZ templates, the versions are not as easy to decipher. When you look at the &amp;lt;tt&amp;gt;vzpkg list&amp;lt;/tt&amp;gt; output, that simply tells you when a cache was created. A cache is simply a snapshot of all the data needed for the latest versions of the OS and it&#039;s applications at the time the cache was created. It is a date, and thus tells you nothing about the versions within. So for instance, if you had a cache for Ubuntu 10.04 from 2007 and you ran &amp;lt;tt&amp;gt;vzpkg create cache ubuntu-10.04-x86&amp;lt;/tt&amp;gt; it would re-download the latest version of apache, mysql and so on. And any &#039;&#039;subsequent&#039;&#039; ubuntu 10.04 CT&#039;s created thereafter would use those newer versions, whereas older CT&#039;s based on 10.04 would use older templates. You can see how this works by looking at the files under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this template has in it 6 different versions of apache2. This means that this template was merged with other 10.04 templates and/or it has been cached a few times, each time a new apache was available. The unfortunate thing is it&#039;s almost impossible to know which CT&#039;s are using which version of apache so it&#039;s hard to try to prune this down and remove unwanted/unneeded applications.&lt;br /&gt;
&lt;br /&gt;
So, if you see another HN has Ubuntu 10.04 on it, you need to see/confirm that it has all the exact files your CT needs. You can run a test rsync to see what &#039;&#039;would&#039;&#039; be transferred (what&#039;s missing):&lt;br /&gt;
&lt;br /&gt;
 rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
Based on the amount of data you get back from the rsync, you will be able to decide whether or not to remove the -n and allow the full transfer to go through. The downside to doing the transfer is the situation described above- you&#039;ve permanently joined these templates and now you may have 10 versions of apache on the target HN. There&#039;s one other potential pitfall to this kind of merging- it will also potentially copy over shared files, for which there is no particular version, most of which are in &amp;lt;tt&amp;gt;/vz/template/ubuntu/10.04/x86/config&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
 cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
 /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
&lt;br /&gt;
Here are some specific things to look out for. Case: copying centos-5 on virt19 to virt12. We dumped the rsync output to a file so we could inspect:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
(note, that can be dangerous, better to add on full path &amp;lt;tt&amp;gt;/vz/template/centos/5&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
So in the output file we see things like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
x86/base0/cachecookie&lt;br /&gt;
x86/base0/primary.xml.gz &lt;br /&gt;
x86/base0/primary.xml.gz.sqlite &lt;br /&gt;
x86/base0/repomd.xml &lt;br /&gt;
x86/base1/cachecookie &lt;br /&gt;
x86/base1/filelists.xml.gz &lt;br /&gt;
x86/base1/filelists.xml.gz.sqlite  &lt;br /&gt;
x86/base1/primary.xml.gz &lt;br /&gt;
x86/base1/primary.xml.gz.sqlite &lt;br /&gt;
x86/base1/repomd.xml&lt;br /&gt;
x86/base2/cachecookie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which make us nervous cause those are not versioned files, i.e.:&lt;br /&gt;
 5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock&lt;br /&gt;
&lt;br /&gt;
So those files will replace existing files on v12 rather than the case of the latter where it&#039;s likely being added. So caution should be given and deference to whichever version is newer (which rsync should take care of, but that will depend on the date each file was created and perhaps not the actual data within).&lt;br /&gt;
&lt;br /&gt;
If we look further in the file we see:&lt;br /&gt;
&lt;br /&gt;
 x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.&lt;br /&gt;
9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif&lt;br /&gt;
&lt;br /&gt;
and other files looking like:&lt;br /&gt;
 5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info&lt;br /&gt;
&lt;br /&gt;
Which means plesk is here. We don&#039;t need plesk on v12 (the CT moving over doesn&#039;t use it) so we rerun the rsync and exclude it:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh --exclude=&amp;quot;plesk*&amp;quot; --exclude=&amp;quot;psa*&amp;quot; /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
and now it&#039;s much smaller:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l&lt;br /&gt;
 97104&lt;br /&gt;
&lt;br /&gt;
Before running with excludes it was:&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l &lt;br /&gt;
 238238&lt;br /&gt;
&lt;br /&gt;
So again, look at what you&#039;re doing. Generally, combining templates is fine however.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re happy with the merge, run the rsync again without the &amp;quot;-n&amp;quot; to let it actually do the transfer.&lt;br /&gt;
&lt;br /&gt;
Once done, don&#039;t forget to add the new template to the HN in Management -&amp;gt; Reference -&amp;gt; Templates&lt;br /&gt;
&lt;br /&gt;
= getting help =&lt;br /&gt;
&lt;br /&gt;
= vzup2date =&lt;br /&gt;
TODO &lt;br /&gt;
= Adding new OS/application templates =&lt;br /&gt;
&lt;br /&gt;
Virtuozzo will lag a bit behind the initial release of an OS, perhaps by a month or more. Further, a newly-released OS may be available, but there may not be many/any application templates available initially. It pays to wait a bit.&lt;br /&gt;
&lt;br /&gt;
A template is easily installed via [[#vzup2date|vzup2date]]:&lt;br /&gt;
&lt;br /&gt;
 vzup2date -z&lt;br /&gt;
&lt;br /&gt;
You will be given a list of OS&#039;s to install. Select an OS, then customize that selection by checking/unchecking the application templates we do/don&#039;t want to include/offer.&lt;br /&gt;
&lt;br /&gt;
Generally, here are the app templates we include/offer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cyrus-imap&lt;br /&gt;
devel&lt;br /&gt;
imp&lt;br /&gt;
jre&lt;br /&gt;
jsdk&lt;br /&gt;
mailman&lt;br /&gt;
mod_perl&lt;br /&gt;
mod_ssl&lt;br /&gt;
mysql&lt;br /&gt;
php&lt;br /&gt;
phpmyadmin&lt;br /&gt;
phppgadmin&lt;br /&gt;
postgresql&lt;br /&gt;
proftpd&lt;br /&gt;
spamassassin&lt;br /&gt;
squirrelmail&lt;br /&gt;
tomcat&lt;br /&gt;
vsftpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do not (any longer) offer webalizer or analog.&lt;br /&gt;
&lt;br /&gt;
After selecting and installing the OS and apps, you should ensure it&#039;s installed:&lt;br /&gt;
&lt;br /&gt;
 vzpkg list -O&lt;br /&gt;
&lt;br /&gt;
Your new OS (ex. fedora-core-13-x86_64) will be listed, without a corresponding cache date:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@virt13 /vzconf]# vzpkg list -O&lt;br /&gt;
centos-6-x86                       2011-07-22 13:24:41&lt;br /&gt;
centos-6-x86_64                    2012-03-09 20:42:22&lt;br /&gt;
centos-5-x86                       2009-07-27 16:58:24&lt;br /&gt;
centos-5-x86_64                    2012-03-09 22:38:53&lt;br /&gt;
ubuntu-11.10-x86_64                2012-03-01 23:13:33&lt;br /&gt;
ubuntu-9.04-x86                    2009-06-02 11:32:39&lt;br /&gt;
ubuntu-12.04-x86_64                2012-05-29 13:50:50&lt;br /&gt;
ubuntu-8.04-x86                    2008-09-17 21:27:20&lt;br /&gt;
ubuntu-8.10-x86                    2009-03-13 13:58:57&lt;br /&gt;
ubuntu-11.04-x86                   2011-12-05 11:15:46&lt;br /&gt;
ubuntu-7.04-x86                    2008-09-24 16:42:50&lt;br /&gt;
redhat-el6-x86_64&lt;br /&gt;
fedora-core-13-x86_64              &lt;br /&gt;
fedora-core-12-x86                 2010-02-06 13:24:32&lt;br /&gt;
fedora-core-15-x86                 2011-12-05 11:36:43&lt;br /&gt;
fedora-core-11-x86                 2009-10-01 16:30:59&lt;br /&gt;
fedora-core-14-x86&lt;br /&gt;
fedora-core-16-x86_64              2012-03-13 11:40:23&lt;br /&gt;
fedora-core-9-x86                  2008-11-29 10:52:18&lt;br /&gt;
debian-6.0-x86                     2011-07-29 16:00:35&lt;br /&gt;
debian-6.0-x86_64                  2012-03-12 19:53:33&lt;br /&gt;
debian-5.0-x86                     2009-03-12 12:39:11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also confirm the apps installed:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt13 /vzconf]# vzpkg list fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64              2013-03-08 11:39:44&lt;br /&gt;
fedora-core-13-x86_64 devel&lt;br /&gt;
fedora-core-13-x86_64 php&lt;br /&gt;
fedora-core-13-x86_64 proftpd&lt;br /&gt;
fedora-core-13-x86_64 postgresql&lt;br /&gt;
fedora-core-13-x86_64 phpmyadmin&lt;br /&gt;
fedora-core-13-x86_64 mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before you can use the OS you must cache it. To create the cache run:&lt;br /&gt;
 vzpkg cache [OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;vzpkg cache fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s ready to use. In order to be able to use it with the [[VPS_Management#vm|vm]] command, you must create a file:&lt;br /&gt;
 jctmpl-[OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;jctmpl-fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In it, on line 1 we place the OS, followed by the app names, ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;more jctmpl-fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64&lt;br /&gt;
postgresql&lt;br /&gt;
jsdk&lt;br /&gt;
mod_ssl&lt;br /&gt;
phpmyadmin&lt;br /&gt;
mod_perl&lt;br /&gt;
tomcat&lt;br /&gt;
devel&lt;br /&gt;
php&lt;br /&gt;
mailman&lt;br /&gt;
cyrus-imap&lt;br /&gt;
squirrelmail&lt;br /&gt;
proftpd&lt;br /&gt;
mysql&lt;br /&gt;
phppgadmin&lt;br /&gt;
spamassassin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The packages will be installed in that order, so any pre-req&#039;s should be handled there.&lt;br /&gt;
&lt;br /&gt;
Now, when you run [[VPS_Management#vm|vm]] it will show you the newly-added OS and you may create a CT using it.&lt;br /&gt;
&lt;br /&gt;
The last few tasks are related to mgmt:&lt;br /&gt;
&lt;br /&gt;
1. add to mgmt-&amp;gt;reference-&amp;gt;templates (use the existing templates as an example). Once added, the new template will be included with the list of OS&#039;s available for the given HN.&lt;br /&gt;
2. if this is going to be a new OS offered for ordering, it needs to be added to the order form and webpage.&lt;br /&gt;
&lt;br /&gt;
a. to get a list of applications and versions in the new OS, you should create a test CT, enter it and run &amp;lt;tt&amp;gt;dpkg -l|sort&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;rpm -aq|sort&amp;lt;/tt&amp;gt; in centos/fedora) and enter that list in the following places:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/jc_pub/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Note, you will have to move the most recent OS data from &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt; into the corresponding &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname]_old.html&amp;lt;/tt&amp;gt; updating the version links in both.&lt;br /&gt;
&lt;br /&gt;
b. to add the new OS to the order form, you will need to update &amp;lt;tt&amp;gt;/usr/local/www/signup/html/step1.html&amp;lt;/tt&amp;gt; in several places (for regular and OSS orders) as well as updating the templateID which you can get from mgmt-&amp;gt;reference-&amp;gt;templates (or [[Management_System_/_Public_Website_/_Signup_/_Account_Manager#jc:ref_templates|jc:ref_templates]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Old method to obtain the templates:&lt;br /&gt;
&lt;br /&gt;
Go to http://www.parallels.com/en/virtuozzo/templates/catalog/&lt;br /&gt;
&lt;br /&gt;
Download the RPM&#039;s and install them&lt;br /&gt;
&lt;br /&gt;
 vzpkg list&lt;br /&gt;
to see the new packages/os templates&lt;br /&gt;
&lt;br /&gt;
 vzpkg create cache &amp;quot;OS_EZ_template_name&amp;quot;&lt;br /&gt;
to create a cache&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Update OS template =&lt;br /&gt;
&lt;br /&gt;
Installation and update of the new version of OS template will not affect the existing containers. It will affect only the new containers, created after this update operation. In terms of fixing &amp;quot;vzctl enter&amp;quot; error and SSH connectivity to Ubuntu based containers, it is necessary to recreate the template and not to update it, so the commands to run are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rpm -Uhv ubuntu-8.04-x86-ez-4.0.0-9.swsoft.noarch.rpm&lt;br /&gt;
vzpkg clean ubuntu-8.04-x86&lt;br /&gt;
vzpkg remove cache ubuntu-8.04-x86&lt;br /&gt;
vzpkg create cache ubuntu-8.04-x86&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installing new SSL cert on VZCP =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;openssl req -days 1999 -new -x509 -nodes -out server.crt -keyout server.key&lt;br /&gt;
&lt;br /&gt;
US&lt;br /&gt;
CA&lt;br /&gt;
San Diego&lt;br /&gt;
johncompanies.com&lt;br /&gt;
johncompanies.com&lt;br /&gt;
virt15ohncompanies.com&lt;br /&gt;
linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.crt/server.crt /etc/httpd/conf/ssl.crt/server.crt.bak&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.key/server.key /etc/httpd/conf/ssl.key/server.key.bak&lt;br /&gt;
cp server.crt /etc/httpd/conf/ssl.crt/server.crt&lt;br /&gt;
cp server.key /etc/httpd/conf/ssl.key/server.key&lt;br /&gt;
/etc/init.d/vzcp restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Moving virt (drives) to new hardware =&lt;br /&gt;
&lt;br /&gt;
If you have a case where a virt is dead (due to hardware failure), you can move the drives to a new hardware setup.&lt;br /&gt;
Here are the steps and things to look for:&lt;br /&gt;
&lt;br /&gt;
Move the drives to the new box. Most likely, the drives will be recognized and there will be no problems booting up. On Dell PERC 5/6 cards you will need to import the new &amp;quot;foreign&amp;quot; volume via the raid BIOS.&lt;br /&gt;
&lt;br /&gt;
If the hardware (motherboard) is different, it’s possible the nic’s won’t be recognized. Look at /etc/modules.conf the ethernet drivers are either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 tg3&lt;br /&gt;
alias eth1 tg3&amp;lt;/pre&amp;gt;&lt;br /&gt;
(supermicro)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 e100&lt;br /&gt;
alias eth1 e1000&amp;lt;/pre&amp;gt;&lt;br /&gt;
(intel)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 bnx2&lt;br /&gt;
alias eth1 bnx2&amp;lt;/pre&amp;gt;&lt;br /&gt;
(dell 29500)&lt;br /&gt;
&lt;br /&gt;
Also, you may see eth0 and eth1 swapped so if after confirming the eth devices are present (may require a reboot), then you may still need to swap the green/yellow network cables in the back to get them on the right port.&lt;br /&gt;
&lt;br /&gt;
VZ will not run (for long) on the new hardware, so you will need to get the license reissued. You may create/download a temporary license via their website for the interim.&lt;br /&gt;
&lt;br /&gt;
= Updating kernel on virt =&lt;br /&gt;
&lt;br /&gt;
We now use [[#vzup2date|vzup2date]] to update systems and kernels. What follows is what we used to do when we had to download kernels and install manually on old systems:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. install kernel and modules&lt;br /&gt;
&amp;lt;pre&amp;gt;# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \&lt;br /&gt;
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm&lt;br /&gt;
vzkernel-smp          ##################################################&lt;br /&gt;
vzmodules-smp       ##################################################&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT USE the &amp;quot;rpm -Uhv&amp;quot; command to install the kernel, otherwise all the previously installed kernels may be removed from your system. &lt;br /&gt;
&lt;br /&gt;
2. update lilo/grub&lt;br /&gt;
&lt;br /&gt;
Lilo:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lilo.conf&lt;br /&gt;
 &lt;br /&gt;
rename old Virtuozzo kernel label from &amp;quot;linux+virtuozzo&amp;quot; to &amp;quot;virtuozzo_old&amp;quot;&lt;br /&gt;
and add a new entry pointing to the newly installed virtuozzo kernel image.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;prompt&lt;br /&gt;
timeout=50&lt;br /&gt;
default=linux+virtuozzo&lt;br /&gt;
append=&amp;quot;debug panic=5 console=tty console=ttyS0,38400&amp;quot;&lt;br /&gt;
boot=/dev/sda&lt;br /&gt;
map=/boot/map&lt;br /&gt;
install=/boot/boot.b&lt;br /&gt;
message=/boot/message&lt;br /&gt;
linear&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3smp&lt;br /&gt;
        label=linux&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3smp.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3&lt;br /&gt;
        label=linux-up&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise&lt;br /&gt;
        label=2.4.20-9.5.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise&lt;br /&gt;
        label=2.4.20-9.8.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise&lt;br /&gt;
        label=2.4.20-9.21.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise&lt;br /&gt;
        label=2.4.20-9.24.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise&lt;br /&gt;
        label=2.4.20-28.3.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise&lt;br /&gt;
        label=old_linux+vz&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise&lt;br /&gt;
        label=linux+virtuozzo&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label &amp;quot;old_linux+vz &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Grub:&lt;br /&gt;
&lt;br /&gt;
 vi /boot/grub /menu.lst&lt;br /&gt;
&lt;br /&gt;
Add new entry at the top.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;serial --unit=0 --speed=38400&lt;br /&gt;
terminal --timeout=10 serial console&lt;br /&gt;
default=0&lt;br /&gt;
timeout=10&lt;br /&gt;
splashimage=(hd0,0)/boot/grub/splash.xpm.gz&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Red Hat Linux (2.4.18-3smp)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3smp.img&lt;br /&gt;
title Red Hat Linux-up (2.4.18-3)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3.img&lt;br /&gt;
title Linux with Virtuozzo 2.5&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1&lt;br /&gt;
title vz-enterpriseo&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1&lt;br /&gt;
title vz-enterprise&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. run the lilo (if using lilo)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lilo&lt;br /&gt;
Added linux&lt;br /&gt;
Added linux-up&lt;br /&gt;
Added virtuozzo_old&lt;br /&gt;
Added linux+virtuozzo *&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. reboot the server&lt;br /&gt;
 shutdown -r 23:05&lt;br /&gt;
&lt;br /&gt;
when it comes time for the shutdown, run [[VPS_Management#stopvirt|stopvirt]] to get things shut down faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Remaking service VE (&amp;lt;=3.x only) =&lt;br /&gt;
&lt;br /&gt;
Occasionally the control panel for VEs (aka VZPP) will stop working and you just need to reinstall the service VE (which runs the control panels for all VEs on the HN). Here&#039;s how that&#039;s done :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop 1&lt;br /&gt;
ipdel 1 69.55.234.152&lt;br /&gt;
vzmlocal 1:2&lt;br /&gt;
vzctl set 2 --save --onboot no&lt;br /&gt;
vzsveinstall -t redhat-as3-minimal -d /root/Rel261/HW/RPMS -s 69.55.234.152 --skip-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzsveinstall -t redhat-as3-minimal -d /vz/Rel300/HW/RPMS -s 69.55.229.151 --skip-client&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzctl mount 1&lt;br /&gt;
vzctl mount 2&lt;br /&gt;
/bin/cp -aRf /vz/root/2/home/vzagent0 /vz/root/1/home&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/lib/mysql/VZADB /vz/root/1/var/lib/mysql&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/shadow /vz/root/1/etc/&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/vzcp/static/vz/skins/ /vz/root/1/var/vzcp/static/vz&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/menu.xml  /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/dashboard.xml /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
&lt;br /&gt;
vzctl umount 2&lt;br /&gt;
vzctl umount 1&lt;br /&gt;
vzctl start 1&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1030</id>
		<title>Virtuozzo / Linux Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1030"/>
		<updated>2013-03-11T23:41:36Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Adding new OS/application templates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Updating VZ =&lt;br /&gt;
&lt;br /&gt;
 Update Virtuozzo to version 4.0.0&lt;br /&gt;
 Apply minor updates for Virtuozzo 3.0.0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
When you get to the last screen, you will be given an option to &lt;br /&gt;
&lt;br /&gt;
 ( ) Automatically reboot after update&lt;br /&gt;
 (*) Reboot later manually&lt;br /&gt;
&lt;br /&gt;
make sure you choose to reboot later.&lt;br /&gt;
&lt;br /&gt;
= Migrating Templates =&lt;br /&gt;
One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it&#039;s now called) based on a particular ditribution on a host which may or may not share the same distribution. For instance, you could run a CT running Ubuntu while the host machine (Hardware Node or HN) is running CentOS. This is accomplished via the use of OS templates. As long as the HN contains the OS template on which a particular CT relies, it will run there. As such, if you want to move a CT from one HN to another, you will need to make sure the OS template exists there.&lt;br /&gt;
&lt;br /&gt;
Modern versions of VZ (&amp;gt;= 4.x) will check for and automatically move the OS template over to the host as you&#039;re (vz)migrating the CT over to a new HN. However we like to make sure the template is in place prior to moving the CT. &lt;br /&gt;
&lt;br /&gt;
The first step is to see if the template exists on the host. To see OS templates installed:&lt;br /&gt;
&lt;br /&gt;
2.x (shows OS and application templates):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkgls&lt;br /&gt;
mod_ssl-rh9 20040624&lt;br /&gt;
mysql-rh9 20030814 20050412&lt;br /&gt;
openwebmail-rh9 20050427&lt;br /&gt;
php-rh9 20050506&lt;br /&gt;
phpBB-rh9 20041229&lt;br /&gt;
postgresql-rh9 20050719&lt;br /&gt;
sl-webalizer-rh9 20040119&lt;br /&gt;
spamassassin-rh9 20040127&lt;br /&gt;
tomcat-rh9 20040524&lt;br /&gt;
usermin-rh9 20040116&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;= 3.x (shows just OS templates, run without -O to see application as well):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkg list -O&lt;br /&gt;
ubuntu-10.04-x86                   2010-06-01 11:39:05&lt;br /&gt;
ubuntu-11.04-x86                   2011-06-22 14:23:59&lt;br /&gt;
ubuntu-9.10-x86                    2010-03-11 17:39:51&lt;br /&gt;
centos-5-x86                       2010-03-11 17:12:27&lt;br /&gt;
debian-5.0-x86                     2010-03-11 17:33:34&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All template files are located:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1&lt;br /&gt;
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2&lt;br /&gt;
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9&lt;br /&gt;
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1&lt;br /&gt;
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2&lt;br /&gt;
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9&lt;br /&gt;
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92&lt;br /&gt;
analog-fc2      mailman-fc2           php-rh9             suse-9.2&lt;br /&gt;
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1&lt;br /&gt;
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2&lt;br /&gt;
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9&lt;br /&gt;
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92&lt;br /&gt;
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1&lt;br /&gt;
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1&lt;br /&gt;
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2&lt;br /&gt;
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9&lt;br /&gt;
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1&lt;br /&gt;
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2&lt;br /&gt;
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9&lt;br /&gt;
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3&lt;br /&gt;
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0&lt;br /&gt;
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92&lt;br /&gt;
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1&lt;br /&gt;
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2&lt;br /&gt;
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9&lt;br /&gt;
jdk-suse92      mysql-rh9             redhat-as3-minimal&lt;br /&gt;
jre-deb31       mysql-suse92          redhat-devel-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here are the base OS templates: &amp;lt;tt&amp;gt;redhat-9, fedora-core-1&amp;lt;/tt&amp;gt; and supporting application templates: &amp;lt;tt&amp;gt;postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1&amp;lt;/tt&amp;gt;. So if you wanted to copy over all of redhat 9 you&#039;d need to copy the contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls -d /vz/template/*rh9*&lt;br /&gt;
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9&lt;br /&gt;
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9&lt;br /&gt;
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9&lt;br /&gt;
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9&lt;br /&gt;
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9&lt;br /&gt;
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9&lt;br /&gt;
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9&lt;br /&gt;
/vz/template/mailman-rh9     /vz/template/postgresql-rh9&lt;br /&gt;
&lt;br /&gt;
# ls -d /vz/template/*redhat-9*&lt;br /&gt;
/vz/template/redhat-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a template from one HN to another, it simply needs to be rsync&#039;d over to the target HN. It&#039;s rsync&#039;d over in this fashion:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template&lt;br /&gt;
 rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template&lt;br /&gt;
&lt;br /&gt;
Newer (&amp;gt;= 3.x) VZ employs &amp;quot;EZ&amp;quot; templates which are organized a little differently:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc&lt;br /&gt;
centos  conf         redhat-as3-minimal  ubuntu&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/ubuntu/&lt;br /&gt;
10.04  11.04  9.10&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/&lt;br /&gt;
x86&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/cache/&lt;br /&gt;
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz&lt;br /&gt;
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz&lt;br /&gt;
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we see is the entire OS and all applications are in 1 directory, and organized by distribution and release version. So to move Ubuntu 10.04:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
and you also need to move the cache:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/&lt;br /&gt;
&lt;br /&gt;
Once the transfer is complete, you will be able to run &amp;lt;tt&amp;gt;vzpkgls&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vzpkg list -O&amp;lt;/tt&amp;gt; and see the template(s) listed on the target HN.&lt;br /&gt;
&lt;br /&gt;
So far, this all supposes template doesn&#039;t exist on the target- very simple, just copy it over. If the template exists already on the target HN, this requires closer inspection. With older templates, simply moving over the templates would be the end of it- you see the version listed when you do a &amp;lt;tt&amp;gt;vzplgls&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysql-rh9 20030814 20050412&lt;br /&gt;
&lt;br /&gt;
this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412&lt;br /&gt;
As an aside, you can&#039;t copy over just 1 of them, but if you rsync&#039;d over the &amp;lt;tt&amp;gt;mysql-rh9&amp;lt;/tt&amp;gt; directory, you&#039;d see 20030814 and 20050412 on the target HN. As long as the versions match up, you&#039;re good to go.&lt;br /&gt;
&lt;br /&gt;
With EZ templates, the versions are not as easy to decipher. When you look at the &amp;lt;tt&amp;gt;vzpkg list&amp;lt;/tt&amp;gt; output, that simply tells you when a cache was created. A cache is simply a snapshot of all the data needed for the latest versions of the OS and it&#039;s applications at the time the cache was created. It is a date, and thus tells you nothing about the versions within. So for instance, if you had a cache for Ubuntu 10.04 from 2007 and you ran &amp;lt;tt&amp;gt;vzpkg create cache ubuntu-10.04-x86&amp;lt;/tt&amp;gt; it would re-download the latest version of apache, mysql and so on. And any &#039;&#039;subsequent&#039;&#039; ubuntu 10.04 CT&#039;s created thereafter would use those newer versions, whereas older CT&#039;s based on 10.04 would use older templates. You can see how this works by looking at the files under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this template has in it 6 different versions of apache2. This means that this template was merged with other 10.04 templates and/or it has been cached a few times, each time a new apache was available. The unfortunate thing is it&#039;s almost impossible to know which CT&#039;s are using which version of apache so it&#039;s hard to try to prune this down and remove unwanted/unneeded applications.&lt;br /&gt;
&lt;br /&gt;
So, if you see another HN has Ubuntu 10.04 on it, you need to see/confirm that it has all the exact files your CT needs. You can run a test rsync to see what &#039;&#039;would&#039;&#039; be transferred (what&#039;s missing):&lt;br /&gt;
&lt;br /&gt;
 rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
Based on the amount of data you get back from the rsync, you will be able to decide whether or not to remove the -n and allow the full transfer to go through. The downside to doing the transfer is the situation described above- you&#039;ve permanently joined these templates and now you may have 10 versions of apache on the target HN. There&#039;s one other potential pitfall to this kind of merging- it will also potentially copy over shared files, for which there is no particular version, most of which are in &amp;lt;tt&amp;gt;/vz/template/ubuntu/10.04/x86/config&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
 cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
 /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
&lt;br /&gt;
Here are some specific things to look out for. Case: copying centos-5 on virt19 to virt12. We dumped the rsync output to a file so we could inspect:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
(note, that can be dangerous, better to add on full path &amp;lt;tt&amp;gt;/vz/template/centos/5&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
So in the output file we see things like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
x86/base0/cachecookie&lt;br /&gt;
x86/base0/primary.xml.gz &lt;br /&gt;
x86/base0/primary.xml.gz.sqlite &lt;br /&gt;
x86/base0/repomd.xml &lt;br /&gt;
x86/base1/cachecookie &lt;br /&gt;
x86/base1/filelists.xml.gz &lt;br /&gt;
x86/base1/filelists.xml.gz.sqlite  &lt;br /&gt;
x86/base1/primary.xml.gz &lt;br /&gt;
x86/base1/primary.xml.gz.sqlite &lt;br /&gt;
x86/base1/repomd.xml&lt;br /&gt;
x86/base2/cachecookie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which make us nervous cause those are not versioned files, i.e.:&lt;br /&gt;
 5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock&lt;br /&gt;
&lt;br /&gt;
So those files will replace existing files on v12 rather than the case of the latter where it&#039;s likely being added. So caution should be given and deference to whichever version is newer (which rsync should take care of, but that will depend on the date each file was created and perhaps not the actual data within).&lt;br /&gt;
&lt;br /&gt;
If we look further in the file we see:&lt;br /&gt;
&lt;br /&gt;
 x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.&lt;br /&gt;
9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif&lt;br /&gt;
&lt;br /&gt;
and other files looking like:&lt;br /&gt;
 5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info&lt;br /&gt;
&lt;br /&gt;
Which means plesk is here. We don&#039;t need plesk on v12 (the CT moving over doesn&#039;t use it) so we rerun the rsync and exclude it:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh --exclude=&amp;quot;plesk*&amp;quot; --exclude=&amp;quot;psa*&amp;quot; /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
and now it&#039;s much smaller:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l&lt;br /&gt;
 97104&lt;br /&gt;
&lt;br /&gt;
Before running with excludes it was:&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l &lt;br /&gt;
 238238&lt;br /&gt;
&lt;br /&gt;
So again, look at what you&#039;re doing. Generally, combining templates is fine however.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re happy with the merge, run the rsync again without the &amp;quot;-n&amp;quot; to let it actually do the transfer.&lt;br /&gt;
&lt;br /&gt;
Once done, don&#039;t forget to add the new template to the HN in Management -&amp;gt; Reference -&amp;gt; Templates&lt;br /&gt;
&lt;br /&gt;
= getting help =&lt;br /&gt;
&lt;br /&gt;
= vzup2date =&lt;br /&gt;
TODO &lt;br /&gt;
= Adding new OS/application templates =&lt;br /&gt;
&lt;br /&gt;
Virtuozzo will lag a bit behind the initial release of an OS, perhaps by a month or more. Further, a newly-released OS may be available, but there may not be many/any application templates available initially. It pays to wait a bit.&lt;br /&gt;
&lt;br /&gt;
A template is easily installed via [[#vzup2date|vzup2date]]:&lt;br /&gt;
&lt;br /&gt;
 vzup2date -z&lt;br /&gt;
&lt;br /&gt;
You will be given a list of OS&#039;s to install. Select an OS, then customize that selection by checking/unchecking the application templates we do/don&#039;t want to include/offer.&lt;br /&gt;
&lt;br /&gt;
Generally, here are the app templates we include/offer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cyrus-imap&lt;br /&gt;
devel&lt;br /&gt;
imp&lt;br /&gt;
jre&lt;br /&gt;
jsdk&lt;br /&gt;
mailman&lt;br /&gt;
mod_perl&lt;br /&gt;
mod_ssl&lt;br /&gt;
mysql&lt;br /&gt;
php&lt;br /&gt;
phpmyadmin&lt;br /&gt;
phppgadmin&lt;br /&gt;
postgresql&lt;br /&gt;
proftpd&lt;br /&gt;
spamassassin&lt;br /&gt;
squirrelmail&lt;br /&gt;
tomcat&lt;br /&gt;
vsftpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do not (any longer) offer webalizer or analog.&lt;br /&gt;
&lt;br /&gt;
After selecting and installing the OS and apps, you should ensure it&#039;s installed:&lt;br /&gt;
&lt;br /&gt;
 vzpkg list -O&lt;br /&gt;
&lt;br /&gt;
Your new OS (ex. fedora-core-13-x86_64) will be listed, without a corresponding cache date:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@virt13 /vzconf]# vzpkg list -O&lt;br /&gt;
centos-6-x86                       2011-07-22 13:24:41&lt;br /&gt;
centos-6-x86_64                    2012-03-09 20:42:22&lt;br /&gt;
centos-5-x86                       2009-07-27 16:58:24&lt;br /&gt;
centos-5-x86_64                    2012-03-09 22:38:53&lt;br /&gt;
ubuntu-11.10-x86_64                2012-03-01 23:13:33&lt;br /&gt;
ubuntu-9.04-x86                    2009-06-02 11:32:39&lt;br /&gt;
ubuntu-12.04-x86_64                2012-05-29 13:50:50&lt;br /&gt;
ubuntu-8.04-x86                    2008-09-17 21:27:20&lt;br /&gt;
ubuntu-8.10-x86                    2009-03-13 13:58:57&lt;br /&gt;
ubuntu-11.04-x86                   2011-12-05 11:15:46&lt;br /&gt;
ubuntu-7.04-x86                    2008-09-24 16:42:50&lt;br /&gt;
redhat-el6-x86_64&lt;br /&gt;
fedora-core-13-x86_64              &lt;br /&gt;
fedora-core-12-x86                 2010-02-06 13:24:32&lt;br /&gt;
fedora-core-15-x86                 2011-12-05 11:36:43&lt;br /&gt;
fedora-core-11-x86                 2009-10-01 16:30:59&lt;br /&gt;
fedora-core-14-x86&lt;br /&gt;
fedora-core-16-x86_64              2012-03-13 11:40:23&lt;br /&gt;
fedora-core-9-x86                  2008-11-29 10:52:18&lt;br /&gt;
debian-6.0-x86                     2011-07-29 16:00:35&lt;br /&gt;
debian-6.0-x86_64                  2012-03-12 19:53:33&lt;br /&gt;
debian-5.0-x86                     2009-03-12 12:39:11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also confirm the apps installed:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt13 /vzconf]# vzpkg list fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64              2013-03-08 11:39:44&lt;br /&gt;
fedora-core-13-x86_64 devel&lt;br /&gt;
fedora-core-13-x86_64 php&lt;br /&gt;
fedora-core-13-x86_64 proftpd&lt;br /&gt;
fedora-core-13-x86_64 postgresql&lt;br /&gt;
fedora-core-13-x86_64 phpmyadmin&lt;br /&gt;
fedora-core-13-x86_64 mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before you can use the OS you must cache it. To create the cache run:&lt;br /&gt;
 vzpkg cache [OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;vzpkg cache fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s ready to use. In order to be able to use it with the [[VPS_Management#vm|vm]] command, you must create a file:&lt;br /&gt;
 jctmpl-[OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;jctmpl-fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In it, on line 1 we place the OS, followed by the app names, ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;more jctmpl-fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64&lt;br /&gt;
postgresql&lt;br /&gt;
jsdk&lt;br /&gt;
mod_ssl&lt;br /&gt;
phpmyadmin&lt;br /&gt;
mod_perl&lt;br /&gt;
tomcat&lt;br /&gt;
devel&lt;br /&gt;
php&lt;br /&gt;
mailman&lt;br /&gt;
cyrus-imap&lt;br /&gt;
squirrelmail&lt;br /&gt;
proftpd&lt;br /&gt;
mysql&lt;br /&gt;
phppgadmin&lt;br /&gt;
spamassassin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The packages will be installed in that order, so any pre-req&#039;s should be handled there.&lt;br /&gt;
&lt;br /&gt;
Now, when you run [[VPS_Management#vm|vm]] it will show you the newly-added OS and you may create a CT using it.&lt;br /&gt;
&lt;br /&gt;
The last few tasks are related to mgmt:&lt;br /&gt;
&lt;br /&gt;
1. add to mgmt-&amp;gt;reference-&amp;gt;templates (use the existing templates as an example). Once added, the new template will be included with the list of OS&#039;s available for the given HN.&lt;br /&gt;
2. if this is going to be a new OS offered for ordering, it needs to be added to the order form and webpage.&lt;br /&gt;
&lt;br /&gt;
a. to get a list of applications and versions in the new OS, you should create a test CT, enter it and run &amp;lt;tt&amp;gt;dpkg -l|sort&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;rpm -aq|sort&amp;lt;/tt&amp;gt; in centos/fedora) and enter that list in the following places:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/jc_pub/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Note, you will have to move the most recent OS data from &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt; into the corresponding &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname]_old.html&amp;lt;/tt&amp;gt; updating the version links in both.&lt;br /&gt;
&lt;br /&gt;
b. to add the new OS to the order form, you will need to update &amp;lt;tt&amp;gt;/usr/local/www/signup/html/step1.html&amp;lt;/tt&amp;gt; in several places (for regular and OSS orders) as well as updating the templateID which you can get from mgmt-&amp;gt;reference-&amp;gt;templates (or [[Management_System_/_Public_Website_/_Signup_/_Account_Manager#jc:ref_templates|jc:ref_templates]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Old method to obtain the templates:&lt;br /&gt;
&lt;br /&gt;
Go to http://www.parallels.com/en/virtuozzo/templates/catalog/&lt;br /&gt;
&lt;br /&gt;
Download the RPM&#039;s and install them&lt;br /&gt;
&lt;br /&gt;
 vzpkg list&lt;br /&gt;
to see the new packages/os templates&lt;br /&gt;
&lt;br /&gt;
 vzpkg create cache &amp;quot;OS_EZ_template_name&amp;quot;&lt;br /&gt;
to create a cache&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Update OS template =&lt;br /&gt;
&lt;br /&gt;
Installation and update of the new version of OS template will not affect the existing containers. It will affect only the new containers, created after this update operation. In terms of fixing &amp;quot;vzctl enter&amp;quot; error and SSH connectivity to Ubuntu based containers, it is necessary to recreate the template and not to update it, so the commands to run are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;rpm -Uhv ubuntu-8.04-x86-ez-4.0.0-9.swsoft.noarch.rpm&lt;br /&gt;
vzpkg clean ubuntu-8.04-x86&lt;br /&gt;
vzpkg remove cache ubuntu-8.04-x86&lt;br /&gt;
vzpkg create cache ubuntu-8.04-x86&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Installing new SSL cert on VZCP =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;openssl req -days 1999 -new -x509 -nodes -out server.crt -keyout server.key&lt;br /&gt;
&lt;br /&gt;
US&lt;br /&gt;
CA&lt;br /&gt;
San Diego&lt;br /&gt;
johncompanies.com&lt;br /&gt;
johncompanies.com&lt;br /&gt;
virt15ohncompanies.com&lt;br /&gt;
linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.crt/server.crt /etc/httpd/conf/ssl.crt/server.crt.bak&lt;br /&gt;
cp -p /etc/httpd/conf/ssl.key/server.key /etc/httpd/conf/ssl.key/server.key.bak&lt;br /&gt;
cp server.crt /etc/httpd/conf/ssl.crt/server.crt&lt;br /&gt;
cp server.key /etc/httpd/conf/ssl.key/server.key&lt;br /&gt;
/etc/init.d/vzcp restart&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Moving virt (drives) to new hardware =&lt;br /&gt;
&lt;br /&gt;
If you have a case where a virt is dead (due to hardware failure), you can move the drives to a new hardware setup.&lt;br /&gt;
Here are the steps and things to look for:&lt;br /&gt;
&lt;br /&gt;
Move the drives to the new box. Most likely, the drives will be recognized and there will be no problems booting up.&lt;br /&gt;
&lt;br /&gt;
If the hardware (motherboard) is different, it’s possible the nic’s won’t be recognized. Look at /etc/modules.conf the ethernet drivers are either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 tg3&lt;br /&gt;
alias eth1 tg3&amp;lt;/pre&amp;gt;&lt;br /&gt;
(supermicro)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 e100&lt;br /&gt;
alias eth1 e1000&amp;lt;/pre&amp;gt;&lt;br /&gt;
(intel)&lt;br /&gt;
&lt;br /&gt;
Or&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;alias eth0 bnx2&lt;br /&gt;
alias eth1 bnx2&amp;lt;/pre&amp;gt;&lt;br /&gt;
(dell 29500)&lt;br /&gt;
&lt;br /&gt;
Also, you may see eth0 and eth1 swapped so if after confirming the eth devices are present (may require a reboot), then you may still need to swap the green/yellow network cables in the back to get them on the right port.&lt;br /&gt;
&lt;br /&gt;
VZ will not run (for long) on the new hardware, so you will need to get the license reissued. You may create/download a temporary license via their website for the interim.&lt;br /&gt;
&lt;br /&gt;
= Updating kernel on virt =&lt;br /&gt;
&lt;br /&gt;
We now use [[#vzup2date|vzup2date]] to update systems and kernels. What follows is what we used to do when we had to download kernels and install manually on old systems:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. install kernel and modules&lt;br /&gt;
&amp;lt;pre&amp;gt;# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \&lt;br /&gt;
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm&lt;br /&gt;
vzkernel-smp          ##################################################&lt;br /&gt;
vzmodules-smp       ##################################################&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT USE the &amp;quot;rpm -Uhv&amp;quot; command to install the kernel, otherwise all the previously installed kernels may be removed from your system. &lt;br /&gt;
&lt;br /&gt;
2. update lilo/grub&lt;br /&gt;
&lt;br /&gt;
Lilo:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lilo.conf&lt;br /&gt;
 &lt;br /&gt;
rename old Virtuozzo kernel label from &amp;quot;linux+virtuozzo&amp;quot; to &amp;quot;virtuozzo_old&amp;quot;&lt;br /&gt;
and add a new entry pointing to the newly installed virtuozzo kernel image.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;prompt&lt;br /&gt;
timeout=50&lt;br /&gt;
default=linux+virtuozzo&lt;br /&gt;
append=&amp;quot;debug panic=5 console=tty console=ttyS0,38400&amp;quot;&lt;br /&gt;
boot=/dev/sda&lt;br /&gt;
map=/boot/map&lt;br /&gt;
install=/boot/boot.b&lt;br /&gt;
message=/boot/message&lt;br /&gt;
linear&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3smp&lt;br /&gt;
        label=linux&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3smp.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3&lt;br /&gt;
        label=linux-up&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise&lt;br /&gt;
        label=2.4.20-9.5.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise&lt;br /&gt;
        label=2.4.20-9.8.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise&lt;br /&gt;
        label=2.4.20-9.21.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise&lt;br /&gt;
        label=2.4.20-9.24.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise&lt;br /&gt;
        label=2.4.20-28.3.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise&lt;br /&gt;
        label=old_linux+vz&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise&lt;br /&gt;
        label=linux+virtuozzo&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label &amp;quot;old_linux+vz &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Grub:&lt;br /&gt;
&lt;br /&gt;
 vi /boot/grub /menu.lst&lt;br /&gt;
&lt;br /&gt;
Add new entry at the top.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;serial --unit=0 --speed=38400&lt;br /&gt;
terminal --timeout=10 serial console&lt;br /&gt;
default=0&lt;br /&gt;
timeout=10&lt;br /&gt;
splashimage=(hd0,0)/boot/grub/splash.xpm.gz&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Red Hat Linux (2.4.18-3smp)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3smp.img&lt;br /&gt;
title Red Hat Linux-up (2.4.18-3)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3.img&lt;br /&gt;
title Linux with Virtuozzo 2.5&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1&lt;br /&gt;
title vz-enterpriseo&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1&lt;br /&gt;
title vz-enterprise&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. run the lilo (if using lilo)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lilo&lt;br /&gt;
Added linux&lt;br /&gt;
Added linux-up&lt;br /&gt;
Added virtuozzo_old&lt;br /&gt;
Added linux+virtuozzo *&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. reboot the server&lt;br /&gt;
 shutdown -r 23:05&lt;br /&gt;
&lt;br /&gt;
when it comes time for the shutdown, run [[VPS_Management#stopvirt|stopvirt]] to get things shut down faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Remaking service VE (&amp;lt;=3.x only) =&lt;br /&gt;
&lt;br /&gt;
Occasionally the control panel for VEs (aka VZPP) will stop working and you just need to reinstall the service VE (which runs the control panels for all VEs on the HN). Here&#039;s how that&#039;s done :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop 1&lt;br /&gt;
ipdel 1 69.55.234.152&lt;br /&gt;
vzmlocal 1:2&lt;br /&gt;
vzctl set 2 --save --onboot no&lt;br /&gt;
vzsveinstall -t redhat-as3-minimal -d /root/Rel261/HW/RPMS -s 69.55.234.152 --skip-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzsveinstall -t redhat-as3-minimal -d /vz/Rel300/HW/RPMS -s 69.55.229.151 --skip-client&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzctl mount 1&lt;br /&gt;
vzctl mount 2&lt;br /&gt;
/bin/cp -aRf /vz/root/2/home/vzagent0 /vz/root/1/home&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/lib/mysql/VZADB /vz/root/1/var/lib/mysql&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/shadow /vz/root/1/etc/&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/vzcp/static/vz/skins/ /vz/root/1/var/vzcp/static/vz&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/menu.xml  /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/dashboard.xml /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
&lt;br /&gt;
vzctl umount 2&lt;br /&gt;
vzctl umount 1&lt;br /&gt;
vzctl start 1&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1029</id>
		<title>Virtuozzo / Linux Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1029"/>
		<updated>2013-03-11T23:37:56Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Adding new OS/application templates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Updating VZ =&lt;br /&gt;
&lt;br /&gt;
 Update Virtuozzo to version 4.0.0&lt;br /&gt;
 Apply minor updates for Virtuozzo 3.0.0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
When you get to the last screen, you will be given an option to &lt;br /&gt;
&lt;br /&gt;
 ( ) Automatically reboot after update&lt;br /&gt;
 (*) Reboot later manually&lt;br /&gt;
&lt;br /&gt;
make sure you choose to reboot later.&lt;br /&gt;
&lt;br /&gt;
= Migrating Templates =&lt;br /&gt;
One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it&#039;s now called) based on a particular ditribution on a host which may or may not share the same distribution. For instance, you could run a CT running Ubuntu while the host machine (Hardware Node or HN) is running CentOS. This is accomplished via the use of OS templates. As long as the HN contains the OS template on which a particular CT relies, it will run there. As such, if you want to move a CT from one HN to another, you will need to make sure the OS template exists there.&lt;br /&gt;
&lt;br /&gt;
Modern versions of VZ (&amp;gt;= 4.x) will check for and automatically move the OS template over to the host as you&#039;re (vz)migrating the CT over to a new HN. However we like to make sure the template is in place prior to moving the CT. &lt;br /&gt;
&lt;br /&gt;
The first step is to see if the template exists on the host. To see OS templates installed:&lt;br /&gt;
&lt;br /&gt;
2.x (shows OS and application templates):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkgls&lt;br /&gt;
mod_ssl-rh9 20040624&lt;br /&gt;
mysql-rh9 20030814 20050412&lt;br /&gt;
openwebmail-rh9 20050427&lt;br /&gt;
php-rh9 20050506&lt;br /&gt;
phpBB-rh9 20041229&lt;br /&gt;
postgresql-rh9 20050719&lt;br /&gt;
sl-webalizer-rh9 20040119&lt;br /&gt;
spamassassin-rh9 20040127&lt;br /&gt;
tomcat-rh9 20040524&lt;br /&gt;
usermin-rh9 20040116&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;= 3.x (shows just OS templates, run without -O to see application as well):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkg list -O&lt;br /&gt;
ubuntu-10.04-x86                   2010-06-01 11:39:05&lt;br /&gt;
ubuntu-11.04-x86                   2011-06-22 14:23:59&lt;br /&gt;
ubuntu-9.10-x86                    2010-03-11 17:39:51&lt;br /&gt;
centos-5-x86                       2010-03-11 17:12:27&lt;br /&gt;
debian-5.0-x86                     2010-03-11 17:33:34&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All template files are located:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1&lt;br /&gt;
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2&lt;br /&gt;
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9&lt;br /&gt;
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1&lt;br /&gt;
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2&lt;br /&gt;
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9&lt;br /&gt;
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92&lt;br /&gt;
analog-fc2      mailman-fc2           php-rh9             suse-9.2&lt;br /&gt;
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1&lt;br /&gt;
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2&lt;br /&gt;
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9&lt;br /&gt;
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92&lt;br /&gt;
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1&lt;br /&gt;
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1&lt;br /&gt;
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2&lt;br /&gt;
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9&lt;br /&gt;
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1&lt;br /&gt;
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2&lt;br /&gt;
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9&lt;br /&gt;
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3&lt;br /&gt;
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0&lt;br /&gt;
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92&lt;br /&gt;
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1&lt;br /&gt;
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2&lt;br /&gt;
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9&lt;br /&gt;
jdk-suse92      mysql-rh9             redhat-as3-minimal&lt;br /&gt;
jre-deb31       mysql-suse92          redhat-devel-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here are the base OS templates: &amp;lt;tt&amp;gt;redhat-9, fedora-core-1&amp;lt;/tt&amp;gt; and supporting application templates: &amp;lt;tt&amp;gt;postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1&amp;lt;/tt&amp;gt;. So if you wanted to copy over all of redhat 9 you&#039;d need to copy the contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls -d /vz/template/*rh9*&lt;br /&gt;
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9&lt;br /&gt;
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9&lt;br /&gt;
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9&lt;br /&gt;
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9&lt;br /&gt;
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9&lt;br /&gt;
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9&lt;br /&gt;
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9&lt;br /&gt;
/vz/template/mailman-rh9     /vz/template/postgresql-rh9&lt;br /&gt;
&lt;br /&gt;
# ls -d /vz/template/*redhat-9*&lt;br /&gt;
/vz/template/redhat-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a template from one HN to another, it simply needs to be rsync&#039;d over to the target HN. It&#039;s rsync&#039;d over in this fashion:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template&lt;br /&gt;
 rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template&lt;br /&gt;
&lt;br /&gt;
Newer (&amp;gt;= 3.x) VZ employs &amp;quot;EZ&amp;quot; templates which are organized a little differently:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc&lt;br /&gt;
centos  conf         redhat-as3-minimal  ubuntu&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/ubuntu/&lt;br /&gt;
10.04  11.04  9.10&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/&lt;br /&gt;
x86&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/cache/&lt;br /&gt;
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz&lt;br /&gt;
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz&lt;br /&gt;
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we see is the entire OS and all applications are in 1 directory, and organized by distribution and release version. So to move Ubuntu 10.04:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
and you also need to move the cache:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/&lt;br /&gt;
&lt;br /&gt;
Once the transfer is complete, you will be able to run &amp;lt;tt&amp;gt;vzpkgls&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vzpkg list -O&amp;lt;/tt&amp;gt; and see the template(s) listed on the target HN.&lt;br /&gt;
&lt;br /&gt;
So far, this all supposes template doesn&#039;t exist on the target- very simple, just copy it over. If the template exists already on the target HN, this requires closer inspection. With older templates, simply moving over the templates would be the end of it- you see the version listed when you do a &amp;lt;tt&amp;gt;vzplgls&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysql-rh9 20030814 20050412&lt;br /&gt;
&lt;br /&gt;
this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412&lt;br /&gt;
As an aside, you can&#039;t copy over just 1 of them, but if you rsync&#039;d over the &amp;lt;tt&amp;gt;mysql-rh9&amp;lt;/tt&amp;gt; directory, you&#039;d see 20030814 and 20050412 on the target HN. As long as the versions match up, you&#039;re good to go.&lt;br /&gt;
&lt;br /&gt;
With EZ templates, the versions are not as easy to decipher. When you look at the &amp;lt;tt&amp;gt;vzpkg list&amp;lt;/tt&amp;gt; output, that simply tells you when a cache was created. A cache is simply a snapshot of all the data needed for the latest versions of the OS and it&#039;s applications at the time the cache was created. It is a date, and thus tells you nothing about the versions within. So for instance, if you had a cache for Ubuntu 10.04 from 2007 and you ran &amp;lt;tt&amp;gt;vzpkg create cache ubuntu-10.04-x86&amp;lt;/tt&amp;gt; it would re-download the latest version of apache, mysql and so on. And any &#039;&#039;subsequent&#039;&#039; ubuntu 10.04 CT&#039;s created thereafter would use those newer versions, whereas older CT&#039;s based on 10.04 would use older templates. You can see how this works by looking at the files under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this template has in it 6 different versions of apache2. This means that this template was merged with other 10.04 templates and/or it has been cached a few times, each time a new apache was available. The unfortunate thing is it&#039;s almost impossible to know which CT&#039;s are using which version of apache so it&#039;s hard to try to prune this down and remove unwanted/unneeded applications.&lt;br /&gt;
&lt;br /&gt;
So, if you see another HN has Ubuntu 10.04 on it, you need to see/confirm that it has all the exact files your CT needs. You can run a test rsync to see what &#039;&#039;would&#039;&#039; be transferred (what&#039;s missing):&lt;br /&gt;
&lt;br /&gt;
 rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
Based on the amount of data you get back from the rsync, you will be able to decide whether or not to remove the -n and allow the full transfer to go through. The downside to doing the transfer is the situation described above- you&#039;ve permanently joined these templates and now you may have 10 versions of apache on the target HN. There&#039;s one other potential pitfall to this kind of merging- it will also potentially copy over shared files, for which there is no particular version, most of which are in &amp;lt;tt&amp;gt;/vz/template/ubuntu/10.04/x86/config&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
 cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
 /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
&lt;br /&gt;
Here are some specific things to look out for. Case: copying centos-5 on virt19 to virt12. We dumped the rsync output to a file so we could inspect:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
(note, that can be dangerous, better to add on full path &amp;lt;tt&amp;gt;/vz/template/centos/5&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
So in the output file we see things like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
x86/base0/cachecookie&lt;br /&gt;
x86/base0/primary.xml.gz &lt;br /&gt;
x86/base0/primary.xml.gz.sqlite &lt;br /&gt;
x86/base0/repomd.xml &lt;br /&gt;
x86/base1/cachecookie &lt;br /&gt;
x86/base1/filelists.xml.gz &lt;br /&gt;
x86/base1/filelists.xml.gz.sqlite  &lt;br /&gt;
x86/base1/primary.xml.gz &lt;br /&gt;
x86/base1/primary.xml.gz.sqlite &lt;br /&gt;
x86/base1/repomd.xml&lt;br /&gt;
x86/base2/cachecookie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which make us nervous cause those are not versioned files, i.e.:&lt;br /&gt;
 5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock&lt;br /&gt;
&lt;br /&gt;
So those files will replace existing files on v12 rather than the case of the latter where it&#039;s likely being added. So caution should be given and deference to whichever version is newer (which rsync should take care of, but that will depend on the date each file was created and perhaps not the actual data within).&lt;br /&gt;
&lt;br /&gt;
If we look further in the file we see:&lt;br /&gt;
&lt;br /&gt;
 x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.&lt;br /&gt;
9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif&lt;br /&gt;
&lt;br /&gt;
and other files looking like:&lt;br /&gt;
 5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info&lt;br /&gt;
&lt;br /&gt;
Which means plesk is here. We don&#039;t need plesk on v12 (the CT moving over doesn&#039;t use it) so we rerun the rsync and exclude it:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh --exclude=&amp;quot;plesk*&amp;quot; --exclude=&amp;quot;psa*&amp;quot; /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
and now it&#039;s much smaller:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l&lt;br /&gt;
 97104&lt;br /&gt;
&lt;br /&gt;
Before running with excludes it was:&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l &lt;br /&gt;
 238238&lt;br /&gt;
&lt;br /&gt;
So again, look at what you&#039;re doing. Generally, combining templates is fine however.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re happy with the merge, run the rsync again without the &amp;quot;-n&amp;quot; to let it actually do the transfer.&lt;br /&gt;
&lt;br /&gt;
Once done, don&#039;t forget to add the new template to the HN in Management -&amp;gt; Reference -&amp;gt; Templates&lt;br /&gt;
&lt;br /&gt;
= getting help =&lt;br /&gt;
&lt;br /&gt;
= vzup2date =&lt;br /&gt;
TODO &lt;br /&gt;
= Adding new OS/application templates =&lt;br /&gt;
&lt;br /&gt;
Virtuozzo will lag a bit behind the initial release of an OS, perhaps by a month or more. Further, a newly-released OS may be available, but there may not be many/any application templates available initially. It pays to wait a bit.&lt;br /&gt;
&lt;br /&gt;
A template is easily installed via [[#vzup2date|vzup2date]]:&lt;br /&gt;
&lt;br /&gt;
 vzup2date -z&lt;br /&gt;
&lt;br /&gt;
You will be given a list of OS&#039;s to install. Select an OS, then customize that selection by checking/unchecking the application templates we do/don&#039;t want to include/offer.&lt;br /&gt;
&lt;br /&gt;
Generally, here are the app templates we include/offer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cyrus-imap&lt;br /&gt;
devel&lt;br /&gt;
imp&lt;br /&gt;
jre&lt;br /&gt;
jsdk&lt;br /&gt;
mailman&lt;br /&gt;
mod_perl&lt;br /&gt;
mod_ssl&lt;br /&gt;
mysql&lt;br /&gt;
php&lt;br /&gt;
phpmyadmin&lt;br /&gt;
phppgadmin&lt;br /&gt;
postgresql&lt;br /&gt;
proftpd&lt;br /&gt;
spamassassin&lt;br /&gt;
squirrelmail&lt;br /&gt;
tomcat&lt;br /&gt;
vsftpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do not (any longer) offer webalizer or analog.&lt;br /&gt;
&lt;br /&gt;
After selecting and installing the OS and apps, you should ensure it&#039;s installed:&lt;br /&gt;
&lt;br /&gt;
 vzpkg list -O&lt;br /&gt;
&lt;br /&gt;
Your new OS (ex. fedora-core-13-x86_64) will be listed, without a corresponding cache date:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@virt13 /vzconf]# vzpkg list -O&lt;br /&gt;
centos-6-x86                       2011-07-22 13:24:41&lt;br /&gt;
centos-6-x86_64                    2012-03-09 20:42:22&lt;br /&gt;
centos-5-x86                       2009-07-27 16:58:24&lt;br /&gt;
centos-5-x86_64                    2012-03-09 22:38:53&lt;br /&gt;
ubuntu-11.10-x86_64                2012-03-01 23:13:33&lt;br /&gt;
ubuntu-9.04-x86                    2009-06-02 11:32:39&lt;br /&gt;
ubuntu-12.04-x86_64                2012-05-29 13:50:50&lt;br /&gt;
ubuntu-8.04-x86                    2008-09-17 21:27:20&lt;br /&gt;
ubuntu-8.10-x86                    2009-03-13 13:58:57&lt;br /&gt;
ubuntu-11.04-x86                   2011-12-05 11:15:46&lt;br /&gt;
ubuntu-7.04-x86                    2008-09-24 16:42:50&lt;br /&gt;
redhat-el6-x86_64&lt;br /&gt;
fedora-core-13-x86_64              &lt;br /&gt;
fedora-core-12-x86                 2010-02-06 13:24:32&lt;br /&gt;
fedora-core-15-x86                 2011-12-05 11:36:43&lt;br /&gt;
fedora-core-11-x86                 2009-10-01 16:30:59&lt;br /&gt;
fedora-core-14-x86&lt;br /&gt;
fedora-core-16-x86_64              2012-03-13 11:40:23&lt;br /&gt;
fedora-core-9-x86                  2008-11-29 10:52:18&lt;br /&gt;
debian-6.0-x86                     2011-07-29 16:00:35&lt;br /&gt;
debian-6.0-x86_64                  2012-03-12 19:53:33&lt;br /&gt;
debian-5.0-x86                     2009-03-12 12:39:11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also confirm the apps installed:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt13 /vzconf]# vzpkg list fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64              2013-03-08 11:39:44&lt;br /&gt;
fedora-core-13-x86_64 devel&lt;br /&gt;
fedora-core-13-x86_64 php&lt;br /&gt;
fedora-core-13-x86_64 proftpd&lt;br /&gt;
fedora-core-13-x86_64 postgresql&lt;br /&gt;
fedora-core-13-x86_64 phpmyadmin&lt;br /&gt;
fedora-core-13-x86_64 mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before you can use the OS you must cache it. To create the cache run:&lt;br /&gt;
 vzpkg cache [OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;vzpkg cache fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s ready to use. In order to be able to use it with the [[VPS_Management#vm|vm]] command, you must create a file:&lt;br /&gt;
 jctmpl-[OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;jctmpl-fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In it, on line 1 we place the OS, followed by the app names, ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;more jctmpl-fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64&lt;br /&gt;
postgresql&lt;br /&gt;
jsdk&lt;br /&gt;
mod_ssl&lt;br /&gt;
phpmyadmin&lt;br /&gt;
mod_perl&lt;br /&gt;
tomcat&lt;br /&gt;
devel&lt;br /&gt;
php&lt;br /&gt;
mailman&lt;br /&gt;
cyrus-imap&lt;br /&gt;
squirrelmail&lt;br /&gt;
proftpd&lt;br /&gt;
mysql&lt;br /&gt;
phppgadmin&lt;br /&gt;
spamassassin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The packages will be installed in that order, so any pre-req&#039;s should be handled there.&lt;br /&gt;
&lt;br /&gt;
Now, when you run [[VPS_Management#vm|vm]] it will show you the newly-added OS and you may create a CT using it.&lt;br /&gt;
&lt;br /&gt;
The last few tasks are related to mgmt:&lt;br /&gt;
&lt;br /&gt;
1. add to mgmt-&amp;gt;reference-&amp;gt;templates (use the existing templates as an example). Once added, the new template will be included with the list of OS&#039;s available for the given HN.&lt;br /&gt;
2. if this is going to be a new OS offered for ordering, it needs to be added to the order form and webpage.&lt;br /&gt;
&lt;br /&gt;
a. to get a list of applications and versions in the new OS, you should create a test CT, enter it and run &amp;lt;tt&amp;gt;dpkg -l|sort&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;rpm -aq|sort&amp;lt;/tt&amp;gt; in centos/fedora) and enter that list in the following places:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/jc_pub/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Note, you will have to move the most recent OS data from &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt; into the corresponding &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname]_old.html&amp;lt;/tt&amp;gt; updating the version links in both.&lt;br /&gt;
&lt;br /&gt;
b. to add the new OS to the order form, you will need to update &amp;lt;tt&amp;gt;/usr/local/www/signup/html/step1.html&amp;lt;/tt&amp;gt; in several places (for regular and OSS orders) as well as updating the templateID which you can get from mgmt-&amp;gt;reference-&amp;gt;templates (or [[Management_System_/_Public_Website_/_Signup_/_Account_Manager#jc:ref_templates|jc:ref_templates]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Old method to obtain the templates:&lt;br /&gt;
&lt;br /&gt;
Go to http://www.parallels.com/en/virtuozzo/templates/catalog/&lt;br /&gt;
&lt;br /&gt;
Download the RPM&#039;s and install them&lt;br /&gt;
&lt;br /&gt;
 vzpkg list&lt;br /&gt;
to see the new packages/os templates&lt;br /&gt;
&lt;br /&gt;
 vzpkg create cache &amp;quot;OS_EZ_template_name&amp;quot;&lt;br /&gt;
to create a cache&lt;br /&gt;
&lt;br /&gt;
= Updating kernel on virt =&lt;br /&gt;
&lt;br /&gt;
We now use [[#vzup2date|vzup2date]] to update systems and kernels. What follows is what we used to do when we had to download kernels and install manually on old systems:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. install kernel and modules&lt;br /&gt;
&amp;lt;pre&amp;gt;# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \&lt;br /&gt;
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm&lt;br /&gt;
vzkernel-smp          ##################################################&lt;br /&gt;
vzmodules-smp       ##################################################&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT USE the &amp;quot;rpm -Uhv&amp;quot; command to install the kernel, otherwise all the previously installed kernels may be removed from your system. &lt;br /&gt;
&lt;br /&gt;
2. update lilo/grub&lt;br /&gt;
&lt;br /&gt;
Lilo:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lilo.conf&lt;br /&gt;
 &lt;br /&gt;
rename old Virtuozzo kernel label from &amp;quot;linux+virtuozzo&amp;quot; to &amp;quot;virtuozzo_old&amp;quot;&lt;br /&gt;
and add a new entry pointing to the newly installed virtuozzo kernel image.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;prompt&lt;br /&gt;
timeout=50&lt;br /&gt;
default=linux+virtuozzo&lt;br /&gt;
append=&amp;quot;debug panic=5 console=tty console=ttyS0,38400&amp;quot;&lt;br /&gt;
boot=/dev/sda&lt;br /&gt;
map=/boot/map&lt;br /&gt;
install=/boot/boot.b&lt;br /&gt;
message=/boot/message&lt;br /&gt;
linear&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3smp&lt;br /&gt;
        label=linux&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3smp.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3&lt;br /&gt;
        label=linux-up&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise&lt;br /&gt;
        label=2.4.20-9.5.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise&lt;br /&gt;
        label=2.4.20-9.8.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise&lt;br /&gt;
        label=2.4.20-9.21.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise&lt;br /&gt;
        label=2.4.20-9.24.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise&lt;br /&gt;
        label=2.4.20-28.3.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise&lt;br /&gt;
        label=old_linux+vz&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise&lt;br /&gt;
        label=linux+virtuozzo&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label &amp;quot;old_linux+vz &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Grub:&lt;br /&gt;
&lt;br /&gt;
 vi /boot/grub /menu.lst&lt;br /&gt;
&lt;br /&gt;
Add new entry at the top.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;serial --unit=0 --speed=38400&lt;br /&gt;
terminal --timeout=10 serial console&lt;br /&gt;
default=0&lt;br /&gt;
timeout=10&lt;br /&gt;
splashimage=(hd0,0)/boot/grub/splash.xpm.gz&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Red Hat Linux (2.4.18-3smp)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3smp.img&lt;br /&gt;
title Red Hat Linux-up (2.4.18-3)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3.img&lt;br /&gt;
title Linux with Virtuozzo 2.5&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1&lt;br /&gt;
title vz-enterpriseo&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1&lt;br /&gt;
title vz-enterprise&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. run the lilo (if using lilo)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lilo&lt;br /&gt;
Added linux&lt;br /&gt;
Added linux-up&lt;br /&gt;
Added virtuozzo_old&lt;br /&gt;
Added linux+virtuozzo *&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. reboot the server&lt;br /&gt;
 shutdown -r 23:05&lt;br /&gt;
&lt;br /&gt;
when it comes time for the shutdown, run [[VPS_Management#stopvirt|stopvirt]] to get things shut down faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Remaking service VE (&amp;lt;=3.x only) =&lt;br /&gt;
&lt;br /&gt;
Occasionally the control panel for VEs (aka VZPP) will stop working and you just need to reinstall the service VE (which runs the control panels for all VEs on the HN). Here&#039;s how that&#039;s done :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop 1&lt;br /&gt;
ipdel 1 69.55.234.152&lt;br /&gt;
vzmlocal 1:2&lt;br /&gt;
vzctl set 2 --save --onboot no&lt;br /&gt;
vzsveinstall -t redhat-as3-minimal -d /root/Rel261/HW/RPMS -s 69.55.234.152 --skip-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzsveinstall -t redhat-as3-minimal -d /vz/Rel300/HW/RPMS -s 69.55.229.151 --skip-client&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzctl mount 1&lt;br /&gt;
vzctl mount 2&lt;br /&gt;
/bin/cp -aRf /vz/root/2/home/vzagent0 /vz/root/1/home&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/lib/mysql/VZADB /vz/root/1/var/lib/mysql&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/shadow /vz/root/1/etc/&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/vzcp/static/vz/skins/ /vz/root/1/var/vzcp/static/vz&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/menu.xml  /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/dashboard.xml /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
&lt;br /&gt;
vzctl umount 2&lt;br /&gt;
vzctl umount 1&lt;br /&gt;
vzctl start 1&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1028</id>
		<title>Virtuozzo / Linux Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1028"/>
		<updated>2013-03-11T23:37:31Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Adding new OS/application templates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Updating VZ =&lt;br /&gt;
&lt;br /&gt;
 Update Virtuozzo to version 4.0.0&lt;br /&gt;
 Apply minor updates for Virtuozzo 3.0.0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
When you get to the last screen, you will be given an option to &lt;br /&gt;
&lt;br /&gt;
 ( ) Automatically reboot after update&lt;br /&gt;
 (*) Reboot later manually&lt;br /&gt;
&lt;br /&gt;
make sure you choose to reboot later.&lt;br /&gt;
&lt;br /&gt;
= Migrating Templates =&lt;br /&gt;
One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it&#039;s now called) based on a particular ditribution on a host which may or may not share the same distribution. For instance, you could run a CT running Ubuntu while the host machine (Hardware Node or HN) is running CentOS. This is accomplished via the use of OS templates. As long as the HN contains the OS template on which a particular CT relies, it will run there. As such, if you want to move a CT from one HN to another, you will need to make sure the OS template exists there.&lt;br /&gt;
&lt;br /&gt;
Modern versions of VZ (&amp;gt;= 4.x) will check for and automatically move the OS template over to the host as you&#039;re (vz)migrating the CT over to a new HN. However we like to make sure the template is in place prior to moving the CT. &lt;br /&gt;
&lt;br /&gt;
The first step is to see if the template exists on the host. To see OS templates installed:&lt;br /&gt;
&lt;br /&gt;
2.x (shows OS and application templates):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkgls&lt;br /&gt;
mod_ssl-rh9 20040624&lt;br /&gt;
mysql-rh9 20030814 20050412&lt;br /&gt;
openwebmail-rh9 20050427&lt;br /&gt;
php-rh9 20050506&lt;br /&gt;
phpBB-rh9 20041229&lt;br /&gt;
postgresql-rh9 20050719&lt;br /&gt;
sl-webalizer-rh9 20040119&lt;br /&gt;
spamassassin-rh9 20040127&lt;br /&gt;
tomcat-rh9 20040524&lt;br /&gt;
usermin-rh9 20040116&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;= 3.x (shows just OS templates, run without -O to see application as well):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkg list -O&lt;br /&gt;
ubuntu-10.04-x86                   2010-06-01 11:39:05&lt;br /&gt;
ubuntu-11.04-x86                   2011-06-22 14:23:59&lt;br /&gt;
ubuntu-9.10-x86                    2010-03-11 17:39:51&lt;br /&gt;
centos-5-x86                       2010-03-11 17:12:27&lt;br /&gt;
debian-5.0-x86                     2010-03-11 17:33:34&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All template files are located:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1&lt;br /&gt;
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2&lt;br /&gt;
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9&lt;br /&gt;
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1&lt;br /&gt;
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2&lt;br /&gt;
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9&lt;br /&gt;
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92&lt;br /&gt;
analog-fc2      mailman-fc2           php-rh9             suse-9.2&lt;br /&gt;
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1&lt;br /&gt;
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2&lt;br /&gt;
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9&lt;br /&gt;
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92&lt;br /&gt;
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1&lt;br /&gt;
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1&lt;br /&gt;
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2&lt;br /&gt;
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9&lt;br /&gt;
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1&lt;br /&gt;
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2&lt;br /&gt;
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9&lt;br /&gt;
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3&lt;br /&gt;
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0&lt;br /&gt;
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92&lt;br /&gt;
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1&lt;br /&gt;
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2&lt;br /&gt;
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9&lt;br /&gt;
jdk-suse92      mysql-rh9             redhat-as3-minimal&lt;br /&gt;
jre-deb31       mysql-suse92          redhat-devel-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here are the base OS templates: &amp;lt;tt&amp;gt;redhat-9, fedora-core-1&amp;lt;/tt&amp;gt; and supporting application templates: &amp;lt;tt&amp;gt;postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1&amp;lt;/tt&amp;gt;. So if you wanted to copy over all of redhat 9 you&#039;d need to copy the contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls -d /vz/template/*rh9*&lt;br /&gt;
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9&lt;br /&gt;
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9&lt;br /&gt;
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9&lt;br /&gt;
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9&lt;br /&gt;
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9&lt;br /&gt;
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9&lt;br /&gt;
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9&lt;br /&gt;
/vz/template/mailman-rh9     /vz/template/postgresql-rh9&lt;br /&gt;
&lt;br /&gt;
# ls -d /vz/template/*redhat-9*&lt;br /&gt;
/vz/template/redhat-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a template from one HN to another, it simply needs to be rsync&#039;d over to the target HN. It&#039;s rsync&#039;d over in this fashion:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template&lt;br /&gt;
 rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template&lt;br /&gt;
&lt;br /&gt;
Newer (&amp;gt;= 3.x) VZ employs &amp;quot;EZ&amp;quot; templates which are organized a little differently:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc&lt;br /&gt;
centos  conf         redhat-as3-minimal  ubuntu&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/ubuntu/&lt;br /&gt;
10.04  11.04  9.10&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/&lt;br /&gt;
x86&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/cache/&lt;br /&gt;
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz&lt;br /&gt;
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz&lt;br /&gt;
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we see is the entire OS and all applications are in 1 directory, and organized by distribution and release version. So to move Ubuntu 10.04:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
and you also need to move the cache:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/&lt;br /&gt;
&lt;br /&gt;
Once the transfer is complete, you will be able to run &amp;lt;tt&amp;gt;vzpkgls&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vzpkg list -O&amp;lt;/tt&amp;gt; and see the template(s) listed on the target HN.&lt;br /&gt;
&lt;br /&gt;
So far, this all supposes template doesn&#039;t exist on the target- very simple, just copy it over. If the template exists already on the target HN, this requires closer inspection. With older templates, simply moving over the templates would be the end of it- you see the version listed when you do a &amp;lt;tt&amp;gt;vzplgls&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysql-rh9 20030814 20050412&lt;br /&gt;
&lt;br /&gt;
this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412&lt;br /&gt;
As an aside, you can&#039;t copy over just 1 of them, but if you rsync&#039;d over the &amp;lt;tt&amp;gt;mysql-rh9&amp;lt;/tt&amp;gt; directory, you&#039;d see 20030814 and 20050412 on the target HN. As long as the versions match up, you&#039;re good to go.&lt;br /&gt;
&lt;br /&gt;
With EZ templates, the versions are not as easy to decipher. When you look at the &amp;lt;tt&amp;gt;vzpkg list&amp;lt;/tt&amp;gt; output, that simply tells you when a cache was created. A cache is simply a snapshot of all the data needed for the latest versions of the OS and it&#039;s applications at the time the cache was created. It is a date, and thus tells you nothing about the versions within. So for instance, if you had a cache for Ubuntu 10.04 from 2007 and you ran &amp;lt;tt&amp;gt;vzpkg create cache ubuntu-10.04-x86&amp;lt;/tt&amp;gt; it would re-download the latest version of apache, mysql and so on. And any &#039;&#039;subsequent&#039;&#039; ubuntu 10.04 CT&#039;s created thereafter would use those newer versions, whereas older CT&#039;s based on 10.04 would use older templates. You can see how this works by looking at the files under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this template has in it 6 different versions of apache2. This means that this template was merged with other 10.04 templates and/or it has been cached a few times, each time a new apache was available. The unfortunate thing is it&#039;s almost impossible to know which CT&#039;s are using which version of apache so it&#039;s hard to try to prune this down and remove unwanted/unneeded applications.&lt;br /&gt;
&lt;br /&gt;
So, if you see another HN has Ubuntu 10.04 on it, you need to see/confirm that it has all the exact files your CT needs. You can run a test rsync to see what &#039;&#039;would&#039;&#039; be transferred (what&#039;s missing):&lt;br /&gt;
&lt;br /&gt;
 rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
Based on the amount of data you get back from the rsync, you will be able to decide whether or not to remove the -n and allow the full transfer to go through. The downside to doing the transfer is the situation described above- you&#039;ve permanently joined these templates and now you may have 10 versions of apache on the target HN. There&#039;s one other potential pitfall to this kind of merging- it will also potentially copy over shared files, for which there is no particular version, most of which are in &amp;lt;tt&amp;gt;/vz/template/ubuntu/10.04/x86/config&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
 cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
 /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
&lt;br /&gt;
Here are some specific things to look out for. Case: copying centos-5 on virt19 to virt12. We dumped the rsync output to a file so we could inspect:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
(note, that can be dangerous, better to add on full path &amp;lt;tt&amp;gt;/vz/template/centos/5&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
So in the output file we see things like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
x86/base0/cachecookie&lt;br /&gt;
x86/base0/primary.xml.gz &lt;br /&gt;
x86/base0/primary.xml.gz.sqlite &lt;br /&gt;
x86/base0/repomd.xml &lt;br /&gt;
x86/base1/cachecookie &lt;br /&gt;
x86/base1/filelists.xml.gz &lt;br /&gt;
x86/base1/filelists.xml.gz.sqlite  &lt;br /&gt;
x86/base1/primary.xml.gz &lt;br /&gt;
x86/base1/primary.xml.gz.sqlite &lt;br /&gt;
x86/base1/repomd.xml&lt;br /&gt;
x86/base2/cachecookie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which make us nervous cause those are not versioned files, i.e.:&lt;br /&gt;
 5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock&lt;br /&gt;
&lt;br /&gt;
So those files will replace existing files on v12 rather than the case of the latter where it&#039;s likely being added. So caution should be given and deference to whichever version is newer (which rsync should take care of, but that will depend on the date each file was created and perhaps not the actual data within).&lt;br /&gt;
&lt;br /&gt;
If we look further in the file we see:&lt;br /&gt;
&lt;br /&gt;
 x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.&lt;br /&gt;
9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif&lt;br /&gt;
&lt;br /&gt;
and other files looking like:&lt;br /&gt;
 5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info&lt;br /&gt;
&lt;br /&gt;
Which means plesk is here. We don&#039;t need plesk on v12 (the CT moving over doesn&#039;t use it) so we rerun the rsync and exclude it:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh --exclude=&amp;quot;plesk*&amp;quot; --exclude=&amp;quot;psa*&amp;quot; /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
and now it&#039;s much smaller:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l&lt;br /&gt;
 97104&lt;br /&gt;
&lt;br /&gt;
Before running with excludes it was:&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l &lt;br /&gt;
 238238&lt;br /&gt;
&lt;br /&gt;
So again, look at what you&#039;re doing. Generally, combining templates is fine however.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re happy with the merge, run the rsync again without the &amp;quot;-n&amp;quot; to let it actually do the transfer.&lt;br /&gt;
&lt;br /&gt;
Once done, don&#039;t forget to add the new template to the HN in Management -&amp;gt; Reference -&amp;gt; Templates&lt;br /&gt;
&lt;br /&gt;
= getting help =&lt;br /&gt;
&lt;br /&gt;
= vzup2date =&lt;br /&gt;
TODO &lt;br /&gt;
= Adding new OS/application templates =&lt;br /&gt;
&lt;br /&gt;
Virtuozzo will lag a bit behind the initial release of an OS, perhaps by a month or more. Further, a newly-released OS may be available, but there may not be many/any application templates available initially. It pays to wait a bit.&lt;br /&gt;
&lt;br /&gt;
A template is easily installed via [[#vzup2date|vzup2date]]:&lt;br /&gt;
&lt;br /&gt;
 vzup2date -z&lt;br /&gt;
&lt;br /&gt;
You will be given a list of OS&#039;s to install. Select an OS, then customize that selection by checking/unchecking the application templates we do/don&#039;t want to include/offer.&lt;br /&gt;
&lt;br /&gt;
Generally, here are the app templates we include/offer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cyrus-imap&lt;br /&gt;
devel&lt;br /&gt;
imp&lt;br /&gt;
jre&lt;br /&gt;
jsdk&lt;br /&gt;
mailman&lt;br /&gt;
mod_perl&lt;br /&gt;
mod_ssl&lt;br /&gt;
mysql&lt;br /&gt;
php&lt;br /&gt;
phpmyadmin&lt;br /&gt;
phppgadmin&lt;br /&gt;
postgresql&lt;br /&gt;
proftpd&lt;br /&gt;
spamassassin&lt;br /&gt;
squirrelmail&lt;br /&gt;
tomcat&lt;br /&gt;
vsftpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do not (any longer) offer webalizer or analog.&lt;br /&gt;
&lt;br /&gt;
After selecting and installing the OS and apps, you should ensure it&#039;s installed:&lt;br /&gt;
&lt;br /&gt;
 vzpkg list -O&lt;br /&gt;
&lt;br /&gt;
Your new OS (ex. fedora-core-13-x86_64) will be listed, without a corresponding cache date:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@virt13 /vzconf]# vzpkg list -O&lt;br /&gt;
centos-6-x86                       2011-07-22 13:24:41&lt;br /&gt;
centos-6-x86_64                    2012-03-09 20:42:22&lt;br /&gt;
centos-5-x86                       2009-07-27 16:58:24&lt;br /&gt;
centos-5-x86_64                    2012-03-09 22:38:53&lt;br /&gt;
ubuntu-11.10-x86_64                2012-03-01 23:13:33&lt;br /&gt;
ubuntu-9.04-x86                    2009-06-02 11:32:39&lt;br /&gt;
ubuntu-12.04-x86_64                2012-05-29 13:50:50&lt;br /&gt;
ubuntu-8.04-x86                    2008-09-17 21:27:20&lt;br /&gt;
ubuntu-8.10-x86                    2009-03-13 13:58:57&lt;br /&gt;
ubuntu-11.04-x86                   2011-12-05 11:15:46&lt;br /&gt;
ubuntu-7.04-x86                    2008-09-24 16:42:50&lt;br /&gt;
redhat-el6-x86_64&lt;br /&gt;
fedora-core-13-x86_64              &lt;br /&gt;
fedora-core-12-x86                 2010-02-06 13:24:32&lt;br /&gt;
fedora-core-15-x86                 2011-12-05 11:36:43&lt;br /&gt;
fedora-core-11-x86                 2009-10-01 16:30:59&lt;br /&gt;
fedora-core-14-x86&lt;br /&gt;
fedora-core-16-x86_64              2012-03-13 11:40:23&lt;br /&gt;
fedora-core-9-x86                  2008-11-29 10:52:18&lt;br /&gt;
debian-6.0-x86                     2011-07-29 16:00:35&lt;br /&gt;
debian-6.0-x86_64                  2012-03-12 19:53:33&lt;br /&gt;
debian-5.0-x86                     2009-03-12 12:39:11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also confirm the apps installed:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt13 /vzconf]# vzpkg list fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64              2013-03-08 11:39:44&lt;br /&gt;
fedora-core-13-x86_64 devel&lt;br /&gt;
fedora-core-13-x86_64 php&lt;br /&gt;
fedora-core-13-x86_64 proftpd&lt;br /&gt;
fedora-core-13-x86_64 postgresql&lt;br /&gt;
fedora-core-13-x86_64 phpmyadmin&lt;br /&gt;
fedora-core-13-x86_64 mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before you can use the OS you must cache it. To create the cache run:&lt;br /&gt;
 vzpkg cache [OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;vzpkg cache fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s ready to use. In order to be able to use it with the [[VPS_Management#vm|vm]] command, you must create a file:&lt;br /&gt;
 jctmpl-[OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;jctmpl-fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In it, on line 1 we place the OS, followed by the app names, ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;more jctmpl-fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64&lt;br /&gt;
postgresql&lt;br /&gt;
jsdk&lt;br /&gt;
mod_ssl&lt;br /&gt;
phpmyadmin&lt;br /&gt;
mod_perl&lt;br /&gt;
tomcat&lt;br /&gt;
devel&lt;br /&gt;
php&lt;br /&gt;
mailman&lt;br /&gt;
cyrus-imap&lt;br /&gt;
squirrelmail&lt;br /&gt;
proftpd&lt;br /&gt;
mysql&lt;br /&gt;
phppgadmin&lt;br /&gt;
spamassassin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The packages will be installed in that order, so any pre-req&#039;s should be handled there.&lt;br /&gt;
&lt;br /&gt;
Now, when you run [[VPS_Management#vm|vm]] it will show you the newly-added OS and you may create a CT using it.&lt;br /&gt;
&lt;br /&gt;
The last few tasks are related to mgmt:&lt;br /&gt;
&lt;br /&gt;
1. add to mgmt-&amp;gt;reference-&amp;gt;templates (use the existing templates as an example). Once added, the new template will be included with the list of OS&#039;s available for the given HN.&lt;br /&gt;
2. if this is going to be a new OS offered for ordering, it needs to be added to the order form and webpage.&lt;br /&gt;
&lt;br /&gt;
a. to get a list of applications and versions in the new OS, you should create a test CT, enter it and run &amp;lt;tt&amp;gt;dpkg -l|sort&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;rpm -aq|sort&amp;lt;/tt&amp;gt; in centos/fedora) and enter that list in the following places:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/jc_pub/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Note, you will have to move the most recent OS data from &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt; into the corresponding &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname]_old.html&amp;lt;/tt&amp;gt; updating the version links in both.&lt;br /&gt;
&lt;br /&gt;
b. to add the new OS to the order form, you will need to update &amp;lt;tt&amp;gt;/usr/local/www/signup/html/step1.html&amp;lt;/tt&amp;gt; in several places (for regular and OSS orders) as well as updating the templateID which you can get from mgmt-&amp;gt;reference-&amp;gt;templates (or [[Management_System_/_Public_Website_/_Signup_/_Account_Manager#jc:ref_templates|jc:ref_templates]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Old method:&lt;br /&gt;
&lt;br /&gt;
Go to http://www.parallels.com/en/virtuozzo/templates/catalog/&lt;br /&gt;
&lt;br /&gt;
Download the RPM&#039;s and install them&lt;br /&gt;
&lt;br /&gt;
 vzpkg list&lt;br /&gt;
to see the new packages/os templates&lt;br /&gt;
&lt;br /&gt;
 vzpkg create cache &amp;quot;OS_EZ_template_name&amp;quot;&lt;br /&gt;
to create a cache&lt;br /&gt;
&lt;br /&gt;
= Updating kernel on virt =&lt;br /&gt;
&lt;br /&gt;
We now use [[#vzup2date|vzup2date]] to update systems and kernels. What follows is what we used to do when we had to download kernels and install manually on old systems:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. install kernel and modules&lt;br /&gt;
&amp;lt;pre&amp;gt;# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \&lt;br /&gt;
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm&lt;br /&gt;
vzkernel-smp          ##################################################&lt;br /&gt;
vzmodules-smp       ##################################################&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT USE the &amp;quot;rpm -Uhv&amp;quot; command to install the kernel, otherwise all the previously installed kernels may be removed from your system. &lt;br /&gt;
&lt;br /&gt;
2. update lilo/grub&lt;br /&gt;
&lt;br /&gt;
Lilo:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lilo.conf&lt;br /&gt;
 &lt;br /&gt;
rename old Virtuozzo kernel label from &amp;quot;linux+virtuozzo&amp;quot; to &amp;quot;virtuozzo_old&amp;quot;&lt;br /&gt;
and add a new entry pointing to the newly installed virtuozzo kernel image.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;prompt&lt;br /&gt;
timeout=50&lt;br /&gt;
default=linux+virtuozzo&lt;br /&gt;
append=&amp;quot;debug panic=5 console=tty console=ttyS0,38400&amp;quot;&lt;br /&gt;
boot=/dev/sda&lt;br /&gt;
map=/boot/map&lt;br /&gt;
install=/boot/boot.b&lt;br /&gt;
message=/boot/message&lt;br /&gt;
linear&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3smp&lt;br /&gt;
        label=linux&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3smp.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3&lt;br /&gt;
        label=linux-up&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise&lt;br /&gt;
        label=2.4.20-9.5.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise&lt;br /&gt;
        label=2.4.20-9.8.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise&lt;br /&gt;
        label=2.4.20-9.21.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise&lt;br /&gt;
        label=2.4.20-9.24.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise&lt;br /&gt;
        label=2.4.20-28.3.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise&lt;br /&gt;
        label=old_linux+vz&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise&lt;br /&gt;
        label=linux+virtuozzo&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label &amp;quot;old_linux+vz &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Grub:&lt;br /&gt;
&lt;br /&gt;
 vi /boot/grub /menu.lst&lt;br /&gt;
&lt;br /&gt;
Add new entry at the top.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;serial --unit=0 --speed=38400&lt;br /&gt;
terminal --timeout=10 serial console&lt;br /&gt;
default=0&lt;br /&gt;
timeout=10&lt;br /&gt;
splashimage=(hd0,0)/boot/grub/splash.xpm.gz&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Red Hat Linux (2.4.18-3smp)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3smp.img&lt;br /&gt;
title Red Hat Linux-up (2.4.18-3)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3.img&lt;br /&gt;
title Linux with Virtuozzo 2.5&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1&lt;br /&gt;
title vz-enterpriseo&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1&lt;br /&gt;
title vz-enterprise&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. run the lilo (if using lilo)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lilo&lt;br /&gt;
Added linux&lt;br /&gt;
Added linux-up&lt;br /&gt;
Added virtuozzo_old&lt;br /&gt;
Added linux+virtuozzo *&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. reboot the server&lt;br /&gt;
 shutdown -r 23:05&lt;br /&gt;
&lt;br /&gt;
when it comes time for the shutdown, run [[VPS_Management#stopvirt|stopvirt]] to get things shut down faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Remaking service VE (&amp;lt;=3.x only) =&lt;br /&gt;
&lt;br /&gt;
Occasionally the control panel for VEs (aka VZPP) will stop working and you just need to reinstall the service VE (which runs the control panels for all VEs on the HN). Here&#039;s how that&#039;s done :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop 1&lt;br /&gt;
ipdel 1 69.55.234.152&lt;br /&gt;
vzmlocal 1:2&lt;br /&gt;
vzctl set 2 --save --onboot no&lt;br /&gt;
vzsveinstall -t redhat-as3-minimal -d /root/Rel261/HW/RPMS -s 69.55.234.152 --skip-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzsveinstall -t redhat-as3-minimal -d /vz/Rel300/HW/RPMS -s 69.55.229.151 --skip-client&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzctl mount 1&lt;br /&gt;
vzctl mount 2&lt;br /&gt;
/bin/cp -aRf /vz/root/2/home/vzagent0 /vz/root/1/home&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/lib/mysql/VZADB /vz/root/1/var/lib/mysql&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/shadow /vz/root/1/etc/&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/vzcp/static/vz/skins/ /vz/root/1/var/vzcp/static/vz&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/menu.xml  /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/dashboard.xml /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
&lt;br /&gt;
vzctl umount 2&lt;br /&gt;
vzctl umount 1&lt;br /&gt;
vzctl start 1&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1027</id>
		<title>Virtuozzo / Linux Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1027"/>
		<updated>2013-03-11T23:37:12Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Adding new OS/application templates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Updating VZ =&lt;br /&gt;
&lt;br /&gt;
 Update Virtuozzo to version 4.0.0&lt;br /&gt;
 Apply minor updates for Virtuozzo 3.0.0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
When you get to the last screen, you will be given an option to &lt;br /&gt;
&lt;br /&gt;
 ( ) Automatically reboot after update&lt;br /&gt;
 (*) Reboot later manually&lt;br /&gt;
&lt;br /&gt;
make sure you choose to reboot later.&lt;br /&gt;
&lt;br /&gt;
= Migrating Templates =&lt;br /&gt;
One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it&#039;s now called) based on a particular ditribution on a host which may or may not share the same distribution. For instance, you could run a CT running Ubuntu while the host machine (Hardware Node or HN) is running CentOS. This is accomplished via the use of OS templates. As long as the HN contains the OS template on which a particular CT relies, it will run there. As such, if you want to move a CT from one HN to another, you will need to make sure the OS template exists there.&lt;br /&gt;
&lt;br /&gt;
Modern versions of VZ (&amp;gt;= 4.x) will check for and automatically move the OS template over to the host as you&#039;re (vz)migrating the CT over to a new HN. However we like to make sure the template is in place prior to moving the CT. &lt;br /&gt;
&lt;br /&gt;
The first step is to see if the template exists on the host. To see OS templates installed:&lt;br /&gt;
&lt;br /&gt;
2.x (shows OS and application templates):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkgls&lt;br /&gt;
mod_ssl-rh9 20040624&lt;br /&gt;
mysql-rh9 20030814 20050412&lt;br /&gt;
openwebmail-rh9 20050427&lt;br /&gt;
php-rh9 20050506&lt;br /&gt;
phpBB-rh9 20041229&lt;br /&gt;
postgresql-rh9 20050719&lt;br /&gt;
sl-webalizer-rh9 20040119&lt;br /&gt;
spamassassin-rh9 20040127&lt;br /&gt;
tomcat-rh9 20040524&lt;br /&gt;
usermin-rh9 20040116&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;= 3.x (shows just OS templates, run without -O to see application as well):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkg list -O&lt;br /&gt;
ubuntu-10.04-x86                   2010-06-01 11:39:05&lt;br /&gt;
ubuntu-11.04-x86                   2011-06-22 14:23:59&lt;br /&gt;
ubuntu-9.10-x86                    2010-03-11 17:39:51&lt;br /&gt;
centos-5-x86                       2010-03-11 17:12:27&lt;br /&gt;
debian-5.0-x86                     2010-03-11 17:33:34&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All template files are located:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1&lt;br /&gt;
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2&lt;br /&gt;
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9&lt;br /&gt;
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1&lt;br /&gt;
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2&lt;br /&gt;
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9&lt;br /&gt;
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92&lt;br /&gt;
analog-fc2      mailman-fc2           php-rh9             suse-9.2&lt;br /&gt;
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1&lt;br /&gt;
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2&lt;br /&gt;
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9&lt;br /&gt;
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92&lt;br /&gt;
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1&lt;br /&gt;
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1&lt;br /&gt;
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2&lt;br /&gt;
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9&lt;br /&gt;
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1&lt;br /&gt;
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2&lt;br /&gt;
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9&lt;br /&gt;
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3&lt;br /&gt;
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0&lt;br /&gt;
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92&lt;br /&gt;
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1&lt;br /&gt;
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2&lt;br /&gt;
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9&lt;br /&gt;
jdk-suse92      mysql-rh9             redhat-as3-minimal&lt;br /&gt;
jre-deb31       mysql-suse92          redhat-devel-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here are the base OS templates: &amp;lt;tt&amp;gt;redhat-9, fedora-core-1&amp;lt;/tt&amp;gt; and supporting application templates: &amp;lt;tt&amp;gt;postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1&amp;lt;/tt&amp;gt;. So if you wanted to copy over all of redhat 9 you&#039;d need to copy the contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls -d /vz/template/*rh9*&lt;br /&gt;
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9&lt;br /&gt;
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9&lt;br /&gt;
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9&lt;br /&gt;
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9&lt;br /&gt;
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9&lt;br /&gt;
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9&lt;br /&gt;
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9&lt;br /&gt;
/vz/template/mailman-rh9     /vz/template/postgresql-rh9&lt;br /&gt;
&lt;br /&gt;
# ls -d /vz/template/*redhat-9*&lt;br /&gt;
/vz/template/redhat-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a template from one HN to another, it simply needs to be rsync&#039;d over to the target HN. It&#039;s rsync&#039;d over in this fashion:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template&lt;br /&gt;
 rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template&lt;br /&gt;
&lt;br /&gt;
Newer (&amp;gt;= 3.x) VZ employs &amp;quot;EZ&amp;quot; templates which are organized a little differently:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc&lt;br /&gt;
centos  conf         redhat-as3-minimal  ubuntu&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/ubuntu/&lt;br /&gt;
10.04  11.04  9.10&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/&lt;br /&gt;
x86&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/cache/&lt;br /&gt;
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz&lt;br /&gt;
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz&lt;br /&gt;
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we see is the entire OS and all applications are in 1 directory, and organized by distribution and release version. So to move Ubuntu 10.04:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
and you also need to move the cache:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/&lt;br /&gt;
&lt;br /&gt;
Once the transfer is complete, you will be able to run &amp;lt;tt&amp;gt;vzpkgls&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vzpkg list -O&amp;lt;/tt&amp;gt; and see the template(s) listed on the target HN.&lt;br /&gt;
&lt;br /&gt;
So far, this all supposes template doesn&#039;t exist on the target- very simple, just copy it over. If the template exists already on the target HN, this requires closer inspection. With older templates, simply moving over the templates would be the end of it- you see the version listed when you do a &amp;lt;tt&amp;gt;vzplgls&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysql-rh9 20030814 20050412&lt;br /&gt;
&lt;br /&gt;
this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412&lt;br /&gt;
As an aside, you can&#039;t copy over just 1 of them, but if you rsync&#039;d over the &amp;lt;tt&amp;gt;mysql-rh9&amp;lt;/tt&amp;gt; directory, you&#039;d see 20030814 and 20050412 on the target HN. As long as the versions match up, you&#039;re good to go.&lt;br /&gt;
&lt;br /&gt;
With EZ templates, the versions are not as easy to decipher. When you look at the &amp;lt;tt&amp;gt;vzpkg list&amp;lt;/tt&amp;gt; output, that simply tells you when a cache was created. A cache is simply a snapshot of all the data needed for the latest versions of the OS and it&#039;s applications at the time the cache was created. It is a date, and thus tells you nothing about the versions within. So for instance, if you had a cache for Ubuntu 10.04 from 2007 and you ran &amp;lt;tt&amp;gt;vzpkg create cache ubuntu-10.04-x86&amp;lt;/tt&amp;gt; it would re-download the latest version of apache, mysql and so on. And any &#039;&#039;subsequent&#039;&#039; ubuntu 10.04 CT&#039;s created thereafter would use those newer versions, whereas older CT&#039;s based on 10.04 would use older templates. You can see how this works by looking at the files under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this template has in it 6 different versions of apache2. This means that this template was merged with other 10.04 templates and/or it has been cached a few times, each time a new apache was available. The unfortunate thing is it&#039;s almost impossible to know which CT&#039;s are using which version of apache so it&#039;s hard to try to prune this down and remove unwanted/unneeded applications.&lt;br /&gt;
&lt;br /&gt;
So, if you see another HN has Ubuntu 10.04 on it, you need to see/confirm that it has all the exact files your CT needs. You can run a test rsync to see what &#039;&#039;would&#039;&#039; be transferred (what&#039;s missing):&lt;br /&gt;
&lt;br /&gt;
 rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
Based on the amount of data you get back from the rsync, you will be able to decide whether or not to remove the -n and allow the full transfer to go through. The downside to doing the transfer is the situation described above- you&#039;ve permanently joined these templates and now you may have 10 versions of apache on the target HN. There&#039;s one other potential pitfall to this kind of merging- it will also potentially copy over shared files, for which there is no particular version, most of which are in &amp;lt;tt&amp;gt;/vz/template/ubuntu/10.04/x86/config&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
 cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
 /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
&lt;br /&gt;
Here are some specific things to look out for. Case: copying centos-5 on virt19 to virt12. We dumped the rsync output to a file so we could inspect:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
(note, that can be dangerous, better to add on full path &amp;lt;tt&amp;gt;/vz/template/centos/5&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
So in the output file we see things like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
x86/base0/cachecookie&lt;br /&gt;
x86/base0/primary.xml.gz &lt;br /&gt;
x86/base0/primary.xml.gz.sqlite &lt;br /&gt;
x86/base0/repomd.xml &lt;br /&gt;
x86/base1/cachecookie &lt;br /&gt;
x86/base1/filelists.xml.gz &lt;br /&gt;
x86/base1/filelists.xml.gz.sqlite  &lt;br /&gt;
x86/base1/primary.xml.gz &lt;br /&gt;
x86/base1/primary.xml.gz.sqlite &lt;br /&gt;
x86/base1/repomd.xml&lt;br /&gt;
x86/base2/cachecookie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which make us nervous cause those are not versioned files, i.e.:&lt;br /&gt;
 5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock&lt;br /&gt;
&lt;br /&gt;
So those files will replace existing files on v12 rather than the case of the latter where it&#039;s likely being added. So caution should be given and deference to whichever version is newer (which rsync should take care of, but that will depend on the date each file was created and perhaps not the actual data within).&lt;br /&gt;
&lt;br /&gt;
If we look further in the file we see:&lt;br /&gt;
&lt;br /&gt;
 x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.&lt;br /&gt;
9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif&lt;br /&gt;
&lt;br /&gt;
and other files looking like:&lt;br /&gt;
 5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info&lt;br /&gt;
&lt;br /&gt;
Which means plesk is here. We don&#039;t need plesk on v12 (the CT moving over doesn&#039;t use it) so we rerun the rsync and exclude it:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh --exclude=&amp;quot;plesk*&amp;quot; --exclude=&amp;quot;psa*&amp;quot; /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
and now it&#039;s much smaller:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l&lt;br /&gt;
 97104&lt;br /&gt;
&lt;br /&gt;
Before running with excludes it was:&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l &lt;br /&gt;
 238238&lt;br /&gt;
&lt;br /&gt;
So again, look at what you&#039;re doing. Generally, combining templates is fine however.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re happy with the merge, run the rsync again without the &amp;quot;-n&amp;quot; to let it actually do the transfer.&lt;br /&gt;
&lt;br /&gt;
Once done, don&#039;t forget to add the new template to the HN in Management -&amp;gt; Reference -&amp;gt; Templates&lt;br /&gt;
&lt;br /&gt;
= getting help =&lt;br /&gt;
&lt;br /&gt;
= vzup2date =&lt;br /&gt;
TODO &lt;br /&gt;
= Adding new OS/application templates =&lt;br /&gt;
&lt;br /&gt;
Virtuozzo will lag a bit behind the initial release of an OS, perhaps by a month or more. Further, a newly-released OS may be available, but there may not be many/any application templates available initially. It pays to wait a bit.&lt;br /&gt;
&lt;br /&gt;
A template is easily installed via [[#vzup2date|vzup2date]]:&lt;br /&gt;
&lt;br /&gt;
 vzup2date -z&lt;br /&gt;
&lt;br /&gt;
You will be given a list of OS&#039;s to install. Select an OS, then customize that selection by checking/unchecking the application templates we do/don&#039;t want to include/offer.&lt;br /&gt;
&lt;br /&gt;
Generally, here are the app templates we include/offer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cyrus-imap&lt;br /&gt;
devel&lt;br /&gt;
imp&lt;br /&gt;
jre&lt;br /&gt;
jsdk&lt;br /&gt;
mailman&lt;br /&gt;
mod_perl&lt;br /&gt;
mod_ssl&lt;br /&gt;
mysql&lt;br /&gt;
php&lt;br /&gt;
phpmyadmin&lt;br /&gt;
phppgadmin&lt;br /&gt;
postgresql&lt;br /&gt;
proftpd&lt;br /&gt;
spamassassin&lt;br /&gt;
squirrelmail&lt;br /&gt;
tomcat&lt;br /&gt;
vsftpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do not (any longer) offer webalizer or analog.&lt;br /&gt;
&lt;br /&gt;
After selecting and installing the OS and apps, you should ensure it&#039;s installed:&lt;br /&gt;
&lt;br /&gt;
 vzpkg list -O&lt;br /&gt;
&lt;br /&gt;
Your new OS (ex. fedora-core-13-x86_64) will be listed, without a corresponding cache date:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@virt13 /vzconf]# vzpkg list -O&lt;br /&gt;
centos-6-x86                       2011-07-22 13:24:41&lt;br /&gt;
centos-6-x86_64                    2012-03-09 20:42:22&lt;br /&gt;
centos-5-x86                       2009-07-27 16:58:24&lt;br /&gt;
centos-5-x86_64                    2012-03-09 22:38:53&lt;br /&gt;
ubuntu-11.10-x86_64                2012-03-01 23:13:33&lt;br /&gt;
ubuntu-9.04-x86                    2009-06-02 11:32:39&lt;br /&gt;
ubuntu-12.04-x86_64                2012-05-29 13:50:50&lt;br /&gt;
ubuntu-8.04-x86                    2008-09-17 21:27:20&lt;br /&gt;
ubuntu-8.10-x86                    2009-03-13 13:58:57&lt;br /&gt;
ubuntu-11.04-x86                   2011-12-05 11:15:46&lt;br /&gt;
ubuntu-7.04-x86                    2008-09-24 16:42:50&lt;br /&gt;
redhat-el6-x86_64&lt;br /&gt;
fedora-core-13-x86_64              &lt;br /&gt;
fedora-core-12-x86                 2010-02-06 13:24:32&lt;br /&gt;
fedora-core-15-x86                 2011-12-05 11:36:43&lt;br /&gt;
fedora-core-11-x86                 2009-10-01 16:30:59&lt;br /&gt;
fedora-core-14-x86&lt;br /&gt;
fedora-core-16-x86_64              2012-03-13 11:40:23&lt;br /&gt;
fedora-core-9-x86                  2008-11-29 10:52:18&lt;br /&gt;
debian-6.0-x86                     2011-07-29 16:00:35&lt;br /&gt;
debian-6.0-x86_64                  2012-03-12 19:53:33&lt;br /&gt;
debian-5.0-x86                     2009-03-12 12:39:11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also confirm the apps installed:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt13 /vzconf]# vzpkg list fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64              2013-03-08 11:39:44&lt;br /&gt;
fedora-core-13-x86_64 devel&lt;br /&gt;
fedora-core-13-x86_64 php&lt;br /&gt;
fedora-core-13-x86_64 proftpd&lt;br /&gt;
fedora-core-13-x86_64 postgresql&lt;br /&gt;
fedora-core-13-x86_64 phpmyadmin&lt;br /&gt;
fedora-core-13-x86_64 mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before you can use the OS you must cache it. To create the cache run:&lt;br /&gt;
 vzpkg cache [OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;vzpkg cache fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s ready to use. In order to be able to use it with the [[VPS_Management#vm|vm]] command, you must create a file:&lt;br /&gt;
 jctmpl-[OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;jctmpl-fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In it, on line 1 we place the OS, followed by the app names, ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;more jctmpl-fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64&lt;br /&gt;
postgresql&lt;br /&gt;
jsdk&lt;br /&gt;
mod_ssl&lt;br /&gt;
phpmyadmin&lt;br /&gt;
mod_perl&lt;br /&gt;
tomcat&lt;br /&gt;
devel&lt;br /&gt;
php&lt;br /&gt;
mailman&lt;br /&gt;
cyrus-imap&lt;br /&gt;
squirrelmail&lt;br /&gt;
proftpd&lt;br /&gt;
mysql&lt;br /&gt;
phppgadmin&lt;br /&gt;
spamassassin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The packages will be installed in that order, so any pre-req&#039;s should be handled there.&lt;br /&gt;
&lt;br /&gt;
Now, when you run [[VPS_Management#vm|vm]] it will show you the newly-added OS and you may create a CT using it.&lt;br /&gt;
&lt;br /&gt;
The last few tasks are related to mgmt:&lt;br /&gt;
&lt;br /&gt;
1. add to mgmt-&amp;gt;reference-&amp;gt;templates (use the existing templates as an example). Once added, the new template will be included with the list of OS&#039;s available for the given HN.&lt;br /&gt;
2. if this is going to be a new OS offered for ordering, it needs to be added to the order form and webpage.&lt;br /&gt;
a. to get a list of applications and versions in the new OS, you should create a test CT, enter it and run &amp;lt;tt&amp;gt;dpkg -l|sort&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;rpm -aq|sort&amp;lt;/tt&amp;gt; in centos/fedora) and enter that list in the following places:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/jc_pub/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Note, you will have to move the most recent OS data from &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt; into the corresponding &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname]_old.html&amp;lt;/tt&amp;gt; updating the version links in both.&lt;br /&gt;
&lt;br /&gt;
b. to add the new OS to the order form, you will need to update &amp;lt;tt&amp;gt;/usr/local/www/signup/html/step1.html&amp;lt;/tt&amp;gt; in several places (for regular and OSS orders) as well as updating the templateID which you can get from mgmt-&amp;gt;reference-&amp;gt;templates (or [[Management_System_/_Public_Website_/_Signup_/_Account_Manager#jc:ref_templates|jc:ref_templates]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Old method:&lt;br /&gt;
&lt;br /&gt;
Go to http://www.parallels.com/en/virtuozzo/templates/catalog/&lt;br /&gt;
&lt;br /&gt;
Download the RPM&#039;s and install them&lt;br /&gt;
&lt;br /&gt;
 vzpkg list&lt;br /&gt;
to see the new packages/os templates&lt;br /&gt;
&lt;br /&gt;
 vzpkg create cache &amp;quot;OS_EZ_template_name&amp;quot;&lt;br /&gt;
to create a cache&lt;br /&gt;
&lt;br /&gt;
= Updating kernel on virt =&lt;br /&gt;
&lt;br /&gt;
We now use [[#vzup2date|vzup2date]] to update systems and kernels. What follows is what we used to do when we had to download kernels and install manually on old systems:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. install kernel and modules&lt;br /&gt;
&amp;lt;pre&amp;gt;# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \&lt;br /&gt;
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm&lt;br /&gt;
vzkernel-smp          ##################################################&lt;br /&gt;
vzmodules-smp       ##################################################&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT USE the &amp;quot;rpm -Uhv&amp;quot; command to install the kernel, otherwise all the previously installed kernels may be removed from your system. &lt;br /&gt;
&lt;br /&gt;
2. update lilo/grub&lt;br /&gt;
&lt;br /&gt;
Lilo:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lilo.conf&lt;br /&gt;
 &lt;br /&gt;
rename old Virtuozzo kernel label from &amp;quot;linux+virtuozzo&amp;quot; to &amp;quot;virtuozzo_old&amp;quot;&lt;br /&gt;
and add a new entry pointing to the newly installed virtuozzo kernel image.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;prompt&lt;br /&gt;
timeout=50&lt;br /&gt;
default=linux+virtuozzo&lt;br /&gt;
append=&amp;quot;debug panic=5 console=tty console=ttyS0,38400&amp;quot;&lt;br /&gt;
boot=/dev/sda&lt;br /&gt;
map=/boot/map&lt;br /&gt;
install=/boot/boot.b&lt;br /&gt;
message=/boot/message&lt;br /&gt;
linear&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3smp&lt;br /&gt;
        label=linux&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3smp.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3&lt;br /&gt;
        label=linux-up&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise&lt;br /&gt;
        label=2.4.20-9.5.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise&lt;br /&gt;
        label=2.4.20-9.8.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise&lt;br /&gt;
        label=2.4.20-9.21.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise&lt;br /&gt;
        label=2.4.20-9.24.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise&lt;br /&gt;
        label=2.4.20-28.3.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise&lt;br /&gt;
        label=old_linux+vz&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise&lt;br /&gt;
        label=linux+virtuozzo&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label &amp;quot;old_linux+vz &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Grub:&lt;br /&gt;
&lt;br /&gt;
 vi /boot/grub /menu.lst&lt;br /&gt;
&lt;br /&gt;
Add new entry at the top.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;serial --unit=0 --speed=38400&lt;br /&gt;
terminal --timeout=10 serial console&lt;br /&gt;
default=0&lt;br /&gt;
timeout=10&lt;br /&gt;
splashimage=(hd0,0)/boot/grub/splash.xpm.gz&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Red Hat Linux (2.4.18-3smp)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3smp.img&lt;br /&gt;
title Red Hat Linux-up (2.4.18-3)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3.img&lt;br /&gt;
title Linux with Virtuozzo 2.5&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1&lt;br /&gt;
title vz-enterpriseo&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1&lt;br /&gt;
title vz-enterprise&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. run the lilo (if using lilo)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lilo&lt;br /&gt;
Added linux&lt;br /&gt;
Added linux-up&lt;br /&gt;
Added virtuozzo_old&lt;br /&gt;
Added linux+virtuozzo *&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. reboot the server&lt;br /&gt;
 shutdown -r 23:05&lt;br /&gt;
&lt;br /&gt;
when it comes time for the shutdown, run [[VPS_Management#stopvirt|stopvirt]] to get things shut down faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Remaking service VE (&amp;lt;=3.x only) =&lt;br /&gt;
&lt;br /&gt;
Occasionally the control panel for VEs (aka VZPP) will stop working and you just need to reinstall the service VE (which runs the control panels for all VEs on the HN). Here&#039;s how that&#039;s done :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop 1&lt;br /&gt;
ipdel 1 69.55.234.152&lt;br /&gt;
vzmlocal 1:2&lt;br /&gt;
vzctl set 2 --save --onboot no&lt;br /&gt;
vzsveinstall -t redhat-as3-minimal -d /root/Rel261/HW/RPMS -s 69.55.234.152 --skip-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzsveinstall -t redhat-as3-minimal -d /vz/Rel300/HW/RPMS -s 69.55.229.151 --skip-client&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzctl mount 1&lt;br /&gt;
vzctl mount 2&lt;br /&gt;
/bin/cp -aRf /vz/root/2/home/vzagent0 /vz/root/1/home&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/lib/mysql/VZADB /vz/root/1/var/lib/mysql&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/shadow /vz/root/1/etc/&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/vzcp/static/vz/skins/ /vz/root/1/var/vzcp/static/vz&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/menu.xml  /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/dashboard.xml /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
&lt;br /&gt;
vzctl umount 2&lt;br /&gt;
vzctl umount 1&lt;br /&gt;
vzctl start 1&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1026</id>
		<title>Virtuozzo / Linux Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1026"/>
		<updated>2013-03-11T23:36:23Z</updated>

		<summary type="html">&lt;p&gt;Support: /* adding new templates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Updating VZ =&lt;br /&gt;
&lt;br /&gt;
 Update Virtuozzo to version 4.0.0&lt;br /&gt;
 Apply minor updates for Virtuozzo 3.0.0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
When you get to the last screen, you will be given an option to &lt;br /&gt;
&lt;br /&gt;
 ( ) Automatically reboot after update&lt;br /&gt;
 (*) Reboot later manually&lt;br /&gt;
&lt;br /&gt;
make sure you choose to reboot later.&lt;br /&gt;
&lt;br /&gt;
= Migrating Templates =&lt;br /&gt;
One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it&#039;s now called) based on a particular ditribution on a host which may or may not share the same distribution. For instance, you could run a CT running Ubuntu while the host machine (Hardware Node or HN) is running CentOS. This is accomplished via the use of OS templates. As long as the HN contains the OS template on which a particular CT relies, it will run there. As such, if you want to move a CT from one HN to another, you will need to make sure the OS template exists there.&lt;br /&gt;
&lt;br /&gt;
Modern versions of VZ (&amp;gt;= 4.x) will check for and automatically move the OS template over to the host as you&#039;re (vz)migrating the CT over to a new HN. However we like to make sure the template is in place prior to moving the CT. &lt;br /&gt;
&lt;br /&gt;
The first step is to see if the template exists on the host. To see OS templates installed:&lt;br /&gt;
&lt;br /&gt;
2.x (shows OS and application templates):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkgls&lt;br /&gt;
mod_ssl-rh9 20040624&lt;br /&gt;
mysql-rh9 20030814 20050412&lt;br /&gt;
openwebmail-rh9 20050427&lt;br /&gt;
php-rh9 20050506&lt;br /&gt;
phpBB-rh9 20041229&lt;br /&gt;
postgresql-rh9 20050719&lt;br /&gt;
sl-webalizer-rh9 20040119&lt;br /&gt;
spamassassin-rh9 20040127&lt;br /&gt;
tomcat-rh9 20040524&lt;br /&gt;
usermin-rh9 20040116&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;= 3.x (shows just OS templates, run without -O to see application as well):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkg list -O&lt;br /&gt;
ubuntu-10.04-x86                   2010-06-01 11:39:05&lt;br /&gt;
ubuntu-11.04-x86                   2011-06-22 14:23:59&lt;br /&gt;
ubuntu-9.10-x86                    2010-03-11 17:39:51&lt;br /&gt;
centos-5-x86                       2010-03-11 17:12:27&lt;br /&gt;
debian-5.0-x86                     2010-03-11 17:33:34&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All template files are located:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1&lt;br /&gt;
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2&lt;br /&gt;
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9&lt;br /&gt;
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1&lt;br /&gt;
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2&lt;br /&gt;
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9&lt;br /&gt;
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92&lt;br /&gt;
analog-fc2      mailman-fc2           php-rh9             suse-9.2&lt;br /&gt;
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1&lt;br /&gt;
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2&lt;br /&gt;
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9&lt;br /&gt;
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92&lt;br /&gt;
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1&lt;br /&gt;
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1&lt;br /&gt;
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2&lt;br /&gt;
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9&lt;br /&gt;
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1&lt;br /&gt;
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2&lt;br /&gt;
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9&lt;br /&gt;
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3&lt;br /&gt;
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0&lt;br /&gt;
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92&lt;br /&gt;
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1&lt;br /&gt;
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2&lt;br /&gt;
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9&lt;br /&gt;
jdk-suse92      mysql-rh9             redhat-as3-minimal&lt;br /&gt;
jre-deb31       mysql-suse92          redhat-devel-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here are the base OS templates: &amp;lt;tt&amp;gt;redhat-9, fedora-core-1&amp;lt;/tt&amp;gt; and supporting application templates: &amp;lt;tt&amp;gt;postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1&amp;lt;/tt&amp;gt;. So if you wanted to copy over all of redhat 9 you&#039;d need to copy the contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls -d /vz/template/*rh9*&lt;br /&gt;
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9&lt;br /&gt;
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9&lt;br /&gt;
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9&lt;br /&gt;
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9&lt;br /&gt;
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9&lt;br /&gt;
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9&lt;br /&gt;
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9&lt;br /&gt;
/vz/template/mailman-rh9     /vz/template/postgresql-rh9&lt;br /&gt;
&lt;br /&gt;
# ls -d /vz/template/*redhat-9*&lt;br /&gt;
/vz/template/redhat-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a template from one HN to another, it simply needs to be rsync&#039;d over to the target HN. It&#039;s rsync&#039;d over in this fashion:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template&lt;br /&gt;
 rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template&lt;br /&gt;
&lt;br /&gt;
Newer (&amp;gt;= 3.x) VZ employs &amp;quot;EZ&amp;quot; templates which are organized a little differently:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc&lt;br /&gt;
centos  conf         redhat-as3-minimal  ubuntu&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/ubuntu/&lt;br /&gt;
10.04  11.04  9.10&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/&lt;br /&gt;
x86&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/cache/&lt;br /&gt;
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz&lt;br /&gt;
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz&lt;br /&gt;
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we see is the entire OS and all applications are in 1 directory, and organized by distribution and release version. So to move Ubuntu 10.04:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
and you also need to move the cache:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/&lt;br /&gt;
&lt;br /&gt;
Once the transfer is complete, you will be able to run &amp;lt;tt&amp;gt;vzpkgls&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vzpkg list -O&amp;lt;/tt&amp;gt; and see the template(s) listed on the target HN.&lt;br /&gt;
&lt;br /&gt;
So far, this all supposes template doesn&#039;t exist on the target- very simple, just copy it over. If the template exists already on the target HN, this requires closer inspection. With older templates, simply moving over the templates would be the end of it- you see the version listed when you do a &amp;lt;tt&amp;gt;vzplgls&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysql-rh9 20030814 20050412&lt;br /&gt;
&lt;br /&gt;
this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412&lt;br /&gt;
As an aside, you can&#039;t copy over just 1 of them, but if you rsync&#039;d over the &amp;lt;tt&amp;gt;mysql-rh9&amp;lt;/tt&amp;gt; directory, you&#039;d see 20030814 and 20050412 on the target HN. As long as the versions match up, you&#039;re good to go.&lt;br /&gt;
&lt;br /&gt;
With EZ templates, the versions are not as easy to decipher. When you look at the &amp;lt;tt&amp;gt;vzpkg list&amp;lt;/tt&amp;gt; output, that simply tells you when a cache was created. A cache is simply a snapshot of all the data needed for the latest versions of the OS and it&#039;s applications at the time the cache was created. It is a date, and thus tells you nothing about the versions within. So for instance, if you had a cache for Ubuntu 10.04 from 2007 and you ran &amp;lt;tt&amp;gt;vzpkg create cache ubuntu-10.04-x86&amp;lt;/tt&amp;gt; it would re-download the latest version of apache, mysql and so on. And any &#039;&#039;subsequent&#039;&#039; ubuntu 10.04 CT&#039;s created thereafter would use those newer versions, whereas older CT&#039;s based on 10.04 would use older templates. You can see how this works by looking at the files under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this template has in it 6 different versions of apache2. This means that this template was merged with other 10.04 templates and/or it has been cached a few times, each time a new apache was available. The unfortunate thing is it&#039;s almost impossible to know which CT&#039;s are using which version of apache so it&#039;s hard to try to prune this down and remove unwanted/unneeded applications.&lt;br /&gt;
&lt;br /&gt;
So, if you see another HN has Ubuntu 10.04 on it, you need to see/confirm that it has all the exact files your CT needs. You can run a test rsync to see what &#039;&#039;would&#039;&#039; be transferred (what&#039;s missing):&lt;br /&gt;
&lt;br /&gt;
 rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
Based on the amount of data you get back from the rsync, you will be able to decide whether or not to remove the -n and allow the full transfer to go through. The downside to doing the transfer is the situation described above- you&#039;ve permanently joined these templates and now you may have 10 versions of apache on the target HN. There&#039;s one other potential pitfall to this kind of merging- it will also potentially copy over shared files, for which there is no particular version, most of which are in &amp;lt;tt&amp;gt;/vz/template/ubuntu/10.04/x86/config&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
 cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
 /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
&lt;br /&gt;
Here are some specific things to look out for. Case: copying centos-5 on virt19 to virt12. We dumped the rsync output to a file so we could inspect:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
(note, that can be dangerous, better to add on full path &amp;lt;tt&amp;gt;/vz/template/centos/5&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
So in the output file we see things like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
x86/base0/cachecookie&lt;br /&gt;
x86/base0/primary.xml.gz &lt;br /&gt;
x86/base0/primary.xml.gz.sqlite &lt;br /&gt;
x86/base0/repomd.xml &lt;br /&gt;
x86/base1/cachecookie &lt;br /&gt;
x86/base1/filelists.xml.gz &lt;br /&gt;
x86/base1/filelists.xml.gz.sqlite  &lt;br /&gt;
x86/base1/primary.xml.gz &lt;br /&gt;
x86/base1/primary.xml.gz.sqlite &lt;br /&gt;
x86/base1/repomd.xml&lt;br /&gt;
x86/base2/cachecookie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which make us nervous cause those are not versioned files, i.e.:&lt;br /&gt;
 5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock&lt;br /&gt;
&lt;br /&gt;
So those files will replace existing files on v12 rather than the case of the latter where it&#039;s likely being added. So caution should be given and deference to whichever version is newer (which rsync should take care of, but that will depend on the date each file was created and perhaps not the actual data within).&lt;br /&gt;
&lt;br /&gt;
If we look further in the file we see:&lt;br /&gt;
&lt;br /&gt;
 x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.&lt;br /&gt;
9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif&lt;br /&gt;
&lt;br /&gt;
and other files looking like:&lt;br /&gt;
 5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info&lt;br /&gt;
&lt;br /&gt;
Which means plesk is here. We don&#039;t need plesk on v12 (the CT moving over doesn&#039;t use it) so we rerun the rsync and exclude it:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh --exclude=&amp;quot;plesk*&amp;quot; --exclude=&amp;quot;psa*&amp;quot; /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
and now it&#039;s much smaller:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l&lt;br /&gt;
 97104&lt;br /&gt;
&lt;br /&gt;
Before running with excludes it was:&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l &lt;br /&gt;
 238238&lt;br /&gt;
&lt;br /&gt;
So again, look at what you&#039;re doing. Generally, combining templates is fine however.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re happy with the merge, run the rsync again without the &amp;quot;-n&amp;quot; to let it actually do the transfer.&lt;br /&gt;
&lt;br /&gt;
Once done, don&#039;t forget to add the new template to the HN in Management -&amp;gt; Reference -&amp;gt; Templates&lt;br /&gt;
&lt;br /&gt;
= getting help =&lt;br /&gt;
&lt;br /&gt;
= vzup2date =&lt;br /&gt;
TODO &lt;br /&gt;
= Adding new OS/application templates =&lt;br /&gt;
&lt;br /&gt;
Virtuozzo will lag a bit behind the initial release of an OS, perhaps by a month or more. Further, a newly-released OS may be available, but there may not be many/any application templates available initially. It pays to wait a bit.&lt;br /&gt;
&lt;br /&gt;
A template is easily installed via [[#vzup2date|vzup2date]]:&lt;br /&gt;
&lt;br /&gt;
 vzup2date -z&lt;br /&gt;
&lt;br /&gt;
You will be given a list of OS&#039;s to install. Select an OS, then customize that selection by checking/unchecking the application templates we do/don&#039;t want to include/offer.&lt;br /&gt;
&lt;br /&gt;
Generally, here are the app templates we include/offer:&lt;br /&gt;
&amp;lt;pre&amp;gt;cyrus-imap&lt;br /&gt;
devel&lt;br /&gt;
imp&lt;br /&gt;
jre&lt;br /&gt;
jsdk&lt;br /&gt;
mailman&lt;br /&gt;
mod_perl&lt;br /&gt;
mod_ssl&lt;br /&gt;
mysql&lt;br /&gt;
php&lt;br /&gt;
phpmyadmin&lt;br /&gt;
phppgadmin&lt;br /&gt;
postgresql&lt;br /&gt;
proftpd&lt;br /&gt;
spamassassin&lt;br /&gt;
squirrelmail&lt;br /&gt;
tomcat&lt;br /&gt;
vsftpd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do not (any longer) offer webalizer or analog.&lt;br /&gt;
&lt;br /&gt;
After selecting and installing the OS and apps, you should ensure it&#039;s installed:&lt;br /&gt;
&lt;br /&gt;
 vzpkg list -O&lt;br /&gt;
&lt;br /&gt;
Your new OS (ex. fedora-core-13-x86_64) will be listed, without a corresponding cache date:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@virt13 /vzconf]# vzpkg list -O&lt;br /&gt;
centos-6-x86                       2011-07-22 13:24:41&lt;br /&gt;
centos-6-x86_64                    2012-03-09 20:42:22&lt;br /&gt;
centos-5-x86                       2009-07-27 16:58:24&lt;br /&gt;
centos-5-x86_64                    2012-03-09 22:38:53&lt;br /&gt;
ubuntu-11.10-x86_64                2012-03-01 23:13:33&lt;br /&gt;
ubuntu-9.04-x86                    2009-06-02 11:32:39&lt;br /&gt;
ubuntu-12.04-x86_64                2012-05-29 13:50:50&lt;br /&gt;
ubuntu-8.04-x86                    2008-09-17 21:27:20&lt;br /&gt;
ubuntu-8.10-x86                    2009-03-13 13:58:57&lt;br /&gt;
ubuntu-11.04-x86                   2011-12-05 11:15:46&lt;br /&gt;
ubuntu-7.04-x86                    2008-09-24 16:42:50&lt;br /&gt;
redhat-el6-x86_64&lt;br /&gt;
fedora-core-13-x86_64              &lt;br /&gt;
fedora-core-12-x86                 2010-02-06 13:24:32&lt;br /&gt;
fedora-core-15-x86                 2011-12-05 11:36:43&lt;br /&gt;
fedora-core-11-x86                 2009-10-01 16:30:59&lt;br /&gt;
fedora-core-14-x86&lt;br /&gt;
fedora-core-16-x86_64              2012-03-13 11:40:23&lt;br /&gt;
fedora-core-9-x86                  2008-11-29 10:52:18&lt;br /&gt;
debian-6.0-x86                     2011-07-29 16:00:35&lt;br /&gt;
debian-6.0-x86_64                  2012-03-12 19:53:33&lt;br /&gt;
debian-5.0-x86                     2009-03-12 12:39:11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also confirm the apps installed:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt13 /vzconf]# vzpkg list fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64              2013-03-08 11:39:44&lt;br /&gt;
fedora-core-13-x86_64 devel&lt;br /&gt;
fedora-core-13-x86_64 php&lt;br /&gt;
fedora-core-13-x86_64 proftpd&lt;br /&gt;
fedora-core-13-x86_64 postgresql&lt;br /&gt;
fedora-core-13-x86_64 phpmyadmin&lt;br /&gt;
fedora-core-13-x86_64 mysql&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before you can use the OS you must cache it. To create the cache run:&lt;br /&gt;
 vzpkg cache [OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;vzpkg cache fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now it&#039;s ready to use. In order to be able to use it with the [[VPS_Management#vm|vm]] command, you must create a file:&lt;br /&gt;
 jctmpl-[OS]&lt;br /&gt;
&lt;br /&gt;
ex: &amp;lt;tt&amp;gt;jctmpl-fedora-core-13-x86_64&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In it, on line 1 we place the OS, followed by the app names, ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;more jctmpl-fedora-core-13-x86_64&lt;br /&gt;
fedora-core-13-x86_64&lt;br /&gt;
postgresql&lt;br /&gt;
jsdk&lt;br /&gt;
mod_ssl&lt;br /&gt;
phpmyadmin&lt;br /&gt;
mod_perl&lt;br /&gt;
tomcat&lt;br /&gt;
devel&lt;br /&gt;
php&lt;br /&gt;
mailman&lt;br /&gt;
cyrus-imap&lt;br /&gt;
squirrelmail&lt;br /&gt;
proftpd&lt;br /&gt;
mysql&lt;br /&gt;
phppgadmin&lt;br /&gt;
spamassassin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The packages will be installed in that order, so any pre-req&#039;s should be handled there.&lt;br /&gt;
&lt;br /&gt;
Now, when you run [[VPS_Management#vm|vm]] it will show you the newly-added OS and you may create a CT using it.&lt;br /&gt;
&lt;br /&gt;
The last few tasks are related to mgmt:&lt;br /&gt;
&lt;br /&gt;
# add to mgmt-&amp;gt;reference-&amp;gt;templates (use the existing templates as an example). Once added, the new template will be included with the list of OS&#039;s available for the given HN.&lt;br /&gt;
# if this is going to be a new OS offered for ordering, it needs to be added to the order form and webpage.&lt;br /&gt;
## to get a list of applications and versions in the new OS, you should create a test CT, enter it and run &amp;lt;tt&amp;gt;dpkg -l|sort&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;rpm -aq|sort&amp;lt;/tt&amp;gt; in centos/fedora) and enter that list in the following places:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/jc_pub/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Note, you will have to move the most recent OS data from &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname].html&amp;lt;/tt&amp;gt; into the corresponding &amp;lt;tt&amp;gt;/usr/local/www/signup/html/[osname]_old.html&amp;lt;/tt&amp;gt; updating the version links in both.&lt;br /&gt;
## to add the new OS to the order form, you will need to update &amp;lt;tt&amp;gt;/usr/local/www/signup/html/step1.html&amp;lt;/tt&amp;gt; in several places (for regular and OSS orders) as well as updating the templateID which you can get from mgmt-&amp;gt;reference-&amp;gt;templates (or [[Management_System_/_Public_Website_/_Signup_/_Account_Manager#jc:ref_templates|jc:ref_templates]])&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Old method:&lt;br /&gt;
&lt;br /&gt;
Go to http://www.parallels.com/en/virtuozzo/templates/catalog/&lt;br /&gt;
&lt;br /&gt;
Download the RPM&#039;s and install them&lt;br /&gt;
&lt;br /&gt;
 vzpkg list&lt;br /&gt;
to see the new packages/os templates&lt;br /&gt;
&lt;br /&gt;
 vzpkg create cache &amp;quot;OS_EZ_template_name&amp;quot;&lt;br /&gt;
to create a cache&lt;br /&gt;
&lt;br /&gt;
= Updating kernel on virt =&lt;br /&gt;
&lt;br /&gt;
We now use [[#vzup2date|vzup2date]] to update systems and kernels. What follows is what we used to do when we had to download kernels and install manually on old systems:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. install kernel and modules&lt;br /&gt;
&amp;lt;pre&amp;gt;# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \&lt;br /&gt;
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm&lt;br /&gt;
vzkernel-smp          ##################################################&lt;br /&gt;
vzmodules-smp       ##################################################&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT USE the &amp;quot;rpm -Uhv&amp;quot; command to install the kernel, otherwise all the previously installed kernels may be removed from your system. &lt;br /&gt;
&lt;br /&gt;
2. update lilo/grub&lt;br /&gt;
&lt;br /&gt;
Lilo:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lilo.conf&lt;br /&gt;
 &lt;br /&gt;
rename old Virtuozzo kernel label from &amp;quot;linux+virtuozzo&amp;quot; to &amp;quot;virtuozzo_old&amp;quot;&lt;br /&gt;
and add a new entry pointing to the newly installed virtuozzo kernel image.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;prompt&lt;br /&gt;
timeout=50&lt;br /&gt;
default=linux+virtuozzo&lt;br /&gt;
append=&amp;quot;debug panic=5 console=tty console=ttyS0,38400&amp;quot;&lt;br /&gt;
boot=/dev/sda&lt;br /&gt;
map=/boot/map&lt;br /&gt;
install=/boot/boot.b&lt;br /&gt;
message=/boot/message&lt;br /&gt;
linear&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3smp&lt;br /&gt;
        label=linux&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3smp.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3&lt;br /&gt;
        label=linux-up&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise&lt;br /&gt;
        label=2.4.20-9.5.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise&lt;br /&gt;
        label=2.4.20-9.8.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise&lt;br /&gt;
        label=2.4.20-9.21.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise&lt;br /&gt;
        label=2.4.20-9.24.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise&lt;br /&gt;
        label=2.4.20-28.3.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise&lt;br /&gt;
        label=old_linux+vz&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise&lt;br /&gt;
        label=linux+virtuozzo&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label &amp;quot;old_linux+vz &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Grub:&lt;br /&gt;
&lt;br /&gt;
 vi /boot/grub /menu.lst&lt;br /&gt;
&lt;br /&gt;
Add new entry at the top.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;serial --unit=0 --speed=38400&lt;br /&gt;
terminal --timeout=10 serial console&lt;br /&gt;
default=0&lt;br /&gt;
timeout=10&lt;br /&gt;
splashimage=(hd0,0)/boot/grub/splash.xpm.gz&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Red Hat Linux (2.4.18-3smp)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3smp.img&lt;br /&gt;
title Red Hat Linux-up (2.4.18-3)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3.img&lt;br /&gt;
title Linux with Virtuozzo 2.5&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1&lt;br /&gt;
title vz-enterpriseo&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1&lt;br /&gt;
title vz-enterprise&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. run the lilo (if using lilo)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lilo&lt;br /&gt;
Added linux&lt;br /&gt;
Added linux-up&lt;br /&gt;
Added virtuozzo_old&lt;br /&gt;
Added linux+virtuozzo *&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. reboot the server&lt;br /&gt;
 shutdown -r 23:05&lt;br /&gt;
&lt;br /&gt;
when it comes time for the shutdown, run [[VPS_Management#stopvirt|stopvirt]] to get things shut down faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Remaking service VE (&amp;lt;=3.x only) =&lt;br /&gt;
&lt;br /&gt;
Occasionally the control panel for VEs (aka VZPP) will stop working and you just need to reinstall the service VE (which runs the control panels for all VEs on the HN). Here&#039;s how that&#039;s done :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop 1&lt;br /&gt;
ipdel 1 69.55.234.152&lt;br /&gt;
vzmlocal 1:2&lt;br /&gt;
vzctl set 2 --save --onboot no&lt;br /&gt;
vzsveinstall -t redhat-as3-minimal -d /root/Rel261/HW/RPMS -s 69.55.234.152 --skip-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzsveinstall -t redhat-as3-minimal -d /vz/Rel300/HW/RPMS -s 69.55.229.151 --skip-client&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzctl mount 1&lt;br /&gt;
vzctl mount 2&lt;br /&gt;
/bin/cp -aRf /vz/root/2/home/vzagent0 /vz/root/1/home&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/lib/mysql/VZADB /vz/root/1/var/lib/mysql&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/shadow /vz/root/1/etc/&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/vzcp/static/vz/skins/ /vz/root/1/var/vzcp/static/vz&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/menu.xml  /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/dashboard.xml /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
&lt;br /&gt;
vzctl umount 2&lt;br /&gt;
vzctl umount 1&lt;br /&gt;
vzctl start 1&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Management_System_/_Public_Website_/_Signup_/_Account_Manager&amp;diff=1025</id>
		<title>Management System / Public Website / Signup / Account Manager</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Management_System_/_Public_Website_/_Signup_/_Account_Manager&amp;diff=1025"/>
		<updated>2013-03-11T23:35:59Z</updated>

		<summary type="html">&lt;p&gt;Support: /* jc:billing_history */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
These systems are all running under the same apache instance on the mail server.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main ingredients are: apache 1.3.31, mysql, perl, mod_perl and template toolkit.&lt;br /&gt;
&lt;br /&gt;
Apache is listening on 69.55.230.9 ports 80 and 443&lt;br /&gt;
&lt;br /&gt;
The webserver can be stopped with:&lt;br /&gt;
 apachectl stop&lt;br /&gt;
&lt;br /&gt;
and must be started with:&lt;br /&gt;
 apachectl startssl&lt;br /&gt;
&lt;br /&gt;
If you run &amp;lt;tt&amp;gt;apachectl start&amp;lt;/tt&amp;gt; none of the ssl-enabled pages will work.&lt;br /&gt;
&lt;br /&gt;
The database may be stopped and started as follows:&lt;br /&gt;
 /usr/local/etc/rc.d/mysql-server.sh stop&lt;br /&gt;
 /usr/local/etc/rc.d/mysql-server.sh start&lt;br /&gt;
&lt;br /&gt;
* webroot: &amp;lt;tt&amp;gt;/usr/local/www/&amp;lt;/tt&amp;gt;&lt;br /&gt;
* logs: &amp;lt;tt&amp;gt;/var/log/httpd-error.log /var/log/httpd-access.log&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Apache config: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/usr/local/etc/apache/httpd.conf:&lt;br /&gt;
&lt;br /&gt;
-SNIP-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Directory /usr/local/www&amp;gt;&lt;br /&gt;
 Options none&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *&amp;gt;&lt;br /&gt;
  SSLDisable&lt;br /&gt;
  DocumentRoot /usr/local/www/jc_pub&lt;br /&gt;
  ServerName johncompanies.com&lt;br /&gt;
  ServerAlias www.johncompanies.com&lt;br /&gt;
  ServerAlias newwww.johncompanies.com&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/jc_pub&amp;gt;&lt;br /&gt;
    Options FollowSymLinks&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  Redirect /collocation http://www.johncompanies.com&lt;br /&gt;
  Redirect /colocation http://www.johncompanies.com&lt;br /&gt;
&lt;br /&gt;
  ScriptAlias /cgi-bin/ &amp;quot;/usr/local/www/jc_pub/cgi-bin/&amp;quot;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/jc_pub/cgi-bin&amp;gt;&lt;br /&gt;
    AllowOverride None&lt;br /&gt;
    Options None&lt;br /&gt;
    Order allow,deny&lt;br /&gt;
    Allow from all&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost *&amp;gt;&lt;br /&gt;
  ServerName mini.johncompanies.com&lt;br /&gt;
  SSLDisable&lt;br /&gt;
  DocumentRoot /usr/local/www/mini&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/mini&amp;gt;&lt;br /&gt;
    Options FollowSymLinks&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;VirtualHost _default_:443&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  DocumentRoot &amp;quot;/usr/local/www&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  DocumentRoot /usr/local/www&lt;br /&gt;
  &amp;lt;Directory /usr/local/www&amp;gt;&lt;br /&gt;
    Deny from All&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/mgmt&amp;gt;&lt;br /&gt;
    Allow from All&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/am&amp;gt;&lt;br /&gt;
    Allow from All&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/signup&amp;gt;&lt;br /&gt;
    Allow from All&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/images&amp;gt;&lt;br /&gt;
    Allow from All&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/media&amp;gt;&lt;br /&gt;
    Allow from All&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Files favicon.ico&amp;gt;&lt;br /&gt;
    Allow from All&lt;br /&gt;
  &amp;lt;/Files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  SSLEngine on&lt;br /&gt;
  SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL&lt;br /&gt;
&lt;br /&gt;
#  SSLCertificateFile         /usr/local/etc/apache/mail.cert&lt;br /&gt;
#  SSLCertificateKeyFile     /usr/local/etc/apache/mail.key&lt;br /&gt;
  #SSLCertificateFile         /usr/local/etc/apache/ssl.crt/secure.crt&lt;br /&gt;
  SSLCertificateFile         /usr/local/etc/apache/ssl.crt/secure.johncompanies.com.crt&lt;br /&gt;
  SSLCertificateChainFile    /usr/local/etc/apache/ssl.crt/gd_bundle.crt&lt;br /&gt;
  SSLCertificateKeyFile     /usr/local/etc/apache/ssl.key/secure.key&lt;br /&gt;
&lt;br /&gt;
  PerlModule Apache&lt;br /&gt;
&lt;br /&gt;
  # debug stuff&lt;br /&gt;
  PerlWarn On&lt;br /&gt;
  PerlTaintCheck Off&lt;br /&gt;
  PerlModule Apache::StatINC&lt;br /&gt;
  PerlInitHandler Apache::Reload&lt;br /&gt;
# CustomLog /usr/local/apache/logs/access_log.mgmt common&lt;br /&gt;
# ErrorLog /usr/local/apache/logs/error_log.mgmt&lt;br /&gt;
&lt;br /&gt;
  PerlModule Apache::DBI&lt;br /&gt;
#  PerlModule Mgmt&lt;br /&gt;
#  PerlModule Auth&lt;br /&gt;
&lt;br /&gt;
  PerlSetEnv MGMT_BASE /usr/local/www/mgmt&lt;br /&gt;
  PerlSetEnv COMMON_BASE  /usr/local/www/common&lt;br /&gt;
  PerlSetEnv SIGNUP_BASE  /usr/local/www/signup&lt;br /&gt;
  PerlSetEnv AM_BASE /usr/local/www/am&lt;br /&gt;
  PerlSetEnv MGMT_INDEX /mgmt/index.html&lt;br /&gt;
  PerlSetEnv SIGNUP_INDEX /signup/step1.html&lt;br /&gt;
  PerlSetEnv AM_INDEX /am/dashboard.html&lt;br /&gt;
  PerlSetEnv MGMT_LOG_LEVEL debug&lt;br /&gt;
  PerlSetEnv MGMT_LOG_FILE /usr/local/www/mgmt/Log/mgmt.log&lt;br /&gt;
  PerlSetEnv SIGNUP_LOG_LEVEL info&lt;br /&gt;
  PerlSetEnv SIGNUP_LOG_FILE /usr/local/www/signup/Log/signup.log&lt;br /&gt;
  PerlSetEnv AM_LOG_LEVEL debug&lt;br /&gt;
  PerlSetEnv AM_LOG_FILE /usr/local/www/am/Log/am.log&lt;br /&gt;
  PerlSetEnv PP_AUTH_TOKEN Pe3aLk5GdMblAyyLAv5vNYqipcynWdZJKdw1CmcGcIdOz74ujMrDYIov27i&lt;br /&gt;
  PerlSetEnv PP_URL &#039;https://www.paypal.com/cgi-bin/webscr&#039;&lt;br /&gt;
  PerlSetEnv PP_EMAIL &#039;payments@johncompanies.com&#039;&lt;br /&gt;
  PerlSetEnv JC_DOMAIN &#039;secure.johncompanies.com&#039;&lt;br /&gt;
  PerlSetEnv CC_LOG_FILE /usr/local/www/mgmt/Log/cc.log&lt;br /&gt;
  PerlSetEnv DEV 0&lt;br /&gt;
  PerlRequire /usr/local/www/common/conf/startup.pl&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory &amp;quot;/usr/local/www/mgmt&amp;quot;&amp;gt;&lt;br /&gt;
    SetHandler perl-script&lt;br /&gt;
    PerlHandler Mgmt&lt;br /&gt;
    PerlSetVar JCMGMTPath /mgmt&lt;br /&gt;
    PerlSetVar JCMGMTLoginScript /mgmt/login.html&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;Files LOGIN&amp;gt;&lt;br /&gt;
      AuthType Auth&lt;br /&gt;
      AuthName JCMGMT&lt;br /&gt;
      SetHandler perl-script&lt;br /&gt;
      PerlHandler Auth-&amp;gt;login&lt;br /&gt;
    &amp;lt;/Files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;FilesMatch &amp;quot;.*\.html$|.*\.cgi|.*\.png&amp;quot;&amp;gt;&lt;br /&gt;
      AuthType Auth&lt;br /&gt;
      AuthName JCMGMT&lt;br /&gt;
      PerlAuthenHandler Auth-&amp;gt;authenticate&lt;br /&gt;
      PerlAuthzHandler  Auth-&amp;gt;authorize&lt;br /&gt;
      require valid-user&lt;br /&gt;
    &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory &amp;quot;/usr/local/www/am&amp;quot;&amp;gt;&lt;br /&gt;
    SetHandler perl-script&lt;br /&gt;
    PerlHandler AM&lt;br /&gt;
    PerlSetVar JCAMPath /am&lt;br /&gt;
    PerlSetVar JCAMLoginScript /am/login.html&lt;br /&gt;
    #PerlSetVar JCAMExpires +1m&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;Files LOGINAM&amp;gt;&lt;br /&gt;
     AuthType AMAuth&lt;br /&gt;
     AuthName JCAM&lt;br /&gt;
     SetHandler perl-script&lt;br /&gt;
     PerlHandler AMAuth-&amp;gt;login&lt;br /&gt;
    &amp;lt;/Files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;Files PASSRESET&amp;gt;&lt;br /&gt;
     SetHandler perl-script&lt;br /&gt;
     PerlHandler AMPassR&lt;br /&gt;
    &amp;lt;/Files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;FilesMatch &amp;quot;.*\.html$|.*\.cgi&amp;quot;&amp;gt;&lt;br /&gt;
     AuthType AMAuth&lt;br /&gt;
     AuthName JCAM&lt;br /&gt;
     PerlAuthenHandler AMAuth-&amp;gt;authenticate&lt;br /&gt;
     PerlAuthzHandler AMAuth-&amp;gt;authorize&lt;br /&gt;
     require valid-user&lt;br /&gt;
    &amp;lt;/FilesMatch&amp;gt;&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/mgmt/static&amp;gt;&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/am/static&amp;gt;&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/mgmt/bwgraphs&amp;gt;&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/am/bwgraphs&amp;gt;&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/images&amp;gt;&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/media&amp;gt;&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www&amp;gt;&lt;br /&gt;
    Options FollowSymlinks&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  ScriptAlias /mgmt/cgi/ &amp;quot;/usr/local/www/mgmt/cgi/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/mgmt/cgi&amp;gt;&lt;br /&gt;
    AllowOverride None&lt;br /&gt;
    Options None&lt;br /&gt;
    Order allow,deny&lt;br /&gt;
    Allow from all&lt;br /&gt;
    SetHandler None&lt;br /&gt;
    AuthType Auth&lt;br /&gt;
    AuthName JCMGMT&lt;br /&gt;
    PerlAuthenHandler Auth-&amp;gt;authenticate&lt;br /&gt;
    PerlAuthzHandler  Auth-&amp;gt;authorize&lt;br /&gt;
    require valid-user&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory &amp;quot;/usr/local/www/signup&amp;quot;&amp;gt;&lt;br /&gt;
    SetHandler perl-script&lt;br /&gt;
    PerlHandler Signup&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  Alias /mgmt/mrtg &amp;quot;/usr/local/www/mgmt/mrtg/data&amp;quot;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/mgmt/mrtg/data/&amp;gt;&lt;br /&gt;
    DirectoryIndex index.cgi&lt;br /&gt;
    SetHandler None&lt;br /&gt;
    Options ExecCGI&lt;br /&gt;
    AddHandler cgi-script .cgi&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  Alias /mgmt/rrd &amp;quot;/usr/local/www/mgmt/mrtg/rrd&amp;quot;&lt;br /&gt;
  &amp;lt;Directory /usr/local/www/mgmt/mrtg/rrd/&amp;gt;&lt;br /&gt;
    DirectoryIndex index.html&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  ScriptAlias /mgmt/bb/cgi-bin/ /usr/home/bb/bbsrc/bb1.9i-btf/web/&lt;br /&gt;
  Alias /mgmt/bb &amp;quot;/usr/home/bb/bbsrc/bb1.9i-btf/www&amp;quot;&lt;br /&gt;
  &amp;lt;Directory /usr/home/bb/bbsrc/bb1.9i-btf/www/gifs&amp;gt;&lt;br /&gt;
    SetHandler None&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Directory /usr/home/bb/bbsrc/bb1.9i-btf/web&amp;gt;&lt;br /&gt;
    AllowOverride None&lt;br /&gt;
    Options None&lt;br /&gt;
    Order allow,deny&lt;br /&gt;
    Allow from all&lt;br /&gt;
    PerlSetVar JCMGMTLoginScript /mgmt/login.html&lt;br /&gt;
    AuthType Auth&lt;br /&gt;
    AuthName JCMGMT&lt;br /&gt;
    PerlAuthenHandler Auth-&amp;gt;authenticate&lt;br /&gt;
    PerlAuthzHandler  Auth-&amp;gt;authorize&lt;br /&gt;
    require valid-user&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
  &amp;lt;Directory /usr/home/bb/bbsrc/bb1.9i-btf/www&amp;gt;&lt;br /&gt;
    PerlSetVar JCMGMTLoginScript /mgmt/login.html&lt;br /&gt;
    AuthType Auth&lt;br /&gt;
    AuthName JCMGMT&lt;br /&gt;
    PerlAuthenHandler Auth-&amp;gt;authenticate&lt;br /&gt;
    PerlAuthzHandler  Auth-&amp;gt;authorize&lt;br /&gt;
    require valid-user&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  Alias /mgmt/awstatsclasses &amp;quot;/usr/local/www/mgmt/awstats/wwwroot/classes/&amp;quot;&lt;br /&gt;
  Alias /mgmt/awstatscss &amp;quot;/usr/local/www/mgmt/awstats/wwwroot/css/&amp;quot;&lt;br /&gt;
  Alias /mgmt/awstatsicons &amp;quot;/usr/local/www/mgmt/awstats/wwwroot/icon/&amp;quot;&lt;br /&gt;
  ScriptAlias /mgmt/awstats/ &amp;quot;/usr/local/www/mgmt/awstats/wwwroot/cgi-bin/&amp;quot;&lt;br /&gt;
  Alias /mgmt/icon/ &amp;quot;/usr/local/www/mgmt/awstats/wwwroot/icon/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory &amp;quot;/usr/local/www/mgmt/awstats/wwwroot/icon&amp;quot;&amp;gt;&lt;br /&gt;
    SetHandler None&lt;br /&gt;
    Options Indexes MultiViews&lt;br /&gt;
    AllowOverride None&lt;br /&gt;
    Order allow,deny&lt;br /&gt;
    Allow from all&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;Directory &amp;quot;/usr/local/www/mgmt/awstats/wwwroot&amp;quot;&amp;gt;&lt;br /&gt;
    PerlSetVar JCMGMTLoginScript /mgmt/login.html&lt;br /&gt;
    AuthType Auth&lt;br /&gt;
    AuthName JCMGMT&lt;br /&gt;
    PerlAuthenHandler Auth-&amp;gt;authenticate&lt;br /&gt;
    PerlAuthzHandler  Auth-&amp;gt;authorize&lt;br /&gt;
    require valid-user&lt;br /&gt;
    SetHandler None&lt;br /&gt;
    Options None&lt;br /&gt;
    AllowOverride None&lt;br /&gt;
    Order allow,deny&lt;br /&gt;
    Allow from all&lt;br /&gt;
  &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&amp;lt;/VirtualHost&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Template Toolkit ==&lt;br /&gt;
&lt;br /&gt;
http://www.template-toolkit.org/docs/manual/index.html&lt;br /&gt;
&lt;br /&gt;
All our dynamic content pages (i.e. anything but jcpub) makes use of the Template Toolkit (TT) framework to create/display our pages. This package allows us to create customied apache handlers via the use of mod_perl. The result is an easy to deploy, easy to develop, flexible and efficient platform.&lt;br /&gt;
&lt;br /&gt;
All these sites are organized under &amp;lt;tt&amp;gt;/usr/local/www&amp;lt;/tt&amp;gt; and consist/rely on several components:&lt;br /&gt;
&lt;br /&gt;
* common/conf/startup.pl - this contains all the use/require code that brings in all the required libraries and modules required to run our sites and TT. It is run once as apache starts up and applies to all sites.&lt;br /&gt;
&lt;br /&gt;
* common/conf/Lib - this directory contains all common libraries, primarly those dealing with database access and access to individual tables. &lt;br /&gt;
&lt;br /&gt;
* mysql:jc - the main table containing everything for mgmt/am/signup sites is contained in the &amp;lt;tt&amp;gt;jc&amp;lt;/tt&amp;gt; database. All data is accessed via the mysql user &amp;lt;tt&amp;gt;jc&amp;lt;/tt&amp;gt; - this is so we can impose restrictions on what that user may do. That access info is stored in &amp;lt;tt&amp;gt;common/Lib/DBI.pm&amp;lt;/tt&amp;gt;&lt;br /&gt;
The exception to that is the &amp;lt;tt&amp;gt;traffic&amp;lt;/tt&amp;gt; database which used to be stored on mail, but has since been exported to run locally on the bwdb server itself. i.e. mgmt/am contact the remote traffic database running elsewhere for that data. That access data is stored in &amp;lt;tt&amp;gt;common/Lib/DBI_BWDB.pm&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Part of TT&#039;s efficiency comes from static and natively compiled code/pages. Those pages are stored in:&lt;br /&gt;
* mgmt: &amp;lt;tt&amp;gt;/tmp/mgmt_templates/&amp;lt;/tt&amp;gt;&lt;br /&gt;
* am: &amp;lt;tt&amp;gt;/tmp/am_templates&amp;lt;/tt&amp;gt;&lt;br /&gt;
* signup: &amp;lt;tt&amp;gt;/tmp/signup_templates&amp;lt;/tt&amp;gt;&lt;br /&gt;
You could safely delete all of these and apache will just recreate them - though the directory holding the templates must exist, with the right permissions.&lt;br /&gt;
&lt;br /&gt;
To make editing of pages easier we enable apache modules/directives which direct apache to rebuild these pages when it notices there&#039;s a difference (httpd.conf):&lt;br /&gt;
  PerlModule Apache::StatINC&lt;br /&gt;
  PerlInitHandler Apache::Reload&lt;br /&gt;
&lt;br /&gt;
However, any changes made to anything under &amp;lt;tt&amp;gt;Lib&amp;lt;/tt&amp;gt; requires an immediate apache restart to take effect and to keep the site running- any changes w/o a restart will break the site.&lt;br /&gt;
&lt;br /&gt;
Among the directives in httpd.conf you will see a series of variables which are important as they, among other things, direct the mod_perl handlers where certain data is stored:&lt;br /&gt;
&lt;br /&gt;
This is where all the files for a particular set of pages and unique handler are located:&lt;br /&gt;
  PerlSetEnv MGMT_BASE /usr/local/www/mgmt&lt;br /&gt;
  PerlSetEnv COMMON_BASE  /usr/local/www/common&lt;br /&gt;
  PerlSetEnv SIGNUP_BASE  /usr/local/www/signup&lt;br /&gt;
  PerlSetEnv AM_BASE /usr/local/www/am&lt;br /&gt;
&lt;br /&gt;
This is the default page to present, if none is specified:&lt;br /&gt;
  PerlSetEnv MGMT_INDEX /mgmt/index.html&lt;br /&gt;
  PerlSetEnv SIGNUP_INDEX /signup/step1.html&lt;br /&gt;
  PerlSetEnv AM_INDEX /am/dashboard.html&lt;br /&gt;
&lt;br /&gt;
Indicates the verbosity and location of the handler logfile (these log files only contain logging which we do internally from our code- these differ from the apache logs which log simple hits and server errors):&lt;br /&gt;
  PerlSetEnv MGMT_LOG_LEVEL debug&lt;br /&gt;
  PerlSetEnv MGMT_LOG_FILE /usr/local/www/mgmt/Log/mgmt.log&lt;br /&gt;
  PerlSetEnv SIGNUP_LOG_LEVEL info&lt;br /&gt;
  PerlSetEnv SIGNUP_LOG_FILE /usr/local/www/signup/Log/signup.log&lt;br /&gt;
  PerlSetEnv AM_LOG_LEVEL debug&lt;br /&gt;
  PerlSetEnv AM_LOG_FILE /usr/local/www/am/Log/am.log&lt;br /&gt;
&lt;br /&gt;
Variables used for pp API access:&lt;br /&gt;
  PerlSetEnv PP_AUTH_TOKEN Pe3aLk5GdMblAyyLAv5vNYqipcynWdZJKdw1CmcGcIdOz74ujMrDYIov27i&lt;br /&gt;
  PerlSetEnv PP_URL &#039;https://www.paypal.com/cgi-bin/webscr&#039;&lt;br /&gt;
  PerlSetEnv PP_EMAIL &#039;payments@johncompanies.com&#039;&lt;br /&gt;
&lt;br /&gt;
Our base url:&lt;br /&gt;
  PerlSetEnv JC_DOMAIN &#039;secure.johncompanies.com&#039;&lt;br /&gt;
&lt;br /&gt;
Our credit card info logging file:&lt;br /&gt;
  PerlSetEnv CC_LOG_FILE /usr/local/www/mgmt/Log/cc.log&lt;br /&gt;
&lt;br /&gt;
Indicates we are/not in a dev environment:&lt;br /&gt;
  PerlSetEnv DEV 0&lt;br /&gt;
&lt;br /&gt;
= Public Website (jcpub) =&lt;br /&gt;
&lt;br /&gt;
* domain: &amp;lt;tt&amp;gt;http://www.johncompanies.com http://johncompanies.com&amp;lt;/tt&amp;gt;&lt;br /&gt;
* webroot: &amp;lt;tt&amp;gt;/usr/local/www/jc_pub&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our public-facing website is all static, standard HTML. We have some light javascripting on some pages, but by in large it&#039;s a very WYSIWYG site setup.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Signup (signup) =&lt;br /&gt;
== Setup / organization / notes ==&lt;br /&gt;
&lt;br /&gt;
* domain: &amp;lt;tt&amp;gt;https://secure.johncompanies.com/signup/step1.html&amp;lt;/tt&amp;gt;&lt;br /&gt;
* webroot: &amp;lt;tt&amp;gt;/usr/local/www/signup&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Directory structure:&lt;br /&gt;
* am: contains the main handler &amp;lt;tt&amp;gt;Signup.pm&amp;lt;/tt&amp;gt; and the ipn activity log &amp;lt;tt&amp;gt;ipn.log&amp;lt;/tt&amp;gt;&lt;br /&gt;
* signup/Lib: contains the log module &amp;lt;tt&amp;gt;SLog.pm&amp;lt;/tt&amp;gt;&lt;br /&gt;
* signup/Log: contains the log &amp;lt;tt&amp;gt;signup.log&amp;lt;/tt&amp;gt;, and cardit card activity log &amp;lt;tt&amp;gt;cc.log&amp;lt;/tt&amp;gt;&lt;br /&gt;
* signup/Plugin: contains the plugin module &amp;lt;tt&amp;gt;AMP.pm&amp;lt;/tt&amp;gt; and the form fill in module &amp;lt;tt&amp;gt;FillInForm.pm&amp;lt;/tt&amp;gt;&lt;br /&gt;
* signup/html: contains all web pages&lt;br /&gt;
&lt;br /&gt;
=== Usage - server order ===&lt;br /&gt;
&lt;br /&gt;
Once a customer leaves our public site and visits any page under https://secure.johncompanies.com/signup/ they are in the signup section of our site. There isn&#039;t a strict rule that all these pages are signup-related, for instance there are some pages related to payments that run in the signup namespace. This is for convenience since this codebase doesn&#039;t require a login/authentication.&lt;br /&gt;
&lt;br /&gt;
The signup code primarly deals with the ordering process. Customers entering the signup process via https://secure.johncompanies.com/signup/step1.html will have the ability to order any product. Several links throughout our site pass optional parameters to this page to pre-select the product the customer has selected. For instance, a link to order a linux package looks like https://secure.johncompanies.com/signup/step1.html?svc=linux&lt;br /&gt;
&lt;br /&gt;
In step 1 the customer is prompted to select the package/service level, their OS, any backup space (a la carte), ownership info and contact info. All customers must provide a billing and admin (technical) contact- both may be the same person. They may also (optionally) provide an alternate contact for the billing and admin contacts. What this means is if we are unable to reach them (perhaps due to some outage on their server, where their primary email is hosted) this is how we&#039;d reach them. They must provide at least 1 non-alternate billing and admin contact (i.e. if they provide just 1 contact and mark it billing and admin, it cannot also be marked alternate. They would need to add another contact and mark it as alternate.)&lt;br /&gt;
&lt;br /&gt;
To update the packages available or OS choices for colo&#039;s, edit:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;signup/html/step1.html&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When editing the OS templates for VPSs, make sure the values for the input options matches the existing template_id (jc:ref_templates.template_id). Also remember that there are 2 sets of linux and freebsd order options to edit (1 normal and 1 oss discount).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In step 2 the customer is prompted for more info based upon their service selection:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
any server:&lt;br /&gt;
* hostname&lt;br /&gt;
* ips - if the package allows add-on ips they are given the option to purchase more&lt;br /&gt;
* bandwidth - they are given the option to purchase additional bandwidth&lt;br /&gt;
* bandwidth overage - they are prompted to choose from 3 options for when they use all their bandwidth in a given month: 1. stop traffic, 2. bill for additional usage up to an amount they specify, 3. allow unlimited bandwidth and bill accordingly&lt;br /&gt;
* payment method (cc, paypal, echeck (paypal), invoice)&lt;br /&gt;
* existing customer - we ask if they are an existing customer so we know if this server order is new or a replacement on an existing account or if it is to be set up under a new account&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vps:&lt;br /&gt;
* disk space - if the package allows add-on space they are given the option to purchase more&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
colo: &lt;br /&gt;
* time zone to set the server to&lt;br /&gt;
* # ips to assign initially, and a reason to assign more&lt;br /&gt;
* disk partitioning (this should add up to the amount of the disk included with the system)&lt;br /&gt;
* special instructions&lt;br /&gt;
* (nfs) backup space - provided the option to purchase extra a la carte&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In step 3 they are shown the total price for the selected services and given the choice of billing intervals: 1/6/12 months. Discounts and savings are displayed. They are requested to tell us how they found us here. However, if they indicated they were an existing customer on step 2 and they are replacing or adding to an existing account, they are also prompted for info:&lt;br /&gt;
* hostname/ip of the server being replaced or the account to which we are adding the server&lt;br /&gt;
* selection of a new, permanent ip or a temporary ip&lt;br /&gt;
* how to handle the information provided in the signup in regards to existing data on file (replace/merge)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In step 4 they are shown a summary of the entire order, and prompted to accept our TOS.&lt;br /&gt;
Once they submit this page, their signup is registered regardless of whether they go on to make payment.&lt;br /&gt;
&lt;br /&gt;
The next step depends on their selected payment option. If they are paying via credit card they are prompted to enter their card info, then shown a payment confirmation screen upon successful payment.&lt;br /&gt;
&lt;br /&gt;
If they are paying via paypal, they&#039;re sent off to paypal to setup payment, then returned to our site to complete the payment and shown a payment confirmation screen upon successful payment.&lt;br /&gt;
&lt;br /&gt;
Note on payment- they can reload this page and it will not result in a reorder, in fact they cannot go back and accidentally reorder at all. If the customer is ording a colo no payment is taken, rather we do an authorization or setup their paypal payment, but we don&#039;t actually take funds until the server is in service.&lt;br /&gt;
&lt;br /&gt;
=== Usage - colo quote ===&lt;br /&gt;
&lt;br /&gt;
Another facility provided by the signup code is our colo quote tool. A customer visiting this page https://secure.johncompanies.com/signup/colo_quote.html is able to request a quote on a customized server. The requests end up in the New Signups section of mgmt. Once responded to, the customer is given a special signup link which leads them into the signup process where they may order the customized server.&lt;br /&gt;
&lt;br /&gt;
In the colo quote tool they are asked to provide:&lt;br /&gt;
* processor&lt;br /&gt;
* RAM&lt;br /&gt;
* raid level&lt;br /&gt;
* drive size&lt;br /&gt;
* IPs&lt;br /&gt;
* bandwidth&lt;br /&gt;
* nfs backup space&lt;br /&gt;
* OS&lt;br /&gt;
* requested delivery date&lt;br /&gt;
* OS install option (JC-installed or self-install via IPKVM)&lt;br /&gt;
* current customer Y/N&lt;br /&gt;
* referral source&lt;br /&gt;
* comments/questions&lt;br /&gt;
&lt;br /&gt;
To update the list of OS&#039;s or the hardware options, you&#039;ll edit:&lt;br /&gt;
&amp;lt;tt&amp;gt;signup/html/colo_quote.html&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As long as the field names don&#039;t change, this will not break compatibility with the quote build tool in mgmt.&lt;br /&gt;
&lt;br /&gt;
= Management System (mgmt) =&lt;br /&gt;
== Setup / organization / notes ==&lt;br /&gt;
&lt;br /&gt;
* domain: &amp;lt;tt&amp;gt;https://secure.johncompanies.com/mgmt&amp;lt;/tt&amp;gt;&lt;br /&gt;
* webroot: &amp;lt;tt&amp;gt;/usr/local/www/mgmt&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Directory structure:&lt;br /&gt;
* mgmt: contains the main handler &amp;lt;tt&amp;gt;Mgmt.pm&amp;lt;/tt&amp;gt; and the authentication (&amp;lt;tt&amp;gt;Auth.pm&amp;lt;/tt&amp;gt;) handler, the bigbrother status file &amp;lt;tt&amp;gt;bb.html&amp;lt;/tt&amp;gt;, the credit card gpg key &amp;lt;tt&amp;gt;pubring.gpg&amp;lt;/tt&amp;gt;&lt;br /&gt;
* mgmt/Lib: contains the log module &amp;lt;tt&amp;gt;MLog.pm&amp;lt;/tt&amp;gt;&lt;br /&gt;
* mgmt/Log: contains the log &amp;lt;tt&amp;gt;am.log&amp;lt;/tt&amp;gt;, and ats activity log &amp;lt;tt&amp;gt;ats.log&amp;lt;/tt&amp;gt;&lt;br /&gt;
* mgmt/Plugin: contains the plugins required for the various mgmt pages&lt;br /&gt;
* mgmt/html: contains all web pages&lt;br /&gt;
* mgmt/static: contains static, non-interpreted content like graphics and javascripts&lt;br /&gt;
* mgmt/awstats: our stats package. Not controlled by TT, just lives here so you have to authenticate in mgmt to see it&lt;br /&gt;
* mgmt/bwgraphs: deprecated? b/w graphing libraries and code&lt;br /&gt;
* mgmt/mrtg: mrtg graphs. Not controlled by TT, just lives here so you have to authenticate in mgmt to see it&lt;br /&gt;
&lt;br /&gt;
All functions located in mgmt are password-protected. Once you&#039;re logged in, as long as you keep your browser open (maintain session cookie) you will not need to login again. Users are authenticated via table: &amp;lt;tt&amp;gt;jc.users&amp;lt;/tt&amp;gt; To add users or change password, update this table.&lt;br /&gt;
&lt;br /&gt;
=== menu ===&lt;br /&gt;
&lt;br /&gt;
==== layout ====&lt;br /&gt;
&lt;br /&gt;
* Pastes&lt;br /&gt;
This link is twofold: first it is a dropdown menu of some frequently-used responses to customer questions. Clicking on any of these items will copy the text of the response into your clipboard- provided you are running in a compatible browser (IE). Clicking on the &amp;quot;Pastes&amp;quot; button itself will open up a new window containing many more pastes. Clicking on the links at the top will also copy in the text, which you may review in the page below. &lt;br /&gt;
&lt;br /&gt;
Updating: &amp;lt;tt&amp;gt;mgmt/html/pastes.html&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Load  &lt;br /&gt;
Opens up a new window showing mrtg-style load figures for all our hardware, and network traffic for several important servers (firewall, backup). Clicking on each graph drills down for more data.&amp;lt;br&amp;gt;&lt;br /&gt;
See [[#mrtg|mrtg]]&lt;br /&gt;
&lt;br /&gt;
* BigBrother &lt;br /&gt;
Opens up a new window to the Big Brother monitoring system.&amp;lt;br&amp;gt;&lt;br /&gt;
See [[BigBrother|BigBrother]]&lt;br /&gt;
&lt;br /&gt;
* New Signups &lt;br /&gt;
Opens up a new window to the order processing page.&amp;lt;br&amp;gt;&lt;br /&gt;
See [[#New_Signups|New Signups]]&lt;br /&gt;
&lt;br /&gt;
* PayFlow&lt;br /&gt;
Opens up a new window to the the PayFlow manager.&lt;br /&gt;
See [[Payment_System#PayFlow|PayFlow]]&lt;br /&gt;
&lt;br /&gt;
* Cabinet map&lt;br /&gt;
Opens up a new window to the [[Cabinetmap|cabinet map]] in this wiki&lt;br /&gt;
&lt;br /&gt;
* Monitoring&lt;br /&gt;
Opens up windows to monitor the following:&amp;lt;br&amp;gt;&lt;br /&gt;
ATS - monitor/manage ATSs at i2b. See [[#ats|ATS control]]&amp;lt;br&amp;gt;&lt;br /&gt;
Backups - monitor the size and timing of backups running from our servers to backup1. See [[#backupmonitor|backup monitoring]]&amp;lt;br&amp;gt;&lt;br /&gt;
Colo Monitor - a bb instance that only monitors customers who have requested/receive the service. See [[BigBrother#monitor.johncompanies.com|monitor.johncompanies.com]]&amp;lt;br&amp;gt;&lt;br /&gt;
ATS-n - the web-based interface for the ATS. See [[ATS|ATS]]&amp;lt;br&amp;gt;&lt;br /&gt;
Switches - mrtg pages for our switches&amp;lt;br&amp;gt;&lt;br /&gt;
System Counts - display&#039;s how many VPSs are on each system (according to the database- may not be 100% accurate)&amp;lt;br&amp;gt;&lt;br /&gt;
XX VZPP - VZPP (Virtuozzo Power Panel) for each server. See [[Virtuozzo_Reference|Virtuozzo Reference]]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Payments&lt;br /&gt;
Paypal history - takes you to the paypal page where you can do advanced searches based on email/subid/txnid&amp;lt;br&amp;gt;&lt;br /&gt;
2Checkout V2 - 2Checkout site&amp;lt;br&amp;gt;&lt;br /&gt;
Invoice Pmt Entry - allows easy entry of payments for any customer paying via invoice&amp;lt;br&amp;gt;&lt;br /&gt;
Arrears list - shows customers who have a balance due&amp;lt;br&amp;gt;&lt;br /&gt;
Pmt notices - shows outstanding payment invoices, primarily for customers paying via paypal&amp;lt;br&amp;gt;&lt;br /&gt;
Pfp batch - shows items pending processing via payflow. See [[#pfp_batch|pfp_batch]]&amp;lt;br&amp;gt;&lt;br /&gt;
Payment links - deprecated&amp;lt;br&amp;gt;&lt;br /&gt;
Payment audit - show(ed) discrepancies between pp sub and billing sub&amp;lt;br&amp;gt;&lt;br /&gt;
Packages - shows all our current/past packages. See [[#pkgs|packages]]&amp;lt;br&amp;gt;&lt;br /&gt;
Orphaned R.pmts - shows all paypal subs in the system which are not associated with an account. These should only/all be from people who signed up for payment fraudulently, and all subs should be in cancelled/disabled state. The only real reason to visit this page is in the case of a customer who is adding a server and who&#039;s signed up, you would link his paypal sub to his account here.&amp;lt;br&amp;gt;&lt;br /&gt;
IPN Input - allows you to manually input a paypal IPN into our system&amp;lt;br&amp;gt;&lt;br /&gt;
Request pmt - broken. ??&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Reference&lt;br /&gt;
IPKVM - links to our IPKVMs. See [[IPKVM|IPKVM]]&amp;lt;br&amp;gt;&lt;br /&gt;
VZ Ticket - submit a trouble ticket for help with VZ. See [[Virtuozzo_reference#getting_help|getting help]]&amp;lt;br&amp;gt;&lt;br /&gt;
IP Map - display&#039;s ip allocation information. See [[#ipmap|ipmap]]&amp;lt;br&amp;gt;&lt;br /&gt;
Acct Mgr - quick link to the [[#Account_Manager_.28AM.29|Account Manager]]&amp;lt;br&amp;gt;&lt;br /&gt;
Asset DB - our asset database. See [[#asset_database|asset database]]&amp;lt;br&amp;gt;&lt;br /&gt;
Bandwidth - bandwidth query page. See [[Bandwidth_Management#Reporting|Reporting]]&amp;lt;br&amp;gt;&lt;br /&gt;
Web stats - awstats page&amp;lt;br&amp;gt;&lt;br /&gt;
Domaintools - handy whois resource&amp;lt;br&amp;gt;&lt;br /&gt;
CrashLog - tool to log the details of a crash. See [[#crash_log|crash log]]&amp;lt;br&amp;gt;&lt;br /&gt;
DosLog - tool to log the details of a dos attack. See [[#dos_log|dos log]]&amp;lt;br&amp;gt;&lt;br /&gt;
URL: Linux VPS - takes you right to the linux vps order page&amp;lt;br&amp;gt;&lt;br /&gt;
URL: FreeBSD VPS - takes you right to the linux freebsd order page&amp;lt;br&amp;gt;&lt;br /&gt;
URL: Dedicated - takes you right to the dedicated server order page&amp;lt;br&amp;gt;&lt;br /&gt;
Notices - takes you to the notices tool. See [[#notices|notices]]&amp;lt;br&amp;gt;&lt;br /&gt;
Templates - template management/tracking. See [[#templates|templates]]&amp;lt;br&amp;gt;&lt;br /&gt;
VZ Reference - VZ reference/knowledge base at the parallels website&amp;lt;br&amp;gt;&lt;br /&gt;
VZ Templates - template repository at parallels website. The best method for installing new templates is &amp;lt;tt&amp;gt;vzup2date&amp;lt;/tt&amp;gt;. See [[Virtuozzo_Reference#adding_new_templates|adding new templates]]&amp;lt;br&amp;gt;&lt;br /&gt;
Bugzilla - our bugzilla site&amp;lt;br&amp;gt;&lt;br /&gt;
redit.com - customer portal at redit. Get realtime bandwidth and cabinet power usage&amp;lt;br&amp;gt;&lt;br /&gt;
Manual - old/deprecated&amp;lt;br&amp;gt;&lt;br /&gt;
johncompanies.com - our website&amp;lt;br&amp;gt;&lt;br /&gt;
Linux welcome - generic welcome email&amp;lt;br&amp;gt;&lt;br /&gt;
BSD welcome - freebsd welcome email&amp;lt;br&amp;gt;&lt;br /&gt;
Debian welcome - debian/ubuntu welcome email&amp;lt;br&amp;gt;&lt;br /&gt;
Spam check - site to check if an ip is blacklisted&amp;lt;br&amp;gt;&lt;br /&gt;
DEV mgmt - mgmt site on dev server&amp;lt;br&amp;gt;&lt;br /&gt;
DEV am - AM on dev server&amp;lt;br&amp;gt;&lt;br /&gt;
DEV jcpub - public site on dev server&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Wiki&lt;br /&gt;
This.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== editing ====&lt;br /&gt;
The dropdown menu is driven by a couple files:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mgmt/static/HM_Arrays.js&amp;lt;br&amp;gt;&lt;br /&gt;
mgmt/static/HM_Loader.js&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to change or add menu items, edit HM_Arrays.js&amp;lt;br&amp;gt;&lt;br /&gt;
covering every topic would be lengthy but here are some tips:&lt;br /&gt;
&lt;br /&gt;
* in each section, each entry but the last must end with a comma&lt;br /&gt;
* each entry is formatted: &amp;lt;tt&amp;gt;[&amp;quot;name&amp;quot;, action, 1,0,N]&amp;lt;/tt&amp;gt; where N is 0 that means this is a simple button, when N is 1 it is a dropdown and another menu is attached.&lt;br /&gt;
* in the case of the first, top-level group:&lt;br /&gt;
&amp;lt;pre&amp;gt;[&amp;quot;Pastes&amp;quot;,&amp;quot;JavaScript:win1=window.open(&#039;&#039;,&#039;win1&#039;); win1.location=&#039;https://secure.johncompanies.com/mgmt/pastes.html&#039;; void(0)&amp;quot;,1,0,1],&lt;br /&gt;
[&amp;quot;Load&amp;quot;,&amp;quot;JavaScript:win7=window.open(&#039;&#039;,&#039;win7&#039;); win7.location=&#039;https://secure.johncompanies.com/mgmt/mrtg/index.cgi&#039;; void(0)&amp;quot;,1,0,0],&lt;br /&gt;
[&amp;quot;BigBrother&amp;quot;,&amp;quot;JavaScript:win9=window.open(&#039;&#039;,&#039;win9&#039;); win9.location=&#039;https://secure.johncompanies.com/mgmt/bb/&#039;; void(0)&amp;quot;,1,0,0],&lt;br /&gt;
[&amp;quot;New Signups&amp;quot;,&amp;quot;https://secure.johncompanies.com/mgmt/pending.html&amp;quot;,1,0,0],&lt;br /&gt;
[&amp;quot;PayFlow&amp;quot;,&amp;quot;JavaScript:winpf=window.open(&#039;&#039;,&#039;winpf&#039;); winpf.location=&#039;https://manager.paypal.com/&#039;; void(0)&amp;quot;,1,0,0],&lt;br /&gt;
[&amp;quot;Cabinet map&amp;quot;,&amp;quot;JavaScript:win25=window.open(&#039;&#039;,&#039;win25&#039;); win25.location=&#039;https://secure.johncompanies.com/mgmt/cabinetmap.html&#039;; void(0)&amp;quot;,1,0,0],&lt;br /&gt;
[&amp;quot;Monitoring&amp;quot;,&amp;quot;&amp;quot;,1,0,1],&lt;br /&gt;
[&amp;quot;Payments&amp;quot;,&amp;quot;&amp;quot;,1,0,1],&lt;br /&gt;
[&amp;quot;Reference&amp;quot;,&amp;quot;&amp;quot;,1,0,1],&lt;br /&gt;
[&amp;quot;Wiki&amp;quot;,&amp;quot;JavaScript:winwiki=window.open(&#039;&#039;,&#039;winwiki&#039;); winwiki.location=&#039;https://wiki.johncompanies.com/&#039;; void(0)&amp;quot;,1,0,0]&lt;br /&gt;
],&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You see that Pastes is the first menu item and that it has a submenu. That submenu is defined in the &amp;lt;tt&amp;gt;HM_Array2_1&amp;lt;/tt&amp;gt; array. Likewise, the 7th menu item, Monitoring, has a submenu defined in &amp;lt;tt&amp;gt;HM_Array2_7&amp;lt;/tt&amp;gt;. And that furter has nested menus, the first item in the Monitoring dropdown has a nested menu in &amp;lt;tt&amp;gt;HM_Array2_7_1&amp;lt;/tt&amp;gt; , and the 13th item in &amp;lt;tt&amp;gt;HM_Array2_7_13&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* when setting a window to open a new window (most menu items) it&#039;s important to keep track of the window name if you want each link to open a unique window. i.e. &amp;lt;tt&amp;gt;JavaScript:win10a=window.open(&#039;&#039;,&#039;win10a&#039;...&amp;lt;/tt&amp;gt; make the &amp;lt;tt&amp;gt;win10a&amp;lt;/tt&amp;gt; name is unique.&lt;br /&gt;
&lt;br /&gt;
== Searching ==&lt;br /&gt;
&lt;br /&gt;
== Customer main view page ==&lt;br /&gt;
Most interaction in mgmt is done on or from the main customer page. This is the main landing page you&#039;ll get if you&#039;re searching for a customer. From this page you can see and edit:&lt;br /&gt;
&lt;br /&gt;
* systems/services &lt;br /&gt;
* ownership info&lt;br /&gt;
* bandwidth usage info&lt;br /&gt;
* contact info&lt;br /&gt;
* billing info&lt;br /&gt;
&lt;br /&gt;
=== Systems ===&lt;br /&gt;
This table displays the systems and services to which a customer has subscribed. Depending on the type of system, certain data will appear. Namely:&lt;br /&gt;
* hostname&lt;br /&gt;
* root directory (VPS only)&lt;br /&gt;
* OS (VPS only)&lt;br /&gt;
* disk space allocated (VPS only)&lt;br /&gt;
* CT id (linux VPS only)&lt;br /&gt;
* sysid&lt;br /&gt;
* IPs &lt;br /&gt;
* dates of start/cancel/stop&lt;br /&gt;
* package ID/smount+interval/next bill date&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Any item black and underlined (this goes for anything in mgmt) is clickable and will copy into your clipboard (IE only). Items in this table with special background coloring indicates:&lt;br /&gt;
* grey = cancelled system. To un-stop a system, databases need to be manually edited- so be careful.&lt;br /&gt;
* blue = monotired by castle. If you uncheck and save the monitor flag (in the system edit screen), you must also update the tracking sheet (a0, p4). Before setting up a probe with castle, make sure that there are no notes indicating the customer has previously requested not to be monitored (&amp;quot;don&#039;t monitor&amp;quot;), or “can&#039;t monitor” which means castle just can&#039;t monitor them for some reason. &lt;br /&gt;
* yellow = pending shutdown  (cancel date set)&lt;br /&gt;
&lt;br /&gt;
To setup the system for (future) cancel, click the &amp;quot;cancel&amp;quot; link. You will be prompted to provide a cancel date. This will indicate the date you intend to shut down the system. Usually this is in the future since the customer pre-pays for service. Also, you want to set at least 1 day in the future to allow the customer to get the &amp;quot;[[System-generated_Notifications#.22IMPORTANT_REMINDER_-_SYSTEM_SHUT_DOWN_TODAY.22|Shutdown today]]&amp;quot; email, clueing them in to the fact that their server is going away. The 2 quick links for 5-days and 10-days will set the date in the future (5 or 10 days), both optimized to allow the customer to receive the shutdown reminder notices. If you want the customer not to receive shutdown reminder notices, you should set that field to no. If you want to un-cancel a system, go into the edit screen and remove/clear the cancel date.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When a system has been shut down (or pulled from the rack in the case of a colo), click the &amp;quot;stop&amp;quot; link and set the date it was stopped. If this is the last active system on the account, it will mark the customer cancelled &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To edit aspects of the system click the &amp;quot;edit&amp;quot; link under the &amp;quot;actions&amp;quot; column.&lt;br /&gt;
&lt;br /&gt;
==== edit ====&lt;br /&gt;
From this screen you may edit most if not all aspects of the system in question. &lt;br /&gt;
* machine - pretty simple, what host is the VPS on or is this a (jc owned) managedcolo or (customer owned) colo &lt;br /&gt;
* directory - (VPS only) where the VPS is located on the host&lt;br /&gt;
* disk - (VPS only) how much they actually have. If you need to set this higher, edit systems.disk&lt;br /&gt;
* hostname&lt;br /&gt;
* veid - linux (VPS only) aka CT id&lt;br /&gt;
* os tempalte - (VPS only) this will auto-populate with the templates/os on the host selected in the machine field. To add templates you need to do so via the [[#Templates|Templates]] page&lt;br /&gt;
* password - (VPS only) if this is not set this system was setup with our universal/standard password: p455agfa or 8ico2987&lt;br /&gt;
* ats port - (colo only) port and ATS to which this server is connected&lt;br /&gt;
* cabinet - (colo only) location of colo&lt;br /&gt;
* ips - ips assigned to server and the ability to assign more (space delimited if adding mult). A handy link will open ipmap and clicking ips should copy back the ip to the new ip field.&lt;br /&gt;
* dates - start/stop/cancel&lt;br /&gt;
* monitored - indicate whether this system is on castle&#039;s probe map&lt;br /&gt;
* base, disk, ip packages - adjust all aspects of packages. If a field is red that means there&#039;s a mismatch between what the customer has and what the package covers. i.e. if they have 50 GB of disk and the package only gives 30, you&#039;d need to add a disk package for 20 GB or adjust the base package to include 50 GB. Anything yellow indicates an altered/custom value. i.e. if the package comes with 6 IPs and you set it to 5, that will be highlighted in yellow. Or if the price was $19 and you make it $17, prices will be yellow&#039;d. Green fields in the Totals row indicate a good matchup for the given attribute (i.e. disk allocated to server is the same as disk provided by package(s)). &lt;br /&gt;
&lt;br /&gt;
If you are moving a customer to a new machine, that may be done here- the old machine will be marked as stopped and show up as an additional row in the view screen. So really that is a stop and add operation behind the scenes in mgmt.&lt;br /&gt;
&lt;br /&gt;
==== add ====&lt;br /&gt;
&lt;br /&gt;
This works very similar to edit, and like it implies will add a new system to the customer.&lt;br /&gt;
&lt;br /&gt;
=== Owner Info ===&lt;br /&gt;
&lt;br /&gt;
=== Contact Info ===&lt;br /&gt;
&lt;br /&gt;
=== Notes ===&lt;br /&gt;
&lt;br /&gt;
=== Bandwidth ===&lt;br /&gt;
&lt;br /&gt;
=== Billing History ===&lt;br /&gt;
&lt;br /&gt;
=== Payment Sources ===&lt;br /&gt;
&lt;br /&gt;
=== Outstanding Invoices ===&lt;br /&gt;
&lt;br /&gt;
=== (Legacy) Billing ===&lt;br /&gt;
&lt;br /&gt;
=== (Legacy) Recurring Payments ===&lt;br /&gt;
&lt;br /&gt;
== ats ==&lt;br /&gt;
&lt;br /&gt;
== backupmonitor ==&lt;br /&gt;
&lt;br /&gt;
== asset database ==&lt;br /&gt;
&lt;br /&gt;
== crash log ==&lt;br /&gt;
&lt;br /&gt;
== dos log ==&lt;br /&gt;
&lt;br /&gt;
== notices ==&lt;br /&gt;
&lt;br /&gt;
== New Signups ==&lt;br /&gt;
&lt;br /&gt;
== Templates ==&lt;br /&gt;
&lt;br /&gt;
== mrtg ==&lt;br /&gt;
* domain: &amp;lt;tt&amp;gt;https://secure.johncompanies.com/mgmt/mrtg/index.cgi/ https://secure.johncompanies.com/mgmt/mrtg/switch.cgi?s=switch-p3&amp;amp;path=&amp;lt;/tt&amp;gt;&lt;br /&gt;
* webroot: &amp;lt;tt&amp;gt;/usr/local/www/mgmt/mrtg&amp;lt;/tt&amp;gt;&lt;br /&gt;
All configuration is done via *.cfg files. The main load graph is found in mrtg1.cfg&lt;br /&gt;
All other config files are for various switches. Switch config files are rebuilt out of a cron jobs running on mail. This ensures if we change a port name (desc) that the mrtg we look at has the latest info. So if you want to change port naming, please do it in the switch itself. If you have problems getting new devices setup or change existing devices you may need to change permissions on the cfg file as well as the data file in &amp;lt;tt&amp;gt;/usr/local/www/mgmt/mrtg/data&amp;lt;/tt&amp;gt;, including removal of the rrd file if necessary.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Lock wait timeout exceeded&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
delete error - Can&#039;t delete a2206e24: DBD::mysql::st execute failed: Lock wait timeout exceeded; try restarting transaction [for Statement &amp;quot;DELETE FROM invoice WHERE inv_ref=? &amp;quot;] at /usr/local/lib/perl5/site_perl/5.6.1/DBIx/ContextualFetch.pm line 51. at /usr/local/www/mgmt/Plugin/Billing.pm line 1934&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result of an unclean submit/commit. Usually from an error or a double click on something that should have been single click. To clear this up, restart the database:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mail /usr/local/www/scripts# /usr/local/etc/rc.d/mysql-server.sh stop&lt;br /&gt;
mysqldmail /usr/local/www/scripts#&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It takes a minute to shutdown. I keep running the command until it says it isn&#039;t running, then I start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mail /usr/local/www/scripts# /usr/local/etc/rc.d/mysql-server.sh stop&lt;br /&gt;
 mysqldmail /usr/local/www/scripts# /usr/local/etc/rc.d/mysql-server.sh stop&lt;br /&gt;
 mysqldmail /usr/local/www/scripts# /usr/local/etc/rc.d/mysql-server.sh stop&lt;br /&gt;
mysql-server isn&#039;t running&lt;br /&gt;
mail /usr/local/www/scripts# /usr/local/etc/rc.d/mysql-server.sh start&lt;br /&gt;
 mysqldmail /usr/local/www/scripts#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Account Manager (AM) =&lt;br /&gt;
== Setup / organization / notes ==&lt;br /&gt;
&lt;br /&gt;
* domain: &amp;lt;tt&amp;gt;https://secure.johncompanies.com/am&amp;lt;/tt&amp;gt;&lt;br /&gt;
* webroot: &amp;lt;tt&amp;gt;/usr/local/www/am&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Directory structure:&lt;br /&gt;
* am: contains the main handler &amp;lt;tt&amp;gt;AM.pm&amp;lt;/tt&amp;gt;, the authentication (&amp;lt;tt&amp;gt;AMAuth.pm&amp;lt;/tt&amp;gt;), and password reset (&amp;lt;tt&amp;gt;AMPassR.pm&amp;lt;/tt&amp;gt;) handlers&lt;br /&gt;
* am/Lib: contains the log module &amp;lt;tt&amp;gt;AMLog.pm&amp;lt;/tt&amp;gt;&lt;br /&gt;
* am/Log: contains the log &amp;lt;tt&amp;gt;am.log&amp;lt;/tt&amp;gt;, and ats activity log &amp;lt;tt&amp;gt;ats.log&amp;lt;/tt&amp;gt;&lt;br /&gt;
* am/Plugin: contains the plugin module &amp;lt;tt&amp;gt;AMP.pm&amp;lt;/tt&amp;gt; and the form fill in module &amp;lt;tt&amp;gt;FillInForm.pm&amp;lt;/tt&amp;gt;&lt;br /&gt;
* am/html: contains all web pages&lt;br /&gt;
* am/static: contains static, non-interpreted content like graphics and javascripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Account Manager was designed and intended to allow customers to do the following:&lt;br /&gt;
* see their services and various details about it&lt;br /&gt;
** IP&lt;br /&gt;
** type service&lt;br /&gt;
** cost of service&lt;br /&gt;
** link to control panel (virtuozzo CT only)&lt;br /&gt;
* to manage their service level&lt;br /&gt;
* to power cycle their server (if at i2b)&lt;br /&gt;
* to see their bandwidth usage and allocation&lt;br /&gt;
* to manage their contact info&lt;br /&gt;
* to review their billing history&lt;br /&gt;
* to update their billing method info&lt;br /&gt;
&lt;br /&gt;
It is accessed via our secure website. Customers must login using their CID (colNNNNN) and a password which is created specifically for use with the AM. It is not tied in any way to their server, though some customers may be confused by that or think that changing the password in one location will affect the other.&lt;br /&gt;
&lt;br /&gt;
JC staff may login to any customer&#039;s AM by using a special (all access) password.&lt;br /&gt;
&lt;br /&gt;
In order to access the AM for any given customer, a few things must be in place:&lt;br /&gt;
# they must have a password issued for their AM access. In order to determine if a password has been set you can look at the &amp;quot;AM pass&amp;quot; (jc:customers.am_auth) field in the customer&#039;s page in mgmt. If it says &amp;quot;(hidden)&amp;quot; a password has been established. If instead you see 3 links:&amp;lt;br&amp;gt;reset activate&amp;lt;br&amp;gt;activate+email&amp;lt;br&amp;gt;that means the customer has no password and access has not been enabled.&lt;br /&gt;
# the &amp;quot;owner email&amp;quot; (jc:customers.owner_email) field must contain the owner&#039;s email address. If a customer has been issued the pass to their AM but an owner email has not been selected, they will be prompted to select one from the existing contacts upon logging in for the first time. The selected owner will be emailed. It&#039;s for this reason that if you access the AM for a customer with the global pass, you should make sure a owner has been selected before hand (enter the info in mgmt) and don&#039;t select it in the AM, lest you want them to get a random email.&lt;br /&gt;
&lt;br /&gt;
If no password has been established (or it has been forgotten- it&#039;s stored as a 1 way hash) it must be reset. The customer may do this themselves via the password reset page (linked off the AM login page). This will require them to have on file and use/match the owner_email field. You can also reset the password via mgmt via 2 methods:&lt;br /&gt;
# reset: will just reset their password and show it to you in mgmt. It will also give you handy instructions (commands) on how to place their CID and AM password in a file on their VPS. We prefer to do it this way since we then don&#039;t have to decide if the person requesting access is authorized or not. If we place the CID/password in a file on their VPS and make it viewable by root only, then only someone with root access could get to that and if you have root access, you&#039;re considered authorized.&lt;br /&gt;
# activate+email: this will set/reset their password and send an email to the customer with access instructions and it will instruct them to find the AM access info in the &amp;lt;tt&amp;gt;/root/ampass&amp;lt;/tt&amp;gt; on their VPS- which you will create for them as soon as you click this link. If the customer has only colo&#039;s, the site will recognize that and email them the instructions/password.&lt;br /&gt;
# activate: this will enable AM access. The customer may then use the password reset function to get a password set for access.&lt;br /&gt;
&lt;br /&gt;
There is lots of contextual/hover help throughout the AM to help customers understand what they&#039;re looking at.&lt;br /&gt;
&lt;br /&gt;
Note - if a(n old) customer with no AM access gets a new VPS, the welcome email will indicate they have AM access established- this isn&#039;t true. You will need to at least activate the AM for them and possibly also reset their pass and update the ampass file accordingly.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Dashboard ===&lt;br /&gt;
This is the main/landing page for the AM. It has several sections:&lt;br /&gt;
&lt;br /&gt;
* Announcements: This is where we make available any announcement we might have for the customer. If the customer had a billing issue, it would be listed here.&lt;br /&gt;
&lt;br /&gt;
* Services: lists the services (servers) which the customer has and basic info about it (service type, IP, hostname, OS)&lt;br /&gt;
&lt;br /&gt;
* Bandwidth: shows condensed usage/allocation, overage and how we deal with overage (per the customer&#039;s preference).&lt;br /&gt;
&lt;br /&gt;
* Contacts: shows the contacts on file for the account and their role.&lt;br /&gt;
&lt;br /&gt;
=== Services ===&lt;br /&gt;
&lt;br /&gt;
This page shows in detail what services they have with us. For instance, their package and what it comes with in terms of IP, disk space, bandwidth, price. There is a link for them to change service on this page- this just trigger&#039;s an email to support so they can&#039;t actually change their service instantly.&lt;br /&gt;
&lt;br /&gt;
If they have a colo @ i2b, the power controls are available on this page.&lt;br /&gt;
The status of the power outlet to which their server is connected is displayed (&amp;quot;Current Status&amp;quot;) and if the ATS is responding (see below) 2 radio options are given for controlling the port: &amp;quot;Off&amp;quot; and &amp;quot;On&amp;quot;. Pretty self explanatory, &amp;quot;Off&amp;quot; turns the port off and &amp;quot;On&amp;quot; turns it on. In order to power cycle the server, the will need to first select the &amp;quot;Off&amp;quot; option and click the &amp;quot;Submit&amp;quot; button. A window will popup and display the status of the port until the status switches to off (it will auto refresh every 10sec). To power back on, they just need to set the option to &amp;quot;On&amp;quot; and click &amp;quot;Submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If the customer has a virtuozzo VPS, the link to their VZ control panel is provided.&lt;br /&gt;
&lt;br /&gt;
=== Bandwidth ===&lt;br /&gt;
&lt;br /&gt;
This page allows the customer to pull up bandwidth usage statistics. The reporting of those statistics is available in several flavors and can be customized to show data based on:&lt;br /&gt;
* date range&lt;br /&gt;
* server&lt;br /&gt;
* IP(s)&lt;br /&gt;
* data flowing in a particular direction&lt;br /&gt;
* protocol (ICMP, TCP, UDP) &lt;br /&gt;
* port(s)&lt;br /&gt;
&lt;br /&gt;
Further, data can be output as:&lt;br /&gt;
* daily bar graph&lt;br /&gt;
* 15min granularity bar graph&lt;br /&gt;
* pie chart&lt;br /&gt;
* table/raw&lt;br /&gt;
&lt;br /&gt;
The only thing to keep in mind here is that anything but the daily bar graph query will take up a bit more time as all other queries come from much larger tables and thus require more time to seek through the database.&lt;br /&gt;
&lt;br /&gt;
The graphs generated by this activity actually generate files which live on the server for a period of time, and are removed by cronjob.&lt;br /&gt;
&lt;br /&gt;
=== Billing ===&lt;br /&gt;
&lt;br /&gt;
This screen displays the payment method currently active for the customer, and allows them to update that info (in the case of credit card payments). &lt;br /&gt;
&lt;br /&gt;
It also lists their payment history, oldest to newest, and their outstanding balance.&lt;br /&gt;
&lt;br /&gt;
It displays their ongoing JC charges.&lt;br /&gt;
&lt;br /&gt;
If they have a paypal subscription setup it displays that.&lt;br /&gt;
&lt;br /&gt;
Finally, if they have an outstanding (paypal) invoice, it will display here and give them a link to (pay) it.&lt;br /&gt;
&lt;br /&gt;
=== Account Info ===&lt;br /&gt;
&lt;br /&gt;
Allows the customer to see / update:&lt;br /&gt;
* account owner info&lt;br /&gt;
* contact info&lt;br /&gt;
* the account manager password&lt;br /&gt;
* bandwidth preferences&lt;br /&gt;
&lt;br /&gt;
Any modifications to these settings will require the user to request a security token to be emailed to the owner (jc:customers.owner_email) which they are required to provide in order to make updates to this page. Once the customer provides this key and goes on to edit the info it is no longer valid and any subsequent visit to the edit page will require the generation of a new security token. Obviously, this requires the customer to have the ability to retrieve email at the owner&#039;s email address on file.&lt;br /&gt;
&lt;br /&gt;
=== Support ===&lt;br /&gt;
&lt;br /&gt;
This page allows the customer to quickly send us a message. They are allowed to send it as/from one of the contacts on file (or provide a new one) and they can indicate which server the issue is regarding. The email is cc&#039;d back to the customer for their records. This form is intelligent and will send the email to the right place based on the server/product they select- support@ or linux@&lt;br /&gt;
&lt;br /&gt;
== Problems ==&lt;br /&gt;
=== Power management: Status and control temporarily unavailable ===&lt;br /&gt;
&lt;br /&gt;
ATS isn&#039;t responding. See [[ATS#Rebooting_and_Recovering|Rebooting and Recovering ]]&lt;br /&gt;
&lt;br /&gt;
=== Power control doesn&#039;t work ===&lt;br /&gt;
&lt;br /&gt;
If after requesting a change in power status, the popup status window never reflects a change to the requested status, that means the ATS isn&#039;t responding and the customer should try setting the power again. If that still doesn&#039;t work, the ATS is out and needs to be reset. See [[ATS#Rebooting and Recovering|Rebooting and Recovering]]&lt;br /&gt;
&lt;br /&gt;
= Database =&lt;br /&gt;
&lt;br /&gt;
The database behind AM/Signup/MGMT runs on mysql on the [[Infrastructure_Machines#mail|mail]] server.&lt;br /&gt;
&lt;br /&gt;
== jc:billing_history ==&lt;br /&gt;
&lt;br /&gt;
== jc:ref_templates ==&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1024</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1024"/>
		<updated>2013-03-11T23:16:16Z</updated>

		<summary type="html">&lt;p&gt;Support: /* migrate manually (if migrate/online fails) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrateonline/migrate failures (migrate manually) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. If it fails with [[#migrateonline|migrateonline]], you should try [[#migrate|migrate]] (which will reboot the customer, so notify them ahead of time).&lt;br /&gt;
&lt;br /&gt;
You may want to run a [[#pre-seeding_a_migration|pre-seed]] rsync to see if you can find the problem. On older virts, we&#039;ve seen this problem due to a large logfile (which you can find and encourage the customer to remove/compress):&lt;br /&gt;
 for f in `find / -size +1048576k`; do ls -lh $f; done&lt;br /&gt;
&lt;br /&gt;
You may also see migration failing due to quota issues.&lt;br /&gt;
&lt;br /&gt;
You can try to resolve by copying any quota file into the file you need:&lt;br /&gt;
&lt;br /&gt;
 cp /var/vzquota/quota.1 /var/vzquota/quota.xxx&lt;br /&gt;
&lt;br /&gt;
If it complains about quota running you should then be able to stop it&lt;br /&gt;
&lt;br /&gt;
 vzquota off xxxx&lt;br /&gt;
&lt;br /&gt;
If all else fails, migrate to a new VEID&lt;br /&gt;
i.e. 1234 becomes 12341&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the rsync or [[#migrate|migrate]] fails, you can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE on the same virt ==&lt;br /&gt;
&lt;br /&gt;
Easy way:&amp;lt;br&amp;gt;&lt;br /&gt;
Scenario 1: ve 123 is to be renamed 1231 and moved from vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:1231:/vz/private/1231:/vz/root/1231&lt;br /&gt;
&lt;br /&gt;
Scenario 2: ve 123 is to be moved vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:123:/vz/private/123:/vz/root/123&lt;br /&gt;
&lt;br /&gt;
vzmlocal will reboot the ve at the end of the move&lt;br /&gt;
&lt;br /&gt;
Manual/old way:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;tt&amp;gt;vzctl stop 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2) &amp;lt;tt&amp;gt;mv /vz1/private/123 /vz/private/.&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(or cp -a if you want to copy)&lt;br /&gt;
3) in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts/123.conf&amp;lt;/tt&amp;gt; change value&amp;lt;br&amp;gt;&lt;br /&gt;
of &#039;&amp;lt;tt&amp;gt;VE_PRIVATE&amp;lt;/tt&amp;gt;&#039; variable to point to a new private area location&lt;br /&gt;
4) &amp;lt;tt&amp;gt;vzctl start 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
5) update backups if needed: &amp;lt;tt&amp;gt;mvbackups 123 virtX virt1 vz&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
6) update management scerens&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: a) absolute path to private area is stored in quota file &amp;lt;tt&amp;gt;/var/vzquota/quota.123&amp;lt;/tt&amp;gt; - so during first startup quota will be recalculated.&amp;lt;br&amp;gt;&lt;br /&gt;
b) if you&#039;re going to write some script to do a job, you MUST be sure that $VEID won&#039;t be expanded to &#039;&#039; in ve config file - ie. you need to escape &#039;$&#039;. Otherwise you might have:&lt;br /&gt;
&lt;br /&gt;
 VE_PRIVATE=&amp;quot;/vz/private/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in config, and &#039;vzctl destroy&#039; for this VE ID &#039;&#039;&#039;will remove everything under /vz/private/ directory&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Adding a veth device to a VE ==&lt;br /&gt;
&lt;br /&gt;
Not totally sure what this is, but a customer asked for it and here&#039;s what we did (as instructed by vz support):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;v set 99 --netif_add eth99  --save&lt;br /&gt;
ipdel 99 69.55.230.58&lt;br /&gt;
v set 99 --ifname eth99 --ipadd 69.55.230.58 --save&lt;br /&gt;
v set 99 --ifname eth99 --gateway 69.55.230.1 --save&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active      eth0              veth77.77,veth99.99&lt;br /&gt;
veth_net          active&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
br99             bridge     net99&lt;br /&gt;
veth99.99        veth       net99&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        net99            69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br0 eth0&lt;br /&gt;
&lt;br /&gt;
(will remove 99 from orig net and move to veth_net)&lt;br /&gt;
vznetcfg net addif veth_net veth99.99&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
(delete the old crap)&lt;br /&gt;
vznetcfg net del net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, to add another device in&lt;br /&gt;
&lt;br /&gt;
v set 77 --netif_add eth77  --save&lt;br /&gt;
ipdel 77 69.55.230.78&lt;br /&gt;
v set 77 --ifname eth77 --ipadd 69.55.230.78 --save&lt;br /&gt;
v set 77 --ifname eth77 --gateway 69.55.230.1 --save&lt;br /&gt;
v set 77 --save --ifname eth77 --network veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif veth_net veth77.77&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth       veth_net&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
another example&lt;br /&gt;
&lt;br /&gt;
v set 1182 --netif_add eth1182  --save&lt;br /&gt;
ipdel 1182 69.55.236.217&lt;br /&gt;
v set 1182 --ifname eth1182 --ipadd 69.55.236.217 --save&lt;br /&gt;
v set 1182 --ifname eth1182 --gateway 69.55.236.1 --save&lt;br /&gt;
vznetcfg net addif veth_net veth1182.1182&lt;br /&gt;
v set 1182 --save --ifname eth1182 --network veth_net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unused/not working commands:&lt;br /&gt;
ifconfig veth99.0 0&lt;br /&gt;
vznetcfg net list&lt;br /&gt;
vznetcfg br new br99 net99&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg br show&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
vznetcfg br new br1182 net1182&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif eth0 net1182&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&lt;br /&gt;
--- 8&amp;lt; ---&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new net&lt;br /&gt;
# vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vzctl set 99 --save --netif_add eth0 (at this stage veth99.0 interface have to appear&lt;br /&gt;
on node)&lt;br /&gt;
# vzctl set 99 --save --ifname eth0 --ipadd 69.55.230.58 (and probably few more arguments&lt;br /&gt;
here - see &#039;man vzctl&#039;)&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assigning/remove ip from a VE ==&lt;br /&gt;
&lt;br /&gt;
1. Add or remove ips:&lt;br /&gt;
 ipdel 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
 ipadd 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
&lt;br /&gt;
2. update Mgmt screens&lt;br /&gt;
&lt;br /&gt;
3. offer to update any DNS we do for them&lt;br /&gt;
&lt;br /&gt;
4. check to see if we had rules for old IP in firwall&lt;br /&gt;
&lt;br /&gt;
== Enabling tun device for a ve ==&lt;br /&gt;
Note, there’s a command for this: [[#addtun|addtun]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
Make sure the tun.o module is already loaded before Virtuozzo is started: &lt;br /&gt;
 lsmod &lt;br /&gt;
Allow the VPS to use the TUN/TAP device: &lt;br /&gt;
 vzctl set 101 --devices c:10:200:rw --save &lt;br /&gt;
Create the corresponding device inside the VPS and set the proper permissions: &lt;br /&gt;
 vzctl exec 101 mkdir -p /dev/net &lt;br /&gt;
 vzctl exec 101 mknod /dev/net/tun c 10 200 &lt;br /&gt;
 vzctl exec 101 chmod 600 /dev/net/tun&lt;br /&gt;
&lt;br /&gt;
== Remaking a system (on same virt) ==&lt;br /&gt;
&lt;br /&gt;
1. [[#cancelve|cancelve]] (or v destroy x - ONLY if you&#039;re POSITIVE no data needs to be saved)&lt;br /&gt;
&lt;br /&gt;
2. [[#vemake|vemake]] using same veid&lt;br /&gt;
&lt;br /&gt;
3. [[#mvbackups|mvbackups]] or [[#vb|vb]] (if new mount point)&lt;br /&gt;
&lt;br /&gt;
4. update mgmt with new dir/ip &lt;br /&gt;
&lt;br /&gt;
5. update firewall if changed ip&lt;br /&gt;
&lt;br /&gt;
== Re-initialize quota for a VE ==&lt;br /&gt;
&lt;br /&gt;
There’s a commamd for this now: [[#clearquota|clearquota]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzquota drop 1&lt;br /&gt;
vzctl start 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;br /&gt;
&lt;br /&gt;
== stopvirt ==&lt;br /&gt;
 stopvirt&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1023</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1023"/>
		<updated>2013-03-11T23:14:35Z</updated>

		<summary type="html">&lt;p&gt;Support: /* migrate manually (if migrate/online fails) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrate manually (if migrate/online fails) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. If it fails with [[#migrateonline|migrateonline]], you should try [[#migrate|migrate]] (which will reboot the customer, so notify them ahead of time).&lt;br /&gt;
&lt;br /&gt;
You may want to run a [[#pre-seeding_a_migration|pre-seed]] rsync to see if you can find the problem. On older virts, we&#039;ve seen this problem due to a large logfile (which you can find and encourage the customer to remove/compress):&lt;br /&gt;
 for f in `find / -size +1048576k`; do ls -lh $f; done&lt;br /&gt;
&lt;br /&gt;
If the rsync or [[#migrate|migrate]] fails, &lt;br /&gt;
&lt;br /&gt;
You can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE on the same virt ==&lt;br /&gt;
&lt;br /&gt;
Easy way:&amp;lt;br&amp;gt;&lt;br /&gt;
Scenario 1: ve 123 is to be renamed 1231 and moved from vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:1231:/vz/private/1231:/vz/root/1231&lt;br /&gt;
&lt;br /&gt;
Scenario 2: ve 123 is to be moved vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:123:/vz/private/123:/vz/root/123&lt;br /&gt;
&lt;br /&gt;
vzmlocal will reboot the ve at the end of the move&lt;br /&gt;
&lt;br /&gt;
Manual/old way:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;tt&amp;gt;vzctl stop 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2) &amp;lt;tt&amp;gt;mv /vz1/private/123 /vz/private/.&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(or cp -a if you want to copy)&lt;br /&gt;
3) in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts/123.conf&amp;lt;/tt&amp;gt; change value&amp;lt;br&amp;gt;&lt;br /&gt;
of &#039;&amp;lt;tt&amp;gt;VE_PRIVATE&amp;lt;/tt&amp;gt;&#039; variable to point to a new private area location&lt;br /&gt;
4) &amp;lt;tt&amp;gt;vzctl start 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
5) update backups if needed: &amp;lt;tt&amp;gt;mvbackups 123 virtX virt1 vz&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
6) update management scerens&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: a) absolute path to private area is stored in quota file &amp;lt;tt&amp;gt;/var/vzquota/quota.123&amp;lt;/tt&amp;gt; - so during first startup quota will be recalculated.&amp;lt;br&amp;gt;&lt;br /&gt;
b) if you&#039;re going to write some script to do a job, you MUST be sure that $VEID won&#039;t be expanded to &#039;&#039; in ve config file - ie. you need to escape &#039;$&#039;. Otherwise you might have:&lt;br /&gt;
&lt;br /&gt;
 VE_PRIVATE=&amp;quot;/vz/private/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in config, and &#039;vzctl destroy&#039; for this VE ID &#039;&#039;&#039;will remove everything under /vz/private/ directory&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Adding a veth device to a VE ==&lt;br /&gt;
&lt;br /&gt;
Not totally sure what this is, but a customer asked for it and here&#039;s what we did (as instructed by vz support):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;v set 99 --netif_add eth99  --save&lt;br /&gt;
ipdel 99 69.55.230.58&lt;br /&gt;
v set 99 --ifname eth99 --ipadd 69.55.230.58 --save&lt;br /&gt;
v set 99 --ifname eth99 --gateway 69.55.230.1 --save&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active      eth0              veth77.77,veth99.99&lt;br /&gt;
veth_net          active&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
br99             bridge     net99&lt;br /&gt;
veth99.99        veth       net99&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        net99            69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br0 eth0&lt;br /&gt;
&lt;br /&gt;
(will remove 99 from orig net and move to veth_net)&lt;br /&gt;
vznetcfg net addif veth_net veth99.99&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
(delete the old crap)&lt;br /&gt;
vznetcfg net del net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, to add another device in&lt;br /&gt;
&lt;br /&gt;
v set 77 --netif_add eth77  --save&lt;br /&gt;
ipdel 77 69.55.230.78&lt;br /&gt;
v set 77 --ifname eth77 --ipadd 69.55.230.78 --save&lt;br /&gt;
v set 77 --ifname eth77 --gateway 69.55.230.1 --save&lt;br /&gt;
v set 77 --save --ifname eth77 --network veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif veth_net veth77.77&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth       veth_net&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
another example&lt;br /&gt;
&lt;br /&gt;
v set 1182 --netif_add eth1182  --save&lt;br /&gt;
ipdel 1182 69.55.236.217&lt;br /&gt;
v set 1182 --ifname eth1182 --ipadd 69.55.236.217 --save&lt;br /&gt;
v set 1182 --ifname eth1182 --gateway 69.55.236.1 --save&lt;br /&gt;
vznetcfg net addif veth_net veth1182.1182&lt;br /&gt;
v set 1182 --save --ifname eth1182 --network veth_net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unused/not working commands:&lt;br /&gt;
ifconfig veth99.0 0&lt;br /&gt;
vznetcfg net list&lt;br /&gt;
vznetcfg br new br99 net99&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg br show&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
vznetcfg br new br1182 net1182&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif eth0 net1182&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&lt;br /&gt;
--- 8&amp;lt; ---&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new net&lt;br /&gt;
# vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vzctl set 99 --save --netif_add eth0 (at this stage veth99.0 interface have to appear&lt;br /&gt;
on node)&lt;br /&gt;
# vzctl set 99 --save --ifname eth0 --ipadd 69.55.230.58 (and probably few more arguments&lt;br /&gt;
here - see &#039;man vzctl&#039;)&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assigning/remove ip from a VE ==&lt;br /&gt;
&lt;br /&gt;
1. Add or remove ips:&lt;br /&gt;
 ipdel 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
 ipadd 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
&lt;br /&gt;
2. update Mgmt screens&lt;br /&gt;
&lt;br /&gt;
3. offer to update any DNS we do for them&lt;br /&gt;
&lt;br /&gt;
4. check to see if we had rules for old IP in firwall&lt;br /&gt;
&lt;br /&gt;
== Enabling tun device for a ve ==&lt;br /&gt;
Note, there’s a command for this: [[#addtun|addtun]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
Make sure the tun.o module is already loaded before Virtuozzo is started: &lt;br /&gt;
 lsmod &lt;br /&gt;
Allow the VPS to use the TUN/TAP device: &lt;br /&gt;
 vzctl set 101 --devices c:10:200:rw --save &lt;br /&gt;
Create the corresponding device inside the VPS and set the proper permissions: &lt;br /&gt;
 vzctl exec 101 mkdir -p /dev/net &lt;br /&gt;
 vzctl exec 101 mknod /dev/net/tun c 10 200 &lt;br /&gt;
 vzctl exec 101 chmod 600 /dev/net/tun&lt;br /&gt;
&lt;br /&gt;
== Remaking a system (on same virt) ==&lt;br /&gt;
&lt;br /&gt;
1. [[#cancelve|cancelve]] (or v destroy x - ONLY if you&#039;re POSITIVE no data needs to be saved)&lt;br /&gt;
&lt;br /&gt;
2. [[#vemake|vemake]] using same veid&lt;br /&gt;
&lt;br /&gt;
3. [[#mvbackups|mvbackups]] or [[#vb|vb]] (if new mount point)&lt;br /&gt;
&lt;br /&gt;
4. update mgmt with new dir/ip &lt;br /&gt;
&lt;br /&gt;
5. update firewall if changed ip&lt;br /&gt;
&lt;br /&gt;
== Re-initialize quota for a VE ==&lt;br /&gt;
&lt;br /&gt;
There’s a commamd for this now: [[#clearquota|clearquota]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzquota drop 1&lt;br /&gt;
vzctl start 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;br /&gt;
&lt;br /&gt;
== stopvirt ==&lt;br /&gt;
 stopvirt&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1022</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1022"/>
		<updated>2013-03-11T23:13:43Z</updated>

		<summary type="html">&lt;p&gt;Support: /* migrate manually (if migrate/online fails) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrate manually (if migrate/online fails) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. If it fails with [[#migrateonline|migrateonline]], you should try [[#migrate|migrate]] (which will reboot the customer, so notify them ahead of time).&lt;br /&gt;
&lt;br /&gt;
You may want to run a pre-seed rsync to see if you can find the problem. On older virts, we&#039;ve seen this problem due to a large logfile (which you can find and encourage the customer to remove/compress):&lt;br /&gt;
 for f in `find / -size +1048576k`; do ls -lh $f; done&lt;br /&gt;
&lt;br /&gt;
If the rsync or [[#migrate|migrate]] fails, &lt;br /&gt;
&lt;br /&gt;
You can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE on the same virt ==&lt;br /&gt;
&lt;br /&gt;
Easy way:&amp;lt;br&amp;gt;&lt;br /&gt;
Scenario 1: ve 123 is to be renamed 1231 and moved from vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:1231:/vz/private/1231:/vz/root/1231&lt;br /&gt;
&lt;br /&gt;
Scenario 2: ve 123 is to be moved vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:123:/vz/private/123:/vz/root/123&lt;br /&gt;
&lt;br /&gt;
vzmlocal will reboot the ve at the end of the move&lt;br /&gt;
&lt;br /&gt;
Manual/old way:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;tt&amp;gt;vzctl stop 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2) &amp;lt;tt&amp;gt;mv /vz1/private/123 /vz/private/.&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(or cp -a if you want to copy)&lt;br /&gt;
3) in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts/123.conf&amp;lt;/tt&amp;gt; change value&amp;lt;br&amp;gt;&lt;br /&gt;
of &#039;&amp;lt;tt&amp;gt;VE_PRIVATE&amp;lt;/tt&amp;gt;&#039; variable to point to a new private area location&lt;br /&gt;
4) &amp;lt;tt&amp;gt;vzctl start 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
5) update backups if needed: &amp;lt;tt&amp;gt;mvbackups 123 virtX virt1 vz&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
6) update management scerens&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: a) absolute path to private area is stored in quota file &amp;lt;tt&amp;gt;/var/vzquota/quota.123&amp;lt;/tt&amp;gt; - so during first startup quota will be recalculated.&amp;lt;br&amp;gt;&lt;br /&gt;
b) if you&#039;re going to write some script to do a job, you MUST be sure that $VEID won&#039;t be expanded to &#039;&#039; in ve config file - ie. you need to escape &#039;$&#039;. Otherwise you might have:&lt;br /&gt;
&lt;br /&gt;
 VE_PRIVATE=&amp;quot;/vz/private/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in config, and &#039;vzctl destroy&#039; for this VE ID &#039;&#039;&#039;will remove everything under /vz/private/ directory&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Adding a veth device to a VE ==&lt;br /&gt;
&lt;br /&gt;
Not totally sure what this is, but a customer asked for it and here&#039;s what we did (as instructed by vz support):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;v set 99 --netif_add eth99  --save&lt;br /&gt;
ipdel 99 69.55.230.58&lt;br /&gt;
v set 99 --ifname eth99 --ipadd 69.55.230.58 --save&lt;br /&gt;
v set 99 --ifname eth99 --gateway 69.55.230.1 --save&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active      eth0              veth77.77,veth99.99&lt;br /&gt;
veth_net          active&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
br99             bridge     net99&lt;br /&gt;
veth99.99        veth       net99&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        net99            69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br0 eth0&lt;br /&gt;
&lt;br /&gt;
(will remove 99 from orig net and move to veth_net)&lt;br /&gt;
vznetcfg net addif veth_net veth99.99&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
(delete the old crap)&lt;br /&gt;
vznetcfg net del net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, to add another device in&lt;br /&gt;
&lt;br /&gt;
v set 77 --netif_add eth77  --save&lt;br /&gt;
ipdel 77 69.55.230.78&lt;br /&gt;
v set 77 --ifname eth77 --ipadd 69.55.230.78 --save&lt;br /&gt;
v set 77 --ifname eth77 --gateway 69.55.230.1 --save&lt;br /&gt;
v set 77 --save --ifname eth77 --network veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif veth_net veth77.77&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth       veth_net&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
another example&lt;br /&gt;
&lt;br /&gt;
v set 1182 --netif_add eth1182  --save&lt;br /&gt;
ipdel 1182 69.55.236.217&lt;br /&gt;
v set 1182 --ifname eth1182 --ipadd 69.55.236.217 --save&lt;br /&gt;
v set 1182 --ifname eth1182 --gateway 69.55.236.1 --save&lt;br /&gt;
vznetcfg net addif veth_net veth1182.1182&lt;br /&gt;
v set 1182 --save --ifname eth1182 --network veth_net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unused/not working commands:&lt;br /&gt;
ifconfig veth99.0 0&lt;br /&gt;
vznetcfg net list&lt;br /&gt;
vznetcfg br new br99 net99&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg br show&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
vznetcfg br new br1182 net1182&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif eth0 net1182&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&lt;br /&gt;
--- 8&amp;lt; ---&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new net&lt;br /&gt;
# vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vzctl set 99 --save --netif_add eth0 (at this stage veth99.0 interface have to appear&lt;br /&gt;
on node)&lt;br /&gt;
# vzctl set 99 --save --ifname eth0 --ipadd 69.55.230.58 (and probably few more arguments&lt;br /&gt;
here - see &#039;man vzctl&#039;)&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assigning/remove ip from a VE ==&lt;br /&gt;
&lt;br /&gt;
1. Add or remove ips:&lt;br /&gt;
 ipdel 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
 ipadd 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
&lt;br /&gt;
2. update Mgmt screens&lt;br /&gt;
&lt;br /&gt;
3. offer to update any DNS we do for them&lt;br /&gt;
&lt;br /&gt;
4. check to see if we had rules for old IP in firwall&lt;br /&gt;
&lt;br /&gt;
== Enabling tun device for a ve ==&lt;br /&gt;
Note, there’s a command for this: [[#addtun|addtun]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
Make sure the tun.o module is already loaded before Virtuozzo is started: &lt;br /&gt;
 lsmod &lt;br /&gt;
Allow the VPS to use the TUN/TAP device: &lt;br /&gt;
 vzctl set 101 --devices c:10:200:rw --save &lt;br /&gt;
Create the corresponding device inside the VPS and set the proper permissions: &lt;br /&gt;
 vzctl exec 101 mkdir -p /dev/net &lt;br /&gt;
 vzctl exec 101 mknod /dev/net/tun c 10 200 &lt;br /&gt;
 vzctl exec 101 chmod 600 /dev/net/tun&lt;br /&gt;
&lt;br /&gt;
== Remaking a system (on same virt) ==&lt;br /&gt;
&lt;br /&gt;
1. [[#cancelve|cancelve]] (or v destroy x - ONLY if you&#039;re POSITIVE no data needs to be saved)&lt;br /&gt;
&lt;br /&gt;
2. [[#vemake|vemake]] using same veid&lt;br /&gt;
&lt;br /&gt;
3. [[#mvbackups|mvbackups]] or [[#vb|vb]] (if new mount point)&lt;br /&gt;
&lt;br /&gt;
4. update mgmt with new dir/ip &lt;br /&gt;
&lt;br /&gt;
5. update firewall if changed ip&lt;br /&gt;
&lt;br /&gt;
== Re-initialize quota for a VE ==&lt;br /&gt;
&lt;br /&gt;
There’s a commamd for this now: [[#clearquota|clearquota]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzquota drop 1&lt;br /&gt;
vzctl start 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;br /&gt;
&lt;br /&gt;
== stopvirt ==&lt;br /&gt;
 stopvirt&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1021</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1021"/>
		<updated>2013-03-11T23:11:07Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Traffic accounting on linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrate manually (if migrate/online fails) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. You can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE on the same virt ==&lt;br /&gt;
&lt;br /&gt;
Easy way:&amp;lt;br&amp;gt;&lt;br /&gt;
Scenario 1: ve 123 is to be renamed 1231 and moved from vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:1231:/vz/private/1231:/vz/root/1231&lt;br /&gt;
&lt;br /&gt;
Scenario 2: ve 123 is to be moved vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:123:/vz/private/123:/vz/root/123&lt;br /&gt;
&lt;br /&gt;
vzmlocal will reboot the ve at the end of the move&lt;br /&gt;
&lt;br /&gt;
Manual/old way:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;tt&amp;gt;vzctl stop 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2) &amp;lt;tt&amp;gt;mv /vz1/private/123 /vz/private/.&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(or cp -a if you want to copy)&lt;br /&gt;
3) in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts/123.conf&amp;lt;/tt&amp;gt; change value&amp;lt;br&amp;gt;&lt;br /&gt;
of &#039;&amp;lt;tt&amp;gt;VE_PRIVATE&amp;lt;/tt&amp;gt;&#039; variable to point to a new private area location&lt;br /&gt;
4) &amp;lt;tt&amp;gt;vzctl start 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
5) update backups if needed: &amp;lt;tt&amp;gt;mvbackups 123 virtX virt1 vz&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
6) update management scerens&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: a) absolute path to private area is stored in quota file &amp;lt;tt&amp;gt;/var/vzquota/quota.123&amp;lt;/tt&amp;gt; - so during first startup quota will be recalculated.&amp;lt;br&amp;gt;&lt;br /&gt;
b) if you&#039;re going to write some script to do a job, you MUST be sure that $VEID won&#039;t be expanded to &#039;&#039; in ve config file - ie. you need to escape &#039;$&#039;. Otherwise you might have:&lt;br /&gt;
&lt;br /&gt;
 VE_PRIVATE=&amp;quot;/vz/private/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in config, and &#039;vzctl destroy&#039; for this VE ID &#039;&#039;&#039;will remove everything under /vz/private/ directory&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Adding a veth device to a VE ==&lt;br /&gt;
&lt;br /&gt;
Not totally sure what this is, but a customer asked for it and here&#039;s what we did (as instructed by vz support):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;v set 99 --netif_add eth99  --save&lt;br /&gt;
ipdel 99 69.55.230.58&lt;br /&gt;
v set 99 --ifname eth99 --ipadd 69.55.230.58 --save&lt;br /&gt;
v set 99 --ifname eth99 --gateway 69.55.230.1 --save&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active      eth0              veth77.77,veth99.99&lt;br /&gt;
veth_net          active&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
br99             bridge     net99&lt;br /&gt;
veth99.99        veth       net99&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        net99            69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br0 eth0&lt;br /&gt;
&lt;br /&gt;
(will remove 99 from orig net and move to veth_net)&lt;br /&gt;
vznetcfg net addif veth_net veth99.99&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
(delete the old crap)&lt;br /&gt;
vznetcfg net del net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, to add another device in&lt;br /&gt;
&lt;br /&gt;
v set 77 --netif_add eth77  --save&lt;br /&gt;
ipdel 77 69.55.230.78&lt;br /&gt;
v set 77 --ifname eth77 --ipadd 69.55.230.78 --save&lt;br /&gt;
v set 77 --ifname eth77 --gateway 69.55.230.1 --save&lt;br /&gt;
v set 77 --save --ifname eth77 --network veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif veth_net veth77.77&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth       veth_net&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
another example&lt;br /&gt;
&lt;br /&gt;
v set 1182 --netif_add eth1182  --save&lt;br /&gt;
ipdel 1182 69.55.236.217&lt;br /&gt;
v set 1182 --ifname eth1182 --ipadd 69.55.236.217 --save&lt;br /&gt;
v set 1182 --ifname eth1182 --gateway 69.55.236.1 --save&lt;br /&gt;
vznetcfg net addif veth_net veth1182.1182&lt;br /&gt;
v set 1182 --save --ifname eth1182 --network veth_net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unused/not working commands:&lt;br /&gt;
ifconfig veth99.0 0&lt;br /&gt;
vznetcfg net list&lt;br /&gt;
vznetcfg br new br99 net99&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg br show&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
vznetcfg br new br1182 net1182&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif eth0 net1182&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&lt;br /&gt;
--- 8&amp;lt; ---&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new net&lt;br /&gt;
# vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vzctl set 99 --save --netif_add eth0 (at this stage veth99.0 interface have to appear&lt;br /&gt;
on node)&lt;br /&gt;
# vzctl set 99 --save --ifname eth0 --ipadd 69.55.230.58 (and probably few more arguments&lt;br /&gt;
here - see &#039;man vzctl&#039;)&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assigning/remove ip from a VE ==&lt;br /&gt;
&lt;br /&gt;
1. Add or remove ips:&lt;br /&gt;
 ipdel 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
 ipadd 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
&lt;br /&gt;
2. update Mgmt screens&lt;br /&gt;
&lt;br /&gt;
3. offer to update any DNS we do for them&lt;br /&gt;
&lt;br /&gt;
4. check to see if we had rules for old IP in firwall&lt;br /&gt;
&lt;br /&gt;
== Enabling tun device for a ve ==&lt;br /&gt;
Note, there’s a command for this: [[#addtun|addtun]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
Make sure the tun.o module is already loaded before Virtuozzo is started: &lt;br /&gt;
 lsmod &lt;br /&gt;
Allow the VPS to use the TUN/TAP device: &lt;br /&gt;
 vzctl set 101 --devices c:10:200:rw --save &lt;br /&gt;
Create the corresponding device inside the VPS and set the proper permissions: &lt;br /&gt;
 vzctl exec 101 mkdir -p /dev/net &lt;br /&gt;
 vzctl exec 101 mknod /dev/net/tun c 10 200 &lt;br /&gt;
 vzctl exec 101 chmod 600 /dev/net/tun&lt;br /&gt;
&lt;br /&gt;
== Remaking a system (on same virt) ==&lt;br /&gt;
&lt;br /&gt;
1. [[#cancelve|cancelve]] (or v destroy x - ONLY if you&#039;re POSITIVE no data needs to be saved)&lt;br /&gt;
&lt;br /&gt;
2. [[#vemake|vemake]] using same veid&lt;br /&gt;
&lt;br /&gt;
3. [[#mvbackups|mvbackups]] or [[#vb|vb]] (if new mount point)&lt;br /&gt;
&lt;br /&gt;
4. update mgmt with new dir/ip &lt;br /&gt;
&lt;br /&gt;
5. update firewall if changed ip&lt;br /&gt;
&lt;br /&gt;
== Re-initialize quota for a VE ==&lt;br /&gt;
&lt;br /&gt;
There’s a commamd for this now: [[#clearquota|clearquota]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzquota drop 1&lt;br /&gt;
vzctl start 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;br /&gt;
&lt;br /&gt;
== stopvirt ==&lt;br /&gt;
 stopvirt&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1020</id>
		<title>Virtuozzo / Linux Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1020"/>
		<updated>2013-03-11T23:10:05Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Updating kernel on virt */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Updating VZ =&lt;br /&gt;
&lt;br /&gt;
 Update Virtuozzo to version 4.0.0&lt;br /&gt;
 Apply minor updates for Virtuozzo 3.0.0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
When you get to the last screen, you will be given an option to &lt;br /&gt;
&lt;br /&gt;
 ( ) Automatically reboot after update&lt;br /&gt;
 (*) Reboot later manually&lt;br /&gt;
&lt;br /&gt;
make sure you choose to reboot later.&lt;br /&gt;
&lt;br /&gt;
= Migrating Templates =&lt;br /&gt;
One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it&#039;s now called) based on a particular ditribution on a host which may or may not share the same distribution. For instance, you could run a CT running Ubuntu while the host machine (Hardware Node or HN) is running CentOS. This is accomplished via the use of OS templates. As long as the HN contains the OS template on which a particular CT relies, it will run there. As such, if you want to move a CT from one HN to another, you will need to make sure the OS template exists there.&lt;br /&gt;
&lt;br /&gt;
Modern versions of VZ (&amp;gt;= 4.x) will check for and automatically move the OS template over to the host as you&#039;re (vz)migrating the CT over to a new HN. However we like to make sure the template is in place prior to moving the CT. &lt;br /&gt;
&lt;br /&gt;
The first step is to see if the template exists on the host. To see OS templates installed:&lt;br /&gt;
&lt;br /&gt;
2.x (shows OS and application templates):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkgls&lt;br /&gt;
mod_ssl-rh9 20040624&lt;br /&gt;
mysql-rh9 20030814 20050412&lt;br /&gt;
openwebmail-rh9 20050427&lt;br /&gt;
php-rh9 20050506&lt;br /&gt;
phpBB-rh9 20041229&lt;br /&gt;
postgresql-rh9 20050719&lt;br /&gt;
sl-webalizer-rh9 20040119&lt;br /&gt;
spamassassin-rh9 20040127&lt;br /&gt;
tomcat-rh9 20040524&lt;br /&gt;
usermin-rh9 20040116&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;= 3.x (shows just OS templates, run without -O to see application as well):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkg list -O&lt;br /&gt;
ubuntu-10.04-x86                   2010-06-01 11:39:05&lt;br /&gt;
ubuntu-11.04-x86                   2011-06-22 14:23:59&lt;br /&gt;
ubuntu-9.10-x86                    2010-03-11 17:39:51&lt;br /&gt;
centos-5-x86                       2010-03-11 17:12:27&lt;br /&gt;
debian-5.0-x86                     2010-03-11 17:33:34&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All template files are located:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1&lt;br /&gt;
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2&lt;br /&gt;
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9&lt;br /&gt;
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1&lt;br /&gt;
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2&lt;br /&gt;
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9&lt;br /&gt;
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92&lt;br /&gt;
analog-fc2      mailman-fc2           php-rh9             suse-9.2&lt;br /&gt;
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1&lt;br /&gt;
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2&lt;br /&gt;
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9&lt;br /&gt;
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92&lt;br /&gt;
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1&lt;br /&gt;
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1&lt;br /&gt;
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2&lt;br /&gt;
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9&lt;br /&gt;
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1&lt;br /&gt;
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2&lt;br /&gt;
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9&lt;br /&gt;
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3&lt;br /&gt;
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0&lt;br /&gt;
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92&lt;br /&gt;
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1&lt;br /&gt;
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2&lt;br /&gt;
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9&lt;br /&gt;
jdk-suse92      mysql-rh9             redhat-as3-minimal&lt;br /&gt;
jre-deb31       mysql-suse92          redhat-devel-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here are the base OS templates: &amp;lt;tt&amp;gt;redhat-9, fedora-core-1&amp;lt;/tt&amp;gt; and supporting application templates: &amp;lt;tt&amp;gt;postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1&amp;lt;/tt&amp;gt;. So if you wanted to copy over all of redhat 9 you&#039;d need to copy the contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls -d /vz/template/*rh9*&lt;br /&gt;
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9&lt;br /&gt;
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9&lt;br /&gt;
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9&lt;br /&gt;
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9&lt;br /&gt;
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9&lt;br /&gt;
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9&lt;br /&gt;
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9&lt;br /&gt;
/vz/template/mailman-rh9     /vz/template/postgresql-rh9&lt;br /&gt;
&lt;br /&gt;
# ls -d /vz/template/*redhat-9*&lt;br /&gt;
/vz/template/redhat-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a template from one HN to another, it simply needs to be rsync&#039;d over to the target HN. It&#039;s rsync&#039;d over in this fashion:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template&lt;br /&gt;
 rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template&lt;br /&gt;
&lt;br /&gt;
Newer (&amp;gt;= 3.x) VZ employs &amp;quot;EZ&amp;quot; templates which are organized a little differently:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc&lt;br /&gt;
centos  conf         redhat-as3-minimal  ubuntu&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/ubuntu/&lt;br /&gt;
10.04  11.04  9.10&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/&lt;br /&gt;
x86&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/cache/&lt;br /&gt;
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz&lt;br /&gt;
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz&lt;br /&gt;
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we see is the entire OS and all applications are in 1 directory, and organized by distribution and release version. So to move Ubuntu 10.04:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
and you also need to move the cache:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/&lt;br /&gt;
&lt;br /&gt;
Once the transfer is complete, you will be able to run &amp;lt;tt&amp;gt;vzpkgls&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vzpkg list -O&amp;lt;/tt&amp;gt; and see the template(s) listed on the target HN.&lt;br /&gt;
&lt;br /&gt;
So far, this all supposes template doesn&#039;t exist on the target- very simple, just copy it over. If the template exists already on the target HN, this requires closer inspection. With older templates, simply moving over the templates would be the end of it- you see the version listed when you do a &amp;lt;tt&amp;gt;vzplgls&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysql-rh9 20030814 20050412&lt;br /&gt;
&lt;br /&gt;
this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412&lt;br /&gt;
As an aside, you can&#039;t copy over just 1 of them, but if you rsync&#039;d over the &amp;lt;tt&amp;gt;mysql-rh9&amp;lt;/tt&amp;gt; directory, you&#039;d see 20030814 and 20050412 on the target HN. As long as the versions match up, you&#039;re good to go.&lt;br /&gt;
&lt;br /&gt;
With EZ templates, the versions are not as easy to decipher. When you look at the &amp;lt;tt&amp;gt;vzpkg list&amp;lt;/tt&amp;gt; output, that simply tells you when a cache was created. A cache is simply a snapshot of all the data needed for the latest versions of the OS and it&#039;s applications at the time the cache was created. It is a date, and thus tells you nothing about the versions within. So for instance, if you had a cache for Ubuntu 10.04 from 2007 and you ran &amp;lt;tt&amp;gt;vzpkg create cache ubuntu-10.04-x86&amp;lt;/tt&amp;gt; it would re-download the latest version of apache, mysql and so on. And any &#039;&#039;subsequent&#039;&#039; ubuntu 10.04 CT&#039;s created thereafter would use those newer versions, whereas older CT&#039;s based on 10.04 would use older templates. You can see how this works by looking at the files under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this template has in it 6 different versions of apache2. This means that this template was merged with other 10.04 templates and/or it has been cached a few times, each time a new apache was available. The unfortunate thing is it&#039;s almost impossible to know which CT&#039;s are using which version of apache so it&#039;s hard to try to prune this down and remove unwanted/unneeded applications.&lt;br /&gt;
&lt;br /&gt;
So, if you see another HN has Ubuntu 10.04 on it, you need to see/confirm that it has all the exact files your CT needs. You can run a test rsync to see what &#039;&#039;would&#039;&#039; be transferred (what&#039;s missing):&lt;br /&gt;
&lt;br /&gt;
 rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
Based on the amount of data you get back from the rsync, you will be able to decide whether or not to remove the -n and allow the full transfer to go through. The downside to doing the transfer is the situation described above- you&#039;ve permanently joined these templates and now you may have 10 versions of apache on the target HN. There&#039;s one other potential pitfall to this kind of merging- it will also potentially copy over shared files, for which there is no particular version, most of which are in &amp;lt;tt&amp;gt;/vz/template/ubuntu/10.04/x86/config&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
 cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
 /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
&lt;br /&gt;
Here are some specific things to look out for. Case: copying centos-5 on virt19 to virt12. We dumped the rsync output to a file so we could inspect:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
(note, that can be dangerous, better to add on full path &amp;lt;tt&amp;gt;/vz/template/centos/5&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
So in the output file we see things like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
x86/base0/cachecookie&lt;br /&gt;
x86/base0/primary.xml.gz &lt;br /&gt;
x86/base0/primary.xml.gz.sqlite &lt;br /&gt;
x86/base0/repomd.xml &lt;br /&gt;
x86/base1/cachecookie &lt;br /&gt;
x86/base1/filelists.xml.gz &lt;br /&gt;
x86/base1/filelists.xml.gz.sqlite  &lt;br /&gt;
x86/base1/primary.xml.gz &lt;br /&gt;
x86/base1/primary.xml.gz.sqlite &lt;br /&gt;
x86/base1/repomd.xml&lt;br /&gt;
x86/base2/cachecookie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which make us nervous cause those are not versioned files, i.e.:&lt;br /&gt;
 5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock&lt;br /&gt;
&lt;br /&gt;
So those files will replace existing files on v12 rather than the case of the latter where it&#039;s likely being added. So caution should be given and deference to whichever version is newer (which rsync should take care of, but that will depend on the date each file was created and perhaps not the actual data within).&lt;br /&gt;
&lt;br /&gt;
If we look further in the file we see:&lt;br /&gt;
&lt;br /&gt;
 x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.&lt;br /&gt;
9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif&lt;br /&gt;
&lt;br /&gt;
and other files looking like:&lt;br /&gt;
 5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info&lt;br /&gt;
&lt;br /&gt;
Which means plesk is here. We don&#039;t need plesk on v12 (the CT moving over doesn&#039;t use it) so we rerun the rsync and exclude it:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh --exclude=&amp;quot;plesk*&amp;quot; --exclude=&amp;quot;psa*&amp;quot; /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
and now it&#039;s much smaller:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l&lt;br /&gt;
 97104&lt;br /&gt;
&lt;br /&gt;
Before running with excludes it was:&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l &lt;br /&gt;
 238238&lt;br /&gt;
&lt;br /&gt;
So again, look at what you&#039;re doing. Generally, combining templates is fine however.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re happy with the merge, run the rsync again without the &amp;quot;-n&amp;quot; to let it actually do the transfer.&lt;br /&gt;
&lt;br /&gt;
Once done, don&#039;t forget to add the new template to the HN in Management -&amp;gt; Reference -&amp;gt; Templates&lt;br /&gt;
&lt;br /&gt;
= getting help =&lt;br /&gt;
&lt;br /&gt;
= vzup2date =&lt;br /&gt;
TODO &lt;br /&gt;
= adding new templates =&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
= Updating kernel on virt =&lt;br /&gt;
&lt;br /&gt;
We now use [[#vzup2date|vzup2date]] to update systems and kernels. What follows is what we used to do when we had to download kernels and install manually on old systems:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. install kernel and modules&lt;br /&gt;
&amp;lt;pre&amp;gt;# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \&lt;br /&gt;
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm&lt;br /&gt;
vzkernel-smp          ##################################################&lt;br /&gt;
vzmodules-smp       ##################################################&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT USE the &amp;quot;rpm -Uhv&amp;quot; command to install the kernel, otherwise all the previously installed kernels may be removed from your system. &lt;br /&gt;
&lt;br /&gt;
2. update lilo/grub&lt;br /&gt;
&lt;br /&gt;
Lilo:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lilo.conf&lt;br /&gt;
 &lt;br /&gt;
rename old Virtuozzo kernel label from &amp;quot;linux+virtuozzo&amp;quot; to &amp;quot;virtuozzo_old&amp;quot;&lt;br /&gt;
and add a new entry pointing to the newly installed virtuozzo kernel image.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;prompt&lt;br /&gt;
timeout=50&lt;br /&gt;
default=linux+virtuozzo&lt;br /&gt;
append=&amp;quot;debug panic=5 console=tty console=ttyS0,38400&amp;quot;&lt;br /&gt;
boot=/dev/sda&lt;br /&gt;
map=/boot/map&lt;br /&gt;
install=/boot/boot.b&lt;br /&gt;
message=/boot/message&lt;br /&gt;
linear&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3smp&lt;br /&gt;
        label=linux&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3smp.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3&lt;br /&gt;
        label=linux-up&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise&lt;br /&gt;
        label=2.4.20-9.5.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise&lt;br /&gt;
        label=2.4.20-9.8.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise&lt;br /&gt;
        label=2.4.20-9.21.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise&lt;br /&gt;
        label=2.4.20-9.24.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise&lt;br /&gt;
        label=2.4.20-28.3.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise&lt;br /&gt;
        label=old_linux+vz&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise&lt;br /&gt;
        label=linux+virtuozzo&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label &amp;quot;old_linux+vz &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Grub:&lt;br /&gt;
&lt;br /&gt;
 vi /boot/grub /menu.lst&lt;br /&gt;
&lt;br /&gt;
Add new entry at the top.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;serial --unit=0 --speed=38400&lt;br /&gt;
terminal --timeout=10 serial console&lt;br /&gt;
default=0&lt;br /&gt;
timeout=10&lt;br /&gt;
splashimage=(hd0,0)/boot/grub/splash.xpm.gz&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Red Hat Linux (2.4.18-3smp)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3smp.img&lt;br /&gt;
title Red Hat Linux-up (2.4.18-3)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3.img&lt;br /&gt;
title Linux with Virtuozzo 2.5&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1&lt;br /&gt;
title vz-enterpriseo&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1&lt;br /&gt;
title vz-enterprise&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. run the lilo (if using lilo)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lilo&lt;br /&gt;
Added linux&lt;br /&gt;
Added linux-up&lt;br /&gt;
Added virtuozzo_old&lt;br /&gt;
Added linux+virtuozzo *&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. reboot the server&lt;br /&gt;
 shutdown -r 23:05&lt;br /&gt;
&lt;br /&gt;
when it comes time for the shutdown, run [[VPS_Management#stopvirt|stopvirt]] to get things shut down faster&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Remaking service VE (&amp;lt;=3.x only) =&lt;br /&gt;
&lt;br /&gt;
Occasionally the control panel for VEs (aka VZPP) will stop working and you just need to reinstall the service VE (which runs the control panels for all VEs on the HN). Here&#039;s how that&#039;s done :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop 1&lt;br /&gt;
ipdel 1 69.55.234.152&lt;br /&gt;
vzmlocal 1:2&lt;br /&gt;
vzctl set 2 --save --onboot no&lt;br /&gt;
vzsveinstall -t redhat-as3-minimal -d /root/Rel261/HW/RPMS -s 69.55.234.152 --skip-client&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
on 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzsveinstall -t redhat-as3-minimal -d /vz/Rel300/HW/RPMS -s 69.55.229.151 --skip-client&lt;br /&gt;
&lt;br /&gt;
vzctl stop 1&lt;br /&gt;
vzctl mount 1&lt;br /&gt;
vzctl mount 2&lt;br /&gt;
/bin/cp -aRf /vz/root/2/home/vzagent0 /vz/root/1/home&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/lib/mysql/VZADB /vz/root/1/var/lib/mysql&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/shadow /vz/root/1/etc/&lt;br /&gt;
/bin/cp -aRf /vz/root/2/var/vzcp/static/vz/skins/ /vz/root/1/var/vzcp/static/vz&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/menu.xml  /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
/bin/cp -af /vz/root/2/etc/vzcp/pp/dashboard.xml /vz/root/1/etc/vzcp/pp/&lt;br /&gt;
&lt;br /&gt;
vzctl umount 2&lt;br /&gt;
vzctl umount 1&lt;br /&gt;
vzctl start 1&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1019</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1019"/>
		<updated>2013-03-11T23:08:10Z</updated>

		<summary type="html">&lt;p&gt;Support: /* vzstat */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrate manually (if migrate/online fails) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. You can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE on the same virt ==&lt;br /&gt;
&lt;br /&gt;
Easy way:&amp;lt;br&amp;gt;&lt;br /&gt;
Scenario 1: ve 123 is to be renamed 1231 and moved from vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:1231:/vz/private/1231:/vz/root/1231&lt;br /&gt;
&lt;br /&gt;
Scenario 2: ve 123 is to be moved vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:123:/vz/private/123:/vz/root/123&lt;br /&gt;
&lt;br /&gt;
vzmlocal will reboot the ve at the end of the move&lt;br /&gt;
&lt;br /&gt;
Manual/old way:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;tt&amp;gt;vzctl stop 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2) &amp;lt;tt&amp;gt;mv /vz1/private/123 /vz/private/.&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(or cp -a if you want to copy)&lt;br /&gt;
3) in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts/123.conf&amp;lt;/tt&amp;gt; change value&amp;lt;br&amp;gt;&lt;br /&gt;
of &#039;&amp;lt;tt&amp;gt;VE_PRIVATE&amp;lt;/tt&amp;gt;&#039; variable to point to a new private area location&lt;br /&gt;
4) &amp;lt;tt&amp;gt;vzctl start 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
5) update backups if needed: &amp;lt;tt&amp;gt;mvbackups 123 virtX virt1 vz&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
6) update management scerens&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: a) absolute path to private area is stored in quota file &amp;lt;tt&amp;gt;/var/vzquota/quota.123&amp;lt;/tt&amp;gt; - so during first startup quota will be recalculated.&amp;lt;br&amp;gt;&lt;br /&gt;
b) if you&#039;re going to write some script to do a job, you MUST be sure that $VEID won&#039;t be expanded to &#039;&#039; in ve config file - ie. you need to escape &#039;$&#039;. Otherwise you might have:&lt;br /&gt;
&lt;br /&gt;
 VE_PRIVATE=&amp;quot;/vz/private/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in config, and &#039;vzctl destroy&#039; for this VE ID &#039;&#039;&#039;will remove everything under /vz/private/ directory&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Adding a veth device to a VE ==&lt;br /&gt;
&lt;br /&gt;
Not totally sure what this is, but a customer asked for it and here&#039;s what we did (as instructed by vz support):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;v set 99 --netif_add eth99  --save&lt;br /&gt;
ipdel 99 69.55.230.58&lt;br /&gt;
v set 99 --ifname eth99 --ipadd 69.55.230.58 --save&lt;br /&gt;
v set 99 --ifname eth99 --gateway 69.55.230.1 --save&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active      eth0              veth77.77,veth99.99&lt;br /&gt;
veth_net          active&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
br99             bridge     net99&lt;br /&gt;
veth99.99        veth       net99&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        net99            69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br0 eth0&lt;br /&gt;
&lt;br /&gt;
(will remove 99 from orig net and move to veth_net)&lt;br /&gt;
vznetcfg net addif veth_net veth99.99&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
(delete the old crap)&lt;br /&gt;
vznetcfg net del net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, to add another device in&lt;br /&gt;
&lt;br /&gt;
v set 77 --netif_add eth77  --save&lt;br /&gt;
ipdel 77 69.55.230.78&lt;br /&gt;
v set 77 --ifname eth77 --ipadd 69.55.230.78 --save&lt;br /&gt;
v set 77 --ifname eth77 --gateway 69.55.230.1 --save&lt;br /&gt;
v set 77 --save --ifname eth77 --network veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif veth_net veth77.77&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth       veth_net&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
another example&lt;br /&gt;
&lt;br /&gt;
v set 1182 --netif_add eth1182  --save&lt;br /&gt;
ipdel 1182 69.55.236.217&lt;br /&gt;
v set 1182 --ifname eth1182 --ipadd 69.55.236.217 --save&lt;br /&gt;
v set 1182 --ifname eth1182 --gateway 69.55.236.1 --save&lt;br /&gt;
vznetcfg net addif veth_net veth1182.1182&lt;br /&gt;
v set 1182 --save --ifname eth1182 --network veth_net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unused/not working commands:&lt;br /&gt;
ifconfig veth99.0 0&lt;br /&gt;
vznetcfg net list&lt;br /&gt;
vznetcfg br new br99 net99&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg br show&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
vznetcfg br new br1182 net1182&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif eth0 net1182&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&lt;br /&gt;
--- 8&amp;lt; ---&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new net&lt;br /&gt;
# vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vzctl set 99 --save --netif_add eth0 (at this stage veth99.0 interface have to appear&lt;br /&gt;
on node)&lt;br /&gt;
# vzctl set 99 --save --ifname eth0 --ipadd 69.55.230.58 (and probably few more arguments&lt;br /&gt;
here - see &#039;man vzctl&#039;)&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assigning/remove ip from a VE ==&lt;br /&gt;
&lt;br /&gt;
1. Add or remove ips:&lt;br /&gt;
 ipdel 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
 ipadd 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
&lt;br /&gt;
2. update Mgmt screens&lt;br /&gt;
&lt;br /&gt;
3. offer to update any DNS we do for them&lt;br /&gt;
&lt;br /&gt;
4. check to see if we had rules for old IP in firwall&lt;br /&gt;
&lt;br /&gt;
== Enabling tun device for a ve ==&lt;br /&gt;
Note, there’s a command for this: [[#addtun|addtun]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
Make sure the tun.o module is already loaded before Virtuozzo is started: &lt;br /&gt;
 lsmod &lt;br /&gt;
Allow the VPS to use the TUN/TAP device: &lt;br /&gt;
 vzctl set 101 --devices c:10:200:rw --save &lt;br /&gt;
Create the corresponding device inside the VPS and set the proper permissions: &lt;br /&gt;
 vzctl exec 101 mkdir -p /dev/net &lt;br /&gt;
 vzctl exec 101 mknod /dev/net/tun c 10 200 &lt;br /&gt;
 vzctl exec 101 chmod 600 /dev/net/tun&lt;br /&gt;
&lt;br /&gt;
== Remaking a system (on same virt) ==&lt;br /&gt;
&lt;br /&gt;
1. [[#cancelve|cancelve]] (or v destroy x - ONLY if you&#039;re POSITIVE no data needs to be saved)&lt;br /&gt;
&lt;br /&gt;
2. [[#vemake|vemake]] using same veid&lt;br /&gt;
&lt;br /&gt;
3. [[#mvbackups|mvbackups]] or [[#vb|vb]] (if new mount point)&lt;br /&gt;
&lt;br /&gt;
4. update mgmt with new dir/ip &lt;br /&gt;
&lt;br /&gt;
5. update firewall if changed ip&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;br /&gt;
&lt;br /&gt;
== stopvirt ==&lt;br /&gt;
 stopvirt&lt;br /&gt;
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.&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1018</id>
		<title>Virtuozzo / Linux Reference</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=Virtuozzo_/_Linux_Reference&amp;diff=1018"/>
		<updated>2013-03-11T23:07:11Z</updated>

		<summary type="html">&lt;p&gt;Support: /* adding new templates */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Updating VZ =&lt;br /&gt;
&lt;br /&gt;
 Update Virtuozzo to version 4.0.0&lt;br /&gt;
 Apply minor updates for Virtuozzo 3.0.0&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
When you get to the last screen, you will be given an option to &lt;br /&gt;
&lt;br /&gt;
 ( ) Automatically reboot after update&lt;br /&gt;
 (*) Reboot later manually&lt;br /&gt;
&lt;br /&gt;
make sure you choose to reboot later.&lt;br /&gt;
&lt;br /&gt;
= Migrating Templates =&lt;br /&gt;
One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it&#039;s now called) based on a particular ditribution on a host which may or may not share the same distribution. For instance, you could run a CT running Ubuntu while the host machine (Hardware Node or HN) is running CentOS. This is accomplished via the use of OS templates. As long as the HN contains the OS template on which a particular CT relies, it will run there. As such, if you want to move a CT from one HN to another, you will need to make sure the OS template exists there.&lt;br /&gt;
&lt;br /&gt;
Modern versions of VZ (&amp;gt;= 4.x) will check for and automatically move the OS template over to the host as you&#039;re (vz)migrating the CT over to a new HN. However we like to make sure the template is in place prior to moving the CT. &lt;br /&gt;
&lt;br /&gt;
The first step is to see if the template exists on the host. To see OS templates installed:&lt;br /&gt;
&lt;br /&gt;
2.x (shows OS and application templates):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkgls&lt;br /&gt;
mod_ssl-rh9 20040624&lt;br /&gt;
mysql-rh9 20030814 20050412&lt;br /&gt;
openwebmail-rh9 20050427&lt;br /&gt;
php-rh9 20050506&lt;br /&gt;
phpBB-rh9 20041229&lt;br /&gt;
postgresql-rh9 20050719&lt;br /&gt;
sl-webalizer-rh9 20040119&lt;br /&gt;
spamassassin-rh9 20040127&lt;br /&gt;
tomcat-rh9 20040524&lt;br /&gt;
usermin-rh9 20040116&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;gt;= 3.x (shows just OS templates, run without -O to see application as well):&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzpkg list -O&lt;br /&gt;
ubuntu-10.04-x86                   2010-06-01 11:39:05&lt;br /&gt;
ubuntu-11.04-x86                   2011-06-22 14:23:59&lt;br /&gt;
ubuntu-9.10-x86                    2010-03-11 17:39:51&lt;br /&gt;
centos-5-x86                       2010-03-11 17:12:27&lt;br /&gt;
debian-5.0-x86                     2010-03-11 17:33:34&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All template files are located:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1&lt;br /&gt;
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2&lt;br /&gt;
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9&lt;br /&gt;
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1&lt;br /&gt;
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2&lt;br /&gt;
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9&lt;br /&gt;
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92&lt;br /&gt;
analog-fc2      mailman-fc2           php-rh9             suse-9.2&lt;br /&gt;
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1&lt;br /&gt;
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2&lt;br /&gt;
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9&lt;br /&gt;
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92&lt;br /&gt;
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1&lt;br /&gt;
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1&lt;br /&gt;
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2&lt;br /&gt;
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9&lt;br /&gt;
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1&lt;br /&gt;
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2&lt;br /&gt;
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9&lt;br /&gt;
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3&lt;br /&gt;
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0&lt;br /&gt;
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92&lt;br /&gt;
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1&lt;br /&gt;
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2&lt;br /&gt;
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9&lt;br /&gt;
jdk-suse92      mysql-rh9             redhat-as3-minimal&lt;br /&gt;
jre-deb31       mysql-suse92          redhat-devel-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see here are the base OS templates: &amp;lt;tt&amp;gt;redhat-9, fedora-core-1&amp;lt;/tt&amp;gt; and supporting application templates: &amp;lt;tt&amp;gt;postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1&amp;lt;/tt&amp;gt;. So if you wanted to copy over all of redhat 9 you&#039;d need to copy the contents of:&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls -d /vz/template/*rh9*&lt;br /&gt;
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9&lt;br /&gt;
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9&lt;br /&gt;
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9&lt;br /&gt;
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9&lt;br /&gt;
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9&lt;br /&gt;
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9&lt;br /&gt;
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9&lt;br /&gt;
/vz/template/mailman-rh9     /vz/template/postgresql-rh9&lt;br /&gt;
&lt;br /&gt;
# ls -d /vz/template/*redhat-9*&lt;br /&gt;
/vz/template/redhat-9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get a template from one HN to another, it simply needs to be rsync&#039;d over to the target HN. It&#039;s rsync&#039;d over in this fashion:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template&lt;br /&gt;
 rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template&lt;br /&gt;
&lt;br /&gt;
Newer (&amp;gt;= 3.x) VZ employs &amp;quot;EZ&amp;quot; templates which are organized a little differently:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/&lt;br /&gt;
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc&lt;br /&gt;
centos  conf         redhat-as3-minimal  ubuntu&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/ubuntu/&lt;br /&gt;
10.04  11.04  9.10&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/&lt;br /&gt;
x86&lt;br /&gt;
# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# ls /vz/template/cache/&lt;br /&gt;
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz&lt;br /&gt;
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz&lt;br /&gt;
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we see is the entire OS and all applications are in 1 directory, and organized by distribution and release version. So to move Ubuntu 10.04:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
and you also need to move the cache:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/&lt;br /&gt;
&lt;br /&gt;
Once the transfer is complete, you will be able to run &amp;lt;tt&amp;gt;vzpkgls&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;vzpkg list -O&amp;lt;/tt&amp;gt; and see the template(s) listed on the target HN.&lt;br /&gt;
&lt;br /&gt;
So far, this all supposes template doesn&#039;t exist on the target- very simple, just copy it over. If the template exists already on the target HN, this requires closer inspection. With older templates, simply moving over the templates would be the end of it- you see the version listed when you do a &amp;lt;tt&amp;gt;vzplgls&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysql-rh9 20030814 20050412&lt;br /&gt;
&lt;br /&gt;
this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412&lt;br /&gt;
As an aside, you can&#039;t copy over just 1 of them, but if you rsync&#039;d over the &amp;lt;tt&amp;gt;mysql-rh9&amp;lt;/tt&amp;gt; directory, you&#039;d see 20030814 and 20050412 on the target HN. As long as the versions match up, you&#039;re good to go.&lt;br /&gt;
&lt;br /&gt;
With EZ templates, the versions are not as easy to decipher. When you look at the &amp;lt;tt&amp;gt;vzpkg list&amp;lt;/tt&amp;gt; output, that simply tells you when a cache was created. A cache is simply a snapshot of all the data needed for the latest versions of the OS and it&#039;s applications at the time the cache was created. It is a date, and thus tells you nothing about the versions within. So for instance, if you had a cache for Ubuntu 10.04 from 2007 and you ran &amp;lt;tt&amp;gt;vzpkg create cache ubuntu-10.04-x86&amp;lt;/tt&amp;gt; it would re-download the latest version of apache, mysql and so on. And any &#039;&#039;subsequent&#039;&#039; ubuntu 10.04 CT&#039;s created thereafter would use those newer versions, whereas older CT&#039;s based on 10.04 would use older templates. You can see how this works by looking at the files under:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# ls /vz/template/ubuntu/10.04/x86/&lt;br /&gt;
aap_1.091-1_all&lt;br /&gt;
aap-doc_1.091-1_all&lt;br /&gt;
adduser_3.112ubuntu1_all&lt;br /&gt;
anacron_2.3-13.1ubuntu11_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.2_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.4_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.6_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.7_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.8_i386&lt;br /&gt;
apache2_2.2.14-5ubuntu8.9_i386&lt;br /&gt;
&amp;lt;...snip&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see that this template has in it 6 different versions of apache2. This means that this template was merged with other 10.04 templates and/or it has been cached a few times, each time a new apache was available. The unfortunate thing is it&#039;s almost impossible to know which CT&#039;s are using which version of apache so it&#039;s hard to try to prune this down and remove unwanted/unneeded applications.&lt;br /&gt;
&lt;br /&gt;
So, if you see another HN has Ubuntu 10.04 on it, you need to see/confirm that it has all the exact files your CT needs. You can run a test rsync to see what &#039;&#039;would&#039;&#039; be transferred (what&#039;s missing):&lt;br /&gt;
&lt;br /&gt;
 rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu&lt;br /&gt;
&lt;br /&gt;
Based on the amount of data you get back from the rsync, you will be able to decide whether or not to remove the -n and allow the full transfer to go through. The downside to doing the transfer is the situation described above- you&#039;ve permanently joined these templates and now you may have 10 versions of apache on the target HN. There&#039;s one other potential pitfall to this kind of merging- it will also potentially copy over shared files, for which there is no particular version, most of which are in &amp;lt;tt&amp;gt;/vz/template/ubuntu/10.04/x86/config&amp;lt;/tt&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
 cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
 /vz/template/ubuntu/10.04/x86/config/os/default/repositories&lt;br /&gt;
&lt;br /&gt;
Here are some specific things to look out for. Case: copying centos-5 on virt19 to virt12. We dumped the rsync output to a file so we could inspect:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
(note, that can be dangerous, better to add on full path &amp;lt;tt&amp;gt;/vz/template/centos/5&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
So in the output file we see things like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
x86/base0/cachecookie&lt;br /&gt;
x86/base0/primary.xml.gz &lt;br /&gt;
x86/base0/primary.xml.gz.sqlite &lt;br /&gt;
x86/base0/repomd.xml &lt;br /&gt;
x86/base1/cachecookie &lt;br /&gt;
x86/base1/filelists.xml.gz &lt;br /&gt;
x86/base1/filelists.xml.gz.sqlite  &lt;br /&gt;
x86/base1/primary.xml.gz &lt;br /&gt;
x86/base1/primary.xml.gz.sqlite &lt;br /&gt;
x86/base1/repomd.xml&lt;br /&gt;
x86/base2/cachecookie&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which make us nervous cause those are not versioned files, i.e.:&lt;br /&gt;
 5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock&lt;br /&gt;
&lt;br /&gt;
So those files will replace existing files on v12 rather than the case of the latter where it&#039;s likely being added. So caution should be given and deference to whichever version is newer (which rsync should take care of, but that will depend on the date each file was created and perhaps not the actual data within).&lt;br /&gt;
&lt;br /&gt;
If we look further in the file we see:&lt;br /&gt;
&lt;br /&gt;
 x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.&lt;br /&gt;
9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif&lt;br /&gt;
&lt;br /&gt;
and other files looking like:&lt;br /&gt;
 5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info&lt;br /&gt;
&lt;br /&gt;
Which means plesk is here. We don&#039;t need plesk on v12 (the CT moving over doesn&#039;t use it) so we rerun the rsync and exclude it:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# rsync -an -e ssh --exclude=&amp;quot;plesk*&amp;quot; --exclude=&amp;quot;psa*&amp;quot; /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ &amp;gt; v12_c5&lt;br /&gt;
&lt;br /&gt;
and now it&#039;s much smaller:&lt;br /&gt;
&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l&lt;br /&gt;
 97104&lt;br /&gt;
&lt;br /&gt;
Before running with excludes it was:&lt;br /&gt;
 [root@virt19 /vz/template]# cat v12_c5|wc -l &lt;br /&gt;
 238238&lt;br /&gt;
&lt;br /&gt;
So again, look at what you&#039;re doing. Generally, combining templates is fine however.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re happy with the merge, run the rsync again without the &amp;quot;-n&amp;quot; to let it actually do the transfer.&lt;br /&gt;
&lt;br /&gt;
Once done, don&#039;t forget to add the new template to the HN in Management -&amp;gt; Reference -&amp;gt; Templates&lt;br /&gt;
&lt;br /&gt;
= getting help =&lt;br /&gt;
&lt;br /&gt;
= vzup2date =&lt;br /&gt;
TODO &lt;br /&gt;
= adding new templates =&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
= Updating kernel on virt =&lt;br /&gt;
&lt;br /&gt;
We now use [[#vzup2date|vzup2date]] to update systems and kernels. What follows is what we used to do when we had to download kernels and install manually on old systems:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. install kernel and modules&lt;br /&gt;
&amp;lt;pre&amp;gt;# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \&lt;br /&gt;
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm&lt;br /&gt;
vzkernel-smp          ##################################################&lt;br /&gt;
vzmodules-smp       ##################################################&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
DO NOT USE the &amp;quot;rpm -Uhv&amp;quot; command to install the kernel, otherwise all the previously installed kernels may be removed from your system. &lt;br /&gt;
&lt;br /&gt;
2. update lilo/grub&lt;br /&gt;
&lt;br /&gt;
Lilo:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/lilo.conf&lt;br /&gt;
 &lt;br /&gt;
rename old Virtuozzo kernel label from &amp;quot;linux+virtuozzo&amp;quot; to &amp;quot;virtuozzo_old&amp;quot;&lt;br /&gt;
and add a new entry pointing to the newly installed virtuozzo kernel image.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;prompt&lt;br /&gt;
timeout=50&lt;br /&gt;
default=linux+virtuozzo&lt;br /&gt;
append=&amp;quot;debug panic=5 console=tty console=ttyS0,38400&amp;quot;&lt;br /&gt;
boot=/dev/sda&lt;br /&gt;
map=/boot/map&lt;br /&gt;
install=/boot/boot.b&lt;br /&gt;
message=/boot/message&lt;br /&gt;
linear&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3smp&lt;br /&gt;
        label=linux&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3smp.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.18-3&lt;br /&gt;
        label=linux-up&lt;br /&gt;
        initrd=/boot/initrd-2.4.18-3.img&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise&lt;br /&gt;
        label=2.4.20-9.5.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise&lt;br /&gt;
        label=2.4.20-9.8.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise&lt;br /&gt;
        label=2.4.20-9.21.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise&lt;br /&gt;
        label=2.4.20-9.24.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise&lt;br /&gt;
        label=2.4.20-28.3.777&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise&lt;br /&gt;
        label=old_linux+vz&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&lt;br /&gt;
&lt;br /&gt;
image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise&lt;br /&gt;
        label=linux+virtuozzo&lt;br /&gt;
        read-only&lt;br /&gt;
        root=/dev/sda1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label &amp;quot;old_linux+vz &amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Grub:&lt;br /&gt;
&lt;br /&gt;
 vi /boot/grub /menu.lst&lt;br /&gt;
&lt;br /&gt;
Add new entry at the top.&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;serial --unit=0 --speed=38400&lt;br /&gt;
terminal --timeout=10 serial console&lt;br /&gt;
default=0&lt;br /&gt;
timeout=10&lt;br /&gt;
splashimage=(hd0,0)/boot/grub/splash.xpm.gz&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400&lt;br /&gt;
title Red Hat Linux (2.4.18-3smp)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3smp.img&lt;br /&gt;
title Red Hat Linux-up (2.4.18-3)&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1&lt;br /&gt;
        initrd /boot/initrd-2.4.18-3.img&lt;br /&gt;
title Linux with Virtuozzo 2.5&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1&lt;br /&gt;
title vz-enterpriseo&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1&lt;br /&gt;
title vz-enterprise&lt;br /&gt;
        root (hd0,0)&lt;br /&gt;
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. run the lilo (if using lilo)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# lilo&lt;br /&gt;
Added linux&lt;br /&gt;
Added linux-up&lt;br /&gt;
Added virtuozzo_old&lt;br /&gt;
Added linux+virtuozzo *&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. reboot the server&lt;br /&gt;
 shutdown -r 23:05&lt;br /&gt;
&lt;br /&gt;
when it comes time for the shutdown, run [[VPS_Management#stopvirt|stopvirt]] to get things shut down faster&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1017</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1017"/>
		<updated>2013-03-11T23:04:12Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Remaking a system (on same virt) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrate manually (if migrate/online fails) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. You can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE on the same virt ==&lt;br /&gt;
&lt;br /&gt;
Easy way:&amp;lt;br&amp;gt;&lt;br /&gt;
Scenario 1: ve 123 is to be renamed 1231 and moved from vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:1231:/vz/private/1231:/vz/root/1231&lt;br /&gt;
&lt;br /&gt;
Scenario 2: ve 123 is to be moved vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:123:/vz/private/123:/vz/root/123&lt;br /&gt;
&lt;br /&gt;
vzmlocal will reboot the ve at the end of the move&lt;br /&gt;
&lt;br /&gt;
Manual/old way:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;tt&amp;gt;vzctl stop 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2) &amp;lt;tt&amp;gt;mv /vz1/private/123 /vz/private/.&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(or cp -a if you want to copy)&lt;br /&gt;
3) in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts/123.conf&amp;lt;/tt&amp;gt; change value&amp;lt;br&amp;gt;&lt;br /&gt;
of &#039;&amp;lt;tt&amp;gt;VE_PRIVATE&amp;lt;/tt&amp;gt;&#039; variable to point to a new private area location&lt;br /&gt;
4) &amp;lt;tt&amp;gt;vzctl start 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
5) update backups if needed: &amp;lt;tt&amp;gt;mvbackups 123 virtX virt1 vz&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
6) update management scerens&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: a) absolute path to private area is stored in quota file &amp;lt;tt&amp;gt;/var/vzquota/quota.123&amp;lt;/tt&amp;gt; - so during first startup quota will be recalculated.&amp;lt;br&amp;gt;&lt;br /&gt;
b) if you&#039;re going to write some script to do a job, you MUST be sure that $VEID won&#039;t be expanded to &#039;&#039; in ve config file - ie. you need to escape &#039;$&#039;. Otherwise you might have:&lt;br /&gt;
&lt;br /&gt;
 VE_PRIVATE=&amp;quot;/vz/private/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in config, and &#039;vzctl destroy&#039; for this VE ID &#039;&#039;&#039;will remove everything under /vz/private/ directory&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Adding a veth device to a VE ==&lt;br /&gt;
&lt;br /&gt;
Not totally sure what this is, but a customer asked for it and here&#039;s what we did (as instructed by vz support):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;v set 99 --netif_add eth99  --save&lt;br /&gt;
ipdel 99 69.55.230.58&lt;br /&gt;
v set 99 --ifname eth99 --ipadd 69.55.230.58 --save&lt;br /&gt;
v set 99 --ifname eth99 --gateway 69.55.230.1 --save&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active      eth0              veth77.77,veth99.99&lt;br /&gt;
veth_net          active&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
br99             bridge     net99&lt;br /&gt;
veth99.99        veth       net99&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        net99            69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br0 eth0&lt;br /&gt;
&lt;br /&gt;
(will remove 99 from orig net and move to veth_net)&lt;br /&gt;
vznetcfg net addif veth_net veth99.99&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
(delete the old crap)&lt;br /&gt;
vznetcfg net del net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, to add another device in&lt;br /&gt;
&lt;br /&gt;
v set 77 --netif_add eth77  --save&lt;br /&gt;
ipdel 77 69.55.230.78&lt;br /&gt;
v set 77 --ifname eth77 --ipadd 69.55.230.78 --save&lt;br /&gt;
v set 77 --ifname eth77 --gateway 69.55.230.1 --save&lt;br /&gt;
v set 77 --save --ifname eth77 --network veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif veth_net veth77.77&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth       veth_net&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
another example&lt;br /&gt;
&lt;br /&gt;
v set 1182 --netif_add eth1182  --save&lt;br /&gt;
ipdel 1182 69.55.236.217&lt;br /&gt;
v set 1182 --ifname eth1182 --ipadd 69.55.236.217 --save&lt;br /&gt;
v set 1182 --ifname eth1182 --gateway 69.55.236.1 --save&lt;br /&gt;
vznetcfg net addif veth_net veth1182.1182&lt;br /&gt;
v set 1182 --save --ifname eth1182 --network veth_net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unused/not working commands:&lt;br /&gt;
ifconfig veth99.0 0&lt;br /&gt;
vznetcfg net list&lt;br /&gt;
vznetcfg br new br99 net99&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg br show&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
vznetcfg br new br1182 net1182&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif eth0 net1182&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&lt;br /&gt;
--- 8&amp;lt; ---&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new net&lt;br /&gt;
# vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vzctl set 99 --save --netif_add eth0 (at this stage veth99.0 interface have to appear&lt;br /&gt;
on node)&lt;br /&gt;
# vzctl set 99 --save --ifname eth0 --ipadd 69.55.230.58 (and probably few more arguments&lt;br /&gt;
here - see &#039;man vzctl&#039;)&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assigning/remove ip from a VE ==&lt;br /&gt;
&lt;br /&gt;
1. Add or remove ips:&lt;br /&gt;
 ipdel 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
 ipadd 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
&lt;br /&gt;
2. update Mgmt screens&lt;br /&gt;
&lt;br /&gt;
3. offer to update any DNS we do for them&lt;br /&gt;
&lt;br /&gt;
4. check to see if we had rules for old IP in firwall&lt;br /&gt;
&lt;br /&gt;
== Enabling tun device for a ve ==&lt;br /&gt;
Note, there’s a command for this: [[#addtun|addtun]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
Make sure the tun.o module is already loaded before Virtuozzo is started: &lt;br /&gt;
 lsmod &lt;br /&gt;
Allow the VPS to use the TUN/TAP device: &lt;br /&gt;
 vzctl set 101 --devices c:10:200:rw --save &lt;br /&gt;
Create the corresponding device inside the VPS and set the proper permissions: &lt;br /&gt;
 vzctl exec 101 mkdir -p /dev/net &lt;br /&gt;
 vzctl exec 101 mknod /dev/net/tun c 10 200 &lt;br /&gt;
 vzctl exec 101 chmod 600 /dev/net/tun&lt;br /&gt;
&lt;br /&gt;
== Remaking a system (on same virt) ==&lt;br /&gt;
&lt;br /&gt;
1. [[#cancelve|cancelve]] (or v destroy x - ONLY if you&#039;re POSITIVE no data needs to be saved)&lt;br /&gt;
&lt;br /&gt;
2. [[#vemake|vemake]] using same veid&lt;br /&gt;
&lt;br /&gt;
3. [[#mvbackups|mvbackups]] or [[#vb|vb]] (if new mount point)&lt;br /&gt;
&lt;br /&gt;
4. update mgmt with new dir/ip &lt;br /&gt;
&lt;br /&gt;
5. update firewall if changed ip&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1016</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1016"/>
		<updated>2013-03-11T23:03:38Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Assigning/remove ip from a VE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrate manually (if migrate/online fails) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. You can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE on the same virt ==&lt;br /&gt;
&lt;br /&gt;
Easy way:&amp;lt;br&amp;gt;&lt;br /&gt;
Scenario 1: ve 123 is to be renamed 1231 and moved from vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:1231:/vz/private/1231:/vz/root/1231&lt;br /&gt;
&lt;br /&gt;
Scenario 2: ve 123 is to be moved vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:123:/vz/private/123:/vz/root/123&lt;br /&gt;
&lt;br /&gt;
vzmlocal will reboot the ve at the end of the move&lt;br /&gt;
&lt;br /&gt;
Manual/old way:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;tt&amp;gt;vzctl stop 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2) &amp;lt;tt&amp;gt;mv /vz1/private/123 /vz/private/.&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(or cp -a if you want to copy)&lt;br /&gt;
3) in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts/123.conf&amp;lt;/tt&amp;gt; change value&amp;lt;br&amp;gt;&lt;br /&gt;
of &#039;&amp;lt;tt&amp;gt;VE_PRIVATE&amp;lt;/tt&amp;gt;&#039; variable to point to a new private area location&lt;br /&gt;
4) &amp;lt;tt&amp;gt;vzctl start 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
5) update backups if needed: &amp;lt;tt&amp;gt;mvbackups 123 virtX virt1 vz&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
6) update management scerens&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: a) absolute path to private area is stored in quota file &amp;lt;tt&amp;gt;/var/vzquota/quota.123&amp;lt;/tt&amp;gt; - so during first startup quota will be recalculated.&amp;lt;br&amp;gt;&lt;br /&gt;
b) if you&#039;re going to write some script to do a job, you MUST be sure that $VEID won&#039;t be expanded to &#039;&#039; in ve config file - ie. you need to escape &#039;$&#039;. Otherwise you might have:&lt;br /&gt;
&lt;br /&gt;
 VE_PRIVATE=&amp;quot;/vz/private/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in config, and &#039;vzctl destroy&#039; for this VE ID &#039;&#039;&#039;will remove everything under /vz/private/ directory&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Adding a veth device to a VE ==&lt;br /&gt;
&lt;br /&gt;
Not totally sure what this is, but a customer asked for it and here&#039;s what we did (as instructed by vz support):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;v set 99 --netif_add eth99  --save&lt;br /&gt;
ipdel 99 69.55.230.58&lt;br /&gt;
v set 99 --ifname eth99 --ipadd 69.55.230.58 --save&lt;br /&gt;
v set 99 --ifname eth99 --gateway 69.55.230.1 --save&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active      eth0              veth77.77,veth99.99&lt;br /&gt;
veth_net          active&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
br99             bridge     net99&lt;br /&gt;
veth99.99        veth       net99&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        net99            69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br0 eth0&lt;br /&gt;
&lt;br /&gt;
(will remove 99 from orig net and move to veth_net)&lt;br /&gt;
vznetcfg net addif veth_net veth99.99&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
(delete the old crap)&lt;br /&gt;
vznetcfg net del net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, to add another device in&lt;br /&gt;
&lt;br /&gt;
v set 77 --netif_add eth77  --save&lt;br /&gt;
ipdel 77 69.55.230.78&lt;br /&gt;
v set 77 --ifname eth77 --ipadd 69.55.230.78 --save&lt;br /&gt;
v set 77 --ifname eth77 --gateway 69.55.230.1 --save&lt;br /&gt;
v set 77 --save --ifname eth77 --network veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif veth_net veth77.77&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth       veth_net&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
another example&lt;br /&gt;
&lt;br /&gt;
v set 1182 --netif_add eth1182  --save&lt;br /&gt;
ipdel 1182 69.55.236.217&lt;br /&gt;
v set 1182 --ifname eth1182 --ipadd 69.55.236.217 --save&lt;br /&gt;
v set 1182 --ifname eth1182 --gateway 69.55.236.1 --save&lt;br /&gt;
vznetcfg net addif veth_net veth1182.1182&lt;br /&gt;
v set 1182 --save --ifname eth1182 --network veth_net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unused/not working commands:&lt;br /&gt;
ifconfig veth99.0 0&lt;br /&gt;
vznetcfg net list&lt;br /&gt;
vznetcfg br new br99 net99&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg br show&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
vznetcfg br new br1182 net1182&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif eth0 net1182&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&lt;br /&gt;
--- 8&amp;lt; ---&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new net&lt;br /&gt;
# vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vzctl set 99 --save --netif_add eth0 (at this stage veth99.0 interface have to appear&lt;br /&gt;
on node)&lt;br /&gt;
# vzctl set 99 --save --ifname eth0 --ipadd 69.55.230.58 (and probably few more arguments&lt;br /&gt;
here - see &#039;man vzctl&#039;)&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assigning/remove ip from a VE ==&lt;br /&gt;
&lt;br /&gt;
1. Add or remove ips:&lt;br /&gt;
 ipdel 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
 ipadd 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
&lt;br /&gt;
2. update Mgmt screens&lt;br /&gt;
&lt;br /&gt;
3. offer to update any DNS we do for them&lt;br /&gt;
&lt;br /&gt;
4. check to see if we had rules for old IP in firwall&lt;br /&gt;
&lt;br /&gt;
== Enabling tun device for a ve ==&lt;br /&gt;
Note, there’s a command for this: [[#addtun|addtun]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
Make sure the tun.o module is already loaded before Virtuozzo is started: &lt;br /&gt;
 lsmod &lt;br /&gt;
Allow the VPS to use the TUN/TAP device: &lt;br /&gt;
 vzctl set 101 --devices c:10:200:rw --save &lt;br /&gt;
Create the corresponding device inside the VPS and set the proper permissions: &lt;br /&gt;
 vzctl exec 101 mkdir -p /dev/net &lt;br /&gt;
 vzctl exec 101 mknod /dev/net/tun c 10 200 &lt;br /&gt;
 vzctl exec 101 chmod 600 /dev/net/tun&lt;br /&gt;
&lt;br /&gt;
== Remaking a system (on same virt) ==&lt;br /&gt;
&lt;br /&gt;
1. [[#cancelve|cancelve]] (or v destroy x - ONLY if you&#039;re POSITIVE no data needs to be saved)&lt;br /&gt;
2. [[#vemake|vemake]] using same veid&lt;br /&gt;
3. [[#mvbackups|mvbackups]] or [[#vb|vb]] (if new mount point)&lt;br /&gt;
4. update mgmt with new dir/ip &lt;br /&gt;
5. update firewall if changed ip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1015</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1015"/>
		<updated>2013-03-11T23:03:23Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Moving a VE on the same virt */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrate manually (if migrate/online fails) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. You can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE on the same virt ==&lt;br /&gt;
&lt;br /&gt;
Easy way:&amp;lt;br&amp;gt;&lt;br /&gt;
Scenario 1: ve 123 is to be renamed 1231 and moved from vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:1231:/vz/private/1231:/vz/root/1231&lt;br /&gt;
&lt;br /&gt;
Scenario 2: ve 123 is to be moved vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:123:/vz/private/123:/vz/root/123&lt;br /&gt;
&lt;br /&gt;
vzmlocal will reboot the ve at the end of the move&lt;br /&gt;
&lt;br /&gt;
Manual/old way:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;tt&amp;gt;vzctl stop 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2) &amp;lt;tt&amp;gt;mv /vz1/private/123 /vz/private/.&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(or cp -a if you want to copy)&lt;br /&gt;
3) in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts/123.conf&amp;lt;/tt&amp;gt; change value&amp;lt;br&amp;gt;&lt;br /&gt;
of &#039;&amp;lt;tt&amp;gt;VE_PRIVATE&amp;lt;/tt&amp;gt;&#039; variable to point to a new private area location&lt;br /&gt;
4) &amp;lt;tt&amp;gt;vzctl start 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
5) update backups if needed: &amp;lt;tt&amp;gt;mvbackups 123 virtX virt1 vz&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
6) update management scerens&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: a) absolute path to private area is stored in quota file &amp;lt;tt&amp;gt;/var/vzquota/quota.123&amp;lt;/tt&amp;gt; - so during first startup quota will be recalculated.&amp;lt;br&amp;gt;&lt;br /&gt;
b) if you&#039;re going to write some script to do a job, you MUST be sure that $VEID won&#039;t be expanded to &#039;&#039; in ve config file - ie. you need to escape &#039;$&#039;. Otherwise you might have:&lt;br /&gt;
&lt;br /&gt;
 VE_PRIVATE=&amp;quot;/vz/private/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in config, and &#039;vzctl destroy&#039; for this VE ID &#039;&#039;&#039;will remove everything under /vz/private/ directory&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Adding a veth device to a VE ==&lt;br /&gt;
&lt;br /&gt;
Not totally sure what this is, but a customer asked for it and here&#039;s what we did (as instructed by vz support):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;v set 99 --netif_add eth99  --save&lt;br /&gt;
ipdel 99 69.55.230.58&lt;br /&gt;
v set 99 --ifname eth99 --ipadd 69.55.230.58 --save&lt;br /&gt;
v set 99 --ifname eth99 --gateway 69.55.230.1 --save&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active      eth0              veth77.77,veth99.99&lt;br /&gt;
veth_net          active&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
br99             bridge     net99&lt;br /&gt;
veth99.99        veth       net99&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        net99            69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br0 eth0&lt;br /&gt;
&lt;br /&gt;
(will remove 99 from orig net and move to veth_net)&lt;br /&gt;
vznetcfg net addif veth_net veth99.99&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
net99             active&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
(delete the old crap)&lt;br /&gt;
vznetcfg net del net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then, to add another device in&lt;br /&gt;
&lt;br /&gt;
v set 77 --netif_add eth77  --save&lt;br /&gt;
ipdel 77 69.55.230.78&lt;br /&gt;
v set 77 --ifname eth77 --ipadd 69.55.230.78 --save&lt;br /&gt;
v set 77 --ifname eth77 --gateway 69.55.230.1 --save&lt;br /&gt;
v set 77 --save --ifname eth77 --network veth_net&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif veth_net veth77.77&lt;br /&gt;
&lt;br /&gt;
# vznetcfg if list&lt;br /&gt;
Name             Type       Network ID       Addresses&lt;br /&gt;
veth77.77        veth       veth_net&lt;br /&gt;
br0              bridge     veth_net&lt;br /&gt;
veth99.99        veth       veth_net&lt;br /&gt;
eth1             nic                         10.1.4.62/24&lt;br /&gt;
eth0             nic        veth_net         69.55.227.70/24&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net list&lt;br /&gt;
Network ID        Status      Master Interface  Slave Interfaces&lt;br /&gt;
veth_net          active      eth0              veth77.77,veth99.99&lt;br /&gt;
&lt;br /&gt;
another example&lt;br /&gt;
&lt;br /&gt;
v set 1182 --netif_add eth1182  --save&lt;br /&gt;
ipdel 1182 69.55.236.217&lt;br /&gt;
v set 1182 --ifname eth1182 --ipadd 69.55.236.217 --save&lt;br /&gt;
v set 1182 --ifname eth1182 --gateway 69.55.236.1 --save&lt;br /&gt;
vznetcfg net addif veth_net veth1182.1182&lt;br /&gt;
v set 1182 --save --ifname eth1182 --network veth_net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unused/not working commands:&lt;br /&gt;
ifconfig veth99.0 0&lt;br /&gt;
vznetcfg net list&lt;br /&gt;
vznetcfg br new br99 net99&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg br show&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
---------&lt;br /&gt;
&lt;br /&gt;
vznetcfg br new br1182 net1182&lt;br /&gt;
&lt;br /&gt;
vznetcfg br attach br99 eth0&lt;br /&gt;
vznetcfg if list&lt;br /&gt;
vznetcfg net addif net99 veth99.99&lt;br /&gt;
vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vznetcfg net addif eth0 net1182&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&lt;br /&gt;
--- 8&amp;lt; ---&lt;br /&gt;
&lt;br /&gt;
vznetcfg net new net&lt;br /&gt;
# vznetcfg net addif eth0 net99&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# vzctl set 99 --save --netif_add eth0 (at this stage veth99.0 interface have to appear&lt;br /&gt;
on node)&lt;br /&gt;
# vzctl set 99 --save --ifname eth0 --ipadd 69.55.230.58 (and probably few more arguments&lt;br /&gt;
here - see &#039;man vzctl&#039;)&lt;br /&gt;
# vznetcfg net addif veth99.0 net99&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Assigning/remove ip from a VE ==&lt;br /&gt;
&lt;br /&gt;
1. Add or remove ips:&lt;br /&gt;
 ipdel 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
 ipadd 1234 1.1.1.1 2.2.2.2&lt;br /&gt;
2. update Mgmt screens&lt;br /&gt;
3. offer to update any DNS we do for them&lt;br /&gt;
4. check to see if we had rules for old IP in firwall&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Enabling tun device for a ve ==&lt;br /&gt;
Note, there’s a command for this: [[#addtun|addtun]]&lt;br /&gt;
&lt;br /&gt;
For posterity:&lt;br /&gt;
Make sure the tun.o module is already loaded before Virtuozzo is started: &lt;br /&gt;
 lsmod &lt;br /&gt;
Allow the VPS to use the TUN/TAP device: &lt;br /&gt;
 vzctl set 101 --devices c:10:200:rw --save &lt;br /&gt;
Create the corresponding device inside the VPS and set the proper permissions: &lt;br /&gt;
 vzctl exec 101 mkdir -p /dev/net &lt;br /&gt;
 vzctl exec 101 mknod /dev/net/tun c 10 200 &lt;br /&gt;
 vzctl exec 101 chmod 600 /dev/net/tun&lt;br /&gt;
&lt;br /&gt;
== Remaking a system (on same virt) ==&lt;br /&gt;
&lt;br /&gt;
1. [[#cancelve|cancelve]] (or v destroy x - ONLY if you&#039;re POSITIVE no data needs to be saved)&lt;br /&gt;
2. [[#vemake|vemake]] using same veid&lt;br /&gt;
3. [[#mvbackups|mvbackups]] or [[#vb|vb]] (if new mount point)&lt;br /&gt;
4. update mgmt with new dir/ip &lt;br /&gt;
5. update firewall if changed ip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1014</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1014"/>
		<updated>2013-03-11T23:00:34Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Traffic accounting on linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrate manually (if migrate/online fails) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. You can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE on the same virt ==&lt;br /&gt;
&lt;br /&gt;
Easy way:&amp;lt;br&amp;gt;&lt;br /&gt;
Scenario 1: ve 123 is to be renamed 1231 and moved from vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:1231:/vz/private/1231:/vz/root/1231&lt;br /&gt;
&lt;br /&gt;
Scenario 2: ve 123 is to be moved vz1 to vz&lt;br /&gt;
&lt;br /&gt;
 vzmlocal 123:123:/vz/private/123:/vz/root/123&lt;br /&gt;
&lt;br /&gt;
vzmlocal will reboot the ve at the end of the move&lt;br /&gt;
&lt;br /&gt;
Manual/old way:&lt;br /&gt;
&lt;br /&gt;
1) &amp;lt;tt&amp;gt;vzctl stop 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
2) &amp;lt;tt&amp;gt;mv /vz1/private/123 /vz/private/.&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(or cp -a if you want to copy)&lt;br /&gt;
3) in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts/123.conf&amp;lt;/tt&amp;gt; change value&amp;lt;br&amp;gt;&lt;br /&gt;
of &#039;&amp;lt;tt&amp;gt;VE_PRIVATE&amp;lt;/tt&amp;gt;&#039; variable to point to a new private area location&lt;br /&gt;
4) &amp;lt;tt&amp;gt;vzctl start 123&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
5) update backups if needed: &amp;lt;tt&amp;gt;mvbackups 123 virtX virt1 vz&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
6) update management scerens&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes: a) absolute path to private area is stored in quota file &amp;lt;tt&amp;gt;/var/vzquota/quota.123&amp;lt;/tt&amp;gt; - so during first startup quota will be recalculated.&amp;lt;br&amp;gt;&lt;br /&gt;
b) if you&#039;re going to write some script to do a job, you MUST be sure that $VEID won&#039;t be expanded to &#039;&#039; in ve config file - ie. you need to escape &#039;$&#039;. Otherwise you might have:&lt;br /&gt;
&lt;br /&gt;
 VE_PRIVATE=&amp;quot;/vz/private/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in config, and &#039;vzctl destroy&#039; for this VE ID &#039;&#039;&#039;will remove everything under /vz/private/ directory&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Remaking a system (on same virt) ==&lt;br /&gt;
&lt;br /&gt;
1. [[#cancelve|cancelve]] (or v destroy x - ONLY if you&#039;re POSITIVE no data needs to be saved)&lt;br /&gt;
2. [[#vemake|vemake]] using same veid&lt;br /&gt;
3. [[#mvbackups|mvbackups]] or [[#vb|vb]] (if new mount point)&lt;br /&gt;
4. update mgmt with new dir/ip &lt;br /&gt;
5. update firewall if changed ip&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1013</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1013"/>
		<updated>2013-03-11T22:55:57Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Instructions for src=2.5.x */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrate manually (if migrate/online fails) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. You can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
	<entry>
		<id>https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1012</id>
		<title>VPS Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.jcihosting.com/index.php?title=VPS_Management&amp;diff=1012"/>
		<updated>2013-03-11T22:48:32Z</updated>

		<summary type="html">&lt;p&gt;Support: /* Moving a VE to another virt (migrate/migrateonline) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Common Problems =&lt;br /&gt;
== Login to any machine without a password ==&lt;br /&gt;
&lt;br /&gt;
This is possible via the use of ssh keys. The process is thus:&lt;br /&gt;
&lt;br /&gt;
1. place the public key for your user (root@mail) in the /root/.ssh/authorized_keys file on the server you wish to login to&lt;br /&gt;
 cat /root/.ssh/id_dsa.pub&lt;br /&gt;
(paste that into authorized_keys on the target server). If the file doesn&#039;t exist, create it.&lt;br /&gt;
&lt;br /&gt;
2. enable root login (usually only applies to FreeBSD). Edit the /etc/ssh/sshd_config on the target server and change:&lt;br /&gt;
&amp;lt;tt&amp;gt;#PermitRootLogin no&amp;lt;/tt&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;tt&amp;gt;PermitRootLogin yes&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. Restart the sshd on the target machine. First, find the sshd process: &lt;br /&gt;
 jailps &amp;lt;hostname&amp;gt; | grep sshd &lt;br /&gt;
or &lt;br /&gt;
 vp &amp;lt;VEID&amp;gt; | grep sshd&lt;br /&gt;
&lt;br /&gt;
Look for the process resembling:&lt;br /&gt;
 root     17296  0.0  0.0  5280 1036 ?        Ss    2011   4:27 /usr/sbin/sshd &lt;br /&gt;
(this is the sshd)&lt;br /&gt;
&lt;br /&gt;
Not:&lt;br /&gt;
 root      6270  0.5  0.0  6808 2536 ?        Ss   14:33   0:00 sshd: root [priv]&lt;br /&gt;
(this is an sshd child- someone already ssh&#039;d in as root)&lt;br /&gt;
&lt;br /&gt;
Restart the sshd: &lt;br /&gt;
 kill -1 &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
 kill -1 17296&lt;br /&gt;
&lt;br /&gt;
You may now ssh in.&lt;br /&gt;
&lt;br /&gt;
Once you&#039;re done, IF you enabled root login, you should repeat steps 2 and 3 to disable root logins.&lt;br /&gt;
&lt;br /&gt;
== Letting someone in who has locked themselves out (killed sshd, lost pwd) ==&lt;br /&gt;
&lt;br /&gt;
There are two ways people frequently lock themselves out - either they forget a password, or they kill off sshd somehow.&lt;br /&gt;
&lt;br /&gt;
These are actually both fairly easy to solve.  First, let&#039;s say someone kills off their sshd, or somehow mangles /etc/ssh/sshd_config such that it no longer lets them in.&lt;br /&gt;
&lt;br /&gt;
Their email may be very short, or it may have all sorts of details about how you should fix sshd_config to let them in ... just ignore all of this. They can fix their own mangled sshd.  Fixing this is very simple.  First, edit the /etc/inetd.conf on their system and uncomment the telnet line:&lt;br /&gt;
&lt;br /&gt;
 telnet stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
 #telnet stream  tcp6    nowait  root    /usr/libexec/telnetd    telnetd&lt;br /&gt;
&lt;br /&gt;
(just leave the tcp6 version of telnet commented)&lt;br /&gt;
&lt;br /&gt;
Then, use jailps to list the processes on their system, and find their inetd process.  Then simply:&lt;br /&gt;
&lt;br /&gt;
 kill -HUP (pid)&lt;br /&gt;
&lt;br /&gt;
where (pid) is the PID of their inetd process.  Now they have telnet running on their system and they can log in and do whatever they need to do.&lt;br /&gt;
&lt;br /&gt;
The only complications that could occur are:&lt;br /&gt;
&lt;br /&gt;
a) their firewall config on our firewall has port 23 blocked, in which case you will need to open that - will be covered in a different lesson.&lt;br /&gt;
&lt;br /&gt;
b) they are not running inetd, so you can&#039;t HUP it.  If this happens, edit their /etc/rc.conf, add the inetd_enable=&amp;quot;YES&amp;quot; line, and then kill&lt;br /&gt;
their jail with /tmp/jailkill.pl - then restart their jail with the jail line from their quad/safe file.  Easy.&lt;br /&gt;
&lt;br /&gt;
If they have forgotten a password,&lt;br /&gt;
&lt;br /&gt;
On 6.x+ you can reset their password with:&lt;br /&gt;
 jexec &amp;lt;jailID from jls&amp;gt; passwd root&lt;br /&gt;
&lt;br /&gt;
Note: the default password for 6.x jails is 8ico2987, for 4.x it is p455agfa&lt;br /&gt;
&lt;br /&gt;
On 4.x, you need to cd to their etc directory&lt;br /&gt;
... for instance:&lt;br /&gt;
&lt;br /&gt;
 cd /mnt/data2/198.78.65.136-col00261-DIR/etc&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
 vipw -d .&lt;br /&gt;
&lt;br /&gt;
Then paste in these two lines (theres a paste with these):&lt;br /&gt;
&lt;br /&gt;
 root:$1$krszPxhk$xkCepSnz3mIikT3vCtJCt0:0:0::0:0:Charlie &amp;amp;:/root:/bin/csh&lt;br /&gt;
 user:$1$Mx9p5Npk$QdMU6c8YQqp2FW2M3irEh/:1001:1001::0:0:User &amp;amp;:/home/user:/bin/sh&lt;br /&gt;
&lt;br /&gt;
overwriting the lines they already have for &amp;quot;user&amp;quot; and &amp;quot;root&amp;quot; - then just tell them that both user and root have been reset to the default password of p455agfa.&lt;br /&gt;
&lt;br /&gt;
For linux, just passwd inside shell or &lt;br /&gt;
 vzctl set &amp;lt;veid&amp;gt; --userpasswd root:p455agfa –save&lt;br /&gt;
&lt;br /&gt;
Starting in 2009 we began giving out randomized passwords for FreeBSD and Linux as the default password. That is stored with each system in Mgmt. You should look for and reset the password to that password in the event of a reset and refer the customer to use their original password from their welcome email- this way we don’t have to send the password again via email (in clear text).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== sendmail can’t be contacted from ext ip (only locally) ==&lt;br /&gt;
&lt;br /&gt;
By default redhat puts this line in sendmail.mc:&lt;br /&gt;
&lt;br /&gt;
 DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
which makes it only answer on localhost.  Comment it out like:&lt;br /&gt;
&lt;br /&gt;
 dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA&#039;)&lt;br /&gt;
&lt;br /&gt;
and then rebuild sendmail.cf with:&lt;br /&gt;
&lt;br /&gt;
 m4 /etc/mail/sendmail.mc &amp;gt; /etc/sendmail.cf&lt;br /&gt;
&lt;br /&gt;
== virt doesn’t properly let go of ve’s ip(s) when moved to another system ==&lt;br /&gt;
&lt;br /&gt;
On virtuozzo 2.6 systems, it&#039;s been observed that when moving ips from one virt to another that sometimes the routing table will not get updated to reflect the removal of the ip addresses.&lt;br /&gt;
&lt;br /&gt;
A recent example was a customer that was moving to a new ve on a new virt and the ip addresses were traded between the two ve&#039;s.  After the trade the two systems were not able to talk to each other.  When looking at the routing table for the old system all the ip addresses were still in the routing table as being local, like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;netstat -rn | grep 69.55.225.149&lt;br /&gt;
69.55.225.149   0.0.0.0         255.255.255.255 UH       40 0          0 venet0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This was preventing traffic to the other system from being routed properly.&lt;br /&gt;
The solution is to manually delete the route:&lt;br /&gt;
&lt;br /&gt;
 route delete 69.55.225.149 gw 0.0.0.0&lt;br /&gt;
&lt;br /&gt;
Supposedly, this was fixed in 2.6.1&lt;br /&gt;
&lt;br /&gt;
== sshd on FreeBSD 6.2 segfaults ==&lt;br /&gt;
&lt;br /&gt;
First try to reinstall ssh&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /usr/src/secure&lt;br /&gt;
cd lib/libssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.sbin/sshd&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&lt;br /&gt;
cd ../../usr.bin/ssh&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Failing that, find the library that’s messed up:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ldd /usr/sbin/sshd&lt;br /&gt;
         libssh.so.3 =&amp;gt; /usr/lib/libssh.so.3 (0x280a3000) &lt;br /&gt;
         libutil.so.5 =&amp;gt; /lib/libutil.so.5 (0x280d8000) &lt;br /&gt;
         libz.so.3 =&amp;gt; /lib/libz.so.3 (0x280e4000) &lt;br /&gt;
         libwrap.so.4 =&amp;gt; /usr/lib/libwrap.so.4 (0x280f5000) &lt;br /&gt;
         libpam.so.3 =&amp;gt; /usr/lib/libpam.so.3 (0x280fc000) &lt;br /&gt;
         libbsm.so.1 =&amp;gt; /usr/lib/libbsm.so.1 (0x28103000) &lt;br /&gt;
         libgssapi.so.8 =&amp;gt; /usr/lib/libgssapi.so.8 (0x28112000) &lt;br /&gt;
         libkrb5.so.8 =&amp;gt; /usr/lib/libkrb5.so.8 (0x28120000) &lt;br /&gt;
         libasn1.so.8 =&amp;gt; /usr/lib/libasn1.so.8 (0x28154000) &lt;br /&gt;
         libcom_err.so.3 =&amp;gt; /usr/lib/libcom_err.so.3 (0x28175000) &lt;br /&gt;
         libroken.so.8 =&amp;gt; /usr/lib/libroken.so.8 (0x28177000) &lt;br /&gt;
         libcrypto.so.4 =&amp;gt; /lib/libcrypto.so.4 (0x28183000) &lt;br /&gt;
         libcrypt.so.3 =&amp;gt; /lib/libcrypt.so.3 (0x28276000) &lt;br /&gt;
         libc.so.6 =&amp;gt; /lib/libc.so.6 (0x2828e000) &lt;br /&gt;
         libmd.so.3 =&amp;gt; /lib/libmd.so.3 (0x28373000)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
md5 them and compare to other jail hosts or jails running on host&lt;br /&gt;
&lt;br /&gt;
for libcrypto reinstall:&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/src/crypto&lt;br /&gt;
make depend &amp;amp;&amp;amp; make all install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS =&lt;br /&gt;
&lt;br /&gt;
== Starting jails: Quad/Safe Files ==&lt;br /&gt;
&lt;br /&gt;
FreeBSD customer systems do not start up automatically at boot time.  When one of our freebsd machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. More on monitoring later.&lt;br /&gt;
&lt;br /&gt;
NOTE: &amp;gt;=7.x we have moved to 1 quad file: &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. Startups are not done by running each quad, but rather [[#startalljails|startalljails]] which relies on the contents of &amp;lt;tt&amp;gt;quad1&amp;lt;/tt&amp;gt;. The specifics of this are lower in this article. What follows here applies for pre 7.x systems.&lt;br /&gt;
&lt;br /&gt;
There are eight files in &amp;lt;tt&amp;gt;/usr/local/jail/rc.d&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail3# ls /usr/local/jail/rc.d/&lt;br /&gt;
quad1   quad2   quad3   quad4   safe1   safe2   safe3   safe4&lt;br /&gt;
jail3#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
four quad files and four safe files.&lt;br /&gt;
&lt;br /&gt;
Each file contains an even number of system startup blocks (total number of jails divided by 4)&lt;br /&gt;
 &lt;br /&gt;
The reason for this is, if we make one large script to startup all the systems at boot time, it will take too long - the first system in the script will start up right after system boot, which is great, but the last system may not start for another 20 minutes.&lt;br /&gt;
&lt;br /&gt;
Since there is no way to parralelize this during the startup procedure, we simply open four terminals (in screen window 9) and run each script, one in each terminal. This way they all run simultaneously, and the very last system in each startup script gets started in 1/4th the time it would if there was one large file&lt;br /&gt;
&lt;br /&gt;
The files are generally organized so that quad/safe 1&amp;amp;2 have only jails from disk 1, and quad/safe 3&amp;amp;4 have jails from disk 2. This helps ensure that only 2 fscks on any disk are going on at once. Further, they are balanced so that all quad/safe’s finish executing around the same time. We do this by making sure each quad/safe has a similar number of jails  and represents a similar number of inodes (see js).&lt;br /&gt;
&lt;br /&gt;
The other, very important reason we do it this way, and this is the reason there are quad files and safe files, is that in the event of a system crash, every single vn-backed filesystem that was mounted at the time of system crash needs to be fsck&#039;d.  However, fsck&#039;ing takes time, so if we shut the system down gracefully, we don&#039;t want to fsck.&lt;br /&gt;
&lt;br /&gt;
Therefore, we have two sets of scripts - the four quad scripts are identical to the four safe scripts except for the fact that the quad scripts contain fsck commands for each filesystem.&lt;br /&gt;
&lt;br /&gt;
So, if you shut a system down gracefully, start four terminals and run safe1 in window one, and safe2 in window 2, and so on.&lt;br /&gt;
 &lt;br /&gt;
If you crash, start four terminals (or go to screen window 9) and run quad1 in window one, and quad2 in window 2, and so on.&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 4.x version) quad2 from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
fsck -y /dev/vn16&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#fsck -y /dev/vn28&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
fsck -y /dev/vn22&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#fsck -y /dev/vn15&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, two of the systems specified are commented out - presumably those customers cancelled, or were moved to new servers.&lt;br /&gt;
&lt;br /&gt;
As you can see, the vnconfig line is the simpler command line, not the longer one that was used when it was first configured.  As you can see, all that is done is, vnconfig the filesystem, then fsck it, then mount it. The fourth command is the `jail` command used to start the system – but that will be covered later.&lt;br /&gt;
&lt;br /&gt;
Here is the safe2 file from jail17:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vnconfig /dev/vn16 /mnt/data2/69.55.228.7-col00820&lt;br /&gt;
mount /dev/vn16c /mnt/data2/69.55.228.7-col00820-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.7-col00820-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.7-col00820-DIR mail1.phimail.com 69.55.228.7 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# moved to data2 col00368&lt;br /&gt;
#vnconfig /dev/vn28 /mnt/data2/69.55.236.132-col00368&lt;br /&gt;
#mount /dev/vn28c /mnt/data2/69.55.236.132-col00368-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.236.132-col00368-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.236.132-col00368-DIR limehouse.org 69.55.236.132 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
vnconfig /dev/vn22 /mnt/data2/69.55.228.13-col01063&lt;br /&gt;
mount /dev/vn22c /mnt/data2/69.55.228.13-col01063-DIR&lt;br /&gt;
chmod 0666 /mnt/data2/69.55.228.13-col01063-DIR/dev/null&lt;br /&gt;
jail /mnt/data2/69.55.228.13-col01063-DIR www.widestream.com.au 69.55.228.13 /bin/sh /etc/rc&lt;br /&gt;
&lt;br /&gt;
# cancelled col00106&lt;br /&gt;
#vnconfig /dev/vn15 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
#mount /dev/vn15c /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
#chmod 0666 /mnt/data2/69.55.238.5-col00106-DIR/dev/null&lt;br /&gt;
#jail /mnt/data2/69.55.238.5-col00106-DIR mail.azebu.net 69.55.238.5 /bin/sh /etc/rc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, it is exactly the same, but it does not have the fsck lines.&lt;br /&gt;
&lt;br /&gt;
Take a look at the last entry - note that the file is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106&lt;br /&gt;
&lt;br /&gt;
and the mount point is named:&lt;br /&gt;
&lt;br /&gt;
 /mnt/data2/69.55.238.5-col00106-DIR&lt;br /&gt;
&lt;br /&gt;
This is the general format on all the FreeBSD systems.  The file is always named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber&lt;br /&gt;
&lt;br /&gt;
and the directory is named:&lt;br /&gt;
&lt;br /&gt;
 IP-custnumber-DIR&lt;br /&gt;
&lt;br /&gt;
If you run safe when you need a fsck, the mount will fail and jail will fail:&lt;br /&gt;
&lt;br /&gt;
 # mount /dev/vn1c /mnt/data2/jails/65.248.2.131-ns1.kozubik.com-DIR&lt;br /&gt;
 mount: /dev/vn1c: Operation not permitted&lt;br /&gt;
&lt;br /&gt;
No reboot needed, just run the quad script&lt;br /&gt;
&lt;br /&gt;
Starting with 6.x jails, we added block delimiters to the quad/safe files, the block looks like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: nuie.solaris.mu&#039;&lt;br /&gt;
fsck -y /dev/concat/v30v31a&lt;br /&gt;
mount /dev/concat/v30v31a /mnt/data1/69.55.228.218-col01441-DIR&lt;br /&gt;
mount_devfs devfs /mnt/data1/69.55.228.218-col01441-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.228.218-col01441-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.228.218-col01441-DIR nuie.solaris.mu 69.55.228.218 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: nuie.solaris.mu&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are more than just informative when running quad/safe’s, the echo lines MUST be present for certain tools to work properly. So it’s important that any updates to the hostname also be updated on the 2 echo lines. For example, if you try to startjail a jail with a hostname which is on the jail line but not the echo lines, the command will return with host not found.&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD 7.x+ notes ===&lt;br /&gt;
&lt;br /&gt;
Starting with the release of FreeBSD 7.x, we are doing jail startups in a slightly different way. First, thereis only 1 file: &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/quad1&amp;lt;/tt&amp;gt;&lt;br /&gt;
There are no other quads or corresponding safe files. The reason for this is twofold, 1. We can pass –C to fsck which will tell is to skip the fsck if the fs is clean (no more need for safe files), 2. We have a new startup script which can be launched multiple times, running in parallel to start jails, where quad1 is the master jail file. &lt;br /&gt;
Quad1 could still be run as a shell script, but it would take a very long time for it to run completely so it’s not advisable; or you should break it down into smaller chunks (like quad1, quad2, quad3, etc)&lt;br /&gt;
&lt;br /&gt;
Here is a snip of (a 7.x version) quad1 from jail2:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;## begin ##: projects.tw.com&#039;&lt;br /&gt;
mdconfig -a -t vnode -f /mnt/data1/69.55.230.46-col01213 -u 50&lt;br /&gt;
fsck -Cy /dev/md50c&lt;br /&gt;
mount /dev/md50c /mnt/data1/69.55.230.46-col01213-DIR&lt;br /&gt;
mount -t devfs devfs /mnt/data1/69.55.230.46-col01213-DIR/dev&lt;br /&gt;
devfs -m /mnt/data1/69.55.230.46-col01213-DIR/dev rule -s 3 applyset&lt;br /&gt;
jail /mnt/data1/69.55.230.46-col01213-DIR projects.tw.com 69.55.230.46 /bin/sh /etc/rc&lt;br /&gt;
echo &#039;## end ##: projects.tw.com&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelled jails are no longer commented out and stored in quad1, rather they’re moved to &amp;lt;tt&amp;gt;/usr/local/jail/rc.d/deprecated&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
To start these jails, start the 4 ssh sessions as you would for a normal crash and then instead of running quad1-4, instead run startalljails in each window. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== Problems with the quad/safe files ==&lt;br /&gt;
&lt;br /&gt;
When you run the quad/safe files, there are two problems that can occur - either a particular system will hang during initialization, OR a system will spit out output to the screen, impeding your ability to do anything.  Or both.&lt;br /&gt;
&lt;br /&gt;
First off, when you start a jail, you see output like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Skipping disk checks ...&lt;br /&gt;
adjkerntz[25285]: sysctl(put_wallclock): Operation not permitted&lt;br /&gt;
Doing initial network setup:.&lt;br /&gt;
ifconfig: ioctl (SIOCDIFADDR): permission denied&lt;br /&gt;
lo0: flags=8049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST&amp;gt; mtu 16384&lt;br /&gt;
Additional routing options: TCP keepalive=YESsysctl:&lt;br /&gt;
net.inet.tcp.always_keepalive: Operation not permitted.&lt;br /&gt;
Routing daemons:.&lt;br /&gt;
Additional daemons: syslogd.&lt;br /&gt;
Doing additional network setup:.&lt;br /&gt;
Starting final network daemons:.&lt;br /&gt;
ELF ldconfig path: /usr/lib /usr/lib/compat /usr/X11R6/lib /usr/local/lib&lt;br /&gt;
a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout /usr/X11R6/lib/aout&lt;br /&gt;
Starting standard daemons: inetd cron sshd sendmail sendmail-clientmqueue.&lt;br /&gt;
Initial rc.i386 initialization:.&lt;br /&gt;
Configuring syscons: blanktime.&lt;br /&gt;
Additional ABI support:.&lt;br /&gt;
Local package initialization:.&lt;br /&gt;
Additional TCP options:.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s look at this line, near the end:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization:.&lt;br /&gt;
&lt;br /&gt;
This is where a list of daemons that are set to start at boot time willshow up.  You might see something like:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache sendmail sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
Or something like this:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: postgres postfix apache&lt;br /&gt;
&lt;br /&gt;
The problem is that many systems (about 4-5 per machine) will hang on that line.  Basically it will get to some of the way through the total daemons to be started:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache&lt;br /&gt;
&lt;br /&gt;
and will just sit there.  Forever.&lt;br /&gt;
&lt;br /&gt;
Fortunately, pressing ctrl-c will break out of it.  Not only will it break out of it, but it will also continue on that same line and start the other daemons:&lt;br /&gt;
&lt;br /&gt;
 Local package initialization: mysqld apache ^c sendmail-clientmqueue&lt;br /&gt;
&lt;br /&gt;
and then continue on to finish the startup, and then move to the next system to be started.&lt;br /&gt;
&lt;br /&gt;
So what does this mean?  It means that if a machine crashes, and you start four screen-windows to run four quads or four safes, you need to periodically cycle between them and see if any systems are stuck at that point, causing their quad/safe file to hang.  A good rule of thumb is, if you see a system at that point in the startup, give it another 100 seconds - if it is still at the exact same spot, hit ctrl-c. Its also a good idea to go back into the quad file (just before the first command in the jail startup block) and note that this jail tends to need a control-c or more time as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;### NOTE ### slow sendmail&#039;&lt;br /&gt;
echo &#039;### NOTE ###: ^C @ Starting sendmail.&#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NEVER&#039;&#039;&#039; hit ctrl-c repeatedly if you don&#039;t get an immediate response - that will cause the following jail’s startup commands to be aborted.&lt;br /&gt;
&lt;br /&gt;
A second problem that can occur is that a jail - maybe the first one in that particular quad/safe, maybe the last one, or maybe one in the middle, will start spitting out status or error messages from one of its init scripts.  This is not a problem - basically, hit enter a few times and see if you get a prompt - if you do get a prompt, that means that the quad/safe script has already completed.  Therefore it is safe to log out (and log out of the user that you su&#039;d from) and then log back in (if necessary).&lt;br /&gt;
&lt;br /&gt;
The tricky thing is, if a system in the middle starts flooding with messages, and you hit enter a few times and don&#039;t get a prompt.  Are you not getting a prompt because some subsequent system is hanging at the initialization, as we discussede above ?  Or are you not getting a prompt because that quad file is currently running an fsck ?  Usually you can tell by scrolling back in screen’s history to see what it was doing before you started getting the messages.&lt;br /&gt;
&lt;br /&gt;
If you don’t get clues from history, you have to use your judgement - instead of giving it 100 seconds to respond, perhaps give it 2-3 mins ... if you still get no response (no prompt) when you hit enter, hit ctrl-c.  However, be aware that you might still be hitting ctrl-c in the middle of an fsck.  This means you will get an error like &amp;quot;filesystem still marked dirty&amp;quot; and then the vnconfig for it will fail and so will the jail command, and the next system in the quad file will then start starting up.&lt;br /&gt;
&lt;br /&gt;
If this happens, just wait until the end of all the quad files have finished, and start that system manually.&lt;br /&gt;
&lt;br /&gt;
If things really get weird, like a screen flooded with errors, and you can&#039;t get a prompt, and ctrl-c does nothing, then you need to just eventually (give it ten mins or so) just kill that window with ctrl-p, then k, and then log in again and manually check which systems are now running and which aren&#039;t, and manually start up any that are not.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t EVER risk running a particular quad/safe file a second time.&lt;br /&gt;
If the quad/safe script gets executed twice, reboot the machine immediately.&lt;br /&gt;
&lt;br /&gt;
So, for all the above reasons, anytime a machine crashes and you run all the quads or all the safes, &#039;&#039;&#039;always&#039;&#039;&#039; check every jail afterwards to make sure it is running - even if you have no hangs or complications at all.&lt;br /&gt;
Run this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailpsall|jailpsall]]&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Note: [[#postboot|postboot]] also populates ipfw counts, so it &#039;&#039;&#039;should not be run multiple times&#039;&#039;&#039;,  use &amp;lt;tt&amp;gt;jailpsall&amp;lt;/tt&amp;gt; for subsequent extensive ps’ing&lt;br /&gt;
&lt;br /&gt;
And make sure they all show as running.  If one does not show as running, check its /etc/rc.conf file first to see if maybe it is using a different hostname first before starting it manually.&lt;br /&gt;
&lt;br /&gt;
One thing we have implemented to alleviate these startup hangs and noisy jails, is to put jail start blocks that are slow or hangy at the bottom of the safe/quad file. Further, for each bad jail we note in each quad/safe just before the start block something like:&lt;br /&gt;
&lt;br /&gt;
 echo ‘### NOTE ### ^C @ Local package initialization: pgsqlmesg: /dev/ttyp1: Operation not permitted’&lt;br /&gt;
&lt;br /&gt;
That way we’ll be prepared to ^C when we see that message appear during the quad/safe startup process. If you observe a new, undocumented hang, &#039;&#039;&#039;after&#039;&#039;&#039; the quad/safe has finished, place a line similar to the above in the quad file, move the jail start block to the end of the file, then run [[#buildsafe|buildsafe]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (FreeBSD) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all jails back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log. If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. Note, if you see messages about swap space exhausted, the server is obviously out of memory, however it may recover briefly enough for you to get a jtop in to see who&#039;s lauched a ton of procs (most likely) and then issue a quick jailkill to get it back under control.&lt;br /&gt;
&lt;br /&gt;
If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card (as root, using the standard root pass) and issue &lt;br /&gt;
 racadm serveraction hardreset&lt;br /&gt;
then you will need someone at the data center power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console:&lt;br /&gt;
 tip jailX&lt;br /&gt;
immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTE: on some older FreeBSD systems, there will be no output to the video (KVM) console as it boots up. The console output is redirected to the serial port ... so if a jail crashes, and you attach a kvm, the output during the bootup procedure will not be shown on the screen. However, when the bootup is done, you will get a login prompt on the screen and will be able to log in as normal.  &amp;lt;tt&amp;gt;/boot/loader.conf&amp;lt;/tt&amp;gt; is where serial console redirect output lives, so comment that if you want to catch output on kvm.&lt;br /&gt;
On newer systems it sends most output to both locations. &lt;br /&gt;
&lt;br /&gt;
=== Assess the heath of the server ===&lt;br /&gt;
Once the server boots up fully, you should be able to ssh in. Look around- make sure all the mounts are there and reporting the correct size/usage (i.e. /mnt/data1 /mnt/data2 /mnt/data3 - look in /etc/fstab to determine which mount points should be there), check to see if RAID mirrors are healthy. See [[RAID_Cards#Common_CLI_commands_.28megacli.29|megacli]], [[#aaccheck|aaccheck]]&lt;br /&gt;
&lt;br /&gt;
Before you start the jails, you need to run [[#preboot|preboot]]. This will do some assurance checks to make sure things are prepped to start the jails. Any issues that come out of preboot need to be addressed before starting jails.&lt;br /&gt;
&lt;br /&gt;
=== Start jails ===&lt;br /&gt;
[[#Starting_jails:_Quad.2FSafe_Files|More on starting jails]]&lt;br /&gt;
Customer jails (the VPSs) do not start up automatically at boot time. When a FreeBSD machines boots up, it boots up, and does nothing else. To start jails, we put the commands to start each jail into a shell script(s) and run the script(s). Jail startup is something that needs to be actively monitored, which is why we don’t just run the script automatically. &lt;br /&gt;
&lt;br /&gt;
In order to start jails, we run the quad files: quad1 quad2 quad3 and quad4 (on new systems there is only quad1). If the machine was cleanly rebooted- which wouldn&#039;t be the case if this was a crash, you may run the safe files (safe1 safe2 safe3 safe4) in lieu of quads. &lt;br /&gt;
&lt;br /&gt;
Open up 4 logins to the server (use the windows in [[Screen#Screen_Organization|a9]])&lt;br /&gt;
In each of the 4 windows you will:&lt;br /&gt;
&lt;br /&gt;
If there is a [[#startalljails|startalljails]] script (and only quad1), run that command in each of the 4 windows. It will parse through the quad1 file and start each jail. Follow the instructions [[#Problems_with_the_quad.2Fsafe_files|here]] for monitoring startup. Note that you can be a little more lenient with jails that take awhile to start- startalljails will work around the slow jails and start the rest. As long as there aren&#039;t 4 jails which are &amp;quot;hung&amp;quot; during startup, the rest will get started eventually.&lt;br /&gt;
	-or-&lt;br /&gt;
If there is no startalljails script, there will be multiple quad files. In each of the 4 windows, start each of the quads. i.e. start quad1 in window1, quad2 in window2 and so on. DO NOT start any quad twice. It will crash the server. If you accidentally do this, just jailkill all the jails which are in the quad and run the quad again. Follow the instructions here for monitoring quad startup.&lt;br /&gt;
&lt;br /&gt;
Note the time the last jail boots- this is what you will enter in the crash log.&lt;br /&gt;
&lt;br /&gt;
Save the crash log.&lt;br /&gt;
&lt;br /&gt;
=== Check to make sure all jails have started ===&lt;br /&gt;
There&#039;s a simple script which will make sure all jails have started, and enter the ipfw counter rules: [[#postboot|postboot]] &lt;br /&gt;
Run postboot, which will do a jailps on each jail it finds (excluding commented out jails) in the quad file(s). We&#039;re looking for 2 things:&lt;br /&gt;
# systems spawning out of control or too many procs&lt;br /&gt;
# jails which haven&#039;t started&lt;br /&gt;
On 7.x and newer systems it will print out the problems (which jails haven&#039;t started) at the conclusion of postboot. &lt;br /&gt;
On older systems you will need to watch closely to see if/when there&#039;s a problem, namely:&lt;br /&gt;
 &lt;br /&gt;
 [hostname] doesnt exist on this server&lt;br /&gt;
&lt;br /&gt;
When you get this message, it means one of 2 things:&lt;br /&gt;
1. the jail really didn&#039;t start:&lt;br /&gt;
When a jail doesn&#039;t start it usually boils down to a problem in the quad file. Perhaps the path name is wrong (data1 vs data2) or the name of the vn/mdfile is wrong. Once this is corrected, you will need to run the commands from the quad file manually, or you may use &amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. the customer has changed their hostname (and not told us) so their jail &#039;&#039;is&#039;&#039; running, just under a different hostname:&lt;br /&gt;
On systems with jls, this is easy to rectify. First, get the customer info: &amp;lt;tt&amp;gt;g &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Then look for the customer in jls: &amp;lt;tt&amp;gt;jls | grep &amp;lt;col0XXXX&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
From there you will see their new hostname- you should update that hostname in the quad file: don&#039;t forget to edit it on the &amp;lt;tt&amp;gt;## begin ##&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;## end ##&amp;lt;/tt&amp;gt; lines, and in mgmt. &lt;br /&gt;
On older systems without jls, this will be harder, you will need to look further to see their hostname- perhaps its in their /etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once all jails are started, do some spot checks- try to ssh or browse to some customers, just to make sure things are really ok.&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 7.x/8.x jail ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (md) ==&lt;br /&gt;
&lt;br /&gt;
NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x&lt;br /&gt;
NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
(parts to change/customize are &amp;lt;tt&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;red&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from &amp;lt;tt&amp;gt;js&amp;lt;/tt&amp;gt;. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;jailkill &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &amp;lt;tt&amp;gt;g &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6a. When there&#039;s enough room to place new system on an alternate, or the same drive:&lt;br /&gt;
USE CAUTION not to overwrite (touch, mdconfig) existing md!!&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md97&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
md-unconfig old system:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
archive old mdfile. &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/old-col00241-mdfile-noarchive-20091211&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (vq1) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt; &lt;br /&gt;
(run &amp;lt;tt&amp;gt;df&amp;lt;/tt&amp;gt; to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, &amp;lt;tt&amp;gt;du&amp;lt;/tt&amp;gt; the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure and remove old mdfile&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mdconfig -d -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
rm /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.237.26-col00241&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(there should now be enough space to recreate your bigger system. If not, run sync a couple times)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create the new system (ok to reuse old mdfile and md#):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;touch /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mdconfig -a -t vnode -s &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;g -f /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334&amp;lt;/span&amp;gt; -u &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
mount /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to /dev/md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
umount nfs:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbu&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If md# changed (or mount point), edit quad (&amp;lt;tt&amp;gt;vq1&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new md number (md&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
8. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
9. Optional: archive old mdfile&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;br&amp;gt;&lt;br /&gt;
gzip -c old-col01588-mdfile-noarchive-20120329 &amp;gt; /deprecated/old-col01588-mdfile-noarchive-20120329.gz&amp;lt;br&amp;gt;&lt;br /&gt;
mbu&amp;lt;br&amp;gt;&lt;br /&gt;
rm  old-col01588-mdfile-noarchive-20120329&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding disk to a 6.x jail (gvinum/gconcat) ==&lt;br /&gt;
or&lt;br /&gt;
== Moving customer to a different drive (gvinum/gconcat) ==&lt;br /&gt;
&lt;br /&gt;
(parts to change are &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;highlighted&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Figure out the space avail from [[#js|js]]. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. make a mental note of how much space they&#039;re currently using&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &amp;lt;tt&amp;gt;[[#stopjail|stopjail]] &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &amp;lt;tt&amp;gt;[[#g|g]] &amp;lt;customerID&amp;gt;&amp;lt;/tt&amp;gt; to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a. When there&#039;s enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it&#039;s in use by the system in question - gvinum volumes):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Configure the new device:&amp;lt;br&amp;gt;&lt;br /&gt;
A. for a 2G system (single gvinum volume):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;bsdlabel -r -w /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
-or- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. for a &amp;gt;2G system (create a gconcat volume):&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other valid gconcat examples:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; OR &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
A. &amp;lt;tt&amp;gt;mount /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
-or-&amp;lt;br&amp;gt;&lt;br /&gt;
B. &amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
do the dump and pipe directly to restore:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f - /dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; | restore -r -f - &amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/gvinum/v&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;123&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;) , run &amp;lt;tt&amp;gt;buildsafe&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5b. When there&#039;s not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer&#039;s space (i.e. if you want/need to reuse the existing gvinum volumes and add on more):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
mount backup nfs mounts:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mbm&amp;lt;/tt&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
(run df to confirm backup mounts are mounted)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dump the customer to backup2 or backup1&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;dump -0a -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; /dev/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gconcat/v106-v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
(when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
unconfigure the old gconcat volume&amp;lt;br&amp;gt;&lt;br /&gt;
list member gvinum volumes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat list &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Output will resemble:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Geom name: v106v107&lt;br /&gt;
State: UP&lt;br /&gt;
Status: Total=2, Online=2&lt;br /&gt;
Type: AUTOMATIC&lt;br /&gt;
ID: 3530663882&lt;br /&gt;
Providers:&lt;br /&gt;
1. Name: concat/v106v107&lt;br /&gt;
   Mediasize: 4294966272 (4.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e2&lt;br /&gt;
Consumers:&lt;br /&gt;
1. Name: gvinum/sd/v106.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 0&lt;br /&gt;
   End: 2147483136&lt;br /&gt;
2. Name: gvinum/sd/v107.p0.s0&lt;br /&gt;
   Mediasize: 2147483648 (2.0G)&lt;br /&gt;
   Sectorsize: 512&lt;br /&gt;
   Mode: r1w1e3&lt;br /&gt;
   Start: 2147483136&lt;br /&gt;
   End: 4294966272&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
stop volume and clear members&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat stop &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
gconcat clear &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
create new device- and its ok to reuse old/former members&amp;lt;br&amp;gt;&lt;br /&gt;
try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;gconcat label &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
bsdlabel -r -w /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
newfs /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) AND use that directory in the mount and cd commands below:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mv /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
confirm you are mounted to the device (/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;) and space is correct:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;mount /dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;cd /mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3/69.55.234.66-col01334-DIR&amp;lt;/span&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
df .&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
do the restore from the dumpfile on the backup server:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;restore -r -f /backup&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;4/col00241.20120329.noarchive.dump&amp;lt;/span&amp;gt; .&amp;lt;br&amp;gt;&lt;br /&gt;
rm restoresymtable&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
edit quad (&amp;lt;tt&amp;gt;vq&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;) to point to new (/mnt/data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;) location AND new volume (&amp;lt;tt&amp;gt;/dev/concat/&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;v82-v84v106v107&amp;lt;/span&amp;gt;a&amp;lt;/tt&amp;gt;), run buildsafe&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
restart the jail:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;tt&amp;gt;startjail &amp;lt;hostname&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TODO: clean up/clear old gvin/gconcat vol&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. update disk (and dir if applicable) in mgmt screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
7. update backup list AND move backups, if applicatble&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;mvbackups &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;69.55.237.26-col00241&amp;lt;/span&amp;gt; jail&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt; data&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs&lt;br /&gt;
bsdlabel -e /dev/concat/v82-v84&lt;br /&gt;
&lt;br /&gt;
To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes:&lt;br /&gt;
10G: 4194304 * 5 – 5 = 20971515&lt;br /&gt;
8G: 4194304 * 4 – 4 = 16777212&lt;br /&gt;
6G: 4194304 * 3 – 3 = 12582909&lt;br /&gt;
4G: 4194304 * 2 – 2 = 8388606&lt;br /&gt;
&lt;br /&gt;
To figure out the new size of the a partition, subtract 16 from the c partition:&lt;br /&gt;
10G: 20971515 – 16 = 20971499&lt;br /&gt;
8G: 16777212 – 16 = 16777196&lt;br /&gt;
6G: 12582909 – 16 = 12582893&lt;br /&gt;
4G: 8388606 – 16  = 8388590&lt;br /&gt;
&lt;br /&gt;
Orig:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a:  8388590       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c:  8388606        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
New:&lt;br /&gt;
8 partitions:&lt;br /&gt;
#        size   offset    fstype   [fsize bsize bps/cpg]&lt;br /&gt;
  a: 12582893       16    4.2BSD     2048 16384 28552&lt;br /&gt;
  c: 12582909        0    unused        0     0         # &amp;quot;raw&amp;quot; part, don&#039;t edit&lt;br /&gt;
&lt;br /&gt;
sync; sync&lt;br /&gt;
&lt;br /&gt;
growfs /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
sync&lt;br /&gt;
&lt;br /&gt;
fsck –fy /dev/concat/v82-v84a&lt;br /&gt;
&lt;br /&gt;
(keep running fsck’s till NO errors)&lt;br /&gt;
&lt;br /&gt;
== Problems un-mounting - and with mount_null’s ==&lt;br /&gt;
&lt;br /&gt;
If you cannot unmount a filesystem, beacuse it says the filesystem is busy, it is because of three things:&lt;br /&gt;
&lt;br /&gt;
a) the jail is still running&lt;br /&gt;
&lt;br /&gt;
b) you are actually in that directory, even though the jail is stopped&lt;br /&gt;
&lt;br /&gt;
c) there are still dev, null_mount or linprocfs mount points mounted inside that directory.&lt;br /&gt;
&lt;br /&gt;
d) when trying to umount null_mounts that are really long and you get an error like “No such file or directory”, it’s an OS bug where the dir is truncated. No known fix&lt;br /&gt;
&lt;br /&gt;
e) there are still files open somewhere inside the dir. Use &amp;lt;tt&amp;gt;fstat | grep &amp;lt;cid&amp;gt;&amp;lt;/tt&amp;gt; to find the process that has files open&lt;br /&gt;
&lt;br /&gt;
f) Starting with 6.x, the jail mechanism does a poor job of keeping track of processes running in a jail and if it thinks there are still procs running, it will refuse to umount the disk. If this is happening you should see a low number in the #REF column when you run jls. In this case you &#039;&#039;can&#039;&#039; safely &amp;lt;tt&amp;gt;umount –f&amp;lt;/tt&amp;gt; the mount. &lt;br /&gt;
&lt;br /&gt;
Please note -if you forcibly unmount a (4.x) filesystem that has null_mounts&lt;br /&gt;
still mounted in it, the system &#039;&#039;&#039;will crash&#039;&#039;&#039; within 10-15 mins.&lt;br /&gt;
&lt;br /&gt;
== Misc jail Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space on jail2, jail8, jail9, a couple jails on jail17, jail4, jail12 and jail18.&lt;br /&gt;
Even though the vn file shows 4G size, it doesn’t actually occupy that amount of space on the disk. So be careful not to fill up drives where we’re overselling – use oversellcheck to confirm you’re not oversold by more than 10G.&lt;br /&gt;
There are other truncated jails, they are generally noted in a the file on the root system: /root/truncated&lt;br /&gt;
&lt;br /&gt;
The act of moving a truncated vn to another system un-does the truncating- the truncated vn is filled with 0’s and it occupies physical disk space for which it’s configured. So, you should use dumpremote to preserve the truncation.&lt;br /&gt;
&lt;br /&gt;
= FreeBSD VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
These files are located in /usr/local/jail/rc.d and /usr/local/jail/bin&lt;br /&gt;
&lt;br /&gt;
== jailmake ==&lt;br /&gt;
&lt;br /&gt;
Applies to 7.x+ &lt;br /&gt;
On older systems syntax differs, run jailmake once to see.&lt;br /&gt;
&lt;br /&gt;
Note: this procedure differs on mx2 which is 7.x but still uses gvinum&lt;br /&gt;
&lt;br /&gt;
#	run js to figure out which md’s are in use, which disk has enough space, IP to put it on&lt;br /&gt;
#	use col00xxx for both hostnames if they don’t give you a hostname&lt;br /&gt;
#	copy over dir, ip and password to pending customer screen&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;Usage: jailmake IP[,IP] CID disk[1|2|3] md# hostname shorthost ipfw# email [size in GB]&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ex: &lt;br /&gt;
&lt;br /&gt;
 Jail2# jailmake 69.55.234.66 col01334 3 97 vps.bsd.it vps 1334 fb@bsd.it&lt;br /&gt;
&lt;br /&gt;
== jailps ==&lt;br /&gt;
 jailps [hostname]&lt;br /&gt;
DEPRECATED FOR jps: displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname of the jail you wish to query. If you don’t &lt;br /&gt;
supply an argument, all processes on the machine are listed and grouped by jail. &lt;br /&gt;
&lt;br /&gt;
== jps ==&lt;br /&gt;
 jps [hostname]&lt;br /&gt;
displays processes belonging to/running inside a jail. The command&lt;br /&gt;
takes one (optional) argument – the hostname or ID of the jail you wish to query. &lt;br /&gt;
&lt;br /&gt;
== jailkill ==&lt;br /&gt;
 jailkill &amp;lt;hostname&amp;gt;&lt;br /&gt;
stops all process running in a jail.&lt;br /&gt;
&lt;br /&gt;
You can also run:&lt;br /&gt;
 jailkill &amp;lt;JID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== problems ===&lt;br /&gt;
Occasionally you will hit an issue where jail will not kill off:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailkill www.domain.com&lt;br /&gt;
www.domain.com .. killed: none&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
Because no processes are running under that hostname.  You cannot use jailps.pl either:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9# jailps www.domain.com&lt;br /&gt;
www.domain.com doesn’t exist on this server&lt;br /&gt;
jail9#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The reasons for this are usually:&lt;br /&gt;
* the jail is no longer running&lt;br /&gt;
&lt;br /&gt;
* the jail&#039;s hostname has changed&lt;br /&gt;
In this case, &lt;br /&gt;
&lt;br /&gt;
&amp;gt;=6.x: run a &amp;lt;tt&amp;gt;jls|grep &amp;lt;jail&#039;s IP&amp;gt;&amp;lt;/tt&amp;gt; to find the correct hostname, then update the quad file, then kill the jail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;6.x: the first step is to cat their /etc/rc.conf file to see if you can tell what they set the new hostname to.  This very often works.  For example:&lt;br /&gt;
&lt;br /&gt;
 cat /mnt/data2/198.78.65.136-col00261-DIR/etc/rc.conf&lt;br /&gt;
&lt;br /&gt;
But maybe they set the hostname with the hostname command, and the original hostname is still in /etc/rc.conf.&lt;br /&gt;
&lt;br /&gt;
The welcome email clearly states that they should tell us if they change their hostname, so there is no problem in just emailing them and asking them what they set the new hostname to.&lt;br /&gt;
&lt;br /&gt;
Once you know the new hostname OR if a customer simply emails to inform you that they have set the hostname to something different, you need to edit the quad and safe files that their system is in to input the new hostname.&lt;br /&gt;
&lt;br /&gt;
However, if push comes to shove and you cannot find out the hostname from them or from their system, then you need to start doing some detective work.&lt;br /&gt;
&lt;br /&gt;
The easiest thing to do is run jailps looking for a hostname similar to their original hostname. Or you could get into the /bin/sh shell by running:&lt;br /&gt;
&lt;br /&gt;
 /bin/sh&lt;br /&gt;
&lt;br /&gt;
and then looking at every hostname of every process:&lt;br /&gt;
&lt;br /&gt;
 for f in `ls /proc` ; do cat /proc/$f/status ; done&lt;br /&gt;
&lt;br /&gt;
and scanning for a hostname that is either similar to their original hostname, or that you don&#039;t see in any of the quad safe files.&lt;br /&gt;
&lt;br /&gt;
This is very brute force though, and it is possible that catting every file in /proc is dangerous - I don&#039;t recommend it.  A better thing would be to identify any processes that you know belong to this system – perhaps the reason you are trying to find this system is because they are running something bad - and just catting the status from only that PID.&lt;br /&gt;
&lt;br /&gt;
Somewhere there’s a jail where there may be 2 systems named www.  Look at /etc/rc.conf and make sure they’re both really www. If they are, jailkill www, jailps www to make sure not running.  Then immediately restart the other one, as the fqdn (as found from a rev nslookup)&lt;br /&gt;
&lt;br /&gt;
* on &amp;gt;=6.x the hostname may not yet be hashed:&lt;br /&gt;
&amp;lt;pre&amp;gt;jail9 /# jls&lt;br /&gt;
 JID Hostname                    Path                                  IP Address(es)&lt;br /&gt;
   1 bitnet.dgate.org            /mnt/data1/69.55.232.50-col02094-DIR  69.55.232.50&lt;br /&gt;
   2 ns3.hctc.net                /mnt/data1/69.55.234.52-col01925-DIR  69.55.234.52&lt;br /&gt;
   3 bsd1                        /mnt/data1/69.55.232.44-col00155-DIR  69.55.232.44&lt;br /&gt;
   4 let2.bbag.org               /mnt/data1/69.55.230.92-col00202-DIR  69.55.230.92&lt;br /&gt;
   5 post.org                    /mnt/data2/69.55.232.51-col02095-DIR  69.55.232.51 ...&lt;br /&gt;
   6 ns2                         /mnt/data1/69.55.232.47-col01506-DIR  69.55.232.47 ...&lt;br /&gt;
   7 arlen.server.net            /mnt/data1/69.55.232.52-col01171-DIR  69.55.232.52&lt;br /&gt;
   8 deskfood.com                /mnt/data1/69.55.232.71-col00419-DIR  69.55.232.71&lt;br /&gt;
   9 mirage.confluentforms.com   /mnt/data1/69.55.232.54-col02105-DIR  69.55.232.54 ...&lt;br /&gt;
  10 beachmember.com             /mnt/data1/69.55.232.59-col02107-DIR  69.55.232.59&lt;br /&gt;
  11 www.agottem.com             /mnt/data1/69.55.232.60-col02109-DIR  69.55.232.60&lt;br /&gt;
  12 sdhobbit.myglance.org       /mnt/data1/69.55.236.82-col01708-DIR  69.55.236.82&lt;br /&gt;
  13 ns1.jnielsen.net            /mnt/data1/69.55.234.48-col00204-DIR  69.55.234.48 ...&lt;br /&gt;
  14 ymt.rollingegg.net          /mnt/data2/69.55.236.71-col01678-DIR  69.55.236.71&lt;br /&gt;
  15 verse.unixlore.net          /mnt/data1/69.55.232.58-col02131-DIR  69.55.232.58&lt;br /&gt;
  16 smcc-mail.org               /mnt/data2/69.55.232.68-col02144-DIR  69.55.232.68&lt;br /&gt;
  17 kasoutsuki.w4jdh.net        /mnt/data2/69.55.232.46-col02147-DIR  69.55.232.46&lt;br /&gt;
  18 dili.thium.net              /mnt/data2/69.55.232.80-col01901-DIR  69.55.232.80&lt;br /&gt;
  20 www.tekmarsis.com           /mnt/data2/69.55.232.66-col02155-DIR  69.55.232.66&lt;br /&gt;
  21 vps.yoxel.net               /mnt/data2/69.55.236.67-col01673-DIR  69.55.236.67&lt;br /&gt;
  22 smitty.twitalertz.com       /mnt/data2/69.55.232.84-col02153-DIR  69.55.232.84&lt;br /&gt;
  23 deliver4.klatha.com         /mnt/data2/69.55.232.67-col02160-DIR  69.55.232.67&lt;br /&gt;
  24 nideffer.com                /mnt/data2/69.55.232.65-col00412-DIR  69.55.232.65&lt;br /&gt;
  25 usa.hanyuan.com             /mnt/data2/69.55.232.57-col02163-DIR  69.55.232.57&lt;br /&gt;
  26 daifuku.ppbh.com            /mnt/data2/69.55.236.91-col01720-DIR  69.55.236.91&lt;br /&gt;
  27 collins.greencape.net       /mnt/data2/69.55.232.83-col01294-DIR  69.55.232.83&lt;br /&gt;
  28 ragebox.com                 /mnt/data2/69.55.230.104-col01278-DIR 69.55.230.104&lt;br /&gt;
  29 outside.mt.net              /mnt/data2/69.55.232.72-col02166-DIR  69.55.232.72&lt;br /&gt;
  30 vps.payneful.ca             /mnt/data2/69.55.234.98-col01999-DIR  69.55.234.98&lt;br /&gt;
  31 higgins                     /mnt/data2/69.55.232.87-col02165-DIR  69.55.232.87 ...&lt;br /&gt;
  32 ozymandius                  /mnt/data2/69.55.228.96-col01233-DIR  69.55.228.96&lt;br /&gt;
  33 trusted.realtors.org        /mnt/data2/69.55.238.72-col02170-DIR  69.55.238.72&lt;br /&gt;
  34 jc1.flanderous.com          /mnt/data2/69.55.239.22-col01504-DIR  69.55.239.22&lt;br /&gt;
  36 guppylog.com                /mnt/data2/69.55.238.73-col00036-DIR  69.55.238.73&lt;br /&gt;
  40 haliohost.com               /mnt/data2/69.55.234.41-col01916-DIR  69.55.234.41 ...&lt;br /&gt;
  41 satyr.jorge.cc              /mnt/data1/69.55.232.70-col01963-DIR  69.55.232.70&lt;br /&gt;
jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
ERROR: jail_: jail &amp;quot;satyr,jorge,cc&amp;quot; not found&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how it&#039;s saying &amp;lt;tt&amp;gt;satyr,jorge,cc&amp;lt;/tt&amp;gt; is not found, and not &amp;lt;tt&amp;gt;satyr.jorge.cc&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The jail subsystem tracks things using comma-delimited hostnames. That is created every few hours:&lt;br /&gt;
&lt;br /&gt;
 jail9 /# crontab -l&lt;br /&gt;
 0 0,6,12,18 * * * /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
So if we run this manually:&lt;br /&gt;
 jail9 /# /usr/local/jail/bin/sync_jail_names&lt;br /&gt;
&lt;br /&gt;
Then kill the jail:&lt;br /&gt;
 jail9 /# jailkill satyr.jorge.cc&lt;br /&gt;
 successfully killed: satyr,jorge,cc&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It worked.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you ever see this when trying to kill a jail:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# jailkill e-scribe.com&lt;br /&gt;
killing JID: 6 hostname: e-scribe.com&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
3 procs running&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;[[#jailkill|jailkill]]&amp;lt;/tt&amp;gt; probably got lost trying to kill off the jail. Just ctrl-c the jailkill process, then run a jailps on the hostname, and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; any process which is still running. Keep running jailps and &amp;lt;tt&amp;gt;kill -9&amp;lt;/tt&amp;gt; till all processes are gone.&lt;br /&gt;
&lt;br /&gt;
== jailpsall ==&lt;br /&gt;
 jailpsall&lt;br /&gt;
will run a jailps on all jails configured in the quad files (this is different from&lt;br /&gt;
jailps with no arguments as it won’t help you find a “hidden” system)&lt;br /&gt;
&lt;br /&gt;
== jailpsw ==&lt;br /&gt;
 jailpsw&lt;br /&gt;
will run a jailps with an extra -w to provide wider output&lt;br /&gt;
&lt;br /&gt;
== jt (&amp;gt;=7.x) ==&lt;br /&gt;
 jt&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;gt;=7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
a wrapper for top displaying processes on the server and which jail owns them. Constantly updates, like top. &lt;br /&gt;
&lt;br /&gt;
== jtop (&amp;lt;7.x) ==&lt;br /&gt;
 jtop&lt;br /&gt;
displays the top 20 processes on the server (the top 20 processes from top) and &lt;br /&gt;
which jail owns them. This is very helpful for determining who is doing what when&lt;br /&gt;
the server is very busy.&lt;br /&gt;
&lt;br /&gt;
== stopjail ==&lt;br /&gt;
 stopjail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will jailkill, umount and vnconfig –u a jail. If passed an optional 2nd&lt;br /&gt;
argument, it will not exit before umounting and un-vnconfig’ing in the event&lt;br /&gt;
jailkill returns no processes killed. This is useful if you just want to umount&lt;br /&gt;
and vnconfig –u a jail you’ve already killed. It is intelligent in that it won’t &lt;br /&gt;
try to umount or vnconfig –u if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== startjail ==&lt;br /&gt;
 startjail &amp;lt;hostname&amp;gt;&lt;br /&gt;
this will start vnconfig, mount (including linprocfs and null-mounts), and start a jail.&lt;br /&gt;
Essentially, it reads the jail’s relevant block from the right quad file and executes it.&lt;br /&gt;
It is intelligent in that it won’t try to mount or vnconfig if it’s not necessary.&lt;br /&gt;
&lt;br /&gt;
== jpid ==&lt;br /&gt;
 jpid &amp;lt;pid&amp;gt;&lt;br /&gt;
displays information about a process – including which jail owns it.&lt;br /&gt;
It’s the equivalent of running cat /proc/&amp;lt;pid&amp;gt;/status&lt;br /&gt;
&lt;br /&gt;
== canceljail ==&lt;br /&gt;
 canceljail &amp;lt;hostname&amp;gt; [1]&lt;br /&gt;
this will stop a jail (the equivalent of stopjail), check for backups (offer to remove them &lt;br /&gt;
from the backup server and the backup.config), rename the vnfile, remove the dir, and &lt;br /&gt;
edit quad/safe. If passed an optional 2nd argument, it will not exit upon failing to kill&lt;br /&gt;
and processes owned by the jail. This is useful if you just want to cancel a jail which &lt;br /&gt;
is already stopped.&lt;br /&gt;
&lt;br /&gt;
== jls ==&lt;br /&gt;
 jls [-v]&lt;br /&gt;
Lists all jails running:&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF IP Address      Hostname                     Path&lt;br /&gt;
 101  135 69.55.224.148   mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#REF is the number of references or procs(?) running&lt;br /&gt;
&lt;br /&gt;
Running with -v will give you all IPs assigned to each jail (7.2 up)&lt;br /&gt;
&amp;lt;pre&amp;gt;JID #REF Hostname                     Path                                  IP Address(es)&lt;br /&gt;
 101  139 mail.pc9.org                 /mnt/data2/69.55.224.148-col01034-DIR 69.55.224.14869.55.234.85&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== startalljails ==&lt;br /&gt;
 startalljails&lt;br /&gt;
7.2+ only. This will parse through quad1 and start all jails. It utilizes lockfiles so it won’t try to start a jail more than once- therefore multiple instances can be running in parallel without fear of starting a jail twice. If a jail startup gets stuck, you can ^C without fear of killing the script. IMPORTANT- before running startalljails you should make sure you ran preboot once as it will clear out all the lockfiles and enable startalljails to work properly.&lt;br /&gt;
&lt;br /&gt;
== aaccheck.sh ==&lt;br /&gt;
 aaccheck.sh&lt;br /&gt;
displayes the output of container list and task list from aaccli&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update jail scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== buildsafe ==&lt;br /&gt;
 buildsafe&lt;br /&gt;
creates safe files based on quads (automatically removing the fsck’s). This will destructively overwrite safe files&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a jail when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== checkprio.pl ==&lt;br /&gt;
 checkprio.pl&lt;br /&gt;
will look for any process (other than the current shell’s csh, sh, sshd procs) with a non-normal priority and normalize it&lt;br /&gt;
&lt;br /&gt;
== diskusagemon == &lt;br /&gt;
 diskusagemon &amp;lt;mount point&amp;gt; &amp;lt;1k blocks&amp;gt;&lt;br /&gt;
watches a mount point’s disk use, when it reaches the level specified in the 2nd argument,&lt;br /&gt;
it exits. This is useful when doing a restore and you want to be paged as it’s nearing completion.&lt;br /&gt;
Best used as: &amp;lt;tt&amp;gt;diskusagemon /asd/asd 1234; pagexxx&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumprestore ==&lt;br /&gt;
 dumprestore &amp;lt;dumpfile&amp;gt;&lt;br /&gt;
this is a perl expect script which automatically enters ‘1’ and ‘y’. It seems to cause restore to fail&lt;br /&gt;
to set owner permissions on large restores.&lt;br /&gt;
&lt;br /&gt;
== g ==&lt;br /&gt;
 g &amp;lt;search&amp;gt;&lt;br /&gt;
greps the quad/safe files for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gather.pl ==&lt;br /&gt;
 gather.pl&lt;br /&gt;
gathers up data about jails configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== ipfwbackup ==&lt;br /&gt;
 ipfwbackup&lt;br /&gt;
writes ipfw traffic count data to a logfile&lt;br /&gt;
&lt;br /&gt;
== ipfwreset ==&lt;br /&gt;
 ipfwreset&lt;br /&gt;
writes ipfw traffic count data to a logfile and resets counters to 0&lt;br /&gt;
&lt;br /&gt;
== js ==&lt;br /&gt;
 js&lt;br /&gt;
output varies by OS version, but generally provides information about the base jail:&lt;br /&gt;
- which vn’s are in use&lt;br /&gt;
- disk usage&lt;br /&gt;
- info about the contents of quads&lt;br /&gt;
- the # of inodes represented by the jails contained in the group (133.2 in the example below), and how many jails per data mount, as well as subtotals&lt;br /&gt;
- ips bound to the base machine but not in use by a jail&lt;br /&gt;
- free gvinum volumes, or unused vn’s or used md’s&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;/usr/local/jail/rc.d/quad1:&lt;br /&gt;
        /mnt/data1 133.2 (1)&lt;br /&gt;
        /mnt/data2 1040.5 (7)&lt;br /&gt;
        total 1173.7 (8)&lt;br /&gt;
/usr/local/jail/rc.d/quad2:&lt;br /&gt;
        /mnt/data1 983.4 (6)&lt;br /&gt;
        total 983.4 (6)&lt;br /&gt;
/usr/local/jail/rc.d/quad3:&lt;br /&gt;
        /mnt/data1 693.4 (4)&lt;br /&gt;
        /mnt/data2 371.6 (3)&lt;br /&gt;
        total 1065 (7)&lt;br /&gt;
/usr/local/jail/rc.d/quad4:&lt;br /&gt;
        /mnt/data1 466.6 (3)&lt;br /&gt;
        /mnt/data2 882.2 (5)&lt;br /&gt;
        total 1348.8 (8)&lt;br /&gt;
/mnt/data1: 2276.6 (14)&lt;br /&gt;
/mnt/data2: 2294.3 (15)&lt;br /&gt;
&lt;br /&gt;
Available IPs:&lt;br /&gt;
69.55.230.11 69.55.230.13 69.55.228.200&lt;br /&gt;
&lt;br /&gt;
Available volumes:&lt;br /&gt;
v78 /mnt/data2 2G&lt;br /&gt;
v79 /mnt/data2 2G&lt;br /&gt;
v80 /mnt/data2 2G&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== makevirginjail ==&lt;br /&gt;
 makevirginjail&lt;br /&gt;
Only on some systems, makes an empty jail (doesn&#039;t do restore step)&lt;br /&gt;
&lt;br /&gt;
== mb == &lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== notify.sh ==&lt;br /&gt;
 notify.sh&lt;br /&gt;
emails reboot@johncompanies.com – intended to be called at boot time to alert us to a machine which panics and reboots and isn’t caught by bb or castle.&lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatch ==&lt;br /&gt;
 orphanedbackupwatch&lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to delete them&lt;br /&gt;
&lt;br /&gt;
== postboot ==&lt;br /&gt;
 postboot&lt;br /&gt;
to be run after a machine reboot and quad/safe’s are done executing. It will:&lt;br /&gt;
* do chmod 666 on each jail’s /dev/null&lt;br /&gt;
* add ipfw counts&lt;br /&gt;
* run jailpsall (so you can see if a configured jail isn’t running)&lt;br /&gt;
&lt;br /&gt;
== preboot ==&lt;br /&gt;
 preboot&lt;br /&gt;
to be run before running quad/safe – checks for misconfigurations: &lt;br /&gt;
* a jail configured in a quad but not a safe&lt;br /&gt;
* a jail is listed more than once in a quad&lt;br /&gt;
* the ip assigned to a jail isn’t configured on the machine&lt;br /&gt;
* alias numbering skips in the rc.conf (resulting in the above)&lt;br /&gt;
* orphaned vnfile&#039;s that aren&#039;t mentioned in a quad/safe&lt;br /&gt;
* ip mismatches between dir/vnfile name and the jail’s ip&lt;br /&gt;
* dir/vnfiles&#039;s in quad/safe that don’t exist &lt;br /&gt;
&lt;br /&gt;
== quadanalyze.pl ==&lt;br /&gt;
 quadanalyze.pl&lt;br /&gt;
called by js, produces the info (seen above with js explanation) about the contents of quad (inode count, # of jails, etc.)&lt;br /&gt;
&lt;br /&gt;
== rsync.backup ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== taskdone ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was executed as the subject&lt;br /&gt;
&lt;br /&gt;
== topten ==&lt;br /&gt;
 topten&lt;br /&gt;
summarizes the top 10 traffic users (called by ipfwreset)&lt;br /&gt;
&lt;br /&gt;
== trafficgather.pl ==&lt;br /&gt;
 trafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by jail 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 ipfwreset and ipfwbackup&lt;br /&gt;
&lt;br /&gt;
== trafficwatch.pl ==&lt;br /&gt;
 trafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a jail reaches the warning level (35G) and the limit (40G). We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== trafstats ==&lt;br /&gt;
 trafstats&lt;br /&gt;
writes ipfw traffic usage info by jail to a file called jc_traffic_dump in each jail’s / dir&lt;br /&gt;
&lt;br /&gt;
== truncate_jailmake ==&lt;br /&gt;
 truncate_jailmake&lt;br /&gt;
a version of jailmake which creates truncated vnfiles.&lt;br /&gt;
&lt;br /&gt;
== vb ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/bin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs (freebsd) ==&lt;br /&gt;
 vs&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/jail/rc.d/safe&amp;lt;n&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vq&amp;lt;n&amp;gt;&lt;br /&gt;
the equivalent of: vi /usr/local/jail/rc.d/quad&amp;lt;n&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dumpremote ==&lt;br /&gt;
 dumpremote &amp;lt;user@machine&amp;gt; &amp;lt;/remote/location/file-dump&amp;gt; &amp;lt;vnX&amp;gt;&lt;br /&gt;
ex: dumpremote user@10.1.4.117 /mnt/data3/remote.echoditto.com-dump 7&lt;br /&gt;
this will dump a vn filesystem to a remote machine and location&lt;br /&gt;
&lt;br /&gt;
== oversellcheck ==&lt;br /&gt;
 oversellcheck&lt;br /&gt;
displays how much a disk is oversold or undersold taking into account truncated vn files. Only for use on 4.x systems&lt;br /&gt;
&lt;br /&gt;
== mvbackups (freebsd) ==&lt;br /&gt;
 mvbackups &amp;lt;dir&amp;gt; (1.1.1.1-col00001-DIR) &amp;lt;target_machine&amp;gt; (jail1) &amp;lt;target_dir&amp;gt; (data1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== jailnice ==&lt;br /&gt;
 jailnice &amp;lt;hostname&amp;gt;&lt;br /&gt;
applies &amp;lt;tt&amp;gt;renice 19 [PID]&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;rtprio 31 –[PID]&amp;lt;/tt&amp;gt; to each process in the given jail&lt;br /&gt;
&lt;br /&gt;
== dumpremoterestore ==&lt;br /&gt;
 dumpremoterestore &amp;lt;device&amp;gt; &amp;lt;ip of target machine&amp;gt; &amp;lt;dir on target machine&amp;gt;&lt;br /&gt;
ex: dumpremoterestore /dev/vn51 10.1.4.118 /mnt/data2/69.55.239.45-col00688-DIR&lt;br /&gt;
dumps a device and restores it to a directory on a remote machine. Requires that you enable root ssh on the &lt;br /&gt;
remote machine.&lt;br /&gt;
&lt;br /&gt;
== psj ==&lt;br /&gt;
 psj&lt;br /&gt;
shows just the procs running on the base system – a ps auxw but without jail’d procs present&lt;br /&gt;
&lt;br /&gt;
== perc5iraidchk ==&lt;br /&gt;
 perc5iraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2950 systems with Perc5/6 controllers&lt;br /&gt;
&lt;br /&gt;
== perc4eraidchk ==&lt;br /&gt;
 perc4eraidchk&lt;br /&gt;
checks for degraded arrays on Dell 2850 systems with Perc4e/Di controllers&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS =&lt;br /&gt;
&lt;br /&gt;
Note: We use VEID (Virtual Environment ID) and CTID (Container ID) interchangably. Similarly, VE and CT. They mean the same thing.&lt;br /&gt;
VZPP = VirtuoZzo Power Panel (the control panel for each CT)&lt;br /&gt;
&lt;br /&gt;
All linux systems exist in /vz, /vz1 or /vz2 - since each linux machine holds roughly 60-90 customers, there will be roughly 30-45 in each partition.&lt;br /&gt;
&lt;br /&gt;
The actual filesystem of the system in question is in:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/private/(VEID)&lt;br /&gt;
&lt;br /&gt;
Where VEID is the identifier for that system - an all-numeric string larger than 100.&lt;br /&gt;
&lt;br /&gt;
The actual mounted and running systems are in the corresponding:&lt;br /&gt;
&lt;br /&gt;
 /vz(1-2)/root/(VEID)&lt;br /&gt;
&lt;br /&gt;
But we rarely interact with any system from this mount point.&lt;br /&gt;
&lt;br /&gt;
You should never need to touch the root portion of their system – however you can traverse their filesystem by going to &amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/root&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;/vz(1-2)/private/(VEID)/fs/root&amp;lt;/tt&amp;gt; on 4.x systems) the root of their filesystem is in that directory, and their entire system is underneath that.&lt;br /&gt;
&lt;br /&gt;
Every VE has a startup script in &amp;lt;tt&amp;gt;/etc/sysconfig/vz-scripts&amp;lt;/tt&amp;gt;  (which is symlinked as &amp;lt;tt&amp;gt;/vzconf&amp;lt;/tt&amp;gt; on all systems) - the VE startup script is simply named &amp;lt;tt&amp;gt;(VEID).conf&amp;lt;/tt&amp;gt; - it contains all the system parameters for that VE:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Configuration file generated by vzsplit for 60 VE&lt;br /&gt;
# on HN with total amount of physical mem 2011 Mb&lt;br /&gt;
&lt;br /&gt;
VERSION=&amp;quot;2&amp;quot;&lt;br /&gt;
CLASSID=&amp;quot;2&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
KMEMSIZE=&amp;quot;8100000:8200000&amp;quot;&lt;br /&gt;
LOCKEDPAGES=&amp;quot;322:322&amp;quot;&lt;br /&gt;
PRIVVMPAGES=&amp;quot;610000:615000&amp;quot;&lt;br /&gt;
SHMPAGES=&amp;quot;33000:34500&amp;quot;&lt;br /&gt;
NUMPROC=&amp;quot;410:415&amp;quot;&lt;br /&gt;
PHYSPAGES=&amp;quot;0:2147483647&amp;quot;&lt;br /&gt;
VMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
OOMGUARPAGES=&amp;quot;13019:2147483647&amp;quot;&lt;br /&gt;
NUMTCPSOCK=&amp;quot;1210:1215&amp;quot;&lt;br /&gt;
NUMFLOCK=&amp;quot;107:117&amp;quot;&lt;br /&gt;
NUMPTY=&amp;quot;19:19&amp;quot;&lt;br /&gt;
NUMSIGINFO=&amp;quot;274:274&amp;quot;&lt;br /&gt;
TCPSNDBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
TCPRCVBUF=&amp;quot;1800000:1900000&amp;quot;&lt;br /&gt;
OTHERSOCKBUF=&amp;quot;900000:950000&amp;quot;&lt;br /&gt;
DGRAMRCVBUF=&amp;quot;200000:200000&amp;quot;&lt;br /&gt;
NUMOTHERSOCK=&amp;quot;650:660&amp;quot;&lt;br /&gt;
DCACHE=&amp;quot;786432:818029&amp;quot;&lt;br /&gt;
NUMFILE=&amp;quot;7500:7600&amp;quot;&lt;br /&gt;
AVNUMPROC=&amp;quot;51:51&amp;quot;&lt;br /&gt;
IPTENTRIES=&amp;quot;155:155&amp;quot;&lt;br /&gt;
DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
DISKINODES=&amp;quot;400000:420000&amp;quot;&lt;br /&gt;
CPUUNITS=&amp;quot;1412&amp;quot;&lt;br /&gt;
QUOTAUGIDLIMIT=&amp;quot;2000&amp;quot;&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/636&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/636&amp;quot;&lt;br /&gt;
NAMESERVER=&amp;quot;69.55.225.225 69.55.230.3&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;vzredhat-7.3/20030305&amp;quot;&lt;br /&gt;
VE_TYPE=&amp;quot;regular&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.225.229&amp;quot;&lt;br /&gt;
HOSTNAME=&amp;quot;textengine.net&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As you can see, the hostname is set here, the disk space is set here, the number of inodes, the number of files that can be open, the number of tcp sockets, etc. - all are set here.&lt;br /&gt;
&lt;br /&gt;
In fact, everything that can be set on this customer system is set in this conf file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All interaction with the customer system is done with the VEID.  You start the system by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl start 999&lt;br /&gt;
&lt;br /&gt;
You stop it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl stop 999&lt;br /&gt;
&lt;br /&gt;
You execute commands in it by running:&lt;br /&gt;
&lt;br /&gt;
 vzctl exec 999 df -k&lt;br /&gt;
&lt;br /&gt;
You enter into it, via a root-shell backdoor with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and you set parameters for the system, while it is still running, with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; is the most commonly used command - we have aliased &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; since we use it so often. We’ll continue to use &amp;lt;tt&amp;gt;vzctl&amp;lt;/tt&amp;gt; in our examples, but feel free to use just &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s say the user wants more diskspace.  You can cat their conf file and see:&lt;br /&gt;
&lt;br /&gt;
 DISKSPACE=&amp;quot;4194304:4613734&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So right now they have 4gigs of space.  You can then change it to 6 with:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskspace 6100000:6200000 --save&lt;br /&gt;
&lt;br /&gt;
IMPORTANT:  all issuances of the vzctl set command need to end with &amp;lt;tt&amp;gt;–save&amp;lt;/tt&amp;gt; - if they don&#039;t, the setting will be set, but it will not be saved to the conf file, and they will not have those settings next time they boot.&lt;br /&gt;
&lt;br /&gt;
All of the tunables in the conf file can be set with the vzctl set command.  Note that in the conf file, and on the vzctl set command line, we always issue two numbers seperated by a colon - that is because we are setting the hard and soft limits.  Always set the hard limit slightly above the soft limit, as you see it is in the conf file for all those settings.&lt;br /&gt;
&lt;br /&gt;
There are also things you can set with `&amp;lt;tt&amp;gt;vzctl set&amp;lt;/tt&amp;gt;` that are not in the conf file as settings, per se.  For instance, you can add IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --save&lt;br /&gt;
&lt;br /&gt;
or multiple IPs:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --ipadd 10.10.10.10 --ipadd 10.10.20.30 --save&lt;br /&gt;
&lt;br /&gt;
or change the hostname:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --hostname www.example.com --save&lt;br /&gt;
&lt;br /&gt;
You can even set the nameservers:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --nameserver 198.78.66.4 --nameserver 198.78.70.180 --save&lt;br /&gt;
&lt;br /&gt;
Although you probably will never do that.&lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --disabled yes --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from being started (by VZPP or reboot) (&amp;lt;=3.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --onboot=no --save &lt;br /&gt;
&lt;br /&gt;
You can disable a VPS from using his control panel:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --offline_management=no --save &lt;br /&gt;
&lt;br /&gt;
You can suspend a VPS, so it can be resumed in the same state it was in when it was stopped (4.x):&lt;br /&gt;
&lt;br /&gt;
 vzctl suspend 999&lt;br /&gt;
&lt;br /&gt;
and to resume it:&lt;br /&gt;
&lt;br /&gt;
 vzctl resume 999&lt;br /&gt;
&lt;br /&gt;
to see who owns process:&lt;br /&gt;
 vzpid &amp;lt;PID&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to mount up an unmounted ve:&lt;br /&gt;
 vzctl mount 827&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To see network stats for CT&#039;s:&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One thing that sometimes comes up on older systems that we created with smaller defaults is that the system would run out of inodes.  The user will email and say they cannot create any more files or grow any files larger, but they will also say that they are not out of diskspace ... they are running:&lt;br /&gt;
&lt;br /&gt;
 df -k&lt;br /&gt;
&lt;br /&gt;
and seeing how much space is free - and they are not out of space.  They are most likely out of inodes - which they would see by running:&lt;br /&gt;
&lt;br /&gt;
 df -i&lt;br /&gt;
&lt;br /&gt;
So, the first thing you should do is enter their system with:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 999&lt;br /&gt;
&lt;br /&gt;
and run:  &amp;lt;tt&amp;gt;df -i&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to confirm your theory.  Then exit their system.  Then simply cat their conf file and see what their inodes are set to (probably 200000:200000, since that was the old default on the older systems) and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --diskinodes 400000:400000 --save&lt;br /&gt;
&lt;br /&gt;
If they are not out of inodes, then a good possibility is that they have maxed out their numfile configuration variable, which controls how many files they can have in their system.  The current default is 7500 (which nobody has ever hit), but the old default was as low as 2000, so you would run something like:&lt;br /&gt;
&lt;br /&gt;
 vzctl set 999 --numfile 7500:7500 --save&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You cannot start or stop a VE if your pwd is its private (/vz/private/999) or root (/vz/root/999) directories, or anywhere below them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Recovering from a crash (linux) ==&lt;br /&gt;
&lt;br /&gt;
=== Diagnose whether you have a crash ===&lt;br /&gt;
The most important thing is to get the machine and all ve’s back up as soon as possible. Note the time, you’ll need to create a crash log entry (Mgmt. -&amp;gt; Reference -&amp;gt; CrashLog). The first thing to do is head over to the [[Screen#Screen_Organization|serial console screen]] and see if there’s any kernel error messages output. Try to copy any messages (or just a sample of repeating messages) you see into the notes section of the crash log – these will also likely need to be sent to virtuozzo for interpretation. If the messages are spewing too fast, hit ^O + H to start a screen log dump which you can ob1182.pts-38.bb serve after the machine is rebooted. Additionally, if the  machine is responsive, you can get a trace to send to virtuozzo by hooking up a kvm and entering these 3 sequences:&lt;br /&gt;
&amp;lt;pre&amp;gt;alt+print screen+m&lt;br /&gt;
alt+print screen+p&lt;br /&gt;
alt+print screen+t&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are no messages, the machine may just be really busy- wait a bit (5-10min) to see if it comes back. If it&#039;s still pinging, odds are its very busy. If it doesn&#039;t come back, or the messages indicate a fatal error, you will need to proceed with a power cycle (ctrl+alt+del will not work).&lt;br /&gt;
&lt;br /&gt;
=== Power cycle the server ===&lt;br /&gt;
If this machine is not a Dell 2950 with a [[DRAC/RMM#DRAC|DRAC card]] (i.e. if you can’t ssh into the DRAC card and issue racadm serveraction hardreset, then you will need someone at the data center to power the macine off, wait 30 sec, then turn it back on.  Make sure to re-attach via console (&amp;lt;tt&amp;gt;tip virtxx&amp;lt;/tt&amp;gt;) immediately after power down. &lt;br /&gt;
&lt;br /&gt;
=== (Re)attach to the console ===&lt;br /&gt;
Stay on the console the entire time during boot. As the BIOS posts- look out for the RAID card output- does everything look healthy? The output may be scrambled, look for &amp;quot;DEGRADED&amp;quot; or &amp;quot;FAILED&amp;quot;. Once the OS starts booting you will be disconnected (dropped back to the shell on the console server) a couple times during the boot up. The reason you want to quickly re-attach is two-fold: 1. If you don’t reattach quickly then you won’t get any console output, 2. you want to be attached before the server &#039;&#039;potentially&#039;&#039; starts (an extensive) fsck. If you attach after the fsck begins, you’ll have seen no indication it started an fsck and the server will appear frozen during startup- no output, no response. &lt;br /&gt;
&lt;br /&gt;
=== Start containers/VE&#039;s/VPSs ===&lt;br /&gt;
When the machine begins to start VE’s, it’s safe to leave the console and login via ssh. All virts should be set to auto start all the VEs after a crash. Further, most (newer) virts are set to “fastboot” it’s VE’s (to find out, do:&lt;br /&gt;
 grep -i fast /etc/sysconfig/vz &lt;br /&gt;
and look for &amp;lt;tt&amp;gt;VZFASTBOOT=yes&amp;lt;/tt&amp;gt;). If this was set prior to the machine’s crash (setting it after the machine boots will not have any effect until the vz service is restarted) it will start each ve as fast as possible, in serial, then go thru each VE (serially), shutting it down running a vzquota (disk usage) check, then bringing it back up. The benefit is that all VE’s are brought up quickly (within 15min or so depending on the #), the downside is a customer watching closely will notice 2 outages – 1st the machine crash, 2nd their quota check (which will be a much shorter downtime- on the order of a few minutes). &lt;br /&gt;
&lt;br /&gt;
Where “fastboot” is not set to yes (i.e on quar1), vz will start them consecutively, checking the quotas one at a time, and the 60th VE may not start until an hour or two later - this is not acceptable.&lt;br /&gt;
&lt;br /&gt;
The good news is, if you run vzctl start for a VE that is already started, you will simply get an error: &amp;lt;tt&amp;gt;VE is already started&amp;lt;/tt&amp;gt;.  Further, if you attempt to vzctl start a VE that is in the process of being started, you will simply get an error: unable to lock VE.  So, there is no danger in simply running scripts to start smaller sets of VEs.  If the system is not autostarting, then there is no issue, and even if it does, when it conflicts, one process (yours or the autostart) will lose, and just move on to the next one.&lt;br /&gt;
&lt;br /&gt;
A script has been written to assist with ve starts: [[#startvirt.pl|startvirt.pl]] which will start 6 ve’s at once until there are no more left.  If startvirt.pl  is used on a system where “fastboot” was on,  it will circumvent the fastboot for ve’s started by startvirt.pl – they will go through the complete quota check before starting- therefore this is not advisable when a system has crashed. When a system is booted cleanly, and there&#039;s no need for vzquota checks, then startvirt.pl is safe and advisable to run.&lt;br /&gt;
&lt;br /&gt;
=== Make sure all containers are running ===&lt;br /&gt;
You can quickly get a feel for how many ve’s are started by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt4 log]# vs&lt;br /&gt;
VEID 16066 exist mounted running&lt;br /&gt;
VEID 16067 exist mounted running&lt;br /&gt;
VEID 4102 exist mounted running&lt;br /&gt;
VEID 4112 exist mounted running&lt;br /&gt;
VEID 4116 exist mounted running&lt;br /&gt;
VEID 4122 exist mounted running&lt;br /&gt;
VEID 4123 exist mounted running&lt;br /&gt;
VEID 4124 exist mounted running&lt;br /&gt;
VEID 4132 exist mounted running&lt;br /&gt;
VEID 4148 exist mounted running&lt;br /&gt;
VEID 4151 exist mounted running&lt;br /&gt;
VEID 4155 exist mounted running&lt;br /&gt;
VEID 42 exist mounted running&lt;br /&gt;
VEID 432 exist mounted running&lt;br /&gt;
VEID 434 exist mounted running&lt;br /&gt;
VEID 442 exist mounted running&lt;br /&gt;
VEID 450 exist mounted running&lt;br /&gt;
VEID 452 exist mounted running&lt;br /&gt;
VEID 453 exist mounted running&lt;br /&gt;
VEID 454 exist mounted running&lt;br /&gt;
VEID 462 exist mounted running&lt;br /&gt;
VEID 463 exist mounted running&lt;br /&gt;
VEID 464 exist mounted running&lt;br /&gt;
VEID 465 exist mounted running&lt;br /&gt;
VEID 477 exist mounted running&lt;br /&gt;
VEID 484 exist mounted running&lt;br /&gt;
VEID 486 exist mounted running&lt;br /&gt;
VEID 490 exist mounted running&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So to see how many ve’s have started:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep running | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And to see how many haven’t:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | grep down | wc -l&lt;br /&gt;
     0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And how many we should have running:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 root]# vs | wc -l&lt;br /&gt;
     39&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another tool you can use to see which ve’s have started, among other things is [[#vzstat|vzstat]]. It will give you CPU, memory, and other  stats on each ve and the overall system. It’s a good thing to watch as ve’s are starting (note the VENum parameter, it will tell you how many have started):&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;4:37pm, up 3 days,  5:31,  1 user, load average: 1.57, 1.68, 1.79&lt;br /&gt;
VENum 40, procs 1705: running 2, sleeping 1694, unint 0, zombie 9, stopped 0&lt;br /&gt;
CPU [ OK ]: VEs  57%, VE0   0%, user   8%, sys   7%, idle  85%, lat(ms) 412/2&lt;br /&gt;
Mem [ OK ]: total 6057MB, free 9MB/54MB (low/high), lat(ms) 0/0&lt;br /&gt;
Swap [ OK ]: tot 6142MB, free 4953MB, in 0.000MB/s, out 0.000MB/s&lt;br /&gt;
Net [ OK ]: tot: in  0.043MB/s  402pkt/s, out  0.382MB/s 4116pkt/s&lt;br /&gt;
Disks [ OK ]: in 0.002MB/s, out 0.000MB/s&lt;br /&gt;
&lt;br /&gt;
  VEID ST    %VM     %KM         PROC    CPU     SOCK FCNT MLAT IP&lt;br /&gt;
     1 OK 1.0/17  0.0/0.4    0/32/256 0.0/0.5 39/1256    0    9 69.55.227.152&lt;br /&gt;
    21 OK 1.3/39  0.1/0.2    0/46/410 0.2/2.8 23/1860    0    6 69.55.239.60&lt;br /&gt;
   133 OK 3.1/39  0.1/0.3    1/34/410 6.3/2.8 98/1860    0    0 69.55.227.147&lt;br /&gt;
   263 OK 2.3/39  0.1/0.2    0/56/410 0.3/2.8 34/1860    0    1 69.55.237.74&lt;br /&gt;
   456 OK  17/39  0.1/0.2   0/100/410 0.1/2.8 48/1860    0   11 69.55.236.65&lt;br /&gt;
   476 OK 0.6/39  0.0/0.2    0/33/410 0.1/2.8 96/1860    0   10 69.55.227.151&lt;br /&gt;
   524 OK 1.8/39  0.1/0.2    0/33/410 0.0/2.8 28/1860    0    0 69.55.227.153&lt;br /&gt;
   594 OK 3.1/39  0.1/0.2    0/45/410 0.0/2.8 87/1860    0    1 69.55.239.40&lt;br /&gt;
   670 OK 7.7/39  0.2/0.3    0/98/410 0.0/2.8 64/1860    0  216 69.55.225.136&lt;br /&gt;
   691 OK 2.0/39  0.1/0.2    0/31/410 0.0/0.7 25/1860    0    1 69.55.234.96&lt;br /&gt;
   744 OK 0.1/17  0.0/0.5    0/10/410 0.0/0.7  7/1860    0    6 69.55.224.253&lt;br /&gt;
   755 OK 1.1/39  0.0/0.2    0/27/410 0.0/2.8 33/1860    0    0 192.168.1.4&lt;br /&gt;
   835 OK 1.1/39  0.0/0.2    0/19/410 0.0/2.8  5/1860    0    0 69.55.227.134&lt;br /&gt;
   856 OK 0.3/39  0.0/0.2    0/13/410 0.0/2.8 16/1860    0    0 69.55.227.137&lt;br /&gt;
   936 OK 3.2/52  0.2/0.4    0/75/410 0.2/0.7 69/1910    0    8 69.55.224.181&lt;br /&gt;
  1020 OK 3.9/39  0.1/0.2    0/60/410 0.1/0.7 55/1860    0    8 69.55.227.52&lt;br /&gt;
  1027 OK 0.3/39  0.0/0.2    0/14/410 0.0/2.8 17/1860    0    0 69.55.227.83&lt;br /&gt;
  1029 OK 1.9/39  0.1/0.2    0/48/410 0.2/2.8 25/1860    0    5 69.55.227.85&lt;br /&gt;
  1032 OK  12/39  0.1/0.4    0/80/410 0.0/2.8 41/1860    0    8 69.55.227.90&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you are all done, you will want to make sure that all the VEs really did get started, run vs one more time.&lt;br /&gt;
&lt;br /&gt;
Note the time all ve’s are back up and enter that into and save the crash log entry.&lt;br /&gt;
&lt;br /&gt;
Occasionally, a ve will not start automatically. The most common reason for a ve not to come up normally is the ve was at it’s disk limit before the crash, and will not start since they’re over the limit. To overcome this, set the disk space to current usage level (the system will give this to you when it fails to start), start the ve, then re-set the disk space back to the prior level. Lastly, contact the customer to let them know they’re out of disk (or allocate more disk if they&#039;re entitled to more).&lt;br /&gt;
&lt;br /&gt;
== Hitting performance barriers and fixing them ==&lt;br /&gt;
&lt;br /&gt;
There are multiple modes virtuozzo offers to allocate resources to a ve. We utilize 2: SLM and UBC parameters&lt;br /&gt;
On our 4.x systems, we use all SLM – it’s simpler to manage and understand. There are a few systems on virt19/18 that may also use SLM. Everything else uses UBC. &lt;br /&gt;
You can tell a SLM ve by:&lt;br /&gt;
&lt;br /&gt;
 SLMMODE=&amp;quot;all&amp;quot;&lt;br /&gt;
&lt;br /&gt;
in their conf file. &lt;br /&gt;
&lt;br /&gt;
TODO: detail SLM modes and parameters.&lt;br /&gt;
&lt;br /&gt;
If someone is in SLM mode and they hit memory resource limits, they simply need to upgrade to more memory.&lt;br /&gt;
&lt;br /&gt;
The following applies to everyone else (UBC).&lt;br /&gt;
&lt;br /&gt;
Customers will often email and say that they are getting out of memory errors - a common one is &amp;quot;cannot fork&amp;quot; ... basically, anytime you see something odd like this, it means they are hitting one of their limits that is in place in their conf file.&lt;br /&gt;
&lt;br /&gt;
The conf file, however, simply shows their limits - how do we know what they are currently at ?&lt;br /&gt;
&lt;br /&gt;
The answer is a file called v - this file contains the current status (and peaks) of their  performance settings, and also counts how many times they have hit the barrier.  The output of the file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;764: kmemsize         384113     898185    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          0        322        322          0&lt;br /&gt;
     privvmpages        1292       7108     610000     615000          0&lt;br /&gt;
     shmpages            270        528      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc               8         23        410        415          0&lt;br /&gt;
     physpages            48       5624          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages        641       6389      13019 2147483647          0&lt;br /&gt;
     numtcpsock            3         21       1210       1215          0&lt;br /&gt;
     numflock              1          3        107        117          0&lt;br /&gt;
     numpty                0          2         19         19          0&lt;br /&gt;
     numsiginfo            0          4        274        274          0&lt;br /&gt;
     tcpsndbuf             0      80928    1800000    1900000          0 &lt;br /&gt;
     tcprcvbuf             0     108976    1800000    1900000          0&lt;br /&gt;
     othersockbuf       2224      37568     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4272     200000     200000          0&lt;br /&gt;
     numothersock          3          9        650        660          0&lt;br /&gt;
     dcachesize        53922     100320     786432     818029          0&lt;br /&gt;
     numfile             161        382       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first column is the name of the counter in question - the same names we saw in the systems conf file.  The second column is the _current_ value of that counter, the third column is the max that that counter has ever risen to, the fourth column is the soft limit, and the fifth column is the hard limit (which is the same as the numbers in that systems conf file).&lt;br /&gt;
&lt;br /&gt;
The sixth number is the failcount - how many times the current usage has risen to hit the barrier.  It will increase as soon as the current usage hits the soft limit.&lt;br /&gt;
&lt;br /&gt;
The problem with /proc/user_beancounters is that it actually contains that set of data for every running VE - so you can&#039;t just cat /proc/user_beancounters - it is too long and you get info for every other running system.&lt;br /&gt;
&lt;br /&gt;
You can vzctl enter the system and run:&lt;br /&gt;
&lt;br /&gt;
 vzctl enter 9999&lt;br /&gt;
 cat /proc/user_beancounters&lt;br /&gt;
&lt;br /&gt;
inside their system, and you will just see the stats for their particular system, but entering their system every time you want to see it is combersome.&lt;br /&gt;
&lt;br /&gt;
So, I wrote a simple script called &amp;quot;vzs&amp;quot; which simply greps for the VEID, and spits out the next 20 or so lines (however many lines there are in the output, I forget) after it.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzs 765:&lt;br /&gt;
765: kmemsize        2007936    2562780    8100000    8200000          0&lt;br /&gt;
     lockedpages           0          8        322        322          0&lt;br /&gt;
     privvmpages       26925      71126     610000     615000          0&lt;br /&gt;
     shmpages          16654      16750      33000      34500          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numproc              41         57        410        415          0&lt;br /&gt;
     physpages          1794      49160          0 2147483647          0&lt;br /&gt;
     vmguarpages           0          0      13019 2147483647          0&lt;br /&gt;
     oomguarpages       4780      51270      13019 2147483647          0&lt;br /&gt;
     numtcpsock           23         37       1210       1215          0&lt;br /&gt;
     numflock             17         39        107        117          0&lt;br /&gt;
     numpty                1          3         19         19          0&lt;br /&gt;
     numsiginfo            0          6        274        274          0&lt;br /&gt;
     tcpsndbuf         22240     333600    1800000    1900000          0&lt;br /&gt;
     tcprcvbuf             0     222656    1800000    1900000          0&lt;br /&gt;
     othersockbuf     104528     414944     900000     950000          0&lt;br /&gt;
     dgramrcvbuf           0       4448     200000     200000          0&lt;br /&gt;
     numothersock         73        105        650        660          0&lt;br /&gt;
     dcachesize       247038     309111     786432     818029          0&lt;br /&gt;
     numfile             904       1231       7500       7600          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     dummy                 0          0          0          0          0&lt;br /&gt;
     numiptent             4          4        155        155          0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That showed us just the portion of /proc/user_beancounters for system 765.&lt;br /&gt;
&lt;br /&gt;
When you run the vzs command, always add a : after the VEID.&lt;br /&gt;
&lt;br /&gt;
So, if a customer complains about some out of memory errors, or no more files, or no more ptys, or just has an unspecific complain about processes dying, etc., the very first thing you need to do is check their beancounters with vzs.  Usually you will spot an item that has a high failcount and needs to be upped.&lt;br /&gt;
&lt;br /&gt;
At that point you could simply up the counter with `vzctl set`.  Generally pick a number 10-20% higher than the old one, and make the hard limit slightly larger than the the soft limit. However our systems now come in several levels and those levels have more/different memory allocations. If someone is complaining about something other than a memory limit (pty, numiptent, numflock), it’s generally safe to increase it, at least to the same level as what’s in the /vzconf/4unlimited file on the newest virt. If someone is hitting a memory limit, first make sure they are given what they deserve:&lt;br /&gt;
&lt;br /&gt;
(refer to mgmt -&amp;gt; payments -&amp;gt; packages)&lt;br /&gt;
&lt;br /&gt;
To set those levels, you use the [[#setmem|setmem]] command. &lt;br /&gt;
&lt;br /&gt;
The alternate (DEPRECATED) method would be to use one of 3 commands:&lt;br /&gt;
256 &amp;lt;veid&amp;gt;&lt;br /&gt;
300 &amp;lt;veid&amp;gt;&lt;br /&gt;
384 &amp;lt;veid&amp;gt;&lt;br /&gt;
512 &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the levels were not right (you’d run vzs &amp;lt;veid&amp;gt; before and after to see the effect) tell the customer they’ve been adjusted and be done with it. If the levels were right, tell the customer they must upgrade to a higher package, tell them how to see level (control panel) and that they can reboot their system to escape this lockup contidion.&lt;br /&gt;
&lt;br /&gt;
Customers can also complain that their site is totally unreachable, or complain that it is down ... if the underlying machine is up, and all seems well, you may notice in the beancounters that network-specific counters are failing - such as numtcpsock, tcpsndbuf or tcprcvbuf.  This will keep them from talking on the network and make it seem like their system is down.  Again, just up the limits and things should be fine.&lt;br /&gt;
&lt;br /&gt;
On virts 1-4, you should first look at the default settings for that item on a later virt, such as virt 8 - we have increased the defaults a lot since the early machines.  So, if you are going to up a counter on virt2, instead of upping it by 10-20%, instead up it to the new default that you see on virt8.&lt;br /&gt;
&lt;br /&gt;
== Moving a VE to another virt (migrate/migrateonline) ==&lt;br /&gt;
&lt;br /&gt;
This will take a while to complete - and it is best to do this at night when the load is light on both machines.&lt;br /&gt;
&lt;br /&gt;
There are different methods for this, depending on which version of virtuozzo is installed on the src. and dst. virt. &lt;br /&gt;
To check which version is running: &lt;br /&gt;
 [root@virt12 private]# cat /etc/virtuozzo-release&lt;br /&gt;
 Virtuozzo release 2.6.0&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s say that the VE is 1212, and vital stats are:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1212&lt;br /&gt;
VE_ROOT=&amp;quot;/vz1/root/1212&amp;quot;&lt;br /&gt;
VE_PRIVATE=&amp;quot;/vz1/private/1212&amp;quot;&lt;br /&gt;
OSTEMPLATE=&amp;quot;fedora-core-2/20040903&amp;quot;&lt;br /&gt;
IP_ADDRESS=&amp;quot;69.55.229.84&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;devel-fc2/20040903 php-fc2/20040813 mysql-fc2/20040812 postgresql-fc2/20040813 mod_perl-fc2/20040812 mod_ssl-fc2/20040811 jre-fc2/20040823 jdk-fc2/20040823 mailman-fc2/20040823 analog-fc2/20040824 proftpd-fc2/20040818 tomcat-fc2/20040823 usermin-fc2/20040909 webmin-fc2/20040909 uw-imap-fc2/20040830 phpBB-fc2/20040831 spamassassin-fc2/20040910 PostNuke-fc2/20040824 sl-webalizer-fc2/20040&lt;br /&gt;
818&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# vzctl exec 1212 df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  405M  3.7G  10% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this you can see that he’s using (and will minimally need free on the dst server) ~400MB, and he’s running on a Fedora 2 template, version 20040903. He’s also got a bunch of other templates installed. It’s is &#039;&#039;&#039;vital&#039;&#039;&#039; that &#039;&#039;&#039;all&#039;&#039;&#039; these templates exist on the dst system. To confirm that, on the dst system run:&lt;br /&gt;
&lt;br /&gt;
For &amp;lt; 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt14 private]# vzpkgls | grep fc2&lt;br /&gt;
devel-fc2 20040903&lt;br /&gt;
PostNuke-fc2 20040824&lt;br /&gt;
analog-fc2 20040824&lt;br /&gt;
awstats-fc2 20040824&lt;br /&gt;
bbClone-fc2 20040824&lt;br /&gt;
jdk-fc2 20040823&lt;br /&gt;
jre-fc2 20040823&lt;br /&gt;
mailman-fc2 20040823&lt;br /&gt;
mod_frontpage-fc2 20040816&lt;br /&gt;
mod_perl-fc2 20040812&lt;br /&gt;
mod_ssl-fc2 20040811&lt;br /&gt;
mysql-fc2 20040812&lt;br /&gt;
openwebmail-fc2 20040817&lt;br /&gt;
php-fc2 20040813&lt;br /&gt;
phpBB-fc2 20040831&lt;br /&gt;
postgresql-fc2 20040813&lt;br /&gt;
proftpd-fc2 20040818&lt;br /&gt;
sl-webalizer-fc2 20040818&lt;br /&gt;
spamassassin-fc2 20040910&lt;br /&gt;
tomcat-fc2 20040823&lt;br /&gt;
usermin-fc2 20040909&lt;br /&gt;
uw-imap-fc2 20040830&lt;br /&gt;
webmin-fc2 20040909&lt;br /&gt;
[root@virt14 private]# vzpkgls | grep fedora&lt;br /&gt;
fedora-core-1 20040121 20040818&lt;br /&gt;
fedora-core-devel-1 20040121 20040818&lt;br /&gt;
fedora-core-2 20040903&lt;br /&gt;
[root@virt14 private]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For these older systems, you can simply match up the date on the template. &lt;br /&gt;
&lt;br /&gt;
For &amp;gt;= 3.0:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt19 /vz2/private]# vzpkg list&lt;br /&gt;
centos-5-x86                    2008-01-07 22:05:57&lt;br /&gt;
centos-5-x86    devel&lt;br /&gt;
centos-5-x86    jre&lt;br /&gt;
centos-5-x86    jsdk&lt;br /&gt;
centos-5-x86    mod_perl&lt;br /&gt;
centos-5-x86    mod_ssl&lt;br /&gt;
centos-5-x86    mysql&lt;br /&gt;
centos-5-x86    php&lt;br /&gt;
centos-5-x86    plesk9&lt;br /&gt;
centos-5-x86    plesk9-antivirus&lt;br /&gt;
centos-5-x86    plesk9-api&lt;br /&gt;
centos-5-x86    plesk9-atmail&lt;br /&gt;
centos-5-x86    plesk9-backup&lt;br /&gt;
centos-5-x86    plesk9-horde&lt;br /&gt;
centos-5-x86    plesk9-mailman&lt;br /&gt;
centos-5-x86    plesk9-mod-bw&lt;br /&gt;
centos-5-x86    plesk9-postfix&lt;br /&gt;
centos-5-x86    plesk9-ppwse&lt;br /&gt;
centos-5-x86    plesk9-psa-firewall&lt;br /&gt;
centos-5-x86    plesk9-psa-vpn&lt;br /&gt;
centos-5-x86    plesk9-psa-fileserver&lt;br /&gt;
centos-5-x86    plesk9-qmail&lt;br /&gt;
centos-5-x86    plesk9-sb-publish&lt;br /&gt;
centos-5-x86    plesk9-vault&lt;br /&gt;
centos-5-x86    plesk9-vault-most-popular&lt;br /&gt;
centos-5-x86    plesk9-watchdog&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On these newer systems, it&#039;s difficult to tell whether the template on the dst matches exactly the src. Just cause a centos-5-x86 is listed on both servers doesn&#039;t mean all the same packages are there on the dst. To truly know, you must perform a sample rsync:&lt;br /&gt;
&lt;br /&gt;
 rsync -avn /vz/template/centos/5/x86/ root@10.1.4.61:/vz/template/centos/5/x86/&lt;br /&gt;
&lt;br /&gt;
if you see a ton of output from the dry run command, then clearly there are some differences. You may opt to let the rsync complete (without running in dry run mode) the only downside is you&#039;ve now used up more space on the dst and also the centos template will be a mess with old and new data- it will be difficult if not impossible to undo (if someday we wanted to reclaim the space).&lt;br /&gt;
&lt;br /&gt;
If you choose to merge templates, you should closely inspect the dry run output. You should also take care to exclude anything in the /config directory. For example:&lt;br /&gt;
&lt;br /&gt;
 rsync -av -e ssh --stats --exclude=x86/config  /vz/template/ubuntu/10.04/ root@10.1.4.62:/vz/template/ubuntu/10.04/&lt;br /&gt;
&lt;br /&gt;
Which will avoid this directory and contents:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt11 /vz2/private]# ls /vz/template/ubuntu/10.04/x86/config*&lt;br /&gt;
app  os&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is important to avoid since the config may differ on the destination and we are really only interested in making sure the pacakges are there, not overwriting a newer config with an older one.&lt;br /&gt;
&lt;br /&gt;
If the dst system was missing a template, you have 2 choices: &lt;br /&gt;
# put the missing template on the dst system. 2 choices here: &lt;br /&gt;
## Install the template from rpm (found under backup2: /mnt/data4/vzrpms/distro/) or &lt;br /&gt;
## rsync over the template (found under /vz/template) - see above&lt;br /&gt;
# put the ve on a system which has all the proper templates&lt;br /&gt;
&lt;br /&gt;
=== pre-seeding a migration ===&lt;br /&gt;
&lt;br /&gt;
When migrating a customer (or when doing many) depending on how much data you have to transfer, it can take some time. Further, it can be difficult to gauge when a migration will complete or how long it will take. To help speed up the process and get a better idea about how long it will take you can pre-transfer a customer&#039;s data to the destination server. If done correctly, vzmigrate will see the pre-transferred data and pick up where you left off, having much less to transfer (just changed/new files). &lt;br /&gt;
&lt;br /&gt;
We believe vzmigrate uses rsync to do it&#039;s transfer. Therefore not only can you use rsync to do a pre-seed, you can also run rsync to see what is causing a repeatedly-failing vzmigrate to fail. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no magic to a pre-seed, you just need to make sure it&#039;s named correctly.&lt;br /&gt;
&lt;br /&gt;
Given:&lt;br /&gt;
&lt;br /&gt;
source: /vz1/private/1234&lt;br /&gt;
&lt;br /&gt;
and you want to migrate to /vz2 on the target system, your rsync would look like:&lt;br /&gt;
&lt;br /&gt;
 rsync -av /vz1/private/1234/ root@x.x.x.x:/vz2/private/1234.migrated/&lt;br /&gt;
&lt;br /&gt;
After running that successful rsync, the ensuing migrateonline (or migrate) will take much less time to complete- depending on the # of files to be analyzed and the # of changed files. In any case, it&#039;ll be much much faster than had you just started the migration from scratch.&lt;br /&gt;
&lt;br /&gt;
Further, as we discuss elsewhere in this topic, a failed migration can be moved from &amp;lt;tt&amp;gt;/vz/private/1234&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/vz/private/1234.migrated&amp;lt;/tt&amp;gt; on the destination if you want to restart a failed migration. This should &#039;&#039;&#039;only&#039;&#039;&#039; be done if the migration failed and the CT is not running on the destination HN.&lt;br /&gt;
&lt;br /&gt;
=== migrateonline intructions: src &amp;gt;=3.x -&amp;gt; dst&amp;gt;=3.x ===&lt;br /&gt;
&lt;br /&gt;
A script called [[#migrateonline|migrateonline]] was written to handle this kind of move. It is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – vzmigrate is a util to seamlessly- as no no reboot of the ve necessary- move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. [[#migrate|migrate]] mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrateonline emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt&amp;gt;migrateonline&amp;lt;/tt&amp;gt;, but will &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; a ve AND restart it in the process.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrateonline&lt;br /&gt;
usage: /usr/local/sbin/migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrateonline 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine.&lt;br /&gt;
&lt;br /&gt;
If they had backups, use the mvbackups command to move their backups to the new server:&lt;br /&gt;
&lt;br /&gt;
 mvbackups 1212 virt14 vz&lt;br /&gt;
&lt;br /&gt;
Rename the ve&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/migrated-1212&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/old-1212-migrated-20120404-noarchive&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems in mgmt to reflect the new path and server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IF migrateonline does not work, you can try again using simply migrate- this will result in a brief reboot for the ve.&lt;br /&gt;
Before you try again, make sure of a few things:&lt;br /&gt;
&lt;br /&gt;
Depending on where in the migration died, there may be partial data on the dst system in 1 of 2 places:&lt;br /&gt;
(given the example above)&lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
&lt;br /&gt;
 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
before you run migrate again, you&#039;ll want to rename so that all data is in &lt;br /&gt;
1212.migrated:&lt;br /&gt;
&lt;br /&gt;
 mv /vz/private/1212 /vz/private/1212.migrated&lt;br /&gt;
&lt;br /&gt;
this way, it will pick up where it left off and transfer only new files.&lt;br /&gt;
&lt;br /&gt;
Likewise, if you want to speed up a migration, you can pre-seed the dst as follows:&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# rsync -avSH /vz/private/1212/ root@10.1.4.64:/vz/private/1212.migrated/&lt;br /&gt;
&lt;br /&gt;
then when you run migrate or migrateonline, it will only need to move the changed files- the migration will complete quickly&lt;br /&gt;
&lt;br /&gt;
=== migrate manually (if migrate/online fails) ===&lt;br /&gt;
&lt;br /&gt;
Lets say for whatever reason the migration fails. You can always move someone manually:&lt;br /&gt;
&lt;br /&gt;
1. stop ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v stop 1234&lt;br /&gt;
&lt;br /&gt;
2. copy over data&amp;lt;br&amp;gt;&lt;br /&gt;
 rsync -avSH /vz/private/1234/ root@1.1.1.1:/vzX/private/1234/&lt;br /&gt;
&lt;br /&gt;
NOTE: if you&#039;ve previously seeded the data (run rsync while the VE was up/running), and this is a subsequent rsync, make sure the last rsync you do (while the VE is not running, has the --delete option in the rsync)&lt;br /&gt;
&lt;br /&gt;
3. copy over conf&amp;lt;br&amp;gt;&lt;br /&gt;
 scp /vzconf/1234.conf root@1.1.1.1:/vzconf&lt;br /&gt;
&lt;br /&gt;
4. on dst, edit the conf to reflect the right vzX dir&amp;lt;br&amp;gt;&lt;br /&gt;
 vi /vzconf/1234.conf&lt;br /&gt;
&lt;br /&gt;
5. on src remove the IPs&amp;lt;br&amp;gt;&lt;br /&gt;
 ipdel 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
6. on dst add IPs &amp;lt;br&amp;gt;&lt;br /&gt;
 ipadd 1234 2.2.2.2 3.3.3.3&lt;br /&gt;
&lt;br /&gt;
7. on dst, start ve: &amp;lt;br&amp;gt;&lt;br /&gt;
 v start 1324&lt;br /&gt;
&lt;br /&gt;
8. cancel, then archive ve on src per above instrs.&lt;br /&gt;
&lt;br /&gt;
=== migrate src=2.6.0 -&amp;gt; dst&amp;gt;=2.6.0, or mass-migration with customer notify ===&lt;br /&gt;
&lt;br /&gt;
A script called &amp;lt;tt&amp;gt;migrate&amp;lt;/tt&amp;gt; was written to handle this kind of move. It is basically a wrapper for vzmigrate – vzmigrate is a util to seamlessly move a ve from one host to another. This wrapper was initially written cause vz virtuozzo version 2.6.0 has a bug where the ve’s ip(s) on the src system were not properly removed from arp/route tables, causing problems when the ve was started up on the dst system. migrate mitigates that. Since it makes multiple ssh connections to the dst virt, it’s a good idea to put the pub key for the src virt in the authorized_keys file on the dst virt. In addition, migrate emails ve owners when their migration starts and stops. For this to happen they need to put email addresses (on a single line, space delimited) in a file on their system: /migrate_notify. If the optional target dir is not specified, the ve will be moved to the same private/root location as it was on the src virt. Note: migrateonline is equivalent to migrate, but will migrate a ve from one 2.6 &#039;&#039;&#039;kernel&#039;&#039;&#039; machine to another 2.6 kernel machine without restarting the ve.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# migrate&lt;br /&gt;
usage: /usr/local/sbin/migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
[root@virt12 sbin]# migrate 10.1.4.64 1212 vz&lt;br /&gt;
starting to migrate 1212 at Sat Mar 26 22:40:38 PST 2005&lt;br /&gt;
Turning off offline_management&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
migrating with no start on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
clearing the arp cache&lt;br /&gt;
now going to 10.1.4.64 and clear cache and starting&lt;br /&gt;
starting it&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
finished migrating 1212 at Sat Mar 26 22 22:52:01 PST 2005&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which migrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
 [root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
&lt;br /&gt;
On 2.6.1 you’ll also have to move the private area:&lt;br /&gt;
 [root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, [[#cancelve|cancelve]] would offer to remove them. You want to say &#039;&#039;&#039;no&#039;&#039;&#039; to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
To move everyone off a system, you’d do:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== vzmigrate: src=2.6.1 -&amp;gt; dst&amp;gt;=2.6.0 ===&lt;br /&gt;
&lt;br /&gt;
This version of vzmigrate works properly with regard to handling ips. It will not notify ve owners of moves as in the above example. Other than that it’s essentially the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]#  vzmigrate 10.1.4.64 -r no 1212:1212:/vz/private/1212:/vz/root/1212&lt;br /&gt;
migrating on 10.1.4.64&lt;br /&gt;
Connection to destination HN (10.1.4.64) is successfully established&lt;br /&gt;
Moving/copying VE#1212 -&amp;gt; VE#1212, [/vz/private/1212], [/vz/root/1212] ...&lt;br /&gt;
Syncing private area &#039;/vz1/private/1212&#039;&lt;br /&gt;
- 100% |*************************************************|&lt;br /&gt;
done&lt;br /&gt;
Successfully completed&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es) to pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding port redirection to VE(1): 4643 8443&lt;br /&gt;
Adding IP address(es): 69.55.229.84&lt;br /&gt;
Hostname for VE set: fourmajor.com&lt;br /&gt;
File resolv.conf was modified&lt;br /&gt;
VE start in progress...&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the system is up and running on the dst virt. Try to ssh to it from another machine (backup2 or mail).&lt;br /&gt;
Cancel the ve (first we have to rename things which vzmigrate changed so cancelve will find them):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# mv /vzconf/1212.conf.migrated /vzconf/1212.conf&lt;br /&gt;
[root@virt12 sbin]# mv /vz1/private/1212.migrated /vz1/private/1212&lt;br /&gt;
&lt;br /&gt;
[root@virt12 sbin]# cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, &amp;lt;tt&amp;gt;cancelve&amp;lt;/tt&amp;gt; would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
=== Instructions for src=2.5.x ===&lt;br /&gt;
&lt;br /&gt;
First, go to the private dir:&lt;br /&gt;
&lt;br /&gt;
 cd /vz1/private/&lt;br /&gt;
&lt;br /&gt;
Stop the VE - make sure it stops totally cleanly.&lt;br /&gt;
 &lt;br /&gt;
 vzctl stop 1212&lt;br /&gt;
&lt;br /&gt;
Then you’d use vemove - a script written to copy over the config, create tarballs of the ve’s data on the destination virt, and cancel the ve on the source system (in this example we’re going to put a ve that was in /vz1/private on the src virt, in /vz/private on the dst virt):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vemove&lt;br /&gt;
ERROR: Usage: vemove veid target_ip target_path_dir&lt;br /&gt;
[root@virt12 sbin]# vemove 1212 10.1.4.64 /vz/private/1212&lt;br /&gt;
tar cfpP - 1212 --ignore-failed-read | (ssh -2 -c arcfour 10.1.4.64 &amp;quot;split - -b 1024m /vz/private/1212.tar&amp;quot; )&lt;br /&gt;
scp /vzconf/1212.conf 10.1.4.64:/vzconf&lt;br /&gt;
cancelve 1212&lt;br /&gt;
v stop 1212&lt;br /&gt;
v set 1212 --offline_management=no --save&lt;br /&gt;
Delete port redirection&lt;br /&gt;
Deleting IP address(es) from pool: 69.55.229.84&lt;br /&gt;
Saved parameters for VE 1212&lt;br /&gt;
mv /vzconf/1212.conf /vzconf/deprecated-1212&lt;br /&gt;
mv /vz1/private/1212 /vz1/private/old-1212-cxld-20050414&lt;br /&gt;
don&#039;t forget to remove firewall rules and domains!&lt;br /&gt;
[root@virt12 sbin]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: if the system had backups, cancelve would offer to remove them. You want to say no to this option – doing so would mean that the backups would have to be recreated on the dst virt. Instead, copy over the backup configs (make note of path changes in this example) from backup.config on the src virt to backup.config on the dst virt.&lt;br /&gt;
Then go to backup2 and move the dirs. So you’d do something like this:&lt;br /&gt;
 mv /mnt/data1/virt12/0/vz1/private/1212 /mnt/data3/virt14/0/vz/private/&lt;br /&gt;
&lt;br /&gt;
We don’t bother with the other dirs since there’s no harm in leaving them and eventually they’ll drop out. Besides, moving harlinked files across a filesystem as in the example above will create actual files and consume lots more space on the target drive. &lt;br /&gt;
If moving to the same drive, you can safely preserve hardlinks and move all files with:&lt;br /&gt;
 sh&lt;br /&gt;
 for f in 0 1 2 3 4 5 6; do mv /mnt/data1/virt12/$f/vz1/private/1212  /mnt/data1/virt14/$f/vz/private/; done&lt;br /&gt;
&lt;br /&gt;
When you are done, go to /vz/private on the dst virt you will have files like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;1212.taraa&lt;br /&gt;
1212.tarab&lt;br /&gt;
1212.tarac&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each one 1024m (or less, for the last one) in size.&lt;br /&gt;
&lt;br /&gt;
on the dst server and run:&lt;br /&gt;
&lt;br /&gt;
 cat 1212.tar?? | tar xpPBf -&lt;br /&gt;
&lt;br /&gt;
and after 20 mins or so it will be totally untarred.  Now since the conf&lt;br /&gt;
file is already there, you can go ahead and start the system.&lt;br /&gt;
&lt;br /&gt;
 vzctl start 1212&lt;br /&gt;
&lt;br /&gt;
Update the customer’s systems by clicking the “move” link on the moved system, update the system, template (should be pre-selected as the same), and the shut down date.&lt;br /&gt;
&lt;br /&gt;
NOTE: you MUST tar the system up using the virtuozzo version of tar that&lt;br /&gt;
is on all the virt systems, and further you MUST untar the tarball with&lt;br /&gt;
the virtuozzo tar, using these options:  `&amp;lt;tt&amp;gt;tar xpPBf -&amp;lt;/tt&amp;gt;`&lt;br /&gt;
&lt;br /&gt;
If you tar up an entire VE and move it to a non-virtuozzo machine, that is&lt;br /&gt;
ok, and you can untar it there with normal tar commands, but do not untar&lt;br /&gt;
it and then repack it with a normal tar and expect it to work - you need&lt;br /&gt;
to use virtuozzo tar commands on virtuozzo tarballs to make it work.&lt;br /&gt;
&lt;br /&gt;
The backups are sort of an exception, since we are just (usually)&lt;br /&gt;
restoring user data that was created after we gave them the system, and&lt;br /&gt;
therefore has nothing to do with magic symlinks or vz-rpms, etc.&lt;br /&gt;
&lt;br /&gt;
== Traffic accounting on linux ==&lt;br /&gt;
&lt;br /&gt;
DEPRECATED - all tracking is done via bwdb now. This is how we used to track traffic.&lt;br /&gt;
&lt;br /&gt;
TODO: update for diff versions of vz&lt;br /&gt;
&lt;br /&gt;
Unlike FreeBSD, where we have to add firewall count rules to the system to count the traffic, on virtuozzo counts the traffic for us.  You an see the current traffic stats by running `vznetstat`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vznetstat&lt;br /&gt;
VEID    Net.Class  Output(bytes)   Input(bytes)&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
24218     1            484M             39M&lt;br /&gt;
24245     1            463M            143M&lt;br /&gt;
2451      1           2224M            265M&lt;br /&gt;
2454      1           2616M            385M&lt;br /&gt;
4149      1            125M             68M&lt;br /&gt;
418       1           1560M             34M&lt;br /&gt;
472       1           1219M            315M&lt;br /&gt;
726       1            628M            317M&lt;br /&gt;
763       1            223M             82M&lt;br /&gt;
771       1           4234M            437M&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
Total:               13780M           2090M&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see the VEID is on a line with the in and out bytes.  So, we simply run a cron job:&lt;br /&gt;
&lt;br /&gt;
 4,9,14,19,24,29,34,39,44,49,55,59 * * * * /root/vztrafdump.sh&lt;br /&gt;
&lt;br /&gt;
Just like we do on FreeBSD - this one goes through all the VEs in /vz/private and greps the line from vznetstat that matches them and dumps it in /jc_traffic_dump on their system.  Then it does it again for all the VEs in /vz1/private.  It is important to note that vznetstat runs only once, and the grepping is done from a temporary file that contains that output - we do this because running vznetstat once for each VE that we read out of /vz/private and /vz1/private would take way too long and be too intensive.&lt;br /&gt;
&lt;br /&gt;
You do not need to do anything to facilitate this other than make sure that that cron job is running - the vznetstat counters are always running, and any new VEs that are added to the system will be accounted for automatically.&lt;br /&gt;
&lt;br /&gt;
Traffic resetting no longer works with vz 2.6, so we disable the vztrafdump.sh on those virts.&lt;br /&gt;
&lt;br /&gt;
== Watchdog script ==&lt;br /&gt;
&lt;br /&gt;
On some of the older virts, we have a watchdog running that kills procs that are deemed bad per the following:&lt;br /&gt;
&lt;br /&gt;
/root/watchdog from quar1&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;pre&amp;gt;if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [5-9]...&lt;br /&gt;
  then&lt;br /&gt;
# 50-90%&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;...:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;....m&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# running for &amp;gt; 1000min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  if echo $line | awk &#039;{print $(NF-3)}&#039; | grep [1-9]...&lt;br /&gt;
  then&lt;br /&gt;
# running for 10-90 percent&lt;br /&gt;
    if echo $line | awk &#039;{print $NF}&#039; | egrep &#039;cfusion|counter|vchkpw&#039;&lt;br /&gt;
    then&lt;br /&gt;
&lt;br /&gt;
      if echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[2-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# between 2-9min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      elif echo $line | awk &#039;{print $(NF-1)}&#039; | grep &amp;quot;[0-9][0-9]:..&amp;quot;&lt;br /&gt;
      then&lt;br /&gt;
# up to 99min&lt;br /&gt;
        echo $line &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        /usr/sbin/vzpid $pid | tail -1 &amp;gt;&amp;gt; /root/wd.log&lt;br /&gt;
        kill -9 $pid&lt;br /&gt;
&lt;br /&gt;
      fi&lt;br /&gt;
    fi&lt;br /&gt;
  fi&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Misc Linux Items ==&lt;br /&gt;
&lt;br /&gt;
We are overselling hard drive space ... when you configure a linux system with a certain amount of disk space (the default is 4gigs) you do not actually use up 4gigs of space on the system.  The diskspace setting for a user is simply a cap, and they only use up as much space on the actual disk drive as they are actually using.&lt;br /&gt;
&lt;br /&gt;
When you create a new linux system, even though there are some 300 RPMs or so installed, if you run `df -k` you will see that the entire 4gig partition is empty - no space is being used.  This is because the files in their system are &amp;quot;magic symlinks&amp;quot; to the template for their OS that is in /vz/template - however, any changes to any of those files will &amp;quot;disconnect&amp;quot; them and they will immediately begin using space in their system.  Further, any new files uploaded (even if those new files overwrite existing files) will take up space on the partition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if you see this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt8 root]# vzctl stop 160 ; vzctl start 160&lt;br /&gt;
VE is not running&lt;br /&gt;
Starting VE ...&lt;br /&gt;
VE is unmounted&lt;br /&gt;
VE is mounted&lt;br /&gt;
Adding IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
bash ERROR: Can&#039;t change file /etc/sysconfig/network&lt;br /&gt;
Deleting IP address(es): 69.55.226.83 69.55.226.84&lt;br /&gt;
VE is unmounted&lt;br /&gt;
[root@virt8 root]#&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
it probably means they no longer have /bin/bash - copy one in for them&lt;br /&gt;
 &lt;br /&gt;
ALSO: another possibility is that they have removed the `ed` RPM from their system - it needs to be reinstalled into their system.  But since their system is down, this is tricky ...&lt;br /&gt;
&lt;br /&gt;
VE startup scripts used by &#039;vzctl&#039; want package &#039;ed&#039; to be available inside VE. So if package &#039;ed&#039; will be enabled in OS template config and OS template itself VE #827 is based on - this error should be fixed.&lt;br /&gt;
&lt;br /&gt;
yes, it is possible to add RPM to VE while it not running.&lt;br /&gt;
Try to do following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# cd /vz/template/&amp;lt;OS_template_with_ed_package&amp;gt;/&lt;br /&gt;
# vzctl mount 827&lt;br /&gt;
# rpm -Uvh --root /vz/root/827 --veid 827 ed-0.2-25.i386.vz.rpm&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually theres an error, but its ok&lt;br /&gt;
&lt;br /&gt;
Note: replace &#039;ed-0.2-25.i386.vz.rpm&#039; in last command with actual&lt;br /&gt;
version of &#039;ed&#039; package you have.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
So how do I know what template the user has ?  cat their conf file and it is listed in there.  For example, if the conf file has:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt12 sbin]# vc 1103&lt;br /&gt;
…snip…&lt;br /&gt;
OSTEMPLATE=&amp;quot;debian-3.0/20030822&amp;quot;&lt;br /&gt;
TEMPLATES=&amp;quot;mod_perl-deb30/20030707 mod_ssl-deb30/20030703 mysql-deb30/20030707 proftpd-deb30/20030703 webmin-deb30/20030823 &amp;quot;&lt;br /&gt;
…&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then they are on debian 3.0, all of their system RPMs are in /vz/template/debian-3.0, and they are using version 20030822 of that debian 3.0 template. Also, they’ve also got additional packages installed (mod_perl, mod_ssl, etc).  Those are also found under /vz/template&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Edits needed to run java:&lt;br /&gt;
&lt;br /&gt;
When we first created the VEs, the default setting for privvmpages was 93000:94000 ... which was high enough that most people never had problems ... however, you can;t run java or jdk or tomcat or anything java related with that setting.  We have found that by setting privvmpages to 610000:615000 that java runs just fine.  That is now the default setting. It is exceedingly rare that anyone needs it higher than that, although we have seen it once or twice.&lt;br /&gt;
&lt;br /&gt;
Any problems with java at all - the first thing you need to do is see if the failcnt has raised for privvmpages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# vzctl start 160&lt;br /&gt;
Starting VE ...&lt;br /&gt;
vzquota : (error) Quota on syscall for 160: Device or resource busy&lt;br /&gt;
Running vzquota on failed for VE 160 [3]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because my pwd is _in_ their private directory - you can&#039;t start it until you move out&lt;br /&gt;
&lt;br /&gt;
People seem to have trouble with php if they are clueless newbies.  Here are two common problems/solutions:&lt;br /&gt;
&lt;br /&gt;
no... but i figured it out myself. problem was the php.ini file that came&lt;br /&gt;
vanilla with the account was not configured to work with apache (the&lt;br /&gt;
ENGINE directive was set to off).&lt;br /&gt;
&lt;br /&gt;
everything else seems fine now.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
the problem was in the php.ini file.  I noticed that is wasnt showing&lt;br /&gt;
the code when it was in an html file so I looked at the php.ini file&lt;br /&gt;
and had to change it so it recognized &amp;lt;? tags aswell as &amp;lt;?php tags.&lt;br /&gt;
&lt;br /&gt;
Also, make sure added to httpd.conf&lt;br /&gt;
    AddType application/x-httpd-php .php&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can set the time zone:&lt;br /&gt;
&lt;br /&gt;
You can change the timezone by doing this:&lt;br /&gt;
&lt;br /&gt;
 ln -sf /usr/share/zoneinfo/&amp;lt;zone&amp;gt; /etc/localtime&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;zone&amp;gt; is the zone you want in the /usr/share/zoneinfo/ directory.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Failing shm_open calls:&lt;br /&gt;
&lt;br /&gt;
first, please check if /dev/shm is mounted inside VE.&lt;br /&gt;
&#039;cat /proc/mounts&#039; command should show something like this:&lt;br /&gt;
 tmpfs /dev/shm tmpfs rw 0 0&lt;br /&gt;
&lt;br /&gt;
If /dev/shm is not mounted you have 2 ways to solve issue:&lt;br /&gt;
1. execute following command inside VE (doesn&#039;t require VE reboot):&lt;br /&gt;
 mount -t tmpfs none /dev/shm&lt;br /&gt;
2. add following string to /etc/fstab inside VE and reboot it:&lt;br /&gt;
 tmpfs         /dev/shm        tmpfs           defaults        0 0&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
You can have a mounted but not running ve&lt;br /&gt;
Just:&lt;br /&gt;
 vzctl mount &amp;lt;veid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When a debian sys can’t get on the network, and you try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set 1046 --ipadd 69.55.227.117&lt;br /&gt;
Adding IP address(es): 69.55.227.117&lt;br /&gt;
Failed to bring up lo.&lt;br /&gt;
Failed to bring up venet0.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They probably removed iproute package, which must be the one from swsoft. To restore:&lt;br /&gt;
&amp;lt;pre&amp;gt;# dpkg -i --veid=1046 --admindir=/vz1/private/1046/root/var/lib/dpkg --instdir=/vz1/private/1046/root/ /vz/template/debian-3.0/iproute_20010824-8_i386.vz.deb&lt;br /&gt;
(Reading database ... 16007 files and directories currently installed.)&lt;br /&gt;
Preparing to replace iproute 20010824-8 (using .../iproute_20010824-8_i386.vz.deb) ...&lt;br /&gt;
Unpacking replacement iproute ...&lt;br /&gt;
Setting up iproute (20010824-8) ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then restart their ve&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
in a ve i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /&lt;br /&gt;
du -h .&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and get: 483M    .&lt;br /&gt;
&lt;br /&gt;
i do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;bash-2.05a# df -h&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/vzfs             4.0G  2.3G  1.7G  56% /&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
how can this be?&lt;br /&gt;
&lt;br /&gt;
Is it possible that quota file was corrupted somehow? Please try to:   &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl stop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota drop &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzquota init &amp;lt;VEID&amp;gt;&lt;br /&gt;
vzctl start &amp;lt;VEID&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
How to stop vz from starting after reboot:&lt;br /&gt;
&lt;br /&gt;
 VIRTUOZZO=no &lt;br /&gt;
in &lt;br /&gt;
 /etc/sysconfig/vz&lt;br /&gt;
&lt;br /&gt;
To start: &lt;br /&gt;
 service vz start&lt;br /&gt;
(after setting VIRTUOZZO=yes in /etc/sysconfig/vz)&lt;br /&gt;
&lt;br /&gt;
service vz restart will do some kind of &#039;soft reboot&#039; -- restart all&lt;br /&gt;
VPSes and reload modules without rebooting the node&lt;br /&gt;
&lt;br /&gt;
if you need to shut down all VPSes really really fast, run killall -9 init&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Postfix tip:&lt;br /&gt;
&lt;br /&gt;
You may want to tweak settings: default_process_limit=10&lt;br /&gt;
&lt;br /&gt;
= Virtuozzo VPS Management Tools =&lt;br /&gt;
&lt;br /&gt;
== vm ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== cancelve ==&lt;br /&gt;
 cancelve &amp;lt;veid&amp;gt;&lt;br /&gt;
this will:&lt;br /&gt;
* stop a ve&lt;br /&gt;
* check for backups (offer to remove them from the backup server &lt;br /&gt;
and the backup.config)&lt;br /&gt;
* rename the private dir&lt;br /&gt;
* check for PTR, provide the commands to reset to default&lt;br /&gt;
* and rename the ve’s config&lt;br /&gt;
* remind you to remove firewall rules&lt;br /&gt;
* remind you to remove DNS entries&lt;br /&gt;
&lt;br /&gt;
== ipadd ==&lt;br /&gt;
 ipadd  &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
add’s ip(s) to a ve&lt;br /&gt;
&lt;br /&gt;
== ipdel ==&lt;br /&gt;
 ipdel &amp;lt;veid&amp;gt; &amp;lt;ip&amp;gt; [ip] [ip]&lt;br /&gt;
removes ip(s) from a ve&lt;br /&gt;
&lt;br /&gt;
== vc ==&lt;br /&gt;
 vc &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;cat /vzconf/&amp;lt;veid&amp;gt;.conf&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vl ==&lt;br /&gt;
 vl&lt;br /&gt;
will displays a list of ve #’s, 1 per line. (ostensibly to use in a for loop)&lt;br /&gt;
&lt;br /&gt;
== vp ==&lt;br /&gt;
 vp &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzps auxww –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vpe ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vpe &amp;lt;veid&amp;gt; &lt;br /&gt;
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): &lt;br /&gt;
&amp;lt;pre&amp;gt;vzctl set &amp;lt;veid&amp;gt; --kmemsize 2100000:2200000&lt;br /&gt;
vzctl exec &amp;lt;veid&amp;gt; ps auxw&lt;br /&gt;
vzctl set &amp;lt;veid&amp;gt; --kmemsize (ve’s orig lvalue):(ve’s orig hvalue)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vt ==&lt;br /&gt;
 vt &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vztop –E &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vr ==&lt;br /&gt;
 vr &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl stop &amp;lt;veid&amp;gt;; vzctl start &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
You can run this even if the ve is down - the stop command will just fail&lt;br /&gt;
&lt;br /&gt;
== vs ==&lt;br /&gt;
 vs [veid]&lt;br /&gt;
displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve configured on the system (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;)&lt;br /&gt;
If passed an argument, gives the status for just that ve. &lt;br /&gt;
A running system looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 16066 exist mounted running&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running (but does exist) looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 9990 exist unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A ve which is not running and doesn’t exist looks like:&lt;br /&gt;
&amp;lt;tt&amp;gt;VEID 421 deleted unmounted down&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vs2 ==&lt;br /&gt;
 vs2 [veid]&lt;br /&gt;
this is similar to vs in that it displays status (output of &amp;lt;tt&amp;gt;vzctl status &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;) on each ve,&lt;br /&gt;
but the difference is it’s list comes from doing an ls on the data dirs. This was meant to catch &lt;br /&gt;
the rare case where a ve configured but exists. &lt;br /&gt;
&lt;br /&gt;
== vw ==&lt;br /&gt;
 vw [veid]&lt;br /&gt;
displays the output of ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;’ (the equivalent of &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; w&amp;lt;/tt&amp;gt;) for each configured ve (as determined by &amp;lt;tt&amp;gt;/vzconf/*.conf&amp;lt;/tt&amp;gt;). Useful for determing which ve is contributing to a heavily-loaded system.&lt;br /&gt;
If passed an argument, gives ‘&amp;lt;tt&amp;gt;w&amp;lt;/tt&amp;gt;‘ output for just that ve. &lt;br /&gt;
Ex:&lt;br /&gt;
&amp;lt;pre&amp;gt;[root@virt2 etc]# vw&lt;br /&gt;
134&lt;br /&gt;
 10:52pm  up 79 days,  6:14,  0 users,  load average: 0.02, 0.02, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16027&lt;br /&gt;
  2:52pm  up 7 days, 19:54,  0 users,  load average: 0.00, 0.00, 0.00&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&lt;br /&gt;
16055&lt;br /&gt;
  2:52pm  up 79 days,  6:38,  0 users,  load average: 0.00, 0.04, 0.07&lt;br /&gt;
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vwe ==&lt;br /&gt;
 vwe [constraint]&lt;br /&gt;
just like &amp;lt;tt&amp;gt;vw&amp;lt;/tt&amp;gt;, but takes a constraint as an argument, only show’s ve’s with loads &amp;gt;= the constraint provided. If no constraint is provided, 1 is used by default&lt;br /&gt;
&lt;br /&gt;
== vzs ==&lt;br /&gt;
 vzs [veid]&lt;br /&gt;
displays the beancounter status for all ve’s, or a particular ve if an argument is passed&lt;br /&gt;
&lt;br /&gt;
== ve ==&lt;br /&gt;
 ve &amp;lt;veid&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl enter &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vx ==&lt;br /&gt;
 vx &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;/usr/sbin/vzctl exec &amp;lt;veid&amp;gt; &amp;lt;command&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs [count]&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== setmem ==&lt;br /&gt;
 setmem &amp;lt;VEID&amp;gt; &amp;lt;256|512|768|1024|2048&amp;gt;&lt;br /&gt;
adjusts the memory resources for the VE&lt;br /&gt;
&lt;br /&gt;
== afacheck.sh ==&lt;br /&gt;
 afacheck.sh&lt;br /&gt;
displays the health/status of containers and mirrors on an adaptec card (currently quar1, tempvirt1-2, virt9, virt10)- all other are LSI&lt;br /&gt;
&lt;br /&gt;
== backup ==&lt;br /&gt;
 backup&lt;br /&gt;
backup script called nightly to update virt scripts and do customer backups&lt;br /&gt;
&lt;br /&gt;
== checkload.pl ==&lt;br /&gt;
 checkload.pl&lt;br /&gt;
this was intended to be setup as a cronjob to watch processes on a virt when the load &lt;br /&gt;
rises above a certain level. Not currently in use.&lt;br /&gt;
&lt;br /&gt;
== findbackuppigs.pl ==&lt;br /&gt;
 findbackuppigs.pl&lt;br /&gt;
looks for files larger than 50MB which customers have asked us to backup. Emails matches&lt;br /&gt;
to linux@johncompanies.com&lt;br /&gt;
&lt;br /&gt;
== gatherlinux.pl ==&lt;br /&gt;
 gatherlinux.pl&lt;br /&gt;
gathers up data about ve’s configured and writes to a file. Used for audits against the db&lt;br /&gt;
&lt;br /&gt;
== gb ==&lt;br /&gt;
 gb &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter&lt;br /&gt;
&lt;br /&gt;
== gbg ==&lt;br /&gt;
 gbg &amp;lt;search&amp;gt;&lt;br /&gt;
greps backup.config for the given search parameter and presents just the directories (for clean pasting)&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficgather.pl ==&lt;br /&gt;
 linuxtrafficgather.pl [yy-mm]&lt;br /&gt;
sends a traffic usage summary by ve to support@johncomapnies.com and payments@johncompanies.com.&lt;br /&gt;
Optional arguments are year and month (must be in the past). If not passed, assumes last month. Relies on &lt;br /&gt;
traffic logs created by netstatreset and netstatbackup&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch.pl ==&lt;br /&gt;
 linuxtrafficwatch.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo versions &amp;lt;= 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== linuxtrafficwatch2.pl ==&lt;br /&gt;
 linuxtrafficwatch2.pl&lt;br /&gt;
checks traffic usage and emails support@johncomapnies.com when a ve reaches the warning level (35G) and&lt;br /&gt;
the limit (40G). Works on virtuozzo version 2.6.x. We really aren’t using this anymore now that we have netflow.&lt;br /&gt;
&lt;br /&gt;
== load.pl ==&lt;br /&gt;
 load.pl&lt;br /&gt;
feeds info to load mrtg  - executed by inetd.&lt;br /&gt;
&lt;br /&gt;
== mb (linux) ==&lt;br /&gt;
 mb &amp;lt;mount|umount&amp;gt;&lt;br /&gt;
(nfs) mounts and umounts dirs to backup2. Shortcuts are mbm and mbu to mount and unmount. &lt;br /&gt;
&lt;br /&gt;
== migrate ==&lt;br /&gt;
 migrate &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is basically a wrapper for &amp;lt;tt&amp;gt;vzmigrate&amp;lt;/tt&amp;gt; – 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:&lt;br /&gt;
 for f in `vl`; do migrate &amp;lt;ip&amp;gt; $f; done&lt;br /&gt;
&lt;br /&gt;
== migrateonline ==&lt;br /&gt;
 migrateonline &amp;lt;ip of node migrating to&amp;gt; &amp;lt;veid&amp;gt; &amp;lt;target_veid&amp;gt; [target dir: vz | vz1 | vz2]&lt;br /&gt;
this is the same as migrate but will migrate a ve in &amp;lt;tt&amp;gt;–online&amp;lt;/tt&amp;gt; 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.&lt;br /&gt;
&lt;br /&gt;
== netstatbackup ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup &lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== netstatbackup2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatbackup2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== netstatreset ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset&lt;br /&gt;
writes traffic count data to a logfile and resets counters to 0. Works on virtuozzo versions 2.5.x &lt;br /&gt;
&lt;br /&gt;
== netstatreset2 ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 netstatreset2&lt;br /&gt;
writes traffic count data to a logfile. Works on virtuozzo versions 2.6.x. &lt;br /&gt;
&lt;br /&gt;
== orphanedbackupwatchlinux ==&lt;br /&gt;
 orphanedbackupwatchlinux &lt;br /&gt;
looks for directories on backup2 which aren’t configured in backup.config and offers to &lt;br /&gt;
delete them&lt;br /&gt;
&lt;br /&gt;
== rsync.backup (linux) ==&lt;br /&gt;
 rsync.backup&lt;br /&gt;
does customer backups (relies on backup.config)&lt;br /&gt;
&lt;br /&gt;
== startvirt.pl ==&lt;br /&gt;
 startvirt.pl&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== taskdone (linux) ==&lt;br /&gt;
 taskdone&lt;br /&gt;
when called will email support@johncompanies.com with the hostname of the machine from which it was &lt;br /&gt;
executed as the subject&lt;br /&gt;
&lt;br /&gt;
== vb (linux) ==&lt;br /&gt;
 vb&lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vi /usr/local/sbin/backup.config&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vemakeXX ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemakerh9 &lt;br /&gt;
ve create script for RH9 (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian30 &lt;br /&gt;
ve create script for debian 3.0 (Woody) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian31 &lt;br /&gt;
ve create script for debian 3.1 (Sarge) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakedebian40 &lt;br /&gt;
ve create script for debian 4.0 (Etch) (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakefedora, vemakefedora2, vemakefedora4, vemakefedora5, vemakefedora6, vemakefedora7&lt;br /&gt;
ve create script for fedora core 1, 2, 4, 5, 6, 7 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakecentos3, vemakecentos4&lt;br /&gt;
ve create script for centos 3, 4 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakesuse, vemakesuse93, vemakesuse100&lt;br /&gt;
ve create script for suse 9.2, 9.3, 10.0 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
 vemakeubuntu5, vemakeubuntu606, vemakeubuntu606 vemakeubuntu704&lt;br /&gt;
ve create script for ubuntu 5.10, 6.06, 6.10, 7.04 respectively (see vemake)&lt;br /&gt;
&lt;br /&gt;
== vemove ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vemove &amp;lt;veid&amp;gt; &amp;lt;target_ip&amp;gt; &amp;lt;/vz/private/123&amp;gt;&lt;br /&gt;
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 &amp;lt; 2.6.x&lt;br /&gt;
It’s the equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;tar cfpP - &amp;lt;veid&amp;gt; --ignore-failed-read | (ssh -2 -c arcfour &amp;lt;target_ip&amp;gt; &amp;quot;split - -b 1024m &amp;lt;/vz/private/123&amp;gt;.tar&amp;quot; )&amp;lt;/tt&amp;gt;This should only be used if migrate/vzmigrate can’t be used. &lt;br /&gt;
&lt;br /&gt;
== vim.watchdog ==&lt;br /&gt;
 vim.watchdog &lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu. Works on virtuozzo versions 2.5.x&lt;br /&gt;
&lt;br /&gt;
== vim.watchdog2 ==&lt;br /&gt;
 vim.watchdog2&lt;br /&gt;
looks for and kills procs matching “vi|vim|nano|pine|elm” that are running for a long time &amp;amp; consuming lots of cpu.&lt;br /&gt;
Works on virtuozzo versions 2.6.x.&lt;br /&gt;
&lt;br /&gt;
== vzmigrate ==&lt;br /&gt;
 vzmigrate &amp;lt;target_ip&amp;gt; -r no &amp;lt;veid&amp;gt;:[dst veid]:[dst /vzX/private/veid]:[dst /vzX/root/veid]&lt;br /&gt;
(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&lt;br /&gt;
&lt;br /&gt;
== vztrafdump.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump.sh&lt;br /&gt;
writes traffic usage info by ve to a file called jc_traffic_dump in each ve’s / dir. Works on virtuozzo versions &amp;lt;= 2.5.x. &lt;br /&gt;
&lt;br /&gt;
== vztrafdump2.sh ==&lt;br /&gt;
DEPRECATED&lt;br /&gt;
 vztrafdump2.sh&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
== addtun ==&lt;br /&gt;
 addtun &amp;lt;veid&amp;gt;&lt;br /&gt;
Add’s tun device to ve.&lt;br /&gt;
&lt;br /&gt;
== bwcap ==&lt;br /&gt;
 bwcap &amp;lt;veid&amp;gt; &amp;lt;kbps&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;bwcap 1234 512&amp;lt;/tt&amp;gt;&lt;br /&gt;
Caps a VE’s bandwidth to the amount given&lt;br /&gt;
&lt;br /&gt;
== setdisk ==&lt;br /&gt;
 setdisk &amp;lt;veid&amp;gt; &amp;lt;diskspace in GB&amp;gt;&lt;br /&gt;
Ex: &amp;lt;tt&amp;gt;setdisk 1234 5&amp;lt;/tt&amp;gt;&lt;br /&gt;
Gives a VE’s a given amount of disk space&lt;br /&gt;
&lt;br /&gt;
== vdf ==&lt;br /&gt;
 vdf &amp;lt;veid&amp;gt; &lt;br /&gt;
the equivalent of: &amp;lt;tt&amp;gt;vzctl exec &amp;lt;veid&amp;gt; df –h&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== vdff ==&lt;br /&gt;
 vdff&lt;br /&gt;
runs a (condensed) vdf for all ve’s in your pwd (must be run from /vz/privateN)&lt;br /&gt;
&lt;br /&gt;
== mvbackups ==&lt;br /&gt;
 mvbackups &amp;lt;veid&amp;gt; &amp;lt;target_machine&amp;gt; (virt1) &amp;lt;target_dir&amp;gt; (vz1)&lt;br /&gt;
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&lt;br /&gt;
&lt;br /&gt;
== checkquota ==&lt;br /&gt;
 checkquota&lt;br /&gt;
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)&lt;br /&gt;
&lt;br /&gt;
== clearquota ==&lt;br /&gt;
 clearquota &amp;lt;veid&amp;gt;&lt;br /&gt;
Recalculates a ve’s quota, prints out the usage before and after. The equivalent of:&lt;br /&gt;
&amp;lt;tt&amp;gt;vdf &amp;lt;veid&amp;gt;; v stop &amp;lt;veid&amp;gt;; vzquota drop &amp;lt;veid&amp;gt;; v start &amp;lt;veid&amp;gt;; vdf &amp;lt;veid&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== dprocs ==&lt;br /&gt;
 dprocs&lt;br /&gt;
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&lt;br /&gt;
are stuck and a running average of the top “offenders”&lt;br /&gt;
&lt;br /&gt;
== vzstat ==&lt;br /&gt;
 vstat&lt;br /&gt;
sort of like top for VZ. sort VEs by CPU usage by pressing &#039;o&#039; and then &#039;c&#039; keys&lt;/div&gt;</summary>
		<author><name>Support</name></author>
	</entry>
</feed>