Re: [Users] Some basic startup related issues
Greetings, - Original Message - 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. There is now container fstab on the host node. For how to mount stuff inside the container... you can bind mount. See the section about Action Scripts in the fine OpenVZ Users Guide. There is also a wiki page here: http://wiki.openvz.org/Bind_mounts 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 ? The OSTEMPLATE value and the container config are not the same thing... so you won't find a centos-5-i386-default.conf. The OSTEMPLATE value (found in the container config) is used by vzctl so it knows what scripts to use when injecting settings into the container at startup. For a CentOS container it should use /etc/vz/dists/centos.conf which defines the various scripts to use in /etc/vz/dists/scripts/. In this case: ADD_IP=redhat-add_ip.sh DEL_IP=redhat-del_ip.sh SET_HOSTNAME=redhat-set_hostname.sh SET_DNS=set_dns.sh SET_USERPASS=set_userpass.sh SET_UGID_QUOTA=set_ugid_quota.sh POST_CREATE=postcreate.sh Look at those scripts and you can see exactly what they do to configure the container. Even with nameserver configured, DNS resolution does not work. Overriding default gw does not work either. r...@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 You should not need to override the given gateway. OpenVZ, with the default venet device, sets up networking a little weird but it should work. So far as DNS not working in your container, that is almost always caused by firewall/iptables rules on the host node. TYL, -- Scott Dowdle 704 Church Street Belgrade, MT 59714 (406)388-0827 [home] (406)994-3931 [work] ___ Users mailing list Users@openvz.org https://openvz.org/mailman/listinfo/users
Re: [Users] Some basic startup related issues
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. 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 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. 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 : [r...@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 [r...@localhost /]# route add default gw 10.33.11.1 SIOCADDRT: Network is unreachable [r...@localhost /]# Here is the output from 50 : [r...@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... [r...@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. 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. 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. I hope I've given you some additional info to get your problem solved. TYL, -- Scott Dowdle 704 Church Street Belgrade, MT 59714 (406)388-0827 [home] (406)994-3931 [work] ___ Users mailing list Users@openvz.org https://openvz.org/mailman/listinfo/users
Re: [Users] Some basic startup related issues
On Thu, Jul 8, 2010 at 8:54 AM, Scott Dowdle dow...@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. 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 : [r...@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 [r...@localhost /]# route add default gw 10.33.11.1 SIOCADDRT: Network is unreachable [r...@localhost /]# Here is the output from 50 : [r...@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... [r...@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. r...@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
Re: [Users] Some basic startup related issues
On Wed, Jun 30, 2010 at 12:29 AM, Arturas Skauronas hel...@gmail.com wrote: On Wed, Jun 30, 2010 at 12:11 AM, Nirmal Guhan vavat...@gmail.com wrote: I did so. BTW, where does the container get it fstab entries from? from container etc/fstab file in yours example: /vz/private/50/etc/fstab I doubt. For instance, in another container (102) that is running, I have : # cat /etc/fstab none/dev/ptsdevpts 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? I added proc to /etc/fstab in 50 too but it still does not get mounted during start. No luck yet with these updates :( [r...@localhost conf]# vzctl start 50 Warning: distribution not specified default used /etc/vz/dists/default 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 : [r...@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 [r...@localhost /]# route add default gw 10.33.11.1 SIOCADDRT: Network is unreachable [r...@localhost /]# Here is the output from 50 : [r...@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... [r...@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# FYI, I tried with NAMESERVER as well but no luck with it too. ___ Users mailing list Users@openvz.org https://openvz.org/mailman/listinfo/users ___ Users mailing list Users@openvz.org https://openvz.org/mailman/listinfo/users
Re: [Users] Some basic startup related issues
On Sat, Jun 26, 2010 at 4:02 AM, Nirmal Guhan vavat...@gmail.com wrote: Am following http://wiki.openvz.org/Physical_to_container and facing a couple of issues. Hope someone can help. Am running CentOS 5.5 and trying to create a CentOS 5 container. 1) /proc does not get mounted. I have to manually mount it everytime. I have following entries in /etc/fstab I thing that's another issue from http://wiki.openvz.org/Physical_to_container /etc/mtab Link /etc/mtab to /proc/mounts, for df to work properly: rm -f /vz/private/123/etc/mtab ln -s /proc/mounts /vz/private/123/etc/mtab container must be stopped none /dev/pts devpts defaults 0 0 none /proc proc defaults 0 0 none //sys sysfs defaults 0 0 none /dev/shm tmpfs defaults 0 0 [r...@localhost /]# vzctl enter 50 entered into CT 50 Unable to get tty name: Bad file descriptor -bash-3.2# mount warning: can't open /etc/mtab: No such file or directory --bash-3.2# mount -t proc none /proc -bash-3.2# mount /dev/simfs on / type simfs (rw) none on /proc type proc (rw) -bash-3.2# 2) Not able to assign IP address to venet0. Here are the lines from /etc/vz/conf/50.conf IP_ADDRESS=10.33.11.55 BROADCAST=255.255.255.255 NETMASK=255.255.255.192 I have set onboot=NO in vz/private/50/etc/sysconfig/network-scripts/ifcfg-eth0 delete file vz/private/50/etc/sysconfig/network-scripts/ifcfg-eth0 and please post all 50.conf file --Nirmal ___ Users mailing list Users@openvz.org https://openvz.org/mailman/listinfo/users ___ Users mailing list Users@openvz.org https://openvz.org/mailman/listinfo/users
Re: [Users] Some basic startup related issues
On Tue, Jun 29, 2010 at 1:49 AM, Arturas Skauronas hel...@gmail.com wrote: On Sat, Jun 26, 2010 at 4:02 AM, Nirmal Guhan vavat...@gmail.com wrote: Am following http://wiki.openvz.org/Physical_to_container and facing a couple of issues. Hope someone can help. Am running CentOS 5.5 and trying to create a CentOS 5 container. 1) /proc does not get mounted. I have to manually mount it everytime. I have following entries in /etc/fstab I thing that's another issue from http://wiki.openvz.org/Physical_to_container /etc/mtab Link /etc/mtab to /proc/mounts, for df to work properly: rm -f /vz/private/123/etc/mtab ln -s /proc/mounts /vz/private/123/etc/mtab container must be stopped I think I have them setup correctly. Still see the issue. [r...@localhost etc]# ls -l | grep mtab lrwxrwxrwx 1 root root 12 Jun 29 10:52 mtab - /proc/mounts -bash-3.2# ls -l /etc | grep mtab lrwxrwxrwx 1 root root 12 Jun 29 13:52 mtab - /proc/mounts none /dev/pts devpts defaults 0 0 none /proc proc defaults 0 0 none //sys sysfs defaults 0 0 none /dev/shm tmpfs defaults 0 0 [r...@localhost /]# vzctl enter 50 entered into CT 50 Unable to get tty name: Bad file descriptor -bash-3.2# mount warning: can't open /etc/mtab: No such file or directory --bash-3.2# mount -t proc none /proc -bash-3.2# mount /dev/simfs on / type simfs (rw) none on /proc type proc (rw) -bash-3.2# 2) Not able to assign IP address to venet0. Here are the lines from /etc/vz/conf/50.conf IP_ADDRESS=10.33.11.55 BROADCAST=255.255.255.255 NETMASK=255.255.255.192 I have set onboot=NO in vz/private/50/etc/sysconfig/network-scripts/ifcfg-eth0 delete file vz/private/50/etc/sysconfig/network-scripts/ifcfg-eth0 and please post all 50.conf file Here you go: ONBOOT=yes # UBC parameters (in form of barrier:limit) KMEMSIZE=11055923:11377049 LOCKEDPAGES=256:256 PRIVVMPAGES=65536:69632 SHMPAGES=21504:21504 NUMPROC=240:240 PHYSPAGES=0:2147483647 VMGUARPAGES=33792:2147483647 OOMGUARPAGES=26112:2147483647 NUMTCPSOCK=360:360 NUMFLOCK=188:206 NUMPTY=16:16 NUMSIGINFO=256:256 TCPSNDBUF=1720320:2703360 TCPRCVBUF=1720320:2703360 OTHERSOCKBUF=1126080:2097152 DGRAMRCVBUF=262144:262144 NUMOTHERSOCK=360:360 DCACHESIZE=3409920:3624960 NUMFILE=9312:9312 AVNUMPROC=180:180 NUMIPTENT=128:128 # Disk quota parameters (in form of softlimit:hardlimit) DISKSPACE=1048576:1153024 DISKINODES=20:22 QUOTATIME=0 # CPU fair sheduler parameter CPUUNITS=1000 IP_ADDRESS=10.33.11.55 BROADCAST=255.255.255.255 NETMASK=255.255.255.192 --Nirmal --Nirmal ___ Users mailing list Users@openvz.org https://openvz.org/mailman/listinfo/users ___ Users mailing list Users@openvz.org https://openvz.org/mailman/listinfo/users ___ Users mailing list Users@openvz.org https://openvz.org/mailman/listinfo/users
Re: [Users] Some basic startup related issues
ok, for now: in container /etc/fstab file I put only: none/dev/ptsdevpts rw 0 0 (don't forget new line at the end) in yours ct config (50.conf) thereis invalid values BROADCAST=255.255.255.255 NETMASK=255.255.255.192 delete them On Tue, Jun 29, 2010 at 9:02 PM, Nirmal Guhan vavat...@gmail.com wrote: On Tue, Jun 29, 2010 at 1:49 AM, Arturas Skauronas hel...@gmail.com wrote: On Sat, Jun 26, 2010 at 4:02 AM, Nirmal Guhan vavat...@gmail.com wrote: Am following http://wiki.openvz.org/Physical_to_container and facing a couple of issues. Hope someone can help. Am running CentOS 5.5 and trying to create a CentOS 5 container. 1) /proc does not get mounted. I have to manually mount it everytime. I have following entries in /etc/fstab I thing that's another issue from http://wiki.openvz.org/Physical_to_container /etc/mtab Link /etc/mtab to /proc/mounts, for df to work properly: rm -f /vz/private/123/etc/mtab ln -s /proc/mounts /vz/private/123/etc/mtab container must be stopped I think I have them setup correctly. Still see the issue. [r...@localhost etc]# ls -l | grep mtab lrwxrwxrwx 1 root root 12 Jun 29 10:52 mtab - /proc/mounts -bash-3.2# ls -l /etc | grep mtab lrwxrwxrwx 1 root root 12 Jun 29 13:52 mtab - /proc/mounts none /dev/pts devpts defaults 0 0 none /proc proc defaults 0 0 none //sys sysfs defaults 0 0 none /dev/shm tmpfs defaults 0 0 [r...@localhost /]# vzctl enter 50 entered into CT 50 Unable to get tty name: Bad file descriptor -bash-3.2# mount warning: can't open /etc/mtab: No such file or directory --bash-3.2# mount -t proc none /proc -bash-3.2# mount /dev/simfs on / type simfs (rw) none on /proc type proc (rw) -bash-3.2# 2) Not able to assign IP address to venet0. Here are the lines from /etc/vz/conf/50.conf IP_ADDRESS=10.33.11.55 BROADCAST=255.255.255.255 NETMASK=255.255.255.192 I have set onboot=NO in vz/private/50/etc/sysconfig/network-scripts/ifcfg-eth0 delete file vz/private/50/etc/sysconfig/network-scripts/ifcfg-eth0 and please post all 50.conf file Here you go: ONBOOT=yes # UBC parameters (in form of barrier:limit) KMEMSIZE=11055923:11377049 LOCKEDPAGES=256:256 PRIVVMPAGES=65536:69632 SHMPAGES=21504:21504 NUMPROC=240:240 PHYSPAGES=0:2147483647 VMGUARPAGES=33792:2147483647 OOMGUARPAGES=26112:2147483647 NUMTCPSOCK=360:360 NUMFLOCK=188:206 NUMPTY=16:16 NUMSIGINFO=256:256 TCPSNDBUF=1720320:2703360 TCPRCVBUF=1720320:2703360 OTHERSOCKBUF=1126080:2097152 DGRAMRCVBUF=262144:262144 NUMOTHERSOCK=360:360 DCACHESIZE=3409920:3624960 NUMFILE=9312:9312 AVNUMPROC=180:180 NUMIPTENT=128:128 # Disk quota parameters (in form of softlimit:hardlimit) DISKSPACE=1048576:1153024 DISKINODES=20:22 QUOTATIME=0 # CPU fair sheduler parameter CPUUNITS=1000 IP_ADDRESS=10.33.11.55 BROADCAST=255.255.255.255 NETMASK=255.255.255.192 --Nirmal --Nirmal ___ Users mailing list Users@openvz.org https://openvz.org/mailman/listinfo/users ___ Users mailing list Users@openvz.org https://openvz.org/mailman/listinfo/users ___ Users mailing list Users@openvz.org https://openvz.org/mailman/listinfo/users ___ Users mailing list Users@openvz.org https://openvz.org/mailman/listinfo/users
Re: [Users] Some basic startup related issues
On Tue, Jun 29, 2010 at 11:54 AM, Arturas Skauronas hel...@gmail.com wrote: ok, for now: in container /etc/fstab file I put only: none /dev/pts devpts rw 0 0 (don't forget new line at the end) I did so. BTW, where does the container get it fstab entries from? in yours ct config (50.conf) thereis invalid values BROADCAST=255.255.255.255 NETMASK=255.255.255.192 delete them No luck yet with these updates :( [r...@localhost conf]# vzctl start 50 Warning: distribution not specified default used /etc/vz/dists/default Starting container ... Container is mounted Adding IP address(es): 10.33.11.55 Setting CPU units: 1000 Configure meminfo: 65536 Container start in progress... [r...@localhost conf]# vzctl enter 50 entered into CT 50 -bash-3.2# ls /proc -bash-3.2# -bash-3.2# mount -t proc / /proc -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# ip route -bash-3.2# route Kernel IP routing table Destination Gateway Genmask Flags Metric RefUse Iface -bash-3.2# ___ Users mailing list Users@openvz.org https://openvz.org/mailman/listinfo/users