Book Image

OpenVZ Essentials

By : Mark Furman
Book Image

OpenVZ Essentials

By: Mark Furman

Overview of this book

Table of Contents (13 chapters)

The vzctl command


The next command that we are going to cover is the vzctl command. This is the primary command that you are going to use when you want to perform tasks with the containers on the node. The initial functions of the vzctl command that we will go over are how to start, stop, and restart the container.

Starting a container

We use vzctl to start a container on the node. To start a container, run the following command:

vzctl start 101

Starting Container ...
Setup slm memory limit
Setup slm subgroup (default)
Setting devperms 20002 dev 0x7d00
Adding IP address(es) to pool:
Adding IP address(es): 192.168.2.101
Hostname for Container set: gotham.example.com
Container start in progress...

In the previous example, we used the vzctl command with the start option to start the container 101.

Stopping a container

To stop a container, run the following command:

vzctl stop 101
Stopping container ...
Container was stopped
Container is unmounted

In the previous example, we used the vzctl command...