check out the xenstore utilities. It appears that at least some domain IPs are stored in xenstore

/usr/lib/xen/bin/xenstore-ls | grep 192
   0 = "192.y.x.229"
   0 = "192.y.x.176"

I don't think its recording all the IPs though, we have two interfaces in each domain, xenstore contains only the front end interface.

You might be able to write into the xenstore from the guest, if you can, you could write a DHCP client hook that write the IP address into the xenstore after it is aquired. If you are hosting heterogeneous guests, this could be time consuming to write various scripts for various hosts, and then, if you don't control root, someone could disable them. I just talked myself out of that answer.

using ARP/RARP might be the easiest way, for you to do it in a guest-neutral way.

 --joe

sagun shakya wrote:
Hi,

For the project I am working on I need to find out the network IP address that is assigned to the domU which has been assigned via DHCP. I could run a command like 'pntadm' on the DHCP server and get the IP address based on the MAC address of the domU. My concern here is that I may not have control
over the DHCP server on that subnet.  So the two alternate approach are:
1)Access the domU via virsh console, run /ifconfig/ to grep the IP address of the primary interface. However I need to do this via a script so would have to be able to run virsh console <domain name> | <command> and the return this information back on to dom0. Is this possible to do or is there an easier way?

2) The other alternate was to run a ARP or RARP to get the MAC address to IP mapping.
If anyone has a better solution or suggestion the please let me know.


Thanks,

Sagun

------------------------------------------------------------------------

_______________________________________________
xen-discuss mailing list
[email protected]

_______________________________________________
xen-discuss mailing list
[email protected]

Reply via email to