[Users] Some basic startup related issues

Nirmal Guhan vavatutu at gmail.com
Thu Jul 8 21:14:33 EDT 2010


On Thu, Jul 8, 2010 at 8:54 AM, Scott Dowdle <dowdle at montanalinux.org> wrote:
> Greetings,
>
> ----- Original Message -----
>> I doubt. For instance, in another container (102) that is running, I have:
>>
>> # cat /etc/fstab
>> none /dev/pts devpts rw 0 0
>>
>> # mount
>> /dev/simfs on / type simfs (rw)
>> /proc on /proc type proc (rw)
>> /sys on /sys type sysfs (rw)
>> none on /dev/pts type devpts (rw)
>> none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
>>
>> So wonder where these extra entries came from?
>
> Forgive me, but I'm jumping into the middle of this discussing without having closely read all of the previous posts.
>
> To the best of my knowledge, vzctl make sures that /proc shows up in the container once it has started... and that is why you don't need an entry for it in the container's /etc/fstab.

Above entries must come from some fstab file (either /etc/fstab within
container or some top level container specific fstab in the host). In
other words, if I have to mount some filesystems during startup (say
bind mount of host directories), how do I do that? /etc/fstab within
container does not seem to help.

>
> If I understand correctly you have done a physical-2-virtual migration, right?  If so, have you checked out this wiki page?
>
> http://wiki.openvz.org/P2v

I created one more container using the above steps. I still see the
same issue. I then copied the source code from 102/ and this worked as
expected. I still have few questions. Please see below.

>
>> I added proc to /etc/fstab in 50 too but it still does not get mounted
>> during start.
>
> Please note that according to the OpenVZ documentation, you aren't supposed to use numbers 1-100 as container IDs because those numbers are reserved.  I'm not saying using 50 affects anything, but I'd rather not encourage that practics.
>
>> > mmmm looked a little more deeply to your config
>> >
>> > correct it by adding, correcting values
>> >
>> > in 50.conf
>> >
>> > HOSTNAME="foo.example.com"
>> > VE_ROOT="/vz/root/$VEID"
>> > VE_PRIVATE="/vz/private/$VEID"
>> > OSTEMPLATE="centos"
>> > ORIGIN_SAMPLE="vps.basic"
>> > NAMESERVER="8.8.8.8 8.8.4.4"
>> > NAME="foo"
>> >
>> > *nameservers I entered public google dns servers, enter yours
>>
>> Still does not help. I compared with 102.conf (another container that
>> gets interface address) I don't have nameserver configured. It still
>> gets IP address (though netmask is wrong so basically useless).
>>
>> Here is the output from 102 :
>>
>> [root at localhost /]# ip addr ls
>> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
>> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>> inet 127.0.0.1/8 scope host lo
>> inet6 ::1/128 scope host
>> valid_lft forever preferred_lft forever
>> 3: venet0: <BROADCAST,POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1500 qdisc
>> noqueue
>> link/void
>> inet 127.0.0.1/32 scope host venet0
>> inet 10.33.11.60/32 brd 10.33.11.60 scope global venet0:0
>> [root at localhost /]# route add default gw 10.33.11.1
>> SIOCADDRT: Network is unreachable
>> [root at localhost /]#
>>
>> Here is the output from 50 :
>>
>> [root at localhost /]# vzctl start 50
>> Starting container ...
>> Container is mounted
>> Adding IP address(es): 10.33.11.55
>> Setting CPU units: 1000
>> Configure meminfo: 65536
>> Container start in progress...
>> [root at localhost /]# vzctl enter 50
>> entered into CT 50
>> Unable to get tty name: Bad file descriptor
>> -bash-3.2#
>> -bash-3.2# ip addr ls
>> 1: lo: <LOOPBACK> mtu 16436 qdisc noop
>> link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
>> 3: venet0: <BROADCAST,POINTOPOINT,NOARP> mtu 1500 qdisc noop
>> link/void
>> -bash-3.2#
>
> I'd strongly suggest you copy your 102.conf to 50.conf and then edit 50.conf to change the container specific info (hostname, IP address, etc).  I say that because from the previous comments, it isn't clear that you have a complete config.

I had tried this earlier and tried again after copying the 102 source
files to 123 (my new container). conf file does not make any
difference but the source does. Not sure how.

>
> When a container is started up, vzctl looks at the config for the OSTEMPLATE value.  It then looks in /etc/vz/dists/ for the script that matches the distro and in that script are defined various other scripts (in /etc/vz/dists/scripts/) that are used to inject various parameters into the container's filesystem each time the container starts.

In my case (both 102 and 123) OSTEMPLATE is centos-5-i386-default but
I don't see centos-5-i386-default.conf in dists directory. Things
still seem to work ok. Am I missing anything ?

>
> Just look at those scripts to see how they are injecting the info.  Either they aren't getting called (because vzctl can't figure out which ones to use) or they are failing at their job.  You'll have to compare what they are supposed to do and what they actually get done to figure it out.

Even with nameserver configured, DNS resolution does not work.
Overriding default gw does not work either.
root at localhost /]# ping 10.33.11.1
PING 10.33.11.1 (10.33.11.1) 56(84) bytes of data.
64 bytes from 10.33.11.1: icmp_seq=1 ttl=254 time=0.666 ms
64 bytes from 10.33.11.1: icmp_seq=2 ttl=254 time=0.403 ms

--- 10.33.11.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 0.403/0.534/0.666/0.133 ms
[root at localhost /]# route add default gw 10.33.11.1
SIOCADDRT: Network is unreachable
[root at localhost /]# ip addr ls | grep inet
    inet 10.33.11.59/32 brd 10.33.11.59 scope global venet0:0

>
> I hope I've given you some additional info to get your problem solved.

Yes, thanks.
>
> TYL,
> --
> Scott Dowdle
> 704 Church Street
> Belgrade, MT 59714
> (406)388-0827 [home]
> (406)994-3931 [work]
> _______________________________________________
> Users mailing list
> Users at openvz.org
> https://openvz.org/mailman/listinfo/users
>



More information about the Users mailing list