Updating Virtual Private Server for H-Sphere 2.3.1 RC 2

 
  1. Enter the server console under root. The update procedure requires reboot, therefore it is preferable to reboot from the server console so that you may reload from the old kernel if the problem with the new one occurs.
  2. Check your VPS build version:
    # cat /proc/vservers/setup | grep "vserver build"
    You will get something like this:
    vserver build 1050225694
  3. If your build is older than 1056256121, you need to update your kernel. Download new kernel in rpm-package from our site:
    Kernels for SMP servers are also available:
    where <CPU_type> is CPU type of your host server: i386, i586, i686, athlon.
  4. Install the new kernel package:
    # rpm -ivh kernel-2.4.18-27.7.vserver.rc2.<CPU_type>.rpm
    or
    # rpm -ivh kernel-smp-2.4.18-27.7.vserver.rc2.<CPU_type>.rpm
  5. 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-27.7.vserver.rc2
    Old kernels are:
    vmlinuz-2.4.18-27.7.vserver.
    vmlinuz-2.4.18-3.
  6. 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 have the following look:

    -------------------------------
    default=0
    timeout=10
    splashimage=(hd0,0)/grub/splash.xpm.gz
    title Red Hat Linux (2.4.18-27.7.vserver.rc2)
                 root (hd0,0)
                 kernel /vmlinuz-2.4.18-27.7.vserver.rc2 ro root=/dev/sda5
                 initrd /initrd-2.4.18-27.7.vserver.rc2.img
    title Red Hat Linux (2.4.18-27.7.vserver)
                 root (hd0,0)
                 kernel /vmlinuz-2.4.18-27.7.vserver ro root=/dev/sda5
                 initrd /initrd-2.4.18-27.7.vserver.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, i.e., our new kernel (vmlinuz-2.4.18-27.7.vserver.rc2), as the boot image.
    GRUB loader would update the kernel automatically after reboot.

    (b) LILO:

    Step 1. Modify the lilo.conf configuration file:
    # vi /etc/lilo.conf
    Change the "image" and "initrd" settings lines for the linux_patched section:

       image=/boot/vmlinuz-2.4.18-27.7.vserver.rc2
       initrd=/boot/initrd-2.4.18-27.7.vserver.rc2.img
    

    Important! Do not delete the base kernel image settings section (linux)! 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-27.7.vserver.rc2             # modified
           label=linux_patched
           initrd=/boot/initrd-2.4.18-27.7.vserver.rc2.img  # modified
           read-only
           root=/dev/sda5
    ----------------------
    

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

  7. Suspend all VPS before the server reboot:
    # cd /hsphere/shared/scripts
    # ./vps-suspend.pl <vps_name>

    where <vps_name> is a VPS server name.
    For list of known Virtual Private Servers type:
    # /hsphere/shared/scripts/vps-list.pl
  8. Reboot the server:
    # shutdown -r now
  9. Check if the kernel update takes effect:
    # uname -a
    You should get:
    2.4.18-27.7.vserver.rc2
    Check the VPS build:
    # cat /proc/vservers/setup | grep "vserver build"
    You get something like this:
    vserver build 1056256121
  10. Check the Virtual Private Server tools version:
    # rpm -qa|grep hsphere-vps
    You will see something similar to:
    hsphere-vps-0.98-7
  11. Uninstall old VPS tools:
    # rpm -e hsphere-vps-x.xx-xx
    where x.xx-xx is the old VPS version and release.
  12. Download and install new VPS tools:
    where x.xx-xx is the version and release of the new tools.
    It is also recommended to install the latest package (for now it's: hsphere-vps-0.98-29.noarch.rpm):
    # rpm -ivh hsphere-vps-0.98-29.noarch.rpm
  13. Run update script:
    # cd /hsphere/shared/scripts/
    # ./vps-update.pl
    You will get something similar to this:
    -----------------------------
    Kernel version: 2.4.18-27.7.vserver.rc2
    Kernel build: 1056256121
    Tools package: hsphere-vps-0.98-29
    Updating /hsphere/local/config/vserver/vps.cfg...
    Backing up /hsphere/local/config/vserver/vps.cfg:       [OK]
    Configuration successfully updated.
    Checking modes...
    Creating links...
    Looking at VPSs...
    Patching Virtual Private Server named: vps_name
    Creating /etc/fstab /etc/mtab   [OK]
    Making /sbin/vhalt:     [OK]
    Deleting /etc/rc.d/rc6.d/S*reboot:      [OK]
    Installing quota tools: [OK]
    Disk Limit: xxx Mb     [OK]
    Memory Limit: xxx Mb     [OK]
    Process Limit: xxx     [OK]
    Context RSS limit: xxx Mb        [OK]
    Updating file [vps_name.sh]
    Changing mode for file: vps_name.sh      [OK]
    Chechking virtual server [vps_name] disk usage...        [OK]
    Update complete.
    -----------------------------
    
  14. Run configuration script:
    # ./vps-configure.pl
    and follow the script instructions step by step.
  15. Resume the suspended VPS:
    # cd /hsphere/shared/scripts
    # ./vps-resume.pl <vps_name>

    where <vps_name> is a VPS server name.
    Resume all suspended VPSs
    # ./vps-resume.pl --all
    For the list of all known Virtual Private Servers, type:
    # /hsphere/shared/scripts/vps-list.pl

Read VPS Quota Reconfiguration for more details of setting VPS quota.



Home   Products   Services   News
© Copyright. . PSOFT. All Rights Reserved. Terms | Site Map