OpenVZ Forum


Home » Mailing lists » Users » Problems with Gentoo template creation
Problems with Gentoo template creation [message #5059] Wed, 09 August 2006 15:54 Go to next message
Ronald Tanner is currently offline  Ronald Tanner
Messages: 8
Registered: August 2006
Junior Member
From: openvz.org
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
Re: Problems with Gentoo template creation [message #5062 is a reply to message #5059] Wed, 09 August 2006 20:07 Go to previous messageGo to next message
dwebwarm is currently offline  dwebwarm
Messages: 11
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
>
Re: Problems with Gentoo template creation [message #5064 is a reply to message #5062] Thu, 10 August 2006 05:59 Go to previous messageGo to next message
Ronald Tanner is currently offline  Ronald Tanner
Messages: 8
Registered: August 2006
Junior Member
From: openvz.org
No problem, I can create these devices.
However after a reboot they are lost because /dev is mounted
on tmpfs and gentoo uses udev.

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?

Regards
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
Re: Problems with Gentoo template creation [message #5066 is a reply to message #5064] Thu, 10 August 2006 08:21 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
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?
Re: Problems with Gentoo template creation [message #5067 is a reply to message #5066] Thu, 10 August 2006 12:12 Go to previous messageGo to next message
Ronald Tanner is currently offline  Ronald Tanner
Messages: 8
Registered: August 2006
Junior Member
From: openvz.org
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?
Re: Problems with Gentoo template creation [message #5068 is a reply to message #5067] Thu, 10 August 2006 12:20 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
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?
>>
>
Re: Problems with Gentoo template creation [message #5069 is a reply to message #5068] Thu, 10 August 2006 12:32 Go to previous messageGo to next message
Ronald Tanner is currently offline  Ronald Tanner
Messages: 8
Registered: August 2006
Junior Member
From: openvz.org
I'll care about that.

Kir Kolyshkin wrote:
> Can you put this finding (as well as anything else you found) to the
> appropriate wiki page?
Re: Problems with Gentoo template creation [message #5099 is a reply to message #5068] Fri, 11 August 2006 12:53 Go to previous messageGo to next message
Ronald Tanner is currently offline  Ronald Tanner
Messages: 8
Registered: August 2006
Junior Member
From: openvz.org
My experiments show that setting the route with

/sbin/route add default dev venet0

on the VPS is sufficient.

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?

Regards
Ronald
Re: Problems with Gentoo template creation [message #5111 is a reply to message #5099] Fri, 11 August 2006 16:31 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
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.
Re: Problems with Gentoo template creation [message #5140 is a reply to message #5111] Tue, 15 August 2006 07:45 Go to previous message
Ronald Tanner is currently offline  Ronald Tanner
Messages: 8
Registered: August 2006
Junior Member
From: openvz.org
Thanks. I have just updated the wiki page
http://wiki.openvz.org/Gentoo_template_creation
with your comments.

one last (?) question remains:
Don't you think that the steps described in "Set up udev"
http://wiki.openvz.org/Gentoo_template_creation#Set_up_udev
are obsolete when RC_DEVICES is set to "static" in /etc/conf.d/rc?

Regards
Ronald

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
Previous Topic: -bash: child setpgid (7091 to 8093): Operation not permitted
Next Topic: Can't ping VE from Host
Goto Forum:
  


Current Time: Fri Nov 24 13:10:21 GMT 2017