Bug 1232078

Summary: Start virt-who service will result in RestlibException after migrating guest
Product: Red Hat Enterprise Linux 6 Reporter: Liushihui <shihliu>
Component: virt-whoAssignee: Radek Novacek <rnovacek>
Status: CLOSED DUPLICATE QA Contact: gaoshang <sgao>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.7CC: gxing, hsun, ovasik, rbalakri, sgao
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-06-16 03:31:12 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Liushihui 2015-06-16 03:19:38 UTC
Description of problem:
Migrating guest from orig host to dest host, then start virt-who service in dest host, it will result in 
"Error in communication with subscription manager" since "RestlibException: Task f934bedc-d0cc-4592-bbb7-417e4e8a143b: Katello::Errors::CandlepinError: Runtime Error No entitlements for products: [] at org.candlepin.policy.js.autobind.AutobindRules.selectBestPools:79"

Version-Release number of selected component (if applicable):
subscription-manager-1.14.10-1.el6.x86_64
python-rhsm-1.14.3-1.el6.x86_64
virt-who-0.12-10.el6.noarch
candlepin-0.9.49.3-1.el7.noarch
katello-2.2.0.11-1.el7sat.noarch
foreman-1.7.2.27-1.el7sat.noarch
Satellite-6.1.0-RHEL-7-20150612.0

How reproducible:
50%

Steps to Reproduce:
1. Register orig host, guest and dest host to Satellite 
2. On orig host, Migrate guest to dest host
[root@hp-z220-05 rhsm]# virsh migrate --live 7.1_Server_x86_64 qemu+ssh://10.66.144.4/system
root.144.4's password: 
3. On orig host,Start virt-who serice, virt-who's run at libvirt mode and interval is 10s
[root@hp-z220-05 rhsm]# service virt-who restart
Stopping virt-who:                                         [FAILED]
Starting virt-who:                                         [  OK  ]
[root@hp-z220-05 rhsm]# virsh undefine 7.1_Server_x86_64
Domain 7.1_Server_x86_64 has been undefined
4. on dest host, start virt-who service , virt-who with default configure
[root@hp-z220-06 ~]# service virt-who restart
Stopping virt-who:                                         [FAILED]
Starting virt-who:                                         [  OK  ]
[root@hp-z220-06 ~]# service virt-who status
virt-who (pid  15792) is running...
5. On dest host, Check virt-who's log
2015-06-16 10:44:18,293 [INFO]  @virtwho.py:556 - No configurations found, using libvirt as backend
2015-06-16 10:44:18,293 [INFO]  @virtwho.py:563 - Using configuration "env/cmdline" ("libvirt" mode)
2015-06-16 10:44:18,315 [DEBUG]  @virtwho.py:151 - Starting infinite loop with 3600 seconds interval
2015-06-16 10:44:18,475 [INFO]  @libvirtd.py:120 - Using libvirt url: ""
2015-06-16 10:44:18,528 [DEBUG]  @libvirtd.py:193 - Virtual machine found: 7.1_Server_x86_64: 27c04ba1-678d-1cbc-5d3e-003cf1f00874
2015-06-16 10:44:18,529 [DEBUG]  @libvirtd.py:203 - Libvirt domains found: [{'guestId': '27c04ba1-678d-1cbc-5d3e-003cf1f00874', 'attributes': {'active': 1, 'virtWhoType': 'libvirt', 'hypervisorType': 'QEMU'}, 'state': 1}]
2015-06-16 10:44:18,549 [DEBUG]  @subscriptionmanager.py:76 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2015-06-16 10:44:21,099 [INFO]  @subscriptionmanager.py:117 - Sending domain info: [{'guestId': '27c04ba1-678d-1cbc-5d3e-003cf1f00874', 'attributes': {'active': 1, 'virtWhoType': 'libvirt', 'hypervisorType': 'QEMU'}, 'state': 1}]
2015-06-16 10:44:30,278 [ERROR]  @virtwho.py:123 - Error in communication with subscription manager:
Traceback (most recent call last):
  File "/usr/share/virt-who/virtwho.py", line 103, in send
    self._sendGuestList(report)
  File "/usr/share/virt-who/virtwho.py", line 129, in _sendGuestList
    manager.sendVirtGuests(report.guests)
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 120, in sendVirtGuests
    self.connection.updateConsumer(self.uuid(), guest_uuids=domains)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 858, in updateConsumer
    ret = self.conn.request_put(method, params)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 611, in request_put
    return self._request("PUT", method, params)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 530, in _request
    self.validateResponse(result, request_type, handler)
  File "/usr/lib64/python2.6/site-packages/rhsm/connection.py", line 572, in validateResponse
    raise RestlibException(response['status'], error_msg)
RestlibException: Task f934bedc-d0cc-4592-bbb7-417e4e8a143b: Katello::Errors::CandlepinError: Runtime Error No entitlements for products: [] at org.candlepin.policy.js.autobind.AutobindRules.selectBestPools:79

Actual results:
Failed to send host/guest associate to satellite as "RestlibException"

Expected results:
virt-who should send host/guest association successfully to Satellite.

Additional info:

Comment 2 Liushihui 2015-06-16 03:31:12 UTC

*** This bug has been marked as a duplicate of bug 1220620 ***