Package virtualization :: Module poller
[hide private]
[frames] | no frames]

Module poller

source code

Functions [hide private]
 
poll_hypervisor()
This function polls the hypervisor for information about the currently running set of domains.
source code
 
poll_through_vdsm(server)
This method polls all the virt guests running on a VDSM enabled Host.
source code
 
poll_state(uuid)
Polls just the state of the guest with the provided UUID.
source code
 
_send_notifications(poller_state)
This function will send notifications based on vm state change to the server.
source code
 
_parse_options() source code
 
_log_debug(msg, include_trace=0) source code
Variables [hide private]
  t = gettext.translation('rhn-virtualization', fallback= True)
  libvirt = None
hash(x)
  options = None
hash(x)
  __package__ = 'virtualization'
Function Details [hide private]

poll_hypervisor()

source code 

This function polls the hypervisor for information about the currently
running set of domains.  It returns a dictionary object that looks like the
following:

{ uuid : { 'name'        : '...',
           'uuid'        : '...',
           'virt_type'   : '...',
           'memory_size' : '...',
           'vcpus'       : '...',
           'state'       : '...' }, ... }

poll_through_vdsm(server)

source code 

This method polls all the virt guests running on a VDSM enabled Host.
Libvirt is disabled by default on RHEV-M managed clients.
* Imports the localvdsm client that talks to the localhost
  and fetches the list of vms and their info.
* Extract the data and construct the state to pass it to the
  execution plan for guest polling.
* The server should account for business rules similar to
  xen/kvm.

poll_state(uuid)

source code 

Polls just the state of the guest with the provided UUID. This state is returned.

_send_notifications(poller_state)

source code 

This function will send notifications based on vm state change to the server. To reduce the possibility of spamming the server but still maintain an element of consistency, it will compare the previous poll state against the current poll state and only send notifications if something has changed. In the event that the cache might have gotten into an inconsistent state, the cache will be removed after every 50 polls (this is about every 1.5 hours). This will cause the full state to be re-uploaded and put things back in sync, if necessary.