Bug 1438085 - fact collection behavior of 'virt.uuid' has changed for 'virt.host_type's containing {"ibm_systemz","powervm"}
Summary: fact collection behavior of 'virt.uuid' has changed for 'virt.host_type's con...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.4
Hardware: Unspecified
OS: Unspecified
high
low
Target Milestone: rc
: ---
Assignee: Chris Snyder
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-31 20:54 UTC by John Sefler
Modified: 2017-08-01 19:22 UTC (History)
5 users (show)

Fixed In Version: subscription-manager-1.19.9-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 19:22:43 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github candlepin subscription-manager pull 1576 None closed 1438085: Do not include virt.uuid for platforms where it is not known 2020-03-19 18:44:27 UTC
Red Hat Bugzilla 1444742 None CLOSED Missing virt.uuid fact both in GUI and CLI 2019-07-15 17:07:53 UTC
Red Hat Bugzilla 1461277 None CLOSED Missing virt.uuid fact both in GUI and CLI on RHEL-7.4-Server-s390x 2019-07-15 17:07:54 UTC
Red Hat Product Errata RHBA-2017:2083 normal SHIPPED_LIVE python-rhsm and subscription-manager bug fix and enhancement update 2017-08-01 18:14:19 UTC

Internal Links: 1444742 1461277

Description John Sefler 2017-03-31 20:54:17 UTC
Description of problem:
Prior to pull request https://github.com/candlepin/subscription-manager/pull/1509, the virt facts collection for 'virt.host_type's (reported by virt-what) that contained either "ibm_systemz" or "powervm" where exceptional cases that STOPPED collection for 'virt.uuid' despite the true value for virt.is_guest.

Note: The special case behavior for virt.host_type "xen-dom0" remains unchanged.

This is a regression in behavior. 

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:

DEMONSTRATION OF BEHAVIOR FROM RHEL73...
[root@jsefler-rhel7 ~]# rpm -q subscription-manager python-rhsm
subscription-manager-1.17.15-1.el7.x86_64
python-rhsm-1.17.9-1.el7.x86_64
[root@jsefler-rhel7 ~]# 
[root@jsefler-rhel7 ~]# mv /usr/sbin/virt-what /usr/sbin/virt-what.BAK
[root@jsefler-rhel7 ~]# 

BEFORE CASE FOR "ibm_systemz"
[root@jsefler-rhel7 ~]# echo '#!/bin/bash - ' > /usr/sbin/virt-what; echo -e 'echo -e "ibm_systemz\nibm_systemz-direct"' >> /usr/sbin/virt-what; chmod a+x /usr/sbin/virt-what
[root@jsefler-rhel7 ~]# virt-what
ibm_systemz
ibm_systemz-direct
[root@jsefler-rhel7 ~]# 
[root@jsefler-rhel7 ~]# subscription-manager facts | egrep ^virt
virt.host_type: ibm_systemz, ibm_systemz-direct
virt.is_guest: True
[root@jsefler-rhel7 ~]# 

BEFORE CASE FOR "powervm"
[root@jsefler-rhel7 ~]# echo '#!/bin/bash - ' > /usr/sbin/virt-what; echo -e 'echo -e "powervm_lx86"' >> /usr/sbin/virt-what; chmod a+x /usr/sbin/virt-what
[root@jsefler-rhel7 ~]# virt-what
powervm_lx86
[root@jsefler-rhel7 ~]# 
[root@jsefler-rhel7 ~]# subscription-manager facts | egrep ^virt
virt.host_type: powervm_lx86
virt.is_guest: True
[root@jsefler-rhel7 ~]# 

BEFORE CASE FOR "xen-dom0"
[root@jsefler-rhel7 ~]# echo '#!/bin/bash - ' > /usr/sbin/virt-what; echo -e 'echo -e "xen-dom0"' >> /usr/sbin/virt-what; chmod a+x /usr/sbin/virt-what
[root@jsefler-rhel7 ~]# virt-what
xen-dom0
[root@jsefler-rhel7 ~]# 
[root@jsefler-rhel7 ~]# subscription-manager facts | egrep ^virt
virt.host_type: xen-dom0
virt.is_guest: False
[root@jsefler-rhel7 ~]# 



