Bug 1662212

Summary: No temporary subscriptions granted to VM
Product: Red Hat Satellite Reporter: Eko <hsun>
Component: CandlepinAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: bkearney, csnyder, khowell, prakgupt, sghai, yuefliu
Target Milestone: 6.7.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1665970 (view as bug list) Environment:
Last Closed: 2020-04-14 13:23:48 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:
Bug Depends On: 1665970    
Bug Blocks:    
Attachments:
Description Flags
vm is registered
none
vm's subscripiton none

Description Eko 2018-12-27 05:25:25 UTC
According to the document:
https://access.redhat.com/documentation/en-us/red_hat_satellite/6.4/html-single/virtual_instances_guide/index#temporary_subscriptions

When a virtual machine is first registered, Satellite does not know with which virtualization manager or hypervisor the virtual machine is associated and so cannot assign a subscription. In this case a temporary subscription is granted, valid for a maximum period of 7 days.

but there is no any temporary subscription found in satellite6.5, test steps as below:

1. deploy satellite6.5 and make sure subscription manifest imported.

2. register a vm to the satellite6.5

3. check the Temporary SKU exist or not
no any Temporary SKU found by "subscription-manager list --av --all"

Comment 3 Eko 2018-12-27 05:48:25 UTC
Created attachment 1516985 [details]
vm is registered

Comment 4 Eko 2018-12-27 05:48:54 UTC
Created attachment 1516986 [details]
vm's subscripiton

Comment 5 Eko 2019-01-08 04:56:30 UTC
This issue can be reproduced in sat6.4 and sat6.5, it's hard to reproduce, but it's really exist.

How to reproduce:
1). register virt-who host to sat6.4 or 6.5
2). register vcenter guest to sat6.4 or 6.5
Make sure you never run virt-who for this vcenter and this satellite, the h/g associated info never be sent to this satellite before.
Thus, you can find the Temporary SKU for guest in satellite website, this is expected.

3). Now I will create a virt-who configure file for this vcenter, and make sure the hypervisor_id=uuid, just like:
# cat /etc/virt-who.d/esx.conf
[esx_config]
type=esx
server=xxx.xxx.xxx.xxx
username=administrator
password=xxx
owner=Default_Organization
env=Library
hypervisor_id=uuid

and then I will start virt-who service for this configure file, 
you will find the vcenter's guest is associated with a host in the satellite website. and now there is no any Temporary SKU found for this guest any more, this is expected.

4). this step, I will change the hypervisor_id=hostname in the above configure file:
# cat /etc/virt-who.d/esx.conf
[esx_config]
type=esx
server=xxx.xxx.xxx.xxx
username=administrator
password=xxx
owner=Default_Organization
env=Library
hypervisor_id=hostname

and then I will restart virt-who service for this configure file again,  
you will find the vcenter's guest is associated with the same host in the satellite website. and no any Temporary SKU found for this guest any more, this is expected.

5). now I will unregister the vcenter host in satellite website, that means the association is broken between the vcenter host and guest, the Temporary SKU for the guest should be available.
but the Actual Results: no any Temporary SKU found for this guest


My opinion:
This issue is caused by the duplicated start virt-who service with hypervisor_id=uuid and hypervisor_id=hostname,
Start virt-who service with hypervisor_id=uuid and hypervisor_id=hostname, there are two hyperviosr entry created, but only one hypervisior entry list, another entry is hidden.
Although I unregistered the vcenter host to break the association in satellite website, the hidden association is still exist.

Comment 6 Eko 2019-01-08 05:07:05 UTC
Workaround: Register and Unregister one by one:
start virt-who service with hypervisor_id=uuid, unregistered the hypervisor host in satellite website
start virt-who service with hypervisor_id=hostname, unregistered the hypervisor host in satellite website


if start virt-who service with hypervisor_id=uuid, after that start virt-who service with hypervisor_id=hostname again, you can't unregistered the hypervisor host completely in satellite website,because one of them is hidden.

Comment 9 Eko 2019-10-29 02:49:44 UTC
Hey, 
According to our latest test result, when the a virtual machine is registered to sat6.5, the temporary sku is available and can be attached.

Comment 11 jcallaha 2020-02-17 18:52:51 UTC
Verified in Satellite 6.7 Beta

Submitted a virt-who report with one guest vm and one hypervisor
Registering a VM to the Satellite properly entitled it with the temporary subscription.
Registering the hypervisor allowed me to attach the vdc sub
This made the guest of <hypervisor> sub available to be attached to the guest.
Attaching the guest sub was then successful on the guest vm.

Comment 14 errata-xmlrpc 2020-04-14 13:23:48 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/RHSA-2020:1454