Home > Articles > Creating Container Manually

Creating Container Manually

February 15th, 2010 Leave a comment Go to comments

Creating Container

After the Container ID and the installed OS EZ template have been chosen, you can create the Container private area with the vzctl create command. The private area is the directory containing the VZFS symlinks, copy-on-write area, and private files of the given Container. The private area is mounted to the /vz/root/CT_ID directory on the Hardware Node and provides Container users with a complete Linux file system tree.

The vzctl create command requires only the Container ID and the name of the OS template as arguments; however, in order to avoid setting all the Container resource control parameters after creating the private area, you can specify a sample configuration to be used for your new Container. The sample configuration files are residing in the /etc/vz/conf directory and have names with the following mask: ve-<configname>.conf-sample. The most commonly used sample is the ve-basic.conf-sample file; this sample file has resource control parameters suitable for most Containers.

Thus, for example, you can create a new Container by typing the following string:

# vzctl create 101 –ostemplate redhat-el5-x86 -–config basic

Creating Container private area (redhat-el5-x86)

Container is mounted

Postcreate action done

Container is unmounted

Container private area was created

Delete port redirection

Adding port redirection to Container(1): 4643 8443

In this case, the Virtuozzo Containers software will create a Container with ID 101, the private area based on the redhat-el5-x86 OS EZ template, and configuration parameters taken from the ve-basic.conf-sample sample configuration file.

If you specify neither an OS template nor a sample configuration, vzctl will try to take the corresponding values from the global Virtuozzo configuration file (/etc/vz/vz.conf). So you can set the default values in this file using your favorite text file editor, for example:

DEF_OSTEMPLATE=”.redhat-el5-x86″

CONFIGFILE=”basic”

and do without specifying these parameters each time you create a new Container. Please keep in mind that the . symbol before the template name in the DEF_OSTEMPLATE parameter is used to indicate that the Container being created is to be based on an OS EZ template; otherwise, it will denote an OS standard template Now you can create a Container with ID 101 with the following command:

# vzctl create 101

Creating Container private area (redhat-el5-x86)

Container is mounted

Postcreate action done

Container is unmounted

Container private area was created

Delete port redirection

Adding port redirection to Container(1): 4643 8443

Source : parallels

Categories: Articles Tags:
  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.