Shell utilities (VDSmanager)

From ISPWiki

Jump to: navigation, search

VDSmanager includes both the control panel and a set of utilities that can be used for managing virtual private servers via shell:

Below is detailed description of each utility.

Contents

vdsctl

This utility allows to add, delete, stop and start a VPS, change the root user password, disk quota and other server resources, fix quotas, and execute commands on a single or multiple servers.

Adding virtual private server

To add a VPS, run the command:

vdsctl create IP-address TEMPLATE NAME

  • IP-address - IP-address of a new virtual server. If your VDSmanager is integrated with IPmanager, specify auto to automatically assign the IP-address.
  • NAME - domain name of the virtual private server.
  • TEMPLATE - name of the disk template used by the virtual private server.

Once you have set up the virtual private server, you should specify disk quota and limits on the system resources, and then restart the server.

Deleting virtual private server

To delete a virtual private server, run one of the following commands:

vdsctl delete IP-address vdsctl delete NAME

  • IP-address - IP-address of the virtual private server.
  • NAME - domain name of the virtual private server that you wish to delete.

Stopping virtual private server

To stop a virtual private server, run one of the following commands:

vdsctl stop IP-address vdsctl stop NAME

  • IP-address - IP-address of the virtual private server.
  • NAME - domain name of the virtual private server you wish to stop.

Starting virtual private server

To start the virtual private server, run one of the following commands:

vdsctl start IP-address vdsctl start NAME

  • IP-address - IP-address of the virtual private server.
  • NAME - domain name of the virtual private server you wish to start.

To start all your private servers run the command

vdsctl start all

Changing disk quota

To change disk quota allocated to the virtual private server, run one of the following commands:

vdsctl disksize IP-address SPACE vdsctl disksize NAME SPACE

  • IP-address - IP-address of the virtual private server.
  • NAME - domain name of the virtual private server.
  • SPACE - disk space (Mb) allocated to the virtual private server.

Chang resources quota

To change the virtual private server's CPU, RAM, simultaneously running processes, file descriptors, IP packages per second or bandwidth quotas, run one of the following commands:

vdsctl setlimit IP-address LIMITS vdsctl setlimit LIMIT NAME

  • IP-address - IP-address of the virtual private server.
  • NAME - domain name of the virtual private server.
  • LIMITS - set of limits, each of them are specified as parameter=value. The following limits are currently available:
    • cpu - CPU limit (MHz).
    • mem - Memory/RAM limit (Mb). The default setting of virtual memory (swap) is twice the amount of RAM in the machine.
    • proc - maximum number of simultaneously running processes.
    • desc - maximum number of file descriptors that may be used simultaneously.
    • iprate - maximum number of outgoing IP packets per second.
    • traf - maximum amount of outgoing traffic per month (Mb). this limit allows to monitor traffic usage via the control panel web-interface or via VDSmanager API.

When adding a VPS, you must set all of the above limits. Later on you can change them and use the ones you need. For example:

vdsctl setlimit mydomain.com mem=128 cpu=600 proc=1024 desc=2048 iprate=4096 traf=30720

Changing the VPS admin password

If you wish to change the root password of the virtual private server, run one of the following commands:

vdsctl passwd IP-address PASSWORD vdsctl passwd PASSWORD NAME

  • IP-address - IP-address of the virtual private server.
  • NAME - domain name of the virtual private server.
  • PASSWORD - new root password.

Runing commands in VPS

If you wish to run programs in the VPS, use one of the following commands:

vdsctl exec IP-address COMMAND vdsctl exec NAME COMMAND

  • IP-address - IP-address of the virtual private server.
  • NAME - domain name of the virtual private server.
  • COMMAND - name of the running command and its parameters (in quotation marks). A full path to the program is required.

For security reasons, when executing the command, input/output stream are not redirected to the main server, thus you will not see the executed program output. You can solve the problem by redirecting the stream into the file on the virtual private server. For example:

vdsctl exec mydomain.com "/bin/date > /tmp/current_date"

If you wish to start the program on all the currently running VPSs, run the following command:

vdsctl exec all COMMAND

vdslogin

This utility allows to access shell of the virtual private server. This program has one optional parameter, that can be specified as a VPS IP-address, domain name or their parts. For example:

vdslogin 123.45.67.89 vdslogin 123.45.67 vdslogin mydomain.com vdslogin omain

The list of all registered virtual private servers that meet the specified parameter will be returned. Select a required server and click "Ok".

If the parameter is not specified or no virtual servers meet its requirements, all virtual servers will be listed.

If only one virtual server corresponds to the parameter, it will be applied automatically.

vdsps

The utility allows to view a list of processes currently running on a virtual private server. Specify one of the following values:

  • PID - process identifier. Information concerning the process with specified ID will be displayed.
  • IP-address - IP-address of the virtual private server which processes you wish to list.
  • Domain name - domain name of the virtual private server which processes you wish to list.

The list of processes will be displayed. It consists of three columns:

  • PID - process identifier.
  • Process name - name of the executed command.
  • Domain name - domain name of the virtual private server on which the process runs.


Please note, that the processes on the virtual server can be view by the ps command that run on the main server. These processes are flagged as J.

vdstop

The utility allows to view the information about resources your VPSs consume(no parameters included).

When starting vdstop the list of VPSs will be displayed:

  • Name - VPS domain name. To sort the list by this column, press n.
  • IP - VPS IP address. To sort the list by this column, press i.
  • Proc - number of processes running on the VPS. To sort the list by this column, press p.
  • Load averages - (3 columns) average usage of the system resources (number of outstanding processes) during the last 1, 5 and 15 minutes. To sort the list by this column, press a.
  • files - number of open file descriptors on the VPS. To sort the list by this column, press f.
  • mem - RAM (Mb) consumed by the VPS. To sort the list by this column, press m.
  • swap - virtual memory (Mb) consumed by the VPS. To sort the list by this column, press s.
  • time - total CPU used by the VPS processes.
  • disk io - number of the VPS operations with the hard disk over the statistics update period.

The information updates every 5 seconds. To quit the Program, press q or Ctrl+C.

Was this helpful? Yes | No
Views
Personal tools