FreeVPS Documentation Version 1.1

Upgrading VPS Host

 

Related Docs:  

VPS Host Installation FreeVPS Tools FreeVPS Kernel



This document contains general procedure of upgrading VPS host to the latest version.

IMPORTANT:
• H-Sphere VPS tools require correct kernel build to be installed. Otherwise, they will not work;
• To update H-Sphere VPS tool packages, DO NOT use the rpm -U command. Instead, uninstall old packages and then install new one with rpm -i option.

 

Required Packages

The following packages should be installed:

  • Kernel, version 2.4.18-27.7, patched to support VPS:
    kernel-freevps-1.1-0.<CPU>.rpm

    for SMP servers:
    kernel-freevps-smp-1.1-0.<CPU>.rpm

    where <CPU> is CPU type on your host box: i386, i586, i686, athlon.

    The latest kernel releases can be found in the FreeVPS download area.

  • Linux vserver utilities (Linux vserver project):
    vserver-0.22-1.i386.rpm

  • FreeVPS tools:
    freevps-tools-1.1-1.i386.rpm

  • H-Sphere VPS scripts:
    hsphere-vps-1.1-1.i386.rpm

  • Standard modutils package updates for the 2.4.18 kernel:
    modutils-2.4.18-3.7x.i386.rpm
    modutils-devel-2.4.18-3.7x.i386.rpm

  • hsphere-sudo-1.6.3p5.rpm - H-Sphere package that enables users to execute commands as another user, e.g., as superuser.

Please also check the version you have in the list of VPS releases and patches.

 

