Parallels H-Sphere Documentation System Administrator Guide

 

VPS Quota Reconfiguration

(version 2.3.1 RC2 and higher)
 
 

Related Docs:   VPS Installation

Last modified: 18 Jan 2005

 

WARNING: This documentation covers Parallels H-Sphere versions up to 3.1. For the latest up-to-date Parallels H-Sphere documentation, please proceed to the official Parallels site.

VPS quota allows you to specify limits on two aspects of disk storage for your Virtual Private Server:
- the number of inodes a user or a group of users may have;
- the number of disk blocks that may be allocated to a user or a group of users.

To enable VPS quota for all Virtual Private Servers, you need to have:
- freevps kernel (build 1056256121 or higher) installed on the host box (steps 4-5 of VPS upgrade procedure);
- the Linux virtual server utilities (vserver-0.22-1 package) (step 8 of VPS upgrade procedure);
- new freevps-tools (freevps-tools-x.x-n package) installed on the host box (step 9 of VPS upgrade procedure);
- H-Sphere VPS scripts (hsphere-vps-x.x-n package) this is not necessary (step 10 of VPS upgrade procedure);
- new quota-3.03-2 package for Virtual Private Servers installed on all VPS.
Remember that quota-3.03-2 package is only for VPS installation!

Virtual Private Servers update, if hsphere-vps-x.x-n package is installed (see VPS upgrade) installs quota-3.03-2 on all existing Virtual Private Servers, enables quota on root partition (/) and configures VPS to turn on/off quotas at the VPS start/stop.

To install quota-3.03-2 manually, you need to:

  • Download the quota-3.03-2 package from the FreeVPS site:
    http://www.freevps.com/download/rpms/i386/quota-3.03-2.i386.rpm
    Source package is available at:
    http://www.freevps.com/download/rpms/SRPMS/quota-3.03-2.src.rpm
  • Install quota tools package on each of your VPS:

    # rpm -ivh --root <VPS_HOME> quota-3.03-2.i386.rpm

    Here,
    <VPS_HOME> - Virtual Private Server home directory;

To reconfigure quota on Virtual Private Server:

  1. Enter Virtual Private Server:
    if hsphere-vps-x.x-n package is installed
    # cd /hsphere/shared/scripts/
    # ./vps-enter VPS_NAME
    or log into it with SSH:
    # ssh root@VPS_NAME (or # ssh root@VPS_IP_ADDRESS)
    or use vserver script (if VPS is running)
    # /usr/sbin/vserver <VPS_NAME> enter
  2. here VPS_NAME - name of Virtual Private Server (VPS_IP_ADDRESS - VPS IP address)
  3. If the /dev/hdv1 block special file does not exist, create it:
    touch /dev/hdv1
  4. Modify /etc/fstab
    Partitions where quota is not yet enabled normally look like:
    /dev/hdv1 / ext2 defaults 1 1

    To enable user quota on a file system (for example, on the root partition), add "usrquota" to the fourth column - the one that contains the word "defaults" (refer to man fstab for details):
    /dev/hdv1 / ext2 defaults,usrquota 1 1

    To enable both user quota and group quota on a file system:
    /dev/hdv1 / ext2 defaults,usrquota,grpquota 1 1

    By default, your Virtual Private Servers are to be configured with user and group quota enabled on the root partition (/).
  5. Make sure that the following line is present in /etc/mtab:
    /dev/hdv1 / ext2 rw,usrquota,grpquota 0 0
  6. Activate quota software by running quotacheck. This will generate the files to maintain the quota databases (refer to man quotacheck for more details):
    # /sbin/quotacheck -avugm
    Here:
    -a - check quota for all mount points specified in /etc/fstab
    -m - creates quota files
    -u - check user quota
    -g - check on group quota
    -f - forces check
  7. quotaon and quotaoff
    quotaon is used to turn on quota accounting:
    # quotaon -augv
    Run quotaoff to turn it off:
    # quotaoff -augv
    These commands are executed at the Virtual Private Server start and stop, respectively.
  8. Check the quota information for mountpoints:
    # repquota -a
    or
    # quotastats

Related Docs:   VPS Installation



© Copyright 2017. Parallels Holdings. All rights reserved.