I am now encountering several problems with the VPS
that are created using this template
I cannot find the "random" devices that are needed for example
to generate the host key for ssh. The problem is maybe somehow
related with the link of /etc/mtab -> /proc/mounts.
After removing the link and adding the following
line into /etc/mtab on the VPS:
proc /proc proc rw 0 0
at least the device urandom exists and I am able to create the
host keys. But now I cannot ping the VPS:
VPSID NPROC STATUS IP_ADDR HOSTNAME
500 3 running 10.0.186.10 -
dwebwarm Messages: 12 Registered: February 2006 Location: Hewlett-Packard Global De...
Junior Member
From: openvz.org
Actually /proc is not related to u/random. This are regular devices in
/dev. Can you try to create the devices using mknod inside the VPS...
vzctl exec 500 mknod -m 666 /dev/random c 1 8
vzctl exec 500 mknod -m 444 /dev/urandom c 1 9
Martin
Ronald Tanner wrote:
> Hi
>
> On a Gentoo/OpenVZ system with kernel 2.6.16-026test015 I created a
> gentoo template by following the instructions on
>
> http://wiki.openvz.org/Gentoo_template_creation
>
> I am now encountering several problems with the VPS
> that are created using this template
> I cannot find the "random" devices that are needed for example
> to generate the host key for ssh. The problem is maybe somehow
> related with the link of /etc/mtab -> /proc/mounts.
> After removing the link and adding the following
> line into /etc/mtab on the VPS:
>
> proc /proc proc rw 0 0
>
> at least the device urandom exists and I am able to create the
> host keys. But now I cannot ping the VPS:
>
> VPSID NPROC STATUS IP_ADDR HOSTNAME
> 500 3 running 10.0.186.10 -
>
> ping 10.0.186.10 (no answer)
>
> entering works:
>
> vzctl enter 500
>
>
> Thanks for any help.
>
> Ronald
>
Martin Dobrev wrote:
> Actually /proc is not related to u/random. This are regular devices in
> /dev. Can you try to create the devices using mknod inside the VPS...
>
> vzctl exec 500 mknod -m 666 /dev/random c 1 8
> vzctl exec 500 mknod -m 444 /dev/urandom c 1 9
>
> Martin
>
> Ronald Tanner wrote:
>> Hi
>>
>> On a Gentoo/OpenVZ system with kernel 2.6.16-026test015 I created a
>> gentoo template by following the instructions on
>>
>> http://wiki.openvz.org/Gentoo_template_creation
>>
>> I am now encountering several problems with the VPS
>> that are created using this template
>> I cannot find the "random" devices that are needed for example
>> to generate the host key for ssh. The problem is maybe somehow
>> related with the link of /etc/mtab -> /proc/mounts.
>> After removing the link and adding the following
>> line into /etc/mtab on the VPS:
>>
>> proc /proc proc rw 0 0
>>
>> at least the device urandom exists and I am able to create the
>> host keys. But now I cannot ping the VPS:
>>
>> VPSID NPROC STATUS IP_ADDR HOSTNAME
>> 500 3 running 10.0.186.10 -
>>
>> ping 10.0.186.10 (no answer)
>>
>> entering works:
>>
>> vzctl enter 500
>>
>>
>> Thanks for any help.
>>
>> Ronald
>>
--
Ronald Tanner
SEMAFOR Informatik & Energie AG tel. +41 61 690 9888
Sperrstrasse 104B fax. +41 61 690 9880
CH 4057 Basel Switzerland mailto:tanner@semafor.ch
kir Messages: 1430 Registered: August 2005 Location: Moscow, Russia
Senior Member
From: openvz.org
Ronald Tanner wrote:
> No problem, I can create these devices.
> However after a reboot they are lost because /dev is mounted
> on tmpfs and gentoo uses udev.
>
Can you make it NOT use udev? The thing is udev is really useless in a VE.
Probably setting RC_DEVICES="static" in /etc/conf.d/rc helps.
> Besides: do you have any idea why I have to set the routes
>
> /sbin/route add -net 191.255.255.1 netmask 255.255.255.255 dev venet0
> /sbin/route add default gw 191.255.255.1
>
> on the VE by hand to get the net working?
>
This is a trick to have everything routed to venet0. To set it
automatically (by vzctl) you have to name your template
gentoo-(something), so vzctl will guess this is gentoo (by looking at
the value of OSTEMPLATE in /etc/vz/conf/NNN.conf) and will apply the
appropriate scripts when doing vzctl set NNN --ipadd --save
Can you try this instead:
/sbin/route add default dev venet0
and check if it will work for you?
Thanks. Setting RC_DEVICES to static on the gentoo VE seems to fix
the dev problem.
I am currently not able to check the routing as I must rebuild
the kernel to include iptables. We want to use NAT for our VEs.
I will come back.
Ronald
Kir Kolyshkin wrote:
> Ronald Tanner wrote:
>> No problem, I can create these devices.
>> However after a reboot they are lost because /dev is mounted
>> on tmpfs and gentoo uses udev.
>>
> Can you make it NOT use udev? The thing is udev is really useless in a VE.
> Probably setting RC_DEVICES="static" in /etc/conf.d/rc helps.
>> Besides: do you have any idea why I have to set the routes
>>
>> /sbin/route add -net 191.255.255.1 netmask 255.255.255.255 dev venet0
>> /sbin/route add default gw 191.255.255.1
>>
>> on the VE by hand to get the net working?
>>
> This is a trick to have everything routed to venet0. To set it
> automatically (by vzctl) you have to name your template
> gentoo-(something), so vzctl will guess this is gentoo (by looking at
> the value of OSTEMPLATE in /etc/vz/conf/NNN.conf) and will apply the
> appropriate scripts when doing vzctl set NNN --ipadd --save
>
> Can you try this instead:
> /sbin/route add default dev venet0
> and check if it will work for you?
kir Messages: 1430 Registered: August 2005 Location: Moscow, Russia
Senior Member
From: openvz.org
Ronald Tanner wrote:
> Thanks. Setting RC_DEVICES to static on the gentoo VE seems to fix
> the dev problem.
>
Can you put this finding (as well as anything else you found) to the
appropriate wiki page?
> I am currently not able to check the routing as I must rebuild
> the kernel to include iptables. We want to use NAT for our VEs.
>
> I will come back.
> Ronald
>
> Kir Kolyshkin wrote:
>
>> Ronald Tanner wrote:
>>
>>> No problem, I can create these devices.
>>> However after a reboot they are lost because /dev is mounted
>>> on tmpfs and gentoo uses udev.
>>>
>>>
>> Can you make it NOT use udev? The thing is udev is really useless in a VE.
>> Probably setting RC_DEVICES="static" in /etc/conf.d/rc helps.
>>
>>> Besides: do you have any idea why I have to set the routes
>>>
>>> /sbin/route add -net 191.255.255.1 netmask 255.255.255.255 dev venet0
>>> /sbin/route add default gw 191.255.255.1
>>>
>>> on the VE by hand to get the net working?
>>>
>>>
>> This is a trick to have everything routed to venet0. To set it
>> automatically (by vzctl) you have to name your template
>> gentoo-(something), so vzctl will guess this is gentoo (by looking at
>> the value of OSTEMPLATE in /etc/vz/conf/NNN.conf) and will apply the
>> appropriate scripts when doing vzctl set NNN --ipadd --save
>>
>> Can you try this instead:
>> /sbin/route add default dev venet0
>> and check if it will work for you?
>>
>
localhost / # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
127.0.0.0 127.0.0.1 255.0.0.0 UG 0 0 0 lo
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 venet0
But if you have the line
OSTEMPLATE=gentoo-something
in your config file (eg. /etc/vz/777.conf) the routes are added
automatically when you set up the ip address. However they look
different:
localhost / # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
191.255.255.0 0.0.0.0 255.255.255.0 U 0 0 0 venet0
127.0.0.0 127.0.0.1 255.0.0.0 UG 0 0 0 lo
0.0.0.0 191.255.255.1 0.0.0.0 UG 0 0 0 venet0
for me these routes are somehow strange.
And there is another step in the preparation of the os template which
needs some explanation. Why do I have to replace /etc/mtab with
a link to /proc/mounts?
kir Messages: 1430 Registered: August 2005 Location: Moscow, Russia
Senior Member
From: openvz.org
Ronald Tanner wrote:
> And there is another step in the preparation of the os template which
> needs some explanation. Why do I have to replace /etc/mtab with
> a link to /proc/mounts?
This is because VE root filesystem is mounted by the host system, not
the guest -- and therefore root fs will not appear in /etc/mtab. It will
lead to df command non-working.
If you will replace /etc/mtab with a symlink to /proc/mounts, you will
always have up-to-date information of what is mounted in /etc/mtab.
Kir Kolyshkin wrote:
> Ronald Tanner wrote:
>> And there is another step in the preparation of the os template which
>> needs some explanation. Why do I have to replace /etc/mtab with
>> a link to /proc/mounts?
> This is because VE root filesystem is mounted by the host system, not
> the guest -- and therefore root fs will not appear in /etc/mtab. It will
> lead to df command non-working.
>
> If you will replace /etc/mtab with a symlink to /proc/mounts, you will
> always have up-to-date information of what is mounted in /etc/mtab.
--
Ronald Tanner
SEMAFOR Informatik & Energie AG tel. +41 61 690 9888
Sperrstrasse 104B fax. +41 61 690 9880
CH 4057 Basel Switzerland mailto:tanner@semafor.ch