[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Xen-users] guest to guest communication



Achala Aryal wrote:

I had looked on that thread as well but could not get any clue.
I was looking for some sort of tutorial for doing this. I don't have knowledge of networking things.

Oh dear.
I'm afraid you really do need to understand at least the basics of networking, Xen does not replace any of it, in fact it adds another layer of complexity - which means that if you don't understand a basic network then you'll struggle to understand the extra stuff Xen adds.

You see, the reason there is no tutorial for communicating between Xen machines whether Dom0 or DomU) is because there really is no magic to it.

If I turn it around, how would you communicate between two physical machines on a LAN - both plugged into a normal switch ? The answer is using whatever network tools your are comfortable with and/or are appropriate for the task.
So to copy a file, a simple and appropriate tool might be SCP.
If you want to have general access, then a network file system such as SMB (Samba) or NFS might be appropriate. Now roll the machines into DomU's, replace the switch with a bridge in Dom0 and ... nothing has changed as far as this aspect of networking is concerned.


May be you could help me or somebody else:
I have physically assign nic card to vm machine I want some sort of communication between VMs. When I do brctl show it shows only vibr0 is this a default bridge created by dom0 ????? how can i set up new bridge and where it should be in dom0 or domU and how can I use it? Might be stupid question for some of you....:(

I think the commonest setup for Xen is a bridged setup. You create a bridge in Dom0 and attach a physical NIC to it. Then when you create each DomU you create a virtual NIC for each one and attach that to the same bridge. In logical terms, this is **exactly** the same as having a number of separate physical machines plugged into a switch. My experience is that the Xen supplied scripts for creating bridges are "confusing" and common advice is to ignore them and setup the bridges outside of Xen. In Debian (I don't knwo about others) this is trivially easy to do.
For Debian, you just need a stanza in /etc/network/interfaces like this :
auto eth0
iface eth0 inet static
  bridge_ports peth0
  address 192.168.0.36
  netmask 255.255.255.0
  gateway 192.168.0.1

In /etc/udev/rules.d/70-persistent-net.rules you configure the system to name the NIC as (in this case) peth0. On systems with multiple NICs, I usually use more descriptive names such as ethext, ethint, ethbak and so on.

So the above gets you a bridge, with an IP on it for the Dom0 to use, and one NIC attached to it. We now have a Dom0 that can communicate with it's own local network and the internet as a whole via whatever gateway is on the network.

You can then attach virtual NIC to this bridge for each guest by adding an appropriate entry to the guest config, eg :
vif  = [ 'bridge=eth0,vifname=somename' ]
I believe "vifname=somename" is optional, but I prefer to name things so it's easier to see what they belong to - so when I see an interface attached to the bridge called "somename" then I know what DomU it belongs to rather than seeing vigf7.1 and having to look up which DomU is number 7 at the moment. Obviously you replace somename with something meaningful (I use the hostname of the guest).

Now we've started a guest, if it's in the same subnet as Dom0 or another guest or another machine on the network, then we can communicate with it. We don't need to do anything magical, it all "just works" !


Now, we don't *have* to connect everything to one bridge/network. We can create a second bridge like this :

iface ethext inet static
  bridge_ports pethext
iface ethint inet static
  bridge_ports pethint
  address 192.168.0.36
  netmask 255.255.255.0
  gateway 192.168.0.1

We can start up a DomU with two interfaces :
vif  = [ 'bridge=ethext,vifname=routerext', 'bridge=ethint,vifname=routerint' ]
That DomU can now act as a router between internal and external networks.
Other guests connected to bridge ethint (and indeed Dom0 since we didn't give it an IP address on that bridge) can only communicate with the outside world by routing packets via that virtual router.

Or instead, you could omit bridge ethext altogether and use PCI passthrough to hand over the NIC directly to the DomU. This is what I have on my home network.


I hope this has helped. If not then bear in mind it would help us to help you if we actually knew what you want to achieve. For example, when you write "I have physically assign nic card to vm machine" is this because you particularly need that VM to have a dedicated NIC, or because you followed some tutorial that showed it that way, or ...


Lastly, can you please correct your top posting :
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

--
Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.