OpenVZ Forum


Home » General » Support » debian+networking
debian+networking [message #238] Tue, 18 October 2005 01:20 Go to next message
douglas is currently offline  douglas
Messages: 14
Registered: October 2005
Junior Member
Greetings,

I've got a debian guest image running, seems to run just fine, however I can't seem to get networking working, I created both venet0 and venet0:0 and it sees them just fine when I do a ifconfig, however; the setting the gateway as 191.255.255.1 it doesn't like, could someone provide an interface file (example file) and what needs to be done in terms of routing? Thanks

-doug
Re: debian+networking [message #239 is a reply to message #238] Tue, 18 October 2005 15:36 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

we fixed this when chating on IRC.

OSTEMPLATE=debian-3.1
should be added to VPS config file (/etc/sysconfig/vz-scripts/VPSID.conf) to force vzctl to use correct scripts from /etc/sysconfig/vz-scripts/dists/scripts.

otherwise vzctl issued warning and used default scripts which were redhat ones.


http://static.openvz.org/userbars/openvz-developer.png
Re: debian+networking [message #240 is a reply to message #239] Tue, 18 October 2005 18:01 Go to previous messageGo to next message
douglas is currently offline  douglas
Messages: 14
Registered: October 2005
Junior Member
thanks dev, helped me out alot, I couldn't figure out why it wasn't working, for all those are interested I'll try to put something together for a debian template, right now we are running debian ontop of fedora core 4 and it works beautifully, I'll work on getting something taken care of.
Re: debian+networking [message #244 is a reply to message #240] Wed, 19 October 2005 10:17 Go to previous messageGo to next message
nissan
Messages: 3
Registered: October 2005
Junior Member
I'm totally new to OpenVZ and am looking for a VPS solution to consolidate a friend's four systems. I'm currently weighing up this product and the somewhat simpler Linux VServer Project but I only have a few days to decide.

Douglas, I'd be very grateful for an OS template for the current Debian stable, or even a few pointers to get me started.

Thanks.
Re: debian+networking [message #266 is a reply to message #244] Thu, 20 October 2005 23:32 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Nissan, if you going to try migrating existing running systems into VPSs you might not need any templates at all.

What you need to do in order to migrate is (routhly):
1. Prepare an 'empty' VPS. For OpenVZ this would mean the following (assume you chose VPS ID of 123):
mkdir /vz/root/123 /vz/private/123
cd /etc/sysconfig/vz-scripts
cat ve-vps.basic.conf-sample > 123.conf

2. Stop most services on a machine to be migrated. "Most" means services such as web server, databases and the like -- so you will not loose your data. Just leave the bare minimum (including ssh).

3. Copy all your data from the machine to an OpenVZ box. Say you'll be using VPS with ID of 123, then all the data should be placed to /vz/private/123/ directory (so there will be directories such as /vz/private/123/bin, etc, var and so on).

4. Set some VPS parameters. You have to add OSTEMPLATE=xxx line to /etc/sysconfig/vz-scripts/123.conf, where xxx would be distro name (like 'debian-3.0') for vzctl to be able to make changes specific for this distro.

Also, you have to supply an IP for a new VPS:
vzctl set 123 --ipadd x.x.x.x --save

5. You have to edit some files inside a VPS. For example, virtual server does not have real ttys, so you have to disable getty in /etc/inittab (/vz/private/123/etc/inittab). Also, link /etc/mtab to /proc/mounts. There might be other adjustments needed.

6. Try to start your new VPS:
vzctl start 123

If anything goes wrong, try to find out why and fix. If you have enough Linux experience, it can be handled.


Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: debian+networking [message #269 is a reply to message #266] Fri, 21 October 2005 09:00 Go to previous messageGo to next message
nissan
Messages: 3
Registered: October 2005
Junior Member
Yes, I'd be migrating existing systems, and what you describe sounds straightforward.

Thanks, Kir.
icon4.gif  Re: debian+networking [message #275 is a reply to message #269] Sun, 23 October 2005 08:56 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

also, note, commercial virtuozzo contains p2v tools for physical host to VPS migration Embarassed

http://static.openvz.org/userbars/openvz-developer.png
Re: debian+networking [message #315 is a reply to message #238] Thu, 10 November 2005 18:19 Go to previous messageGo to next message
eugeniopacheco is currently offline  eugeniopacheco
Messages: 40
Registered: November 2005
Member
I'm trying to use the linux-vserver debian guest image on openvz and it seems to run ok, but I'm not being able to do the networking for some reason. Can someone tell me how to make an image or can someone provide me with one?
Re: debian+networking [message #316 is a reply to message #238] Thu, 10 November 2005 19:47 Go to previous messageGo to next message
eugeniopacheco is currently offline  eugeniopacheco
Messages: 40
Registered: November 2005
Member
Hi,

I've fixed networking, not it's running fine, except that when I stop the VPS and it shows the following:
vzquota : (error) Quota off syscall for id 104: Device or resource busy
vzquota setlimit -f failed [3]

When I restart it, it shows:
vzquota : (warning) Quota is running for id 104 already

Also, it doesn't seem to start rc scripts by itself, I have to start /etc/init.d/rcS myself (that's what was missing when I posted before).

Can somebody help me out with the quota and also I noticed something else, when I run rcS and ssh on the vps, it shows the following:
login as: root
System bootup in progress - please wait

Any clues on how to fix this?Smile
Re: debian+networking [message #317 is a reply to message #238] Thu, 10 November 2005 19:49 Go to previous messageGo to next message
eugeniopacheco is currently offline  eugeniopacheco
Messages: 40
Registered: November 2005
Member
Oh, I forgot to mention that quota isn't working properly.

test:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
test:~#

Df information is not shown.
Re: debian+networking [message #318 is a reply to message #238] Thu, 10 November 2005 20:09 Go to previous messageGo to next message
eugeniopacheco is currently offline  eugeniopacheco
Messages: 40
Registered: November 2005
Member
Also, something I just noticed, /proc/user_beancounters is not working. Actually it doesn't exist.
Re: debian+networking [message #319 is a reply to message #318] Thu, 10 November 2005 21:14 Go to previous messageGo to next message
dev is currently offline  dev
Messages: 1693
Registered: September 2005
Location: Moscow
Senior Member

eugeniopacheco, it's 0:20am here. we'll investigate it tomorrow. thanks for reporting!
BTW, please provide lsmod and `uname -a` output. OVZ kernel always provides /proc/user_beancounters actually.


http://static.openvz.org/userbars/openvz-developer.png
Re: debian+networking [message #320 is a reply to message #238] Thu, 10 November 2005 21:25 Go to previous messageGo to next message
eugeniopacheco is currently offline  eugeniopacheco
Messages: 40
Registered: November 2005
Member
I'm very sorry, actually, /proc/user_beancounters do exist, here goes the lsmod and uname -a
Module Size Used by
simfs 3348 4
vzdquota 38416 4 [permanent]
af_packet 16360 0
sunrpc 127300 1
vznetdev 12480 9
vzmon 40928 5 vznetdev
vzdev 1792 3 vzdquota,vznetdev,vzmon
thermal 10096 0
processor 10244 1 thermal
fan 2668 0
button 4408 0
battery 7052 0
asus_acpi 8920 0
ac 3084 0
e100 30144 0
mii 3808 1 e100

Linux teste.cbras.com 2.6.8-022stab045.1 #1 Fri Oct 28 16:31:19 MSD 2005 i686 GNU/Linux

I've managed to fix the message System bootup in progress - please wait by executing /etc/init.d/rmnologin. Also the df showing the current amount by adding simfs / simfs rw 0 0 to the /etc/mtab, but everytime I start the VPS I have to execute /etc/init.d/rcS and everytime I have to add simfs / simfs rw 0 0 to /etc/mtab. Isn't there a way to make openvz execute those commands everytime a debian VPS is started?
Re: debian+networking [message #321 is a reply to message #238] Thu, 10 November 2005 23:51 Go to previous messageGo to next message
eugeniopacheco is currently offline  eugeniopacheco
Messages: 40
Registered: November 2005
Member
Uh, I just forgot to add that vzctl exec VPSID /bin/echo simfs ... > /etc/mtab doesn't work, I have to use echo inside the VPS, is there any particular reason?

Regards.
Re: debian+networking [message #322 is a reply to message #321] Fri, 11 November 2005 07:46 Go to previous messageGo to next message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

Can you tell the URL of the debian template for vserver so we can download it, play with it and fix all the possible problems?

Kir Kolyshkin
http://static.openvz.org/userbars/openvz-developer.png
Re: debian+networking [message #323 is a reply to message #238] Fri, 11 November 2005 10:40 Go to previous messageGo to next message
eugeniopacheco is currently offline  eugeniopacheco
Messages: 40
Registered: November 2005
Member
Sure. The URL is:
http://debian.marlow.dk/vserver/guest/_debian_sarge_20050123 .tb2
It works just fine, I just had to untar, then tar again as tar.gz and put it into /vz/template/cache. I changed its name to debian-3.1-i386-minimal.tar.gz. Then after you create the VPS using ostemplate debian-3.1-i386-minimal, you will have to change VPSID.conf and add the OSTEMPLATE='debian-3.1' and manually start rcS (vzctl exec VPSID /etc/init.d/rcS). After that you will be able to log into your VPS, but you will have to use /etc/init.d/rmnologin to get rid of a message saying you need to wait the system to boot up and you will have to add the simfs something line to /etc/mtab from inside the VPS, please look above in this message to see what the line is.

I tried to make OpenVZ execute the commands by creating a VPSID.mount and afterwards changing it to VPSID.start, in both cases it didn't work. I think I should have created an installation-post file to fix it, but I didn't understand the current templates. Can anyone help me? I tried to copy /vz/template/centos/4/i386/config to /vz/template/debian/3.1/i386/config and change it but it didn't work at all. Have I done something wrong?
Re: debian+networking [message #327 is a reply to message #323] Sat, 12 November 2005 04:16 Go to previous messageGo to next message
douglas is currently offline  douglas
Messages: 14
Registered: October 2005
Junior Member
I use debootstrap. Located at http://ftp.debian.org/debian/pool/main/d/debootstrap/deboots trap_0.2.45-0.2.tar.gz No problems, just networking needs to be setup (in the .conf) also to fix debian you need to ln -s /etc/mtab to something in /proc I think, I don't remember the dir, if you or sw guys remember can you post it so we have a reference? I try to find out.

debootstrap allows you to download and bootstrap a debian system (minimal) on the fly downloading the current files/updates. Its a nice package.

These are most of the packages required, (99%)

required="base-files base-passwd bash bsdutils coreutils libacl1 libattr1 debconf debconf-i18n liblocale-gettext-perl libtext-wrapi18n-perl libtext-charwidth-perl debianutils diff dpkg dselect libblkid1 e2fsprogs e2fslibs libcomerr2 libss2 libuuid1 findutils grep gzip hostname libcap1 libc6 libdb1-compat libdb3 libncurses5 libnewt0.51 libpam-modules libpam-runtime libpam0g libperl5.8 libpopt0 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-base procps sed slang1a-utf8 initscripts sysvinit sysv-rc tar util-linux whiptail libgcc1 gcc-3.3-base libstdc++5"

base="adduser apt apt-utils libdb4.2 at base-config aptitude libsigc++-1.2-5c102 bsdmainutils console-common console-tools libconsole console-data cpio cron dhcp-client ed exim4 exim4-base exim4-config exim4-daemon-light libgcrypt11 libgnutls11 libgpg-error0 libopencdk8 libtasn1-2 fdutils gettext-base groff-base ifupdown info klogd libssl0.9.7 liblzo1 zlib1g liblockfile1 libpcre3 libwrap0 logrotate mailx man-db libgdbm3 manpages nano net-tools netbase netkit-inetd iputils-ping nvi ppp pppconfig pppoe pppoeconf libpcap0.7 sysklogd tasksel libtextwrap1 tcpd telnet libtext-iconv-perl wget $additional"

Theres a few more to look futher, install debootstrap source and look in /usr/lib/debootstrap/scripts/ and take a look at sarge. The script it called by debootstrap located in /usr/sbin I believe.

Currently we are still testing but so far it runs pretty normal with a few minor cosmestic issues.

debootstrap installas a simple as

debootstrap sarge /vz/private/VIED

Douglas Wheet
VSFX.com

[Updated on: Sat, 12 November 2005 04:27]

Report message to a moderator

Re: debian+networking [message #329 is a reply to message #327] Sat, 12 November 2005 16:49 Go to previous messageGo to next message
KriS83 is currently offline  KriS83
Messages: 12
Registered: October 2005
Junior Member
Hi,

douglas wrote on Fri, 11 November 2005 23:16

I use debootstrap. Located at http://ftp.debian.org/debian/pool/main/d/debootstrap/deboots trap_0.2.45-0.2.tar.gz No problems, just networking needs to be setup (in the .conf) also to fix debian you need to ln -s /etc/mtab to something in /proc I think, I don't remember the dir, if you or sw guys remember can you post it so we have a reference? I try to find out.


It's a "ln -s /proc/mounts /etc/mtab"

Quote:


Currently we are still testing but so far it runs pretty normal with a few minor cosmestic issues.


You should also edit /etc/inittab and comment out or remove the following lines:

#1:2345:respawn:/sbin/getty 38400 tty1
#2:23:respawn:/sbin/getty 38400 tty2
#3:23:respawn:/sbin/getty 38400 tty3
#4:23:respawn:/sbin/getty 38400 tty4
#5:23:respawn:/sbin/getty 38400 tty5
#6:23:respawn:/sbin/getty 38400 tty6

Quote:


debootstrap installas a simple as

debootstrap sarge /vz/private/VIED


Correct, though I used:

debootstrap sarge /vz/private/VEID http://ftp.debian.de/debian


Basicly, my networking here works fine.
Though simple "telnet localhost 25" do not work Sad
nmap also fails. withe the following error:

# nmap localhost

Starting nmap 3.81 ( http://www.insecure.org/nmap/ ) at 2005-12-11 17:44 UTC
sendto in send_ip_packet: sendto(4, packet, 28, 0, 127.0.0.1, 16) => Invalid argument
Sleeping 15 seconds then retrying

So long
KriS


P.S: I've had a look at the vzpkgcache script to try to modify it to get it to create a ostemplate just like it does with fedora,
but as it is not really created for anyother program other than "rpm" this will not be easy. Maybe when I find some time, I'll give it a go Smile

[Updated on: Sat, 12 November 2005 16:53]

Report message to a moderator

Re: debian+networking [message #330 is a reply to message #329] Sat, 12 November 2005 20:26 Go to previous message
douglas is currently offline  douglas
Messages: 14
Registered: October 2005
Junior Member
I filed a bug about this. its a bug for vzctl I guess for debian.
Bug #67

inside /etc/sysconfig/vz-scripts/dists/scripts I believe is where debian-add_ip.sh is

loopback device needs to be added.

Under VENET_DEV=venet0 I added LOOPBACK=lo like so

LOOPBACK=lo
FAKEGATEWAY=191.255.255.1
FAKEGATEWAYNET=191.255.255.0
CFGFILE=/etc/network/interfaces
HOSTFILE=/etc/hosts

Then right under
# Auto generated loopback venet0 intefaces
I changed this

auto ${VENET_DEV}
to
auto ${VENET_DEV} ${LOOPBACK}

A few more lines down

iface ${VENET_DEV} inet static
address 127.0.0.1
netmask 255.255.255.255
broadcast 0.0.0.0
up route add -net ${FAKEGATEWAY} netmask 255.255.255.255 dev ${VENET_DEV}
up route add default gw ${FAKEGATEWAY}

I added after "up route add default gw ${FAKEGATEWAY}"

iface ${LOOPBACK} inet loopback

Essentially all I did was tell the debian-add_ip.sh to bring up LO like it should be. This will fix your problem about ping localhost

-doug
VSFX.com


[Updated on: Sat, 12 November 2005 20:28]

Report message to a moderator

Previous Topic: java problem
Next Topic: Specyfiing a mac address for vz interface
Goto Forum:
  


Current Time: Sat Jul 13 23:47:32 GMT 2024

Total time taken to generate the page: 0.02211 seconds