Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 546676

Summary: frequent status updates from virtualization/poller.py resulting into 'Abuse of Service' messages
Product: Red Hat Satellite 5 Reporter: Milan Zázrivec <mzazrivec>
Component: VirtualizationAssignee: Milan Zázrivec <mzazrivec>
Status: CLOSED ERRATA QA Contact: Petr Sklenar <psklenar>
Severity: medium Docs Contact:
Priority: urgent    
Version: 530CC: asari, cperry, dave-bugzilla, menthos, psklenar, raud, tao, ubeck, xdmoon
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-01-13 11:25:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 518256    

Description Milan Zázrivec 2009-12-11 16:37:07 UTC
Description of problem:
rhn-virtualization package comes with a cron job that is supposed to poll
virt. hypervisor for guest domain statuses and in case of a change will
report the updated status to RHN / RHN Satellite.

With the release of rhn-virtualization-5.3.0-12, this cron job changed its 
behavior so that now it reports when a guest domain changes status from
'blocked' to 'running' (et vice versa).

This is not desirable becase it is very common for a guest domain to flip
between these statuses, plus frequent updates will eventually result into
'Abuse of Service' messages being sent from rhn.redhat.com

Version-Release number of selected component (if applicable):
>= rhn-virtualization-5.3.0-12

How reproducible:
Always

Steps to Reproduce:
1. Install a RHEL-5 based virt. host system, create a virt guest on it,
register both to rhn.redhat.com
2. Make sure the status of your guest domain (as reported by xm list) is
'blocked'.
3. On your host system, stop crond
4. From your host system, run: python /usr/share/rhn/virtualization/poller.py -d
5. In rhn.redhat.com webui, watch 'Checked In' times of your virt. host
6. Make your guest domain to change status from 'blocked' to 'runinng'. You
can achieve that by for example runing following in your guest system:
   # dd if=/dev/xvda of=/dev/null
7. From your virt. host, run: python /usr/share/rhn/virtualization/poller.py -d
8. See whether the output from poller.py reports any changes (modified domains)
9. See whether 'Checked In' time for your host system in rhn.redhat.com changed
  
Actual results:
poller.py will show there was a change in the running guest status,
'Checked In' time will change.

Expected results:
No changes reported for a plain 'blocked' -> 'running' change.

Additional info:
http://git.fedorahosted.org/git/?p=spacewalk.git;a=commitdiff;h=41df363e238ffb345f2dce35eb013c9f1a7c2f26#patch2

Comment 2 Xixi 2009-12-17 01:17:27 UTC
Interim workaround options for this bug, choose one:

1. Revert the errata http://rhn.redhat.com/errata/RHEA-2009-1491.html and go back to previous version of the rhn-virtualzation*12 packages on the client.

2. Revert *only* the following section of the patch (http://git.fedorahosted.org/git/?p=spacewalk.git;a=commitdiff;h=41df363e238ffb345f2dce35eb013c9f1a7c2f26#patch2) that caused the issue:
--- a/client/tools/rhn-virtualization/virtualization/constants.py
+++ b/client/tools/rhn-virtualization/virtualization/constants.py

@@ -52,11 +52,17 @@ class PropertyType:
# This structure maps the libvirt state enumeration to labels that RHN
# understands.
#

-VIRT_STATE_NAME_MAP = ( StateType.RUNNING,  # VIR_DOMAIN_NOSTATE
+VIRT_STATE_NAME_MAP = ( StateType.NOSTATE,  # VIR_DOMAIN_NOSTATE
                        StateType.RUNNING,  # VIR_DOMAIN_RUNNING
-                        StateType.RUNNING,  # VIR_DOMAIN_BLOCKED
+                        StateType.BLOCKED,  # VIR_DOMAIN_BLOCKED

Before making changes backup constants.py.
#cp /usr/share/rhn/virtualization/constants.py Under /usr/share/rhn/virtualization/constants.py.org

3. If user doesn't want to make code changes, adjust the cron job from 2 minutes to, say, 30 or 60 mins, to prevent client from checking in too often,
 
After any of the above options - delete the system profile and re-register.

Comment 3 Milan Zázrivec 2010-01-04 14:06:10 UTC
spacewalk.git master: 72e10709b87fa115cf75fb3451cf4494e34f2bcb
satellite.git SATELLITE-5.3: c48ca2fa02b9cb6dc801ca4fe6c611a49248253b

Comment 5 Milan Zázrivec 2010-01-04 16:47:19 UTC
Built & tagged rhn-virtualization-5.3.0-15.el5sat

Comment 6 Petr Sklenar 2010-01-07 17:04:35 UTC
I followed test procedure from Comment #0 and "checked in" was not changed when switching between "running" and "blocked" state of virt-guest.

tried on 
xen-host x8664, guest xen-pv i386 and x8664, xen-pv i386
kvm-host x8664, kvm-guest x8664 
all rhel55 with rhn-virtualization-5.3.0-15.el5sat connected to rhn.redhat.com
--
moving to Verified

Comment 8 errata-xmlrpc 2010-01-13 11:25:25 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0031.html