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

[Xen-users] xen guest IP roll call


  • To: xen-users@xxxxxxxxxxxxxxxxxxx
  • From: Mark Pryor <tlviewer@xxxxxxxxx>
  • Date: Wed, 5 May 2010 20:39:36 -0700 (PDT)
  • Delivery-date: Wed, 05 May 2010 20:40:55 -0700
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=npXATvxzJX78kJDiwOX+LR0sBiIzRcb7nSiW0AXAYTZDxzuktEyyJEAnuLbz1tBtDXc4o51BjnlQDDLT3L2al8Fz0vUDRqyJt9zCn+NNGgSiYUUVHWeCEC9x53botXS0o9sJ1QOgjxmsvTidDnCiWhQuveWVtHpG3JyYTyPFs/8=;
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

This must be an FAQ: How to find the IP address of a Xen guest?

Here's a simple approach using a local webserver and the wget command.

Your webserver is at $WS, this is also gateway on my network.

Now we need an init file that fires at the end of the boot sequence:

  --Ubuntu, Redhat (maybe Debian) use /etc/rc.local

  --OpenSuSE use /etc/init.d/after.local

Setup inside each domU
---------------- /etc/rc.local ------------
#!/bin/sh
#at now + 1 minute <<EOF
wget --spider http://$WS/favicon.ico?NameU?HostU
#EOF
exit 0
---------------- end ----------


where NameU is the domU name and HostU is the dom0 name.

Now when each domU boots, its IP address will be in the
httpd log. If your network is slow to come up, uncomment the
chron script wrap above and below the wget command.

Simply grep the /var/log/httpd/local_access.log for favi, and all the
IP's will be grouped.

I see this in my httpd log
192.168.1.115 - - [04/May/2010:13:45:25 -0700] "HEAD 
/favicon.ico?ubsvr91pv?ga-p45 HTTP/1.0" 200 -
192.168.1.234 - - [04/May/2010:13:45:37 -0700] "HEAD 
/favicon.ico?karmicpv?ga-p45 HTTP/1.0" 200 -
192.168.1.243 - - [04/May/2010:13:45:49 -0700] "HEAD 
/favicon.ico?fc12pv01.tlviewer.org?ga-p45 HTTP/1.0" 200 -
192.168.1.233 - - [04/May/2010:13:46:02 -0700] "HEAD 
/favicon.ico?fc12pvg.tlviewer.org?ga-p45 HTTP/1.0" 200 -
192.168.1.114 - - [04/May/2010:13:46:02 -0700] "HEAD 
/favicon.ico?suse11pv?ga-p45 HTTP/1.0" 200 -
192.168.1.112 - - [04/May/2010:13:46:05 -0700] "HEAD 
/favicon.ico?fc12pv.tlviewer.org?ga-p45 HTTP/1.0" 200 -
192.168.1.231 - - [04/May/2010:13:46:09 -0700] "HEAD 
/favicon.ico?supvops?ga-p45 HTTP/1.0" 200 -
192.168.1.116 - - [04/May/2010:13:46:24 -0700] "HEAD 
/favicon.ico?c564pv.tlviewer.org?ga-p45 HTTP/1.0" 200 -
192.168.1.224 - - [04/May/2010:13:50:13 -0700] "HEAD 
/favicon.ico?lucidpv?ga-p45 HTTP/1.0" 200 -






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