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

Re: [Xen-users] mount DomU root fs via. NFS



On Mon, 2014-08-04 at 15:00 +0100, Jeenu Viswambharan wrote:
> On Mon, Aug 04, 2014 at 13:11:22, Ian Campbell wrote:
> > On Wed, 2014-07-30 at 18:03 +0100, Jeenu Viswambharan wrote:
> >
> > > And I've in my guest configuration:
> > >
> > >   ...
> > >   vif = [ "script=vif-nat,ip=192.168.1.1" ]
> > >   extra = "... root=/dev/nfs nfsroot=my.ip.add.ress:/path/to/root ..."
> > >   ...
> >
> > I've just setup NAT on a random x86 Xen box I had (I don't think the
> > arch should matter) and things seem to be working ok from the guest.
> > Other than ip_forward=1 and the iptables run all I had to do was
> > correctly configure the ip address within the guest.
> >
> > One thing I tripped over was the need to setup the default
> > gateway/route from within the guest. Once I set that to the IP of the
> > vifX.Y device (127 more than the guest internal one, so 192.168.1.128
> > here) then it worked ok.
> >
> > That made me come back and look here where I notice that you don't
> > seem to have the ip= option which I would expect for an NFS root
> > setup. Note that the ip= in the vif stanza is only about the *host*
> > configuration associated with that vif (i.e. the dom0 routing tables
> > etc), the virtual Ethernet device still needs to be configured within
> > the guest. I did it using /etc/network/interfaces but I suppose for
> > nfsroot it is done differently.
> 
> Ah, I was under the impression that the vif stanza was configuring
> interface address for the guest!

Aha!

> Dom0 gets IP address using DHCP (I've ip=dhcp in Dom0 command line). Can
> vif be configured to get IP address via. DHCP too, rather than assigning
> a static one?

Sort of, but not how you probably mean...

It is possible to run a dhcpd in dom0 which serves IP addresses to the
VMs which are behind the NAT. The vif-nat script will frob the dhcp
config to contain the ip address which you gave in the config and reload
the server config on the fly, so that the guest gets given that address.

What isn't possible is to use the existing DHCP server, since it doesn't
know about your private network. Plus you would need to be able to write
the answer to the DHCP request into the guest cfg file, or do something
else clever with proxy dhcp or something...

If you were to setup dhcpd in dom0 you'd need to be very careful about
which interfaces it will send replies to, otherwise you'll have your IT
department breaking down your door ;-)

Personally I don't trust that stuff much, so I would use a static IP.

> Later, with NAT, I suppose the guest is on a private network, and I can
> pass a sensible IP address/netmask/gateway via. ip= parameter to DomU?

Yes. That's what I would do.

> Otherwise, I suppose I can as well use ip=dhcp for DomU instead?

It can be done, but as I say it's a bit tricky...

Ian.


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

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