Create a Virtual Server:
Once you have OpenVZ installed you will be able to begin the process of installing individual containers.
Using the vzctl command you will be able to create a virtual server.
vzctl create 102 –ostemplate debian-6.0-x86 –config basic
Creating container private area (debian-6.0-x86)
Performing postcreate actions
Container private area was created
The following setting provides for the VE to start on boot:
vzctl set 102 –onboot yes –save
vzctl set 102 –hostname debian-tutorials –save
vzctl set 102 –ipadd 192.168.1.102 –save
vzctl set 102 –nameserver 192.168.1.1 –save
vzctl start 102
Starting container …
Container is mounted
Adding IP address(es): 192.168.1.102
Setting CPU units: 1000
Set hostname: debian-tutorials
File resolv.conf was modified
Container start in progress…vzctl set 102 –userpasswd root:your-root-password –save
Changing password for user root.
passwd: all authentication tokens updated successfully.
Saved parameters for VE 102
If you want to see whitch virtual server are running use the following command:
vzlist -a
CTID NPROC STATUS IP_ADDR HOSTNAME
101 – stopped 192.168.1.101 slave
102 11 running 192.168.1.102 debian-tutorials
This was a wonderful article. Very well written and understandable. You effectively covered a very important aspect of open-source technology. I am new to open-source technology so I need to find easy to understand articles and this was really helpful. Thanks!
Looks ok – can i re-assign an IP address after the VM is created using the same syntax?
Also does anybody know how to backup the VM file in the most effective way?
Thanks
yes, you can reaasign the same ip address.
this is very informative! thanks for the info