DEMONSTRATION OF BEHAVIOR AFTER UPGRADING TO RHSM PACKAGES TARGETED FOR RHEL74...
[root@jsefler-rhel7 ~]# rpm -q subscription-manager python-rhsm
subscription-manager-1.19.4-1.el7.x86_64
python-rhsm-1.19.2-1.el7.x86_64

AFTER CASE FOR "ibm_systemz"
[root@jsefler-rhel7 ~]# echo '#!/bin/bash - ' > /usr/sbin/virt-what; echo -e 'echo -e "ibm_systemz\nibm_systemz-direct"' >> /usr/sbin/virt-what; chmod a+x /usr/sbin/virt-what
[root@jsefler-rhel7 ~]# virt-what
ibm_systemz
ibm_systemz-direct
[root@jsefler-rhel7 ~]# 
[root@jsefler-rhel7 ~]# subscription-manager facts | egrep ^virt
virt.host_type: ibm_systemz, ibm_systemz-direct
virt.is_guest: True
virt.uuid: 672A2A41-EFBD-463F-B8A0-543C292AAEAB   <============== REGRESSION: NOT EXPECTED
[root@jsefler-rhel7 ~]# 

AFTER CASE FOR "powervm"
[root@jsefler-rhel7 ~]# echo '#!/bin/bash - ' > /usr/sbin/virt-what; echo -e 'echo -e "powervm_lx86"' >> /usr/sbin/virt-what; chmod a+x /usr/sbin/virt-what
[root@jsefler-rhel7 ~]# virt-what
powervm_lx86
[root@jsefler-rhel7 ~]# 
[root@jsefler-rhel7 ~]# subscription-manager facts | egrep ^virt
virt.host_type: powervm_lx86
virt.is_guest: True
virt.uuid: 672A2A41-EFBD-463F-B8A0-543C292AAEAB   <============== REGRESSION: NOT EXPECTED
[root@jsefler-rhel7 ~]# 
AFTER CASE FOR "xen-dom0"
[root@jsefler-rhel7 ~]# echo '#!/bin/bash - ' > /usr/sbin/virt-what; echo -e 'echo -e "xen-dom0"' >> /usr/sbin/virt-what; chmod a+x /usr/sbin/virt-what
[root@jsefler-rhel7 ~]# virt-what
xen-dom0
[root@jsefler-rhel7 ~]# 
[root@jsefler-rhel7 ~]# subscription-manager facts | egrep ^virt
virt.host_type: xen-dom0
virt.is_guest: False                              <============== NOT A REGRESSION: STILL A SPECIAL CASE TREATMENT
[root@jsefler-rhel7 ~]# 

[root@jsefler-rhel7 ~]# mv /usr/sbin/virt-what.BAK /usr/sbin/virt-what




Actual results:
 above

Expected results:
 THE FACT 'virt.uuid' SHOULD BE ABSENT FOR virt.host_types CONTAINING "ibm_systemz" OR "powervm"

Additional info:
 testing demonstrated above was actually conducted on an x86_64 KVM guest

Comment 3 Chris Snyder 2017-04-06 13:53:59 UTC
Out of curiosity, have you tried these cases against systems matching the arch and virtualization platforms mentioned in beaker?

Comment 4 Chris Snyder 2017-04-06 16:08:28 UTC
It turns out I did not need the answer to the question in comment 3 to solve this bug. Cancelling needinfo.

I've attached a PR including a fix for this.

Comment 6 Rehana 2017-05-17 09:11:58 UTC
Reproducing the failure with below subscription-manager versions on an x86_64 KVM guest :
============================================================
# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.51.21-1
subscription management rules: 5.15.1
subscription-manager: 1.19.4-1.el7
python-rhsm: 1.19.2-1.el7

