Linux > Virtualization

How to create a new Virtuozzo Container

(1/1)

vinayakk:
How to create a new Virtuozzo Container

The following steps will walk you through setting up a new container on a Virtuozzo server, if you are not familiar with a command line interface

Step 1:
Check the list of containers on your host:


--- Code: ---# vzlist -a
CTID NPROC STATUS IP_ADDR HOSTNAME
1 96 running 67.219.*.* ServiceCT
6646 55 running 216.36.*.* server.example.com
--- End code ---

Step 2:
Create a container with an open ID#. In this example we will use 6648.


--- Code: ---# vzctl create 6648 –ostemplate centos-5-x86
Creating Container private area (centos-5-x86)
Container is mounted
Post create action done
Container is unmounted
Container private area created
Container registered successfully
--- End code ---


--- Code: ---# vzlist -a
CTID NPROC STATUS IP_ADDR HOSTNAME
1 96 running 67.219.*.* ServiceCT
6646 55 running 216.36.*.* server.example.com
6648 – stopped – –

--- End code ---

Immediately after creation the VZ will be in the stopped state. If you are not sure what packages are installed you can use the vzpkgls command, this will show you a listing of installed virtuozzo OS and Application packages on the server. In our example we used a red hat template, but Virtuozzo will support several different OS’s including RedHat, CentOS, Debian, Fedora Core, and SuSe.

Step 3:
Review the default configuration and make changes if necessary for the container:


--- Code: ---# less /etc/sysconfig/vz-scripts/6648.conf
--- End code ---

Step 4:
Add parameters necessary for managing the Container:


--- Code: ---# vzctl set 6648 –ipadd 216.36.*.* –hostname server1test.com –save
Hostname for Container set: server1test.com
Adding IP address(es) to pool: 216.36.*.*
Adding IP address(es): 216.36.*.*
Saved parameters for Container 6648
--- End code ---


--- Code: ---# vzctl set 6648 –diskspace 10G –save
Saved parameters for Container 6648
--- End code ---

Adding RAM memory 2GB to the container:


--- Code: ---# vzctl set 6648 –physpages 262144 –save
Saved parameters for Container 6648
--- End code ---


--- Code: ---# vzctl set 6648 –privvmpages 262144 –save
Saved parameters for Container 6648

--- End code ---


--- Code: ---# vzctl set 6648 –oomguarpages 262144 –save
Saved parameters for Container 6648
--- End code ---


--- Code: ---# vzctl set 6648 –vmguarpages 262144 –save
Saved parameters for Container 6648
--- End code ---

Step 5:
Start the container:


--- Code: ---# vzctl start 6648
Starting Container …
Container is mounted
Setting devperms 20002 dev 0x7d00
Adding port redirection to Container(1): 4643 8443
Adding IP address(es) to pool:
Adding IP address(es): 216.36.*.*
Hostname for Container set: server1test.com
Configure meminfo: 393216
Container start in progress…

--- End code ---

Step 6:
Install yum packages to the container:


--- Code: ---# vzpkg install 6648 -p yum

Loading “rpm2vzrpm” plugin
Cleaning up xml metadata
16 metadata files removed

Loading “rpm2vzrpm” plugin
Making cache files for all metadata files.
This may take a while depending on the speed of this computer
Setting up repositories
—–
--- End code ---


--- Code: ---# vzctl enter 6648
entered into Container 6648
-bash-3.2# hostname
server1test.com
-bash-3.2# hostname -i
216.36.*.*
--- End code ---

This concludes basic setup of a new Virtuozzo Container via the command line

 :)

Navigation

[0] Message Index

Go to full version