ok guide Open VZ

Page 95

Reference

95

You should use action scripts (mount/umount and start/stop) if you would like to carry out some actions upon VPS startup/shutdown. The vzctl restart vpsid command consecutively performs the stopping and starting of the corresponding VPS. The vzctl status vpsid command shows current VPS state. It outputs the following information: whether the VPS private area exists, whether it is mounted and whether the VPS is running as in the example below: # vzctl status 101 VPS 101 exist mounted running

vzctl mount and vzctl umount These commands take no additional arguments: vzctl mount vpsid vzctl umount vpsid

The first command mounts the VPS private area to the VPS root directory (/vz/root/vpsid/ on the Hardware Node) without starting it. Normally you do not have to use this command as the vzctl start command mounts the VPS private area automatically. The vzctl umount command unmounts the VPS private area. Usually there is no need in using this command either, for vzctl stop unmounts the VPS private area automatically.

vzctl set This command is used for setting VPS parameters. It has the following syntax: vzctl set vpsid --setting_name value […] [ --save ]

An optional –-save switch tells vzctl whether to save changes into the VPS configuration file /etc/sysconfig/vz-scripts/vpsid.conf. Practically all VPS settings can be changed dynamically without the necessity of VPS reboot. The exceptions are --onboot, --quotaugidlimit, --capability, --private, and --root. The settings specified in this file can be subdivided into the following categories: miscellaneous, networking, and resource management parameters. Miscellaneous settings: --onboot yes|no

This setting requires the –-save switch. If you set it to “yes” than OpenVZ will automatically start this Virtual Private Server on next system startup.

--userpasswd user:password

This setting creates a new user with the specified password in the VPS, or changes the password of an already existing user. This command modifies not the VPS configuration file, but the /etc/passwd and /etc/shadow files inside the VPS. In case the VPS root is not mounted, it is automatically mounted to apply the changes and then unmounted.


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.