This seems to come up every few months.
If you're dead set on shell scripting it, there are always the xenstore
commands.
You¹re probably used to seeing the SXP formatted format of ³xm list l².
That's a bit difficult to parse using shell tools. Try this instead:
/usr/lib/xen/bin/xenstore-ls
To list all of the VMs and their MAC address, you could use:
/usr/lib/xen/bin/xenstore-list /vm | while read uuid ; do
echo $(/usr/lib/xen/bin/xenstore-read /vm/${uuid}/name \
/vm/${uuid}/device/vif/0/mac ) ; \
done
Hope this helps.
- Ian Blenke <[email protected]> <[email protected]> http://ian.blenke.com/
On 3/2/09 12:46 AM, "David Edmondson" <[email protected]> wrote:
>
>
> On 28 Feb 2009, at 11:01pm, James Adams wrote:
>
>> I'm creating a new domU using 'virsh create <xmlfile>' without
>> specifying the MAC address within the XML file, under the assumption
>> that the dom0 or hypervisor generates the MAC address for me. Next
>> I'd like to get the MAC address that was assigned to this new domU,
>> and I don't see a way to get that information from the command line
>> via virsh or xm. The closest thing I've found is that you can use
>> 'xm info' and it will give you some MAC address-looking values in
>> its hw_caps line, but I can't find any documentation which explains
>> how to interpret these values and whether or not they're actually
>> related to any of the domUs. I'd like to leverage a shell command
>> if possible for this since I'm communicating with the machine that
>> is running xVM via ssh from a Java program. Can anyone give me any
>> suggestions on how I'd go about doing this?
>
> As Andrew says, dumping the configuration of the domain is the right
> way to go. I'd encourage you to parse the XML with a more complete
> tool than 'grep' though ;-)
>
> _______________________________________________
> xen-discuss mailing list
> [email protected]
>
_______________________________________________
xen-discuss mailing list
[email protected]