on "ibm_systemz":
================
[root@dhcp35-71 ~]#  mv /usr/sbin/virt-what /usr/sbin/virt-what.BAK
[root@dhcp35-71 ~]#  echo '#!/bin/bash - ' > /usr/sbin/virt-what; echo -e 'echo -e "ibm_systemz\nibm_systemz-direct"' >> /usr/sbin/virt-what; chmod a+x /usr/sbin/virt-what
[root@dhcp35-71 ~]# virt-what
ibm_systemz
ibm_systemz-direct
[root@dhcp35-71 ~]# subscription-manager facts | egrep ^virt
virt.host_type: ibm_systemz, ibm_systemz-direct
virt.is_guest: True
virt.uuid: 09daf6e6-e77e-af0f-16b6-2ee661306d71 --> FAILED 

on  "powervm":
==============
[root@dhcp35-71 ~]# echo '#!/bin/bash - ' > /usr/sbin/virt-what; echo -e 'echo -e "powervm_lx86"' >> /usr/sbin/virt-what; chmod a+x /usr/sbin/virt-what
[root@dhcp35-71 ~]# virt-what
powervm_lx86
[root@dhcp35-71 ~]# subscription-manager facts | egrep ^virt
virt.host_type: powervm_lx86
virt.is_guest: True
virt.uuid: 09daf6e6-e77e-af0f-16b6-2ee661306d71 --> FAILED

on "xen-dom0":
==============
[root@dhcp35-71 ~]# echo '#!/bin/bash - ' > /usr/sbin/virt-what; echo -e 'echo -e "xen-dom0"' >> /usr/sbin/virt-what; chmod a+x /usr/sbin/virt-what
[root@dhcp35-71 ~]# virt-what
xen-dom0
[root@dhcp35-71 ~]# subscription-manager facts | egrep ^virt
virt.host_type: xen-dom0
virt.is_guest: False 

Retesting with updated subscription-manager version on a x86_64 machine:
========================================================================
subscription-manager: 1.19.13-1.el7
python-rhsm: 1.19.6-1.el7

# rpm -qa subscription-manager --changelog | grep 1438085
- 1438085: Do not include virt.uuid for platforms where it is not known

on "ibm_systemz":
===============
#  mv /usr/sbin/virt-what /usr/sbin/virt-what.BAK

# echo '#!/bin/bash - ' > /usr/sbin/virt-what; echo -e 'echo -e "ibm_systemz\nibm_systemz-direct"' >> /usr/sbin/virt-what; chmod a+x /usr/sbin/virt-what

# virt-what
ibm_systemz
ibm_systemz-direct

# subscription-manager facts | egrep ^virt
virt.host_type: ibm_systemz, ibm_systemz-direct
virt.is_guest: True

^^ PASSED : virt.uuid  is absent for the system of virt.host_type " ibm_systemz"

on "powervm":
============

[root@inferno ~]#  echo '#!/bin/bash - ' > /usr/sbin/virt-what; echo -e 'echo -e "powervm_lx86"' >> /usr/sbin/virt-what; chmod a+x /usr/sbin/virt-what

[root@inferno ~]# virt-what
powervm_lx86

[root@inferno ~]# subscription-manager facts | egrep ^virt
virt.host_type: powervm_lx86
virt.is_guest: True

^^ PASSED : virt.uuid  is absent for the system of virt.host_type "powervm"

on "xen-dom0":
==============

[root@inferno ~]# echo '#!/bin/bash - ' > /usr/sbin/virt-what; echo -e 'echo -e "xen-dom0"' >> /usr/sbin/virt-what; chmod a+x /usr/sbin/virt-what

[root@inferno ~]# virt-what
xen-dom0

[root@inferno ~]#  subscription-manager facts | egrep ^virt
virt.host_type: xen-dom0
virt.is_guest: False


Based on the above test observations , marking this bug as verified!!

Comment 7 errata-xmlrpc 2017-08-01 19:22:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2083


Note You need to log in before you can comment on or make changes to this bug.