From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Russ Pavlicek <russell.pavlicek@xenproject.org>, xen-devel@lists.xen.org
Subject: Re: Best way to get IP addresses from VMs without logging in to them?
Date: Wed, 11 Jun 2014 17:49:37 +0100 [thread overview]
Message-ID: <539888A1.6020004@citrix.com> (raw)
In-Reply-To: <1402504732.16332.51.camel@kazak.uk.xensource.com>
On 11/06/14 17:38, Ian Campbell wrote:
> On Wed, 2014-06-11 at 12:32 -0400, Russ Pavlicek wrote:
>> I have been working on an "on-ramp" application to introduce new
>> people to Xen Project (more on that later), when I ran into a simple
>> scenario which seems to lack a simple solution:
>>
>> When I start up a new VM which employs DHCP, how can I
>> programmatically determine what IP address it obtained?
>>
>> When I look at the Wiki, I find the following reference:
>>
>> http://wiki.xenproject.org/wiki/Xen_FAQ_Networking#IP_Determination
>>
>> Which suggests using tcpdump for sniffing out packets relating to a
>> known MAC address. But that depends on traffic flow from VM, which
>> could be time consuming if the machine happens to be idle.
> If the machine is using DHCP then you should be able to observe the DHCP
> requests and responses, which contain the IP address. I think Xenrt does
> something around parsing the tcpdump output of that happening, but I'm
> not sure of the details.
>
> Ian.
I believe XenRT snoops ARP and DHCP packets from dom0 using tcpdump, but
also controls the DHCP server itself.
XenServer also has the guest tools package. This is a small daemon
running in the guest which, amongst other things, writes
/local/domain/$DOMID/attr/eth$N/ip/$DETAILS which is then consumed by
monitoring tools in dom0.
~Andrew
next prev parent reply other threads:[~2014-06-11 16:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-11 16:32 Best way to get IP addresses from VMs without logging in to them? Russ Pavlicek
2014-06-11 16:38 ` Ian Campbell
2014-06-11 16:49 ` Andrew Cooper [this message]
2014-06-11 17:47 ` Russ Pavlicek
2014-06-11 18:02 ` Andrew Cooper
2014-06-11 18:14 ` Ian Campbell
2014-06-11 18:36 ` Russ Pavlicek
2014-06-11 18:44 ` Andrew Cooper
2014-06-11 22:10 ` Don Slutz
2014-06-12 7:26 ` Ian Campbell
2014-06-12 8:19 ` Tamas Lengyel
2014-06-11 16:40 ` Andy Smith
2014-06-11 16:49 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=539888A1.6020004@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=russell.pavlicek@xenproject.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.