Re: get xen name from guest

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

Christopher G. Stach II wrote:
> ----- "Ryan Pugatch" <rpug@xxxxxxxxx> wrote:
>> Hello,
>> Is it possible to get the name that was set in a VM's xen config file
>> from the guest machine?  I'm interested in having my kickstart launch a 
>> script that can configure hostname, but to do that it would need to
>> get the name set in the config.
>> Thanks,
>> Ryan
> Since there isn't an rpm for the xenstore tools for guests, copy* and /usr/bin/xenstore-read (and the rest, if you want) to the guest and use something like this:
> #!/bin/bash
> let i=1
> while [ $i -le 100 ]; do
>         NAME=$(./xenstore-read /local/domain/$i/name 2> /dev/null)
>         [ -n "${NAME}" ] && break
>         let i++
> done
> [ -n "${NAME}" ] && echo ${NAME}
> exit 0
> I don't see why you would even need this, though. If you are using kickstart, you can get the hostname with either the static configuration or DHCP.

The reason I want to do this is so I don't have to specify in the 
kickstart the IP to use.  With our Dell servers, for example, I just add 
the service tag in to DNS and then the server figures out what IP it is 
supposed to have.


CentOS-virt mailing list

[CentOS Users]     [Linux Media]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Xfree86]     [Devices]     [Linux USB]

Powered by Linux Add to Google