Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1552085

Summary: hyper-v VMs do not have uuid set which breaks virt-who mapping
Product: Red Hat Enterprise Linux 7 Reporter: Kenny Tordeurs <ktordeur>
Component: dmidecodeAssignee: Kairui Song <kasong>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.2CC: ailan, cavery, hsun, kasong, ktordeur, leiwang, qguo, rbeyel, vkuznets, yacao
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-12 03:32:17 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 Kenny Tordeurs 2018-03-06 13:31:03 UTC
Description of problem:
The RHEL VMs running on hyper-v do not have a uuid set which breaks the virt-who mapping

# dmidecode| egrep -i uuid | tr '[:upper:]' '[:lower:]'
~~~
uuid: not settable
~~~

subscription-manager facts:
~~~
...
virt.host_type: hyperv
virt.is_guest: True
virt.uuid: Not Settable
~~~

hypervisor details:
~~~
"hypervisor.type": "hyperv",
"hypervisor.version": "10.0.14393.1532"
~~~

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


How reproducible:
100%

Steps to Reproduce:
1. Run RHEL VMs on hyperv-v
2. Create virt-who config for hyper-v
3. No errors are reported from virt-who and mapping is shown
4. Mapping will fail as GuestId cannot be mapped with uuid as it's not set on the VM

Actual results:
VMs are showing:
~~~
Guest has not been reported on any host and is using a temporary unmapped guest subscription.
~~~

Expected results:
virt-who mapping to work

Additional info:

From virt-who mapping (# virt-who -op)
~~~
...
 "facts": {
                "cpu.cpu_socket(s)": "2",
                "hypervisor.type": "hyperv",
                "hypervisor.version": "10.0.14393.1532"
            },
            "guests": [
                {
                    "attributes": {
                        "active": 1,
                        "virtWhoType": "hyperv"
                    },
                    "guestId": "4546B285-6C41-5D6R-86G5-0BFR4B3625FD",
                    "state": 1
                },
...
~~~

We can workaround the issue by setting the uuid manually:
# echo '{"virt.uuid": "4546B285-6C41-5D6R-86G5-0BFR4B3625FD"}' > /etc/rhsm/facts/virt_uuid.facts

Confirm if all was set correctly with:
# subscription-manager facts | grep virt.uuid

You should now have the VM mapped and should be able to subscribe it:
# subscription-manager refresh
# subscription-manager list --available