On Mon, Apr 28, 2008 at 11:15 PM, shankar ganesh <ganshankar at gmail.com> 
wrote:
> Can u please tell me how to get the ipaddress of guest domains  from
> control domain, currently iam using arp command to the ipaddress of
> the guest domain but my friends told that it won't work if the guest
> domain & control domain are in different network, can u tell me the
> way in which i can get the ipaddress of the guest domain.

I assume that if you have equipment that is capable of running LDoms
that environment also has DNS.  Why not just name the LDom the same as
the hostname, then use DNS to figure out the IP address of the LDom?

If this for some reason won't work, you may want to try adding a
script that runs at boot time in the LDom that does something along
lines of:

===============
#! /bin/ksh

# Untested

PATH=/usr/bin:/usr/sbin

nva="$(eeprom nvramrc | sed 's/nvramrc=//' \
        | grep -v 'devalias ldomip')"
myip="$(getent hosts $(hostname) | nawk '{print $1}')
if [ -z "$nva" ] ; then
        nva="devalias ldomip $myip"
else
        nva=$(printf "$nva\ndevalias ldomip $myip")
fi
eeprom nvramrc="$nva"
===============

Then from the primary ldom you should be able to use the following
from the primary LDom to see the IP address.

ldm ls -l <ldom> | grep ldomip

Of course, that is untested and is an abuse of the purpose of devalias
and will provide misleading information if the IP address changes or
you don't trust root in the LDom or ...

Having a reasonable LDom naming standard that matches up with
something in DNS is a much easier way to go.

-- 
Mike Gerdts
http://mgerdts.blogspot.com/

Reply via email to