Virtuozzo / Linux Reference

From JCWiki
Jump to navigation Jump to search

Spare licenses[edit]

Licenses which we are no longer user are located:

backup2:/d4/sparevzlics


Updating VZ[edit]

Update Virtuozzo to version 4.0.0
Apply minor updates for Virtuozzo 3.0.0

... When you get to the last screen, you will be given an option to

( ) Automatically reboot after update
(*) Reboot later manually

make sure you choose to reboot later.

Migrating Templates[edit]

One nice feature VZ offers is the ability to run a virtual environment (VE or CT as it'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.

Modern versions of VZ (>= 4.x) will check for and automatically move the OS template over to the host as you'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.

The first step is to see if the template exists on the host. To see OS templates installed:

2.x (shows OS and application templates):

# vzpkgls
mod_ssl-rh9 20040624
mysql-rh9 20030814 20050412
openwebmail-rh9 20050427
php-rh9 20050506
phpBB-rh9 20041229
postgresql-rh9 20050719
sl-webalizer-rh9 20040119
spamassassin-rh9 20040127
tomcat-rh9 20040524
usermin-rh9 20040116

>= 3.x (shows just OS templates, run without -O to see application as well):

# vzpkg list -O
ubuntu-10.04-x86                   2010-06-01 11:39:05
ubuntu-11.04-x86                   2011-06-22 14:23:59
ubuntu-9.10-x86                    2010-03-11 17:39:51
centos-5-x86                       2010-03-11 17:12:27
debian-5.0-x86                     2010-03-11 17:33:34


All template files are located:

# ls /vz/template/
ColdFusion-fc1  jre-fc1               openwebmail-fc1     sl-webalizer-fc1
ColdFusion-fc2  jre-fc2               openwebmail-fc2     sl-webalizer-fc2
ColdFusion-rh9  jre-rh9               openwebmail-rh9     sl-webalizer-rh9
PostNuke-fc1    jre-suse92            openwebmail-suse92  spamassassin-fc1
PostNuke-fc2    jrun                  php-deb31           spamassassin-fc2
PostNuke-rh9    mailman-deb31         php-fc1             spamassassin-rh9
analog-fc1      mailman-fc1           php-fc2             spamassassin-suse92
analog-fc2      mailman-fc2           php-rh9             suse-9.2
analog-rh9      mailman-rh9           php-suse92          tomcat-fc1
awstats-fc1     mailman-suse92        phpBB-fc1           tomcat-fc2
awstats-rh9     mod_frontpage-fc1     phpBB-fc2           tomcat-rh9
bbClone-fc1     mod_frontpage-fc2     phpBB-rh9           tomcat-suse92
bbClone-fc2     mod_frontpage-rh9     phpmyadmin-deb31    urchin-fc1
bbClone-rh9     mod_frontpage-suse92  postgresql-deb31    usermin-fc1
conf            mod_perl-deb31        postgresql-fc1      usermin-fc2
debian-3.1      mod_perl-fc1          postgresql-fc2      usermin-rh9
devel-deb31     mod_perl-fc2          postgresql-rh9      uw-imap-fc1
devel-fc2       mod_perl-rh9          postgresql-suse92   uw-imap-fc2
devel-suse92    mod_perl-suse92       proftpd-deb31       uw-imap-rh9
fedora-core-1   mod_ssl-fc1           proftpd-fc1         vzredhat-7.3
fedora-core-2   mod_ssl-fc2           proftpd-fc2         vzredhat-8.0
jdk-deb31       mod_ssl-rh9           proftpd-rh9         webalizer-suse92
jdk-fc1         mysql-deb31           proftpd-suse92      webmin-fc1
jdk-fc2         mysql-fc1             redhat-7.2          webmin-fc2
jdk-rh9         mysql-fc2             redhat-9            webmin-rh9
jdk-suse92      mysql-rh9             redhat-as3-minimal
jre-deb31       mysql-suse92          redhat-devel-9

What we see here are the base OS templates: redhat-9, fedora-core-1 and supporting application templates: postgresql-rh9, mailman-rh9, jdk-fc1, mod_ssl-fc1. So if you wanted to copy over all of redhat 9 you'd need to copy the contents of:

# ls -d /vz/template/*rh9*
/vz/template/ColdFusion-rh9  /vz/template/mod_frontpage-rh9  /vz/template/proftpd-rh9
/vz/template/PostNuke-rh9    /vz/template/mod_perl-rh9       /vz/template/sl-webalizer-rh9
/vz/template/analog-rh9      /vz/template/mod_ssl-rh9        /vz/template/spamassassin-rh9
/vz/template/awstats-rh9     /vz/template/mysql-rh9          /vz/template/tomcat-rh9
/vz/template/bbClone-rh9     /vz/template/openwebmail-rh9    /vz/template/usermin-rh9
/vz/template/jdk-rh9         /vz/template/php-rh9            /vz/template/uw-imap-rh9
/vz/template/jre-rh9         /vz/template/phpBB-rh9          /vz/template/webmin-rh9
/vz/template/mailman-rh9     /vz/template/postgresql-rh9

# ls -d /vz/template/*redhat-9*
/vz/template/redhat-9

To get a template from one HN to another, it simply needs to be rsync'd over to the target HN. It's rsync'd over in this fashion:

rsync -av -e ssh /vz/template/redhat-9 root@10.1.4.65:/vz/template
rsync -av -e ssh /vz/template/*rh9 root@10.1.4.65:/vz/template

Newer (>= 3.x) VZ employs "EZ" templates which are organized a little differently:

# ls /vz/template/
cache   CmdTool.log  debian              redhat-as3-minimal-20080630.tar.gz  vc
centos  conf         redhat-as3-minimal  ubuntu

# ls /vz/template/ubuntu/
10.04  11.04  9.10
# ls /vz/template/ubuntu/10.04/
x86
# ls /vz/template/ubuntu/10.04/x86/
aap_1.091-1_all
aap-doc_1.091-1_all
adduser_3.112ubuntu1_all
anacron_2.3-13.1ubuntu11_i386
apache2_2.2.14-5ubuntu8.2_i386
apache2_2.2.14-5ubuntu8.4_i386
apache2_2.2.14-5ubuntu8.6_i386
apache2_2.2.14-5ubuntu8.7_i386
apache2_2.2.14-5ubuntu8.8_i386
apache2_2.2.14-5ubuntu8.9_i386
<...snip>

# ls /vz/template/cache/
centos-5-x86.tar.gz        suse-11.3-x86.tar.gz     ubuntu-9.10-x86.tar.gz
debian-5.0-x86.tar.gz      ubuntu-10.04-x86.tar.gz
fedora-core-14-x86.tar.gz  ubuntu-11.04-x86.tar.gz

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:

rsync -av -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu

and you also need to move the cache:

rsync -av -e ssh /vz/template/cache/ubuntu-10.04-x86.tar.gz root@10.1.4.69:/vz/template/cache/

Once the transfer is complete, you will be able to run vzpkgls or vzpkg list -O and see the template(s) listed on the target HN.

So far, this all supposes template doesn'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 vzplgls:

mysql-rh9 20030814 20050412

this means there are 2 versions of the mysql package for RH9: 20030814 and 20050412 As an aside, you can't copy over just 1 of them, but if you rsync'd over the mysql-rh9 directory, you'd see 20030814 and 20050412 on the target HN. As long as the versions match up, you're good to go.

With EZ templates, the versions are not as easy to decipher. When you look at the vzpkg list 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'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 vzpkg create cache ubuntu-10.04-x86 it would re-download the latest version of apache, mysql and so on. And any subsequent ubuntu 10.04 CT's created thereafter would use those newer versions, whereas older CT's based on 10.04 would use older templates. You can see how this works by looking at the files under:

# ls /vz/template/ubuntu/10.04/x86/
aap_1.091-1_all
aap-doc_1.091-1_all
adduser_3.112ubuntu1_all
anacron_2.3-13.1ubuntu11_i386
apache2_2.2.14-5ubuntu8.2_i386
apache2_2.2.14-5ubuntu8.4_i386
apache2_2.2.14-5ubuntu8.6_i386
apache2_2.2.14-5ubuntu8.7_i386
apache2_2.2.14-5ubuntu8.8_i386
apache2_2.2.14-5ubuntu8.9_i386
<...snip>

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's almost impossible to know which CT's are using which version of apache so it's hard to try to prune this down and remove unwanted/unneeded applications.

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 would be transferred (what's missing):

rsync -avn --stats -e ssh /vz/template/ubuntu/10.04 root@10.1.4.69:/vz/template/ubuntu

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've permanently joined these templates and now you may have 10 versions of apache on the target HN. There'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 /vz/template/ubuntu/10.04/x86/config:

cat /vz/template/ubuntu/10.04/x86/config/os/default/repositories
/vz/template/ubuntu/10.04/x86/config/os/default/repositories

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:

[root@virt19 /vz/template]# rsync -an -e ssh /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ > v12_c5

(note, that can be dangerous, better to add on full path /vz/template/centos/5)

So in the output file we see things like:

x86/base0/cachecookie
x86/base0/primary.xml.gz 
x86/base0/primary.xml.gz.sqlite 
x86/base0/repomd.xml 
x86/base1/cachecookie 
x86/base1/filelists.xml.gz 
x86/base1/filelists.xml.gz.sqlite  
x86/base1/primary.xml.gz 
x86/base1/primary.xml.gz.sqlite 
x86/base1/repomd.xml
x86/base2/cachecookie

Which make us nervous cause those are not versioned files, i.e.:

5/x86/MAKEDEV-3.23-1.2.i386/usr/sbin/mksock

So those files will replace existing files on v12 rather than the case of the latter where it'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).

If we look further in the file we see:

x86/psa-appvault-moodle-1.8-8202920080409011254.noarch/usr/local/psa/var/cgitory/moodle-1.

9/htdocs/lib/editor/htmlarea/plugins/TableOperations/img/cell-split.gif

and other files looking like:

5/x86/plesk-base-9.0.1-cos5.build90090127.18.i586/etc/sw/keys/info

Which means plesk is here. We don't need plesk on v12 (the CT moving over doesn't use it) so we rerun the rsync and exclude it:

[root@virt19 /vz/template]# rsync -an -e ssh --exclude="plesk*" --exclude="psa*" /vz/template/centos/ root@10.1.4.62:/vz/template/centos/ > v12_c5

and now it's much smaller:

[root@virt19 /vz/template]# cat v12_c5|wc -l
97104

Before running with excludes it was:

[root@virt19 /vz/template]# cat v12_c5|wc -l 
238238

So again, look at what you're doing. Generally, combining templates is fine however.

If you're happy with the merge, run the rsync again without the "-n" to let it actually do the transfer.

Once done, don't forget to add the new template to the HN in Management -> Reference -> Templates

getting help[edit]

vzup2date[edit]

TODO

Adding new OS/application templates[edit]

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.

A template is easily installed via vzup2date:

vzup2date -z

You will be given a list of OS's to install. Select an OS, then customize that selection by checking/unchecking the application templates we do/don't want to include/offer.

Generally, here are the app templates we include/offer:

cyrus-imap
devel
imp
jre
jsdk
mailman
mod_perl
mod_ssl
mysql
php
phpmyadmin
phppgadmin
postgresql
proftpd
spamassassin
squirrelmail
tomcat
vsftpd

We do not (any longer) offer webalizer or analog.

After selecting and installing the OS and apps, you should ensure it's installed:

vzpkg list -O

Your new OS (ex. fedora-core-13-x86_64) will be listed, without a corresponding cache date:

[root@virt13 /vzconf]# vzpkg list -O
centos-6-x86                       2011-07-22 13:24:41
centos-6-x86_64                    2012-03-09 20:42:22
centos-5-x86                       2009-07-27 16:58:24
centos-5-x86_64                    2012-03-09 22:38:53
ubuntu-11.10-x86_64                2012-03-01 23:13:33
ubuntu-9.04-x86                    2009-06-02 11:32:39
ubuntu-12.04-x86_64                2012-05-29 13:50:50
ubuntu-8.04-x86                    2008-09-17 21:27:20
ubuntu-8.10-x86                    2009-03-13 13:58:57
ubuntu-11.04-x86                   2011-12-05 11:15:46
ubuntu-7.04-x86                    2008-09-24 16:42:50
redhat-el6-x86_64
fedora-core-13-x86_64              
fedora-core-12-x86                 2010-02-06 13:24:32
fedora-core-15-x86                 2011-12-05 11:36:43
fedora-core-11-x86                 2009-10-01 16:30:59
fedora-core-14-x86
fedora-core-16-x86_64              2012-03-13 11:40:23
fedora-core-9-x86                  2008-11-29 10:52:18
debian-6.0-x86                     2011-07-29 16:00:35
debian-6.0-x86_64                  2012-03-12 19:53:33
debian-5.0-x86                     2009-03-12 12:39:11

You can also confirm the apps installed:

[root@virt13 /vzconf]# vzpkg list fedora-core-13-x86_64
fedora-core-13-x86_64              2013-03-08 11:39:44
fedora-core-13-x86_64 devel
fedora-core-13-x86_64 php
fedora-core-13-x86_64 proftpd
fedora-core-13-x86_64 postgresql
fedora-core-13-x86_64 phpmyadmin
fedora-core-13-x86_64 mysql

Before you can use the OS you must cache it. To create the cache run:

vzpkg cache [OS]

ex: vzpkg cache fedora-core-13-x86_64

Now it's ready to use. In order to be able to use it with the vm command, you must create a file:

jctmpl-[OS]

ex: jctmpl-fedora-core-13-x86_64

In it, on line 1 we place the OS, followed by the app names, ex:

more jctmpl-fedora-core-13-x86_64
fedora-core-13-x86_64
postgresql
jsdk
mod_ssl
phpmyadmin
mod_perl
tomcat
devel
php
mailman
cyrus-imap
squirrelmail
proftpd
mysql
phppgadmin
spamassassin

The packages will be installed in that order, so any pre-req's should be handled there.

Now, when you run vm it will show you the newly-added OS and you may create a CT using it.

The last few tasks are related to mgmt:

1. add to mgmt->reference->templates (use the existing templates as an example). Once added, the new template will be included with the list of OS's available for the given HN. 2. if this is going to be a new OS offered for ordering, it needs to be added to the order form and webpage.

a. to get a list of applications and versions in the new OS, you should create a test CT, enter it and run dpkg -l|sort (or rpm -aq|sort in centos/fedora) and enter that list in the following places:
/usr/local/www/jc_pub/[osname].html
/usr/local/www/signup/html/[osname].html
Note, you will have to move the most recent OS data from /usr/local/www/signup/html/[osname].html into the corresponding /usr/local/www/signup/html/[osname]_old.html updating the version links in both.

b. to add the new OS to the order form, you will need to update /usr/local/www/signup/html/step1.html in several places (for regular and OSS orders) as well as updating the templateID which you can get from mgmt->reference->templates (or jc:ref_templates)


Old method to obtain the templates:

Go to http://www.parallels.com/en/virtuozzo/templates/catalog/

Download the RPM's and install them

vzpkg list

to see the new packages/os templates

vzpkg create cache "OS_EZ_template_name"

to create a cache


Update OS template[edit]

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 "vzctl enter" 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:

rpm -Uhv ubuntu-8.04-x86-ez-4.0.0-9.swsoft.noarch.rpm
vzpkg clean ubuntu-8.04-x86
vzpkg remove cache ubuntu-8.04-x86
vzpkg create cache ubuntu-8.04-x86


Installing new SSL cert on VZCP[edit]

openssl req -days 1999 -new -x509 -nodes -out server.crt -keyout server.key

US
CA
San Diego
johncompanies.com
johncompanies.com
virt15ohncompanies.com
linux@johncompanies.com

cp -p /etc/httpd/conf/ssl.crt/server.crt /etc/httpd/conf/ssl.crt/server.crt.bak
cp -p /etc/httpd/conf/ssl.key/server.key /etc/httpd/conf/ssl.key/server.key.bak
cp server.crt /etc/httpd/conf/ssl.crt/server.crt
cp server.key /etc/httpd/conf/ssl.key/server.key
/etc/init.d/vzcp restart

Moving virt (drives) to new hardware[edit]

If you have a case where a virt is dead (due to hardware failure), you can move the drives to a new hardware setup. Here are the steps and things to look for:

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 "foreign" volume via the raid BIOS.

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:

alias eth0 tg3
alias eth1 tg3

(supermicro)

Or

alias eth0 e100
alias eth1 e1000

(intel)

Or

alias eth0 bnx2
alias eth1 bnx2

(dell 29500)

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.

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.

Updating kernel on virt[edit]

We now use 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:


1. install kernel and modules

# rpm -ivh vzkernel-enterprise-2.4.20-021stab028.12.777.i686.rpm \
vzmodules-enterprise-2.4.20-021stab028.12.swsoft.i686.rpm
vzkernel-smp          ##################################################
vzmodules-smp       ##################################################

DO NOT USE the "rpm -Uhv" command to install the kernel, otherwise all the previously installed kernels may be removed from your system.

2. update lilo/grub

Lilo:

vi /etc/lilo.conf

rename old Virtuozzo kernel label from "linux+virtuozzo" to "virtuozzo_old" and add a new entry pointing to the newly installed virtuozzo kernel image. For example:

prompt
timeout=50
default=linux+virtuozzo
append="debug panic=5 console=tty console=ttyS0,38400"
boot=/dev/sda
map=/boot/map
install=/boot/boot.b
message=/boot/message
linear

image=/boot/vmlinuz-2.4.18-3smp
        label=linux
        initrd=/boot/initrd-2.4.18-3smp.img
        read-only
        root=/dev/sda1

image=/boot/vmlinuz-2.4.18-3
        label=linux-up
        initrd=/boot/initrd-2.4.18-3.img
        read-only
        root=/dev/sda1

image=/boot/vmlinuz-2.4.20-020stab009.5.777-enterprise
        label=2.4.20-9.5.777
        read-only
        root=/dev/sda1

image=/boot/vmlinuz-2.4.20-020stab009.8.777-enterprise
        label=2.4.20-9.8.777
        read-only
        root=/dev/sda1

image=/boot/vmlinuz-2.4.20-020stab009.21.777-enterprise
        label=2.4.20-9.21.777
        read-only
        root=/dev/sda1

image=/boot/vmlinuz-2.4.20-020stab009.24.777-enterprise
        label=2.4.20-9.24.777
        read-only
        root=/dev/sda1

image=/boot/vmlinuz-2.4.20-021stab028.3.777-enterprise
        label=2.4.20-28.3.777
        read-only
        root=/dev/sda1

image=/boot/vmlinuz-2.4.20-021stab028.5.777-enterprise
        label=old_linux+vz
        read-only
        root=/dev/sda1

image=/boot/vmlinuz-2.4.20-021stab028.12.777-enterprise
        label=linux+virtuozzo
        read-only
        root=/dev/sda1

With this configuration, the new kernel is the default kernel to use at boot. The original kernel entry has been retained with the label "old_linux+vz ".

Grub:

vi /boot/grub /menu.lst

Add new entry at the top. For example:

serial --unit=0 --speed=38400
terminal --timeout=10 serial console
default=0
timeout=10
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
title Virtuozzo 2.6.1 (2.4.20-021stab028.12.777-enterprise)
        root (hd0,0)
        kernel /boot/vmlinuz-22.4.20-021stab028.12.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400
title Virtuozzo 2.6.1 (2.4.20-021stab028.3.777-enterprise)
        root (hd0,0)
        kernel /boot/vmlinuz-2.4.20-021stab028.3.777-enterprise root=/dev/sda1 console=tty0 \ console=ttyS0,38400
title Red Hat Linux (2.4.18-3smp)
        root (hd0,0)
        kernel /boot/vmlinuz-2.4.18-3smp ro root=/dev/sda1
        initrd /boot/initrd-2.4.18-3smp.img
title Red Hat Linux-up (2.4.18-3)
        root (hd0,0)
        kernel /boot/vmlinuz-2.4.18-3 ro root=/dev/sda1
        initrd /boot/initrd-2.4.18-3.img
title Linux with Virtuozzo 2.5
        root (hd0,0)
        kernel /boot/vmlinuz-2.4.20-020stab009.3.777-smp ro root=/dev/sda1
title vz-enterpriseo
        root (hd0,0)
        kernel /boot/vmlinuz-2.4.20-020stab009.21.777-enterprise ro root=/dev/sda1
title vz-enterprise
        root (hd0,0)
        kernel /boot/vmlinuz-2.4.20-020stab009.24.777-enterprise ro root=/dev/sda1 \ console=tty0 console=ttyS0,38400

3. run the lilo (if using lilo)

# lilo
Added linux
Added linux-up
Added virtuozzo_old
Added linux+virtuozzo *

4. reboot the server

shutdown -r 23:05

when it comes time for the shutdown, run stopvirt to get things shut down faster


Remaking service VE (<=3.x only)[edit]

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's how that's done :

vzctl stop 1
ipdel 1 69.55.234.152
vzmlocal 1:2
vzctl set 2 --save --onboot no
vzsveinstall -t redhat-as3-minimal -d /root/Rel261/HW/RPMS -s 69.55.234.152 --skip-client

on 3.0:

vzsveinstall -t redhat-as3-minimal -d /vz/Rel300/HW/RPMS -s 69.55.229.151 --skip-client

vzctl stop 1
vzctl mount 1
vzctl mount 2
/bin/cp -aRf /vz/root/2/home/vzagent0 /vz/root/1/home
/bin/cp -aRf /vz/root/2/var/lib/mysql/VZADB /vz/root/1/var/lib/mysql
/bin/cp -af /vz/root/2/etc/shadow /vz/root/1/etc/
/bin/cp -aRf /vz/root/2/var/vzcp/static/vz/skins/ /vz/root/1/var/vzcp/static/vz
/bin/cp -af /vz/root/2/etc/vzcp/pp/menu.xml  /vz/root/1/etc/vzcp/pp/
/bin/cp -af /vz/root/2/etc/vzcp/pp/dashboard.xml /vz/root/1/etc/vzcp/pp/

vzctl umount 2
vzctl umount 1
vzctl start 1


GRUB: boot once to a new kernel[edit]

To use a different kernel for the next reboot only:

grub --no-floppy
  savedefault --default=N --once
  (where N is the number of the kernel you want to boot once)
  quit

Reboot your machine. It will boot using kernel "N".

grub-reboot N

will do essentially the same thing and prompt to reboot the machine


Recovering from GRUB failure[edit]

(example from DPE 2950)

Boot to CEOS4 server CD (original install cd). Did this example with iso mounted via drac

Boot: linux rescue


Make/edit an ISO on Linux[edit]

mount file.iso /mnt/iso/ -t iso9660 -o ro,loop=/dev/loop0
mkdir /tmp/iso
cp -aR /mnt/iso/* /tmp/iso/
umount /mnt/iso/
mkisofs -iso-level 2 -o /tmp/new.iso /tmp/iso/
rm -fr /tmp/iso

To mount it:

mount -t vfat -o loop /tmp/3wfirmware.iso /mnt/usb/

http://www.damnsmalllinux.org/wiki/index.php/Installing_to_a_USB_Flash_Drive

Mount/edit USB drive on Linux[edit]

mount -t vfat -o loop  /dev/sdc1 /mnt/usb/

This example is for our floating usb drive on virt16. You should edit the device as necessary on other hardware.


Installing OS via net[edit]

Centos 5.1:
http site name: vault.centos.org
dir: /5.1/os/i386/

Centos 5.4:
http site name: mirrors.kernel.org
dir: /centos/5.4/os/i386/
or
/centos/5.4/os/x86_64/
or
http://mirrors.usc.edu/pub/linux/distributions/centos/5.4/os/i386/


Centos 6.2:
http://mirrors.usc.edu/pub/linux/distributions/centos/6.2/os/x86_64/


Single user mode (Ubuntu)[edit]

add to end of kernel line: init=/bin/bash rw


FC9:
http://linux.nssl.noaa.gov/fedora/linux/releases/9/Fedora/i386/os/


FC10:
http://linux.nssl.noaa.gov/fedora/linux/releases/10/Fedora/i386/os/


installing phpMyAdmin[edit]

install php

get latest from:

http://www.phpmyadmin.net/home_page/downloads.php

fetch http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.4.3.2/phpMyAdmin-3.4.3.2-english.tar.gz
tar xzf phpMyAdmin-3.4.3.2-english.tar.gz
mv phpMyAdmin-3.4.3.2-english /usr/local/www/phpMyAdmin
cd /usr/local/www/phpMyAdmin
cp config.sample.inc.php config.inc.php
vi config.inc.php (update secret)
edit apache config and restart
www.xxx.com/setup