Util-vserver:Useful commands: Difference between revisions

From Linix VServer
Jump to navigationJump to search
(Revert previous change and merge the two copy sections)
imported>Glenn
 
(4 intermediate revisions by 3 users not shown)
Line 30: Line 30:
run this command:
run this command:
<pre>$ vserver-stat</pre>
<pre>$ vserver-stat</pre>
Please note that root context is not listed anymore with recent util-vserver.


== Copying a virtual server and changing its address IP ==
== Copying a virtual server and changing its address IP ==
Line 59: Line 61:


  vserver <name> build ... --rootdir /path/to/vserver ...
  vserver <name> build ... --rootdir /path/to/vserver ...
== Doing one action to ALL vservers in one go ==
<pre>vsomething [--quiet|-q] [--debug] <cmd> [--] <vserver-name>* [--all] -- <params>+
Execute <cmd> <vserver> <params>* foreach vserver.
</pre>
Just launch any command you want to all the vservers in one go, very usefull for hashify for exemple :)


== Other useful commands ==
== Other useful commands ==
Line 68: Line 81:


'''''vps''''': a ps that shows processes of all vservers
'''''vps''''': a ps that shows processes of all vservers
[[Category:Configuration]]

Latest revision as of 21:19, 21 October 2011

Starting a virtual server[edit]

You can start a virtual server with the following command:

# vserver <name> start

Where <name> is the name of the virtual server.

Coming into a virtual server[edit]

To enter into a virtual server execute this command:

# vserver <name> enter

To exit from a virtual server[edit]

To exit from a virtual server you only need to finish the Shell. For example typing:

# exit

or pressing "Ctrl + d"

In this way you can finish the virtual server Shell.

Stopping a virtual server[edit]

Use the following command:

# vserver <name> stop

Showing what virtual servers are running and some information about them[edit]

run this command:

$ vserver-stat

Please note that root context is not listed anymore with recent util-vserver.

Copying a virtual server and changing its address IP[edit]

You should visit the Building Guest Systems section and look for the clone and rsync methods.

For reference, the (deprecated) vserver-copy method worked as follows.

# vserver-copy --stopstart --ip newIP --domain newDomain nameOldServer nameNewServer

where:

-s,--stopstart: stops  the virtual server before copying and start the new vserver afterwards.
                This really only makes sense if you are copying across root hosts and not changing
                names or IP addresses.

-i,--ip address: the new IP address when changing name. Overwrites /etc/hosts. Must be used with -d

-d,--domain domain: the new DNS domain when changing name. Overwrites /etc/hosts. Must be used with -i

You can see more information in "man vserver-copy"

Deleting a virtual server[edit]

# vserver <name> delete

Where <name> should be replaced by the name of virtual server.

Putting a virtual server in a specified directory[edit]

vserver <name> build ... --rootdir /path/to/vserver ...


Doing one action to ALL vservers in one go[edit]

vsomething [--quiet|-q] [--debug] <cmd> [--] <vserver-name>* [--all] -- <params>+

Execute <cmd> <vserver> <params>* foreach vserver.


Just launch any command you want to all the vservers in one go, very usefull for hashify for exemple :)

Other useful commands[edit]

vserver-info: gives info about the vserver program itself

vtop: a top command that shows the top of *all* vservers

vpstree: a tree ps view of processes of all vservers

vps: a ps that shows processes of all vservers