Hey
guys...
I hope that you can help me with
these information...
Thank you
for the books. And I already knew that I shouldn't need anything else to access
my local network or use the internet from my virtual machines. Since my Xen
server can access my local network and the Internet.
I just
made that question just to make sure. Since the things I have read are saying
that it should be working but it is not. Everything that I read is saying that
the Xen should bridge “automatically” the network traffic from my VM to my local
network using in this case eth0 adapter.
Here are some data that may be useful:
NFS and gateway to internet
I have a
Linux server that I am using as a NFS and gateway to the internet. This server
has two network adapters one is eth0 that has access to my local network and the
internet and eth1 that is in the same network that the Xen server is. In the
network where the Xen server is, this linux server has the IP
192.168.2.100.
Xenserver
--ifconfig
eth0
Link encap:Ethernet HWaddr 08:00:27:63:84:BA
UP
BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX
packets:30177 errors:0 dropped:0 overruns:0 frame:0
TX
packets:16187 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX
bytes:22687837 (21.6 MiB) TX bytes:895138 (874.1 KiB)
lo
Link encap:Local Loopback
inet
addr:127.0.0.1 Mask:255.0.0.0
UP
LOOPBACK RUNNING MTU:16436 Metric:1
RX
packets:129 errors:0 dropped:0 overruns:0 frame:0
TX
packets:129 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX
bytes:20617 (20.1 KiB) TX bytes:20617 (20.1 KiB)
vif1.3 Link encap:Ethernet HWaddr
FE:FF:FF:FF:FF:FF
UP
BROADCAST RUNNING NOARP MTU:1500 Metric:1
RX
packets:0 errors:0 dropped:0 overruns:0 frame:0
TX
packets:45 errors:0 dropped:84 overruns:0 carrier:0
collisions:0 txqueuelen:32
RX
bytes:0 (0.0 b) TX bytes:8310 (8.1 KiB)
xenbr0 Link encap:Ethernet HWaddr
08:00:27:63:84:BA
inet
addr:192.168.2.101 Bcast:192.168.2.255 Mask:255.255.255.0
UP
BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX
packets:30012 errors:0 dropped:0 overruns:0 frame:0
TX
packets:16187 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX
bytes:22667707 (21.6 MiB) TX bytes:895138 (874.1
KiB) |
--brctl show
bridge name bridge id STP enabled
interfaces
xenbr0 0000.0800276384ba no eth0
vif1.3 |
--ethtool -i eth0
driver: e1000
version: 8.0.19-NAPI
firmware-version: N/A
bus-info:
0000:00:03.0 |
More data:
I
got my XCP from this link:
http://downloads.xen.org/XCP/42052/XCP-1.0-base-42052.iso
and you guys?
My
Xen server has just the interface eth0, and the xenbr0 that Xen creates to
bridge the traffic from the virtual interfaces to eth0, is it right?
And
now some tests that I have been doing since yesterday.
First shot:
I tried to install CentOS 5 – 32 bits in a
VM.
I got the OS ISO in this repository:
http://centos-mirror.hostdime.com.br/centos/5.6/isos/i386/
[root@xenserver1 ~]# xe vm-install
template=CentOS\ 5\ \(32-bit\) new-name-label=centOS-32bits
e459b183-0773-1a1a-e82a-520d9622ed5f
[root@xenserver1 ~]# xe vbd-list
vm-name-label=centOS-32bits type=Disk params=uuid
uuid
( RO) : 08cdbeca-864b-9f8d-da6a-09663a9b92cb
[root@xenserver1 ~]# xe vbd-param-set
uuid=08cdbeca-864b-9f8d-da6a-09663a9b92cb bootable=false
[root@xenserver1 ~]# xe vm-cd-add
vm=centOS-32bits cd-name=CentOS-5.6-i386-LiveCD.iso
device=5
[root@xenserver1 ~]# xe vbd-list
vm-name-label=centOS-32bits type=CD params=uuid
uuid
( RO) : fb4e19e8-f306-e644-92d9-b219f31c7781
[root@xenserver1 ~]# xe vbd-param-set
uuid=fb4e19e8-f306-e644-92d9-b219f31c7781 bootable=true
[root@xenserver1 ~]# xe vm-param-set
other-config:install-repository=cdrom
uuid=e459b183-0773-1a1a-e82a-520d9622ed5f
[root@xenserver1 ~]# xe vm-start
uuid=e459b183-0773-1a1a-e82a-520d9622ed5f Error code:
INVALID_SOURCE
Error
parameters: Unable to access a required file in the specified repository:
file:///tmp/cdrom-repo-vEeeEn/isolinux/vmlinuz., ,
|
When I saw this error. I opened the ISO and looked into
the folder “isolinux” to see what files it has.
What a surprise when I opened.
I
saw a file called “vmlinuz0” . So, I thought I will copy that file to the same
folder with the name “vmlinuz” that my VM is looking for. Just to see what would
happen.
Then the VM said that it could not find a file called
“initrd.img”.
I
started to smile just because I was receiving a new error. =)
And
I looked the ISO again and found a file called “initrd0.img”. So far I did the
same thing, I copied the file to the same folder using the name that the VM was
looking for.
Then I received an error that I have no idea how to solve
it:
[root@xenserver1 ~]# xe vm-start
uuid=e459b183-0773-1a1a-e82a-520d9622ed5f
The
server failed to handle your request, due to an internal error. The given
message may give details useful for debugging the problem.
message:
XenguestHelper.Xc_dom_linux_build_failure(2, " xc_dom_parse_elf_kernel:
ELF image has no shstrtab\\\\n\\\"") |
So,
far I gave up with Cent OS.
Second shot:
I tried to install Debian-6 32 bits in a
VM.
I got the ISO in this link:
http://cdimage.debian.org/debian-cd/6.0.1a/i386/iso-cd/debian-6.0.1a-i386-CD-1.iso
[root@xenserver1 ~]# xe vm-install
template=Debian\ Squeeze\ 6.0\ \(32-bit\)
new-name-label=debian6-32bits
cc258b5c-9723-1c78-4773-fe4cb82a73fd
[root@xenserver1 ~]# xe vbd-list
vm-uuid=cc258b5c-9723-1c78-4773-fe4cb82a73fd type=Disk
params=uuid
uuid
( RO) : b058711c-3161-838a-3b15-82c46d30c572
[root@xenserver1 ~]# xe vbd-param-set
uuid=b058711c-3161-838a-3b15-82c46d30c572 bootable=false
[root@xenserver1 ~]# xe vm-cd-add
vm=debian6-32bits cd-name=debian-6.0.1a-i386-CD-1.iso
device=3
[root@xenserver1 ~]# xe vbd-list
vm-uuid=cc258b5c-9723-1c78-4773-fe4cb82a73fd type=CD
params=uuid
uuid
( RO) : 981cac82-3477-308c-7a3f-668038459633
[root@xenserver1 ~]# xe vbd-param-set
uuid=981cac82-3477-308c-7a3f-668038459633 bootable=true
[root@xenserver1 ~]# xe vm-param-set
uuid=cc258b5c-9723-1c78-4773-fe4cb82a73fd
other-config:install-repository=cdrom
[root@xenserver1 ~]# xe vm-start
uuid=cc258b5c-9723-1c78-4773-fe4cb82a73fd
Error
code: INVALID_SOURCE
Error
parameters: Unable to access a required file in the specified repository:
file:///tmp/cdrom-repo-WsjCeI/install.386/xen/vmlinuz.,
, |
I
thought, it is almost the same error that I was receiving before. Let's take a
look into the ISO.
I
could not find that folder called “xen”. But in the directory “install.386” I
have the files that the VM was looking for. So I just created a folder called
“xen” inside the folder “install.386” and I copied the files “vmlinuz” and
“initrd.img” to the new folder.
[root@xenserver1 ~]# xe vm-start
uuid=cc258b5c-9723-1c78-4773-fe4cb82a73fd The server failed to handle your
request, due to an internal error. The given message may give details
useful for debugging the problem.
message:
XenguestHelper.Xc_dom_linux_build_failure(2, " elf_xen_note_check: ERROR:
Will only load images built \\\"") |
And then,
as you can see I got that error again.
So, I started to google some things, trying to find someone
with the same problem. And I found a link to Xen wiki where a guy was saying to
use the files from http://archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/xen/
to “fix” a
Ubuntu ISO, because the VM need those files, and the files were not in the
ISO.
Here is
the link:
http://lists.xensource.com/archives/html/xen-users/2010-07/msg00361.html
Then I
thought that probably this Debian ISO that I got has the same problem. So I went
to the Debian repository to see if I could find something. And I found. Look at
this link:
http://ftp.br.debian.org/debian/dists/squeeze/main/installer-i386/current/images/cdrom/xen/
It has the
“xen” folder with some files that the VM is looking for. So I downloaded them
and put into the ISO.
Guess what
happened when I started the VM...
Can you
believe that the VM started?
I was so
happy that I almost cried at this time. =)
Then I
opened the VNC to continue the installation...
What a
surprise... I got a message saying that no kernel modules were found in the ISO.
As you can see in the SS attached to this message. I checked the CD integrity,
and the test finished with a successful message. =(
So, I got
the ISO, and tried to install the Debian with that modified ISO in a Virtual box
instance. It installed and worked so far so good.
At that
time I was tired to try to install using an ISO.
Then I
started trying to install an OS using a remote repository.
[root@xenserver1 ~]# xe vm-install
template=Debian\ Squeeze\ 6.0\ \(32-bit\)
new-name-label=debian6-online
be7dbe65-de1a-42ca-ba1d-f1902bf7064d
[root@xenserver1 ~]# xe vm-param-set
uuid=be7dbe65-de1a-42ca-ba1d-f1902bf7064d
other-config:install-repository=http://ftp.br.debian.org/debian
[root@xenserver1 ~]# xe network-list
bridge=xenbr0 params=uuid
uuid
( RO) : 8bdd4e6a-29ee-5adb-4ec0-41896d4054be
[root@xenserver1 ~]# xe vif-create
vm-uuid=be7dbe65-de1a-42ca-ba1d-f1902bf7064d
network-uuid=8bdd4e6a-29ee-5adb-4ec0-41896d4054be device=3
ef880beb-c992-2ddb-5264-051ebdf03de9
[root@xenserver1 ~]# xe vm-start
uuid=be7dbe65-de1a-42ca-ba1d-f1902bf7064d
|
After the VM started, when the installer was configuring
my network it said that it could not find a route to communicate with hosts on
internet.
When I got this message I used the shell that is provided
during the installation time, and I looked the log message. It said that was not
possible to reach the address http://ftp.br.debian.org
then I
tried to reach a file from the VM in my local network with wget and it did not
work either.
So I have
no idea about what I should do to make it work. As you said it should not need
anything else to work.
I tested
and the Xen server have access to that address:
http://ftp.br.debian.org/debian
Those
network information seem to be right. The bridge should be working, shouldn’t
be?
Can you
guys try to install a Debian, CentOS or Ubuntu in your VM using an
ISO?
Just to see if you can get the same
problem as I am getting.
-----Mensagem Original-----
From: Todd Deshane
Sent: Monday, June 20, 2011 10:39 PM
To: Rafael Weingartner
Cc: Xen-user-list
Subject: Re: [Xen-users] Networking how does it really work?
On Mon, Jun 20, 2011 at 8:04 PM, Rafael Weingartner
<rafaelweingartner@xxxxxxxxx> wrote:
> Hey guys,
>
> I have some doubts about networking on XCP.
> When I create a VM and start it, the Xen server is creating a
VIFx.x
>
> So, here is my doubts.
> When I start a VM and the Xen server creates this interface is it
bridged
> automatically?
Xen bridges the guest traffic automatically.
You shouldn't need to do the below in order for it to work. Post the
output of brctl show and ethtool -i eth0. If you have other bridges
and physical interfaces post information about them as well.
There are several good books that cover Xen basics such as "Running
Xen" and "The Book of Xen". You may consider doing some background
reading for some of these basic concepts. Please do also post your
questions here with enough detail for us to understand what you are
trying to accomplish.
Thanks,
Todd
> Or do I need to forward its traffic through my LAN connection?
>
> I tried to forward the traffic from this interface to my eth0 but it
seemed
> not work.
>
> Here is the script that I created and executed on Xen server:
> # Always accept loopback traffic
> iptables -A INPUT -i lo -j ACCEPT
>
> # Allow established connections, and those not coming from the
outside
> iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
> iptables -A INPUT -m state --state NEW -i ! xenbr0 -j ACCEPT
> iptables -A FORWARD -i xenbr0 -o vif5.2 -m state --state
ESTABLISHED,RELATED
> -j ACCEPT
>
> # Allow outgoing connections from the LAN side.
> iptables -A FORWARD -i vif5.2 -o xenbr0 -j ACCEPT
>
> # Masquerade.
> iptables -t nat -A POSTROUTING -o xenbr0 -j MASQUERADE
>
> # Enable routing.
> echo 1 > /proc/sys/net/ipv4/ip_forward
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users
>
--
Todd Deshane
http://www.linkedin.com/in/deshantm
http://www.xen.org/products/cloudxen.html
http://runningxen.com/