Upgrade Procedure

  1. Suspend all VPS before the server reboot:
    # cd /hsphere/shared/scripts
    # ./vps-suspend.pl -a

  2. Download the packages and put them into a separate directory, for example, to /root/inst:

    # wget http://www.psoft.net/shiv/HS/VPS/modutils-2.4.18-3.7x.i386.rpm
    # wget http://www.psoft.net/shiv/HS/VPS/modutils-devel-2.4.18-3.7x.i386.rpm

    Kernel without SMP:
    # wget http://www.freevps.com/download/rpms/<CPU>/kernel-freevps-1.1-0.<CPU>.rpm
    Kernel with SMP:
    # wget http://www.freevps.com/download/rpms/<CPU>/kernel-freevps-smp-1.1-0.<CPU>.rpm

    # wget http://www.freevps.com/download/releases/vserver-0.22-1.i386.rpm
    # wget http://www.freevps.com/download/rpms/i386/freevps-tools-1.1-1.i386.rpm
    # wget http://www.psoft.net/shiv/HS/VPS/hsphere-vps-1.1-1.i386.rpm
    # wget http://www.psoft.net/shiv/HS/RH73/hsphere-sudo-1.6.3p5.rpm

    Here, <CPU> is the CPU type of your host server.

  3. Check the VPS build:
    # cat /proc/vservers/setup | grep "vserver build"
    You will get something like this:
    vserver build 1056256121
    If your vserver build is less than the required 1069944738, you need to update your kernel (see steps 4-5 of this instruction). Otherwise, skip these steps.

  4. Check your kernel release.

    # uname -r

    You will get something like this (for example):

    2.4.18-27.7.vserver.rc2

    Find out kernel packages installed:

    # rpm -qa | grep "kernel-2.4.18"

    You will get, for example:

    kernel-2.4.18-27.7.vserver.rc2
    kernel-2.4.18-3

    Therefore, the old kernel package to be uninstalled is kernel-2.4.18-27.7.vserver.rc2. Howerever, beforehand you need to install the new kernel as specified in the next step.

  5. Install new kernel.
    Note: Skip this step if you have the latest kernel release.

    1. Install the new kernel package:

      Kernel without SMP:
      # rpm -ivh kernel-freevps-1.1-0.<CPU>.rpm
      Kernel with SMP:
      # rpm -ivh kernel-freevps-smp-1.1-0.<CPU>.rpm

      Go to the /boot directory to check if the kernel update takes place:

      # cd /boot
      # ls -la

      The new kernel is vmlinuz-2.4.18-freevps-1.1-0.
      The old one would look like vmlinuz-2.4.18-3.

    2. Modify the boot loader, (a) for GRUB or (b) for LILO:

      (a) GRUB: Edit the /boot/grub/grub.conf configuration file:

      vi /boot/grub.conf
      

      The file should look like this:

      default=0
      timeout=10
      splashimage=(hd0,0)/grub/splash.xpm.gz
      title Red Hat Linux (2.4.18-freevps-1.1-0)
                  root (hd0,0)
                  kernel /vmlinuz-2.4.18-freevps-1.1-0 ro root=/dev/sda5
                  initrd /initrd-2.4.18-freevps-1.1-0.img
      title Red Hat Linux (2.4.18-3)
                  root (hd0,0)
                  kernel /vmlinuz-2.4.18-3 ro root=/dev/sda5
                  initrd /initrd-2.4.18-3.img
      

      default=0 means that GRUB would take the first title record as the boot image, i.e., our new kernel.

      GRUB loader would update the kernel automatically after reboot.

      (b) LILO:
      Step 1: Modify the lilo.conf configuration file:

      # vi /etc/lilo.conf

      Copy and paste the kernel image settings lines and change the kernel number and the label parameter. Change the default kernel loading parameter to the new kernel label name.

      Important! Do not delete the old kernel image settings! If you delete these lines and something goes wrong with the new kernel installation, your system would not start!

      After these changes, lilo.conf would look like:

      prompt
      timeout=50
      default=linux_patched
      boot=/dev/sda
      map=/boot/map
      install=/boot/boot.b
      message=/boot/message
      linear
      
      image=/boot/vmlinuz-2.4.18-3
              label=linux
              initrd=/boot/initrd-2.4.18-3.img
              read-only
              root=/dev/sda5
      
      image=/boot/vmlinuz-2.4.18-freevps-1.1-0
              label=linux_patched
              initrd=/boot/initrd-2.4.18-freevps-1.1-0.img
              read-only
              root=/dev/sda5
      

      Step 2: Type lilo to apply changes:
      # lilo
      You will see the line:
      Added linux
      Added linux_patched *

    3. Reboot the server:

      # shutdown -r now

    4. 6) Check if the kernel update takes effect:

      # uname -a

      If the kernel version is 2.4.18-freevps-1.1-0, the kernel is patched successfully.

    After the new kernel installation is complete, uninstall the old kernel which version was defined in Step 4. For example, if kernel is kernel-2.4.18-27.7.vserver.rc2, run:

    # rpm -e kernel-2.4.18-27.7.vserver.rc2

  6. Check the H-Sphere VPS tools version:
    # rpm -qa | grep hsphere-vps

    You will see something like this:
    hsphere-vps-x.xx-x

    where x.xx-x is the old hsphere-vps tools/scripts version and release number.

  7. Uninstall the old H-Sphere VPS tools:
    # rpm -e hsphere-vps-x.xx-xx

  8. Install the Linux virtual server utilities:
    # rpm -ivh vserver-0.22-1.i386.rpm

  9. Install generic FreeVPS tools:
    # rpm -ivh freevps-tools-1.1-1.i386.rpm --replacefiles
    Note: Install the package with --replacefiles option!

  10. Install new H-Sphere VPS tools:
    # rpm -ivh hsphere-vps-1.1-1.i386.rpm --replacefiles
    Note: Install the package with --replacefiles option!

  11. Run update script:
    # cd /hsphere/shared/scripts/
    # ./vps-update.pl

    and follow the script instructions step by step.

  12. Run configuration script:
    # ./vps-configure.pl
    and follow the script instructions step by step.

  13. Resume suspended VPS:
    # cd /hsphere/shared/scripts
    # ./vps-resume.pl <vps_name>

    where <vps_name> is a suspended VPS server name.
    To resume all suspended VPS servers, run:
    # ./vps-resume.pl --all



Home   Downloads   Docs   FAQ   News  Partners   Contact
© Copyright 1998-2006. Positive Software Corporation.
All rights reserved.