[openstack-dev] [nova][ceilometer] proposal to send bulk hypervisor stats data in periodic notifications

Daniel P. Berrange berrange at redhat.com
Sat Jun 20 20:35:36 UTC 2015

On Sat, Jun 20, 2015 at 01:50:53PM -0500, Matt Riedemann wrote:
> Waking up from a rare nap opportunity on a Saturday, this is what was
> bothering me:
> The proposal in the etherpad assumes that we are just getting bulk
> host/domain/guest VM stats from the hypervisor and sending those in a
> notification, but how do we go about filtering those out to only instances
> that were booted through Nova?

In general I would say that is an unsupported deployment scenario to
have other random virt guests running on a nova compute node.

Having said that, when nova uses libguestfs, it will create some temp
guests via libvirt, so we do have to consider that possibility.

Even today with the general list domains virt driver call, we could be
getting domains that weren't launched by Nova I believe.

> Jason pointed out the ceilometer code gets all of the non-error state
> instances from nova first [1] and then for each of those it does the domain
> lookup from libvirt, filtering out any that are in SHUTOFF state [2].
> When talking about the new virt driver API for bulk stats, danpb said to use
> virConnectGetAllDomainStats with libvirt [3] but I'm not aware of that being
> able to filter out instances that weren't created by nova.  I don't think we
> want a notification from nova about the hypervisor stats to include things
> that were created outside nova, like directly through virsh or vCenter.
> For at least libvirt, if virConnectGetAllDomainStats returns the domain
> metadata then we can filter those since there is nova-specific metadata in
> the domains created through nova [4] but I'm not sure that's true about the
> other virt types in nova (I think the vCenter driver tags VMs somehow as
> being created by OpenStack/Nova, but not sure about xen/hyper-v/ironic).

The nova database hsa a list of domains that it owns, so if you query the
database for a list of valid UUIDs for the host, you can use that to filter
the domains that libvirt reports by comparing UUIDs.

|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

More information about the OpenStack-dev mailing list