[CentOS-virt] Extract ip address from a kvm guest

Sat Apr 23 15:07:19 UTC 2011
carlopmart <carlopmart at gmail.com>

Hi all,

  Somebody knows how can I extract/know an ip address used by a kvm 
guest using a script?? For example I have the following guests:

[root at kvmsrv01 bin]# virsh list --all
  Id Name                 State
   1 linclunode01         running
   2 linmgmt              running
   5 win7desktop          running

  I know that linclunode01 has as ip address, linmgmt has and so on. But suppose that i don't know which ip address is 
used by win7desktop guest. The real fqdn for win7desktop is 
win7.local.net. How can I know its real ip using a script (bash, python, 
etc)?? I don't use a dhcp or dns server on this network.


CL Martinez
carlopmart {at} gmail {d0t} com