User`s guide
Advanced Tasks 186
Obtaining Server ID From Inside a
Container
The default Parallels Server Bare Metal installation does not allow users inside a Container to
obtain any information specific to the Parallels server the Container is running on. The reason is
that no Container shall have knowledge about the corresponding server. A Container can be
transparently migrated to another server, and if this Container runs any applications depending
on the particular server, these applications might fail after the migration.
In some situations, however, you need to provide a unique server ID to some applications. For
example, you might want to license your application per server. In this case, after the migration
your customer will need to re-apply the license for your application.
Parallels Server Bare Metal provides access to the unique server ID via the /proc/vz/hwid
file. The default Parallels Server Bare Metal installation makes this file accessible to Containers
from 1 to 100 (i.e. Containers with reserved IDs). It is possible to change this range in the global
configuration file (vz.conf). For example, this is the way to make the file visible in
Containers from 1 to 1000:
# vi /etc/vz/vz.conf
VZPRIVRANGE=”1 1000”
# pctl exec 101 cat /proc/vz/hwid
0C3A.14CB.391B.6B69.02C9.4022.3E2F.CAF6
The above example illustrates accessing the server ID from Container 101.
Enabling VPN for Container
Virtual Private Network (VPN) is a technology which allows you to establish a secure network
connection even over an insecure public network. Setting up a VPN for a separate Container is
possible via the TUN/TAP device. To allow a particular Container to use this device, the
following steps are required:
Make sure the tun.o module is already loaded before Parallels Server Bare Metal is
started:
# lsmod
Allow the Container to use the TUN/TAP device:
# pctl set 101 --devices c:10:200:rw --save
Create the corresponding device inside the Container and set the proper permissions:
# pctl exec 101 mkdir -p /dev/net
# pctl exec 101 mknod /dev/net/tun c 10 200
# pctl exec 101 chmod 600 /dev/net/tun
Configuring the VPN proper is carried out as a common Linux administration task, which is out
of the scope of this guide. Some popular Linux software for setting up a VPN over the
TUN/TAP driver includes Virtual TUNnel <http://vtun.sourceforge.net/> and
OpenVPN <http://openvpn.sourceforge.net/>.










