virsh and guest IP

2011-11-02 Thread der.hans

moin moin,

is there a way from virsh to see actual networking for a qemu/kvm guest?

I can use dumpxml to pull the interface stanza and get the guest's MAC
addy, then look at the arp cache ( ip neighbor show or arp -a ) to find
the address associated with the MAC.

However, what if the guest has dropped from the arp table due to not
actually using the network for a while? I ran into that the other day.

Since the host is setting up the networking it should be able to report
the networking as well.

I think virt-manager will report the networking info, but I need to be
able to work w/out a GUI for this setup.

There are ways to do this by changing the guest, e.g. ping the gateway
every couple of minutes so that the guest stays in the host's arp table.
But, the info comes from the host, so the host should be able to see it.

ciao,

der.hans
--
#  http://www.LuftHans.com/http://www.LuftHans.com/Classes/
#  "Rock 'n' roll might not solve your problems, but it does let you dance
#  all over them." -- Pete Townsend
---
PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss


Re: virsh and guest IP

2011-11-03 Thread James Crawford

I can't think of a virsh command that would return the IP of the guest.
Are you using DHCP to assign the Guest IP?
Ask dhcpd server.

We setup Static IP when we build the guests, so I keep it on a spreadsheet.

Of course we only have 14 Guest across 4 Host servers.

James Crawford
---
PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss


Re: virsh and guest IP

2011-11-03 Thread der.hans

Am 03. Nov, 2011 schwätzte James Crawford so:

moin moin,


I can't think of a virsh command that would return the IP of the guest.
Are you using DHCP to assign the Guest IP?
   Ask dhcpd server.


True. Good idea. I should be able to script that somewhat easily.

It seems logical that if the client got an IP from the dhcp server
that it would be in the arp cache, but that doesn't seem to always be the
case. After sending my email I had a guest not in the host's arp cache,
but the guest had an IP when I checked via the console.


We setup Static IP when we build the guests, so I keep it on a spreadsheet.


Yeah, that's a good idea. In this particular case I'm building one-off
test VMs, so I'd rather not track anything extra :).

ciao,

der.hans
--
#  http://www.LuftHans.com/http://www.LuftHans.com/Classes/
#  Keine Ahnung, was ich dir sagen soll,
#  keine Ahnung und keinen (.)plan. -- die Toten Hosen---
PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

Re: virsh and guest IP

2011-11-04 Thread der.hans

Am 03. Nov, 2011 schwätzte James Crawford so:


I can't think of a virsh command that would return the IP of the guest.
Are you using DHCP to assign the Guest IP?
   Ask dhcpd server.


That isn't working, but that's due to udev rules that don't make sense for
VMen.

The clone notices that it's no longer on the same (virtual) hardware, so
udev rules move to a new networking device, but the networking rules don't
get updated. In other words, no networking, so no talking to the dhcp
server.

Below is specific to Ubuntu. Other distros are similar, but the rules
files might be otherly numbered/named.

Remove the offending rules file:

sudo rm /etc/udev/rules.d/70-persistent-net.rules

Copy the offending rules generation file into /etc/udev/rules.d/:

sudo cp -pi /lib/udev/rules.d/75-persistent-net-generator.rules
/lib/udev/rules.d/75-persistent-net-generator.rules

Then remove 'eth*|' from the offending rule:

sudo sed -i -e 's/eth\*|//' /etc/udev/rules.d/75-persistent-net-generator.rules

If you do that on the template the clones won't be hosed. If you already
created the clone you can just do the first step if you won't be cloning
it.

Also, go ahead and turn on the serial console, so you can connect to the
guest from virsh :).

https://help.ubuntu.com/community/SerialConsoleHowto

ciao,

der.hans
--
#  http://www.LuftHans.com/http://www.LuftHans.com/Classes/
#  Very frankly, I am opposed to people being programmed by others.
#-- Fred Rogers, aka Mr. Rogers (1928-2003)---
PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

Re: virsh and guest IP

2011-11-05 Thread Benjamin Browning
On Fri, Nov 4, 2011 at 5:34 PM, der.hans  wrote:
> The clone notices that it's no longer on the same (virtual) hardware, so
> udev rules move to a new networking device, but the networking rules don't
> get updated. In other words, no networking, so no talking to the dhcp
> server.

If you do this, be mindful that spinning up a clone VM without
disabling the networking until you reconfigure it can and will cause
arp poisoning...

~Ben
---
PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss


Re: virsh and guest IP

2011-11-05 Thread James Mcphee
There are managed switches that are designed to prevent the migration
pains, but they tend to be spendy.  I tend to build from clone without
networking and configure it after I can get to the guest os.  Or use
kickstart, but then you don't exactly have a clone.
On Nov 5, 2011 9:42 AM, "Benjamin Browning"  wrote:

> On Fri, Nov 4, 2011 at 5:34 PM, der.hans  wrote:
> > The clone notices that it's no longer on the same (virtual) hardware, so
> > udev rules move to a new networking device, but the networking rules
> don't
> > get updated. In other words, no networking, so no talking to the dhcp
> > server.
>
> If you do this, be mindful that spinning up a clone VM without
> disabling the networking until you reconfigure it can and will cause
> arp poisoning...
>
> ~Ben
> ---
> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>
---
PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

Re: virsh and guest IP

2011-11-09 Thread der.hans

Am 05. Nov, 2011 schwätzte Benjamin Browning so:


On Fri, Nov 4, 2011 at 5:34 PM, der.hans  wrote:

The clone notices that it's no longer on the same (virtual) hardware, so
udev rules move to a new networking device, but the networking rules don't
get updated. In other words, no networking, so no talking to the dhcp
server.


If you do this, be mindful that spinning up a clone VM without
disabling the networking until you reconfigure it can and will cause
arp poisoning...


Bah. What's a little poison between VMs?  :)

It's working well for me thus far, but I'm not yet doing much with it.

I might soon need to spin up lots of VMen, so I'll want to automate a few
things at that point. Hostname changes ( which fix the networking issues
since I'm using DHCP ) will be amongst the first things to be automated.

Finally found a document on what parameters are allowed for dnsmasq setup.

http://www.libvirt.org/formatnetwork.html

ciao,

der.hans
--
#  http://www.LuftHans.com/http://www.LuftHans.com/Classes/
#  If you're not learning, you're not living. - der.hans---
PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss