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

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



On Tue, 2014-08-05 at 16:32 +0100, Jeenu Viswambharan wrote:
> On Mon, Aug 04, 2014 at 16:36:44, Ian Campbell wrote:
> > On Mon, 2014-08-04 at 15:00 +0100, Jeenu Viswambharan wrote:
> > > 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.
> 
> OK, I don't have a static IP allocated, but I managed to use the dhtest
> tool [1] to temporarily lease a dynamic IP for testing purposes on my
> network. I assume, for all intent and purposes, that can be treated as a
> static IP.

If you were using vif-route then this would be the case, but not if you
are using vif-nat.

If you are using vif-nat then you have your own set of RFC1918 private
IP spaces to play with, so a static address is simply one you have made
up, e.g. any 192.168.1.x for 0 < x < 127 will do.

>   ...
> 
> What I now see that xl fails to create the guest, and it reports the
> following error (verbose logs attached).
> 
>   ...
>   libxl: error: libxl_device.c:1084:device_hotplug_child_death_cb: script: ip 
> addr add 10.1.193.268 dev vif4.0 failed
>   ...
> 
> The printed IP address 10.1.193.268 seems spurious.

It is trying to assign 10.1.192.(141+127=268) as the "routable_ip" (see
vif-nat for the logic) for the vif device in dom0 (the peer of the
10.1.192.141 IP inside the guest). 10.1.192.268 is not a valid IP
address so it fails. 

I think this cfg ought to work:

  vif = [ "script=vif-nat,mac=22:1e:4e:fc:6d:be,ip=192.168.1.1" ]
  extra = "... root=/dev/nfs nfsroot=nfs.ip.add.ress:/path/to/nfs/root 
ip=192.168.1.1 ..."

i.e. give the guest address 192.168.1.1. This won't pollute your
corporate network since NAT will ensure that what is seen outside the
host is the hosts own address.

> Also, I don't know if it's the MAC address is causing it to fail.
> Although randomly generated, it does seem to have compatible (locally
> administered, multicast etc.) bits.

You can use http://www.hellion.org.uk/cgi-bin/randmac.pl to generate
something which you are sure is correct but I don't think
22:1e:4e:fc:6d:be is wrong, it is a locally administered unicast address
AFAICT.

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®.