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 1097580 - [virt-who] It will regenerate a new hypervisor if add the deleted host to the RHEVM
Summary: [virt-who] It will regenerate a new hypervisor if add the deleted host to the...
Keywords:
Status: CLOSED DUPLICATE of bug 1197970
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-who
Version: 6.0
Hardware: x86_64
OS: Linux
high
high
Target Milestone: pre-dev-freeze
: 6.1
Assignee: Radek Novacek
QA Contact: gaoshang
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-14 06:33 UTC by Liushihui
Modified: 2016-12-01 00:32 UTC (History)
23 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-19 10:00:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1102462 0 high CLOSED virt-who's configuration can't be save after reboot rhevh 2021-02-22 00:41:40 UTC

Internal Links: 1102462

Description Liushihui 2014-05-14 06:33:29 UTC
Description of problem:
In the RHEVM , add the deleted host to RHEVM (we haven't delete the hypervisor in the SAM server after delete it),it will recreate a new hypervisor in the SAM server

Version-Release number of selected component (if applicable):
virt-who-0.8-12.el7.noarch
subscription-manager-1.10.14-7.el7.x86_64
python-rhsm-1.10.12-2.el7.x86_64
candlepin-0.9.6-1.el6_5.noarch
katello-headpin-1.4.3.26-1.el6sam_splice.noarch

How reproducible:
Always

Steps to Reproduce:
1. Register system with virt-who to SAM server, Add three RHEL6.5 hosts to RHEVM
2. Configure virt-who run in the rhevm mode
VIRTWHO_DEBUG=1
VIRTWHO_INTERVAL=2
VIRTWHO_RHEVM_OWNER=ACME_Corporation
VIRTWHO_RHEVM_ENV=Library
VIRTWHO_RHEVM_SERVER=https://10.66.129.57:443
VIRTWHO_RHEVM_USERNAME=admin@internal
VIRTWHO_RHEVM_PASSWORD=redhat
3. Restart virt-who service ,make sure three hypervisors have been send to SAM server
# systemctl restart virt-who
4. In the RHEVM web UI, delete host1 (the hypervisor hasn'te been deleted on the SAM)
5. In the RHEVM web UI, add host1 to RHEVM again
6. Check the virt-who log in the /var/log/rhsm/rhsm.log
7. Check the SAM web UI

Actual results:
6. After step6, In the virt-who log, it will create a new host, please see the log as the following
7. After step7, In the SAM web UI, It will regenerate a new hypervisor
==>Before delete host1:
2014-05-14 13:54:20,299 [DEBUG]  @subscriptionmanager.py:109 - Sending update in hosts-to-guests mapping: {'3c2c5db2-bdcb-4ce2-b545-4ab1f7c9336e': ['810ea352-eee2-42ce-94fd-fdac13163d93'], '2e8cbe73-8872-46c0-b742-ec4dfac01dda': [], 'cca20075-abb1-464a-80f1-3e8b6a07dc6c': []}
2014-05-14 13:54:22,914 [DEBUG]  @subscriptionmanager.py:109 - Sending update in hosts-to-guests mapping: {'3c2c5db2-bdcb-4ce2-b545-4ab1f7c9336e': ['810ea352-eee2-42ce-94fd-fdac13163d93'], '2e8cbe73-8872-46c0-b742-ec4dfac01dda': [], 'cca20075-abb1-464a-80f1-3e8b6a07dc6c': []}
-==>After delete host1
2014-05-14 13:54:25,319 [DEBUG]  @subscriptionmanager.py:109 - Sending update in hosts-to-guests mapping: {'3c2c5db2-bdcb-4ce2-b545-4ab1f7c9336e': ['810ea352-eee2-42ce-94fd-fdac13163d93'], '2e8cbe73-8872-46c0-b742-ec4dfac01dda': []}
2014-05-14 13:54:55,155 [DEBUG]  @subscriptionmanager.py:109 - Sending update in hosts-to-guests mapping: {'3c2c5db2-bdcb-4ce2-b545-4ab1f7c9336e': ['810ea352-eee2-42ce-94fd-fdac13163d93'], '2e8cbe73-8872-46c0-b742-ec4dfac01dda': []}
==>After add host1
2014-05-14 13:54:57,587 [DEBUG]  @subscriptionmanager.py:109 - Sending update in hosts-to-guests mapping: {'3c2c5db2-bdcb-4ce2-b545-4ab1f7c9336e': ['810ea352-eee2-42ce-94fd-fdac13163d93'], '2e8cbe73-8872-46c0-b742-ec4dfac01dda': [], 'a0483d14-d738-4e60-8ede-62fe6bb70015': []}
2014-05-14 13:54:59,514 [INFO]  @virt-who.py:217 - Created host: 55b00b6e-0360-49dc-ae60-d7ee2b126779 with guests: []
2014-05-14 13:55:01,791 [DEBUG]  @subscriptionmanager.py:109 - Sending update in hosts-to-guests mapping: {'3c2c5db2-bdcb-4ce2-b545-4ab1f7c9336e': ['810ea352-eee2-42ce-94fd-fdac13163d93'], '2e8cbe73-8872-46c0-b742-ec4dfac01dda': [], 'a0483d14-d738-4e60-8ede-62fe6bb70015': []}

Expected results:
As the old hypervisor is still exist in the SAM, It shouldn't regenerate a new hypervisor even though the host has been deleted before

Additional info:
It hasn't this problem in the ESX mode

Comment 2 Radek Novacek 2014-05-14 07:05:26 UTC
From the logs, it doesn't look that virt-who is doing anything wrong.

When host1 is deleted, host 'cca20075-abb1-464a-80f1-3e8b6a07dc6c' disappears from the list of reported host/guest associations.

But after readding it, it got new uuid 'a0483d14-d738-4e60-8ede-62fe6bb70015' and virt-who reports that.

I don't see anything wrong with that (apart from changing the uuid, but that's coming from RHEVM, virt-who can't do anything about it).

Comment 3 Liushihui 2014-05-14 09:40:23 UTC
Hi Radek
 
  Thanks for your explain. The problem is changing the uuid after readd the same host to rhevm.
  As Rhevm will regenerate a new uuid if readding the host which has been delete previously, Then virt-who will send the new uuid to the SAM server. However, if the old hypervisor hasn't been deleted by manual before add the new one, the old hypervisor will become a junk data in the SAM server. customers might be confused about it. In order to resolve this problem, I have two suggestions:
1. virt-who should determine whether both the new uuid and the old one which still exist on the SAM server are come from the host or not. if it's yes, replace the old one with the new one
2. rhevm should generate the same uuid to the same host. BTW, ESX hasn't this problem

Thanks.

(In reply to Radek Novacek from comment #2)
> From the logs, it doesn't look that virt-who is doing anything wrong.
> 
> When host1 is deleted, host 'cca20075-abb1-464a-80f1-3e8b6a07dc6c'
> disappears from the list of reported host/guest associations.
> 
> But after readding it, it got new uuid
> 'a0483d14-d738-4e60-8ede-62fe6bb70015' and virt-who reports that.
> 
> I don't see anything wrong with that (apart from changing the uuid, but
> that's coming from RHEVM, virt-who can't do anything about it).

Comment 4 Radek Novacek 2014-05-14 10:20:19 UTC
virt-who can't possibly tell if the new uuid that appears is from the same host that disappeared earlier.

Comment 5 Radek Novacek 2014-05-14 10:28:23 UTC
Reassigning to RHEV-M.

To clarify what is the issue here:

When a host is removed from hypervisor and then readded again, its ID changes. Would it be possible to preserve the ID? We need it to be the same for proper management of subscription in the SAM.

You can how is it used in the following file:
https://git.fedorahosted.org/cgit/virt-who.git/tree/rhevm.py

Comment 6 Fabian Deutsch 2014-05-21 15:45:17 UTC
I think we just need to persist the UUID virt-who is suing.

Comment 7 Ying Cui 2014-05-22 05:59:55 UTC
Hi Shihui,
  Which RHEV-H build you used for this testing?
  1. checked your test version is virt-who-0.8-12.el7.
  2. checked your test steps with RHEL 6.5 as host.
  Can you please give more info here?

Thanks
Ying

Comment 8 Liushihui 2014-05-22 06:23:10 UTC
Hi, Ying
   
  Please see it as the following reply

(In reply to Ying Cui from comment #7)
> Hi Shihui,
>   Which RHEV-H build you used for this testing?
===> I used  RHEL-6.5-20131213.0-Server-x86_64 as host
>   1. checked your test version is virt-who-0.8-12.el7.
===>I used virt-who-0.8-12.el7 on RHEL7 when I report this bug, it has the same problem if use virt-who-0.8-9.el6.noarch on RHEL6, I have confirmed with cshao
>   2. checked your test steps with RHEL 6.5 as host.
===>Please following test steps as the following:
1. Register system with virt-who to SAM server, Add three RHEL6.5 hosts to RHEVM
2. Configure virt-who run in the rhevm mode
VIRTWHO_DEBUG=1
VIRTWHO_INTERVAL=2
VIRTWHO_RHEVM=1
VIRTWHO_RHEVM_OWNER=ACME_Corporation
VIRTWHO_RHEVM_ENV=Library
VIRTWHO_RHEVM_SERVER=https://10.66.129.57:443
VIRTWHO_RHEVM_USERNAME=admin@internal
VIRTWHO_RHEVM_PASSWORD=redhat
3. Restart virt-who service ,make sure three hypervisors have been send to SAM server
#service virt-who restart
4. In the RHEVM web UI, delete host1 (the hypervisor hasn't been deleted on the SAM)
5. In the RHEVM web UI, add host1 to RHEVM again
6. Check the virt-who log in the /var/log/rhsm/rhsm.log
7. Check the SAM web UI

>   Can you please give more info here?
> 
> Thanks
> Ying

Comment 9 Ying Cui 2014-05-22 07:17:01 UTC
This problem occur on both RHEL and RHEV-H, not ovirt-node specific issue, need to move bug to another component to investigate.

Thanks
Ying

Comment 10 Fabian Deutsch 2014-05-23 10:41:44 UTC
Moving this to virt-who, as this could also reproduced on RHEL, according to the last comment.

Comment 12 Radek Novacek 2014-06-18 07:57:27 UTC
Fabian, Ying,

I'm not sure if I understand this correctly.

As I see it, the probem is that when host is removed and then readded to hypervisor, its UUID changes. Would it be possible to make this stable?

There is nothing virt-who can do about it, it just reads the host/guest associations from RHEV-M and reports it to subscription manager.

Comment 13 Fabian Deutsch 2014-07-14 11:43:17 UTC
Hey radek,

yep you are right. We should keep the UUID.


Liushihui, can you tell me in what file the UUID is kept?

Comment 14 Fabian Deutsch 2014-07-14 13:11:38 UTC
Here we go again.

My previous assumption was that the host (RHEV-H) side UUID was relevant.

But it seems that the UUID for the host-guest mapping is actually received from RHEV-M.

This can be seen here:
https://git.fedorahosted.org/cgit/virt-who.git/tree/virt/rhevm/rhevm.py
https://git.fedorahosted.org/cgit/virt-who.git/tree/virt/rhevm/rhevm.py#n66


Alon,
do you maybe know what UUID RHEV-M is using to identify a host?
Is the UUID taken from teh RHVE-H instance or is it internally maintained inside a db?

Comment 15 Allon Mureinik 2014-07-14 19:12:44 UTC
(In reply to Fabian Deutsch from comment #14)
> Here we go again.
> 
> My previous assumption was that the host (RHEV-H) side UUID was relevant.
> 
> But it seems that the UUID for the host-guest mapping is actually received
> from RHEV-M.
> 
> This can be seen here:
> https://git.fedorahosted.org/cgit/virt-who.git/tree/virt/rhevm/rhevm.py
> https://git.fedorahosted.org/cgit/virt-who.git/tree/virt/rhevm/rhevm.py#n66
> 
> 
> Alon,
> do you maybe know what UUID RHEV-M is using to identify a host?
> Is the UUID taken from teh RHVE-H instance or is it internally maintained
> inside a db?
Haven't got the foggiest - although I think you've got the wrong Alon.
Alon (BL) - does any of this sound familiar to you?

Comment 16 Alon Bar-Lev 2014-07-14 20:07:44 UTC
I do not see the host unique id reflected in the restapi, what you get is the host id within rhevm (engine unique id).

adding mskrivan for more information.

Comment 17 Alon Bar-Lev 2014-07-16 09:54:50 UTC
it should not be on node component as it will happen at generic host as well

Comment 18 Fabian Deutsch 2014-07-16 11:19:10 UTC
That is what I wanted to find out in comment 14.
if we agree, then I see it more as a problem of RHEV-M.

But this is in general a conceptual question: Should the same host be identified as the same host in RHEV-M after it has been removed and re-added?

IMO the current solution (host get's new UUID when the host is added to RHEV-M) is a good the the right solution.

But then we need to see hwo this problem can be addressed.

Moving it to RHEV-M anyway.

Comment 19 Michal Skrivanek 2014-07-28 10:54:54 UTC
reassigning - Host management is infra

I'm not sure though, that persisting the UUID on host is the way to go. When we remove the host in RHEVM it seems to me it should be removed from SAM too?

Remove and add is considered a new hypervisor deployment

Comment 20 Liushihui 2014-07-30 06:28:57 UTC
When we remove the host in RHEVM , the hypervisor won't remove from SAM, it only can be removed by manual delete it in the SAM web UI. 

(In reply to Michal Skrivanek from comment #19)
> reassigning - Host management is infra
> 
> I'm not sure though, that persisting the UUID on host is the way to go. When
> we remove the host in RHEVM it seems to me it should be removed from SAM too?
> 
> Remove and add is considered a new hypervisor deployment

Comment 21 Oved Ourfali 2014-08-03 12:34:39 UTC
why won't virt-who save the FQDN of hosts, and then identify once a host that already exists is added? Why using the uuid?

Any other solution for that in the rhev-m side seems like a hack. Using the FQDN ensures it is the same host.

Any thoughts?

Comment 22 Radek Novacek 2014-08-04 07:16:44 UTC
Only thing that virt-who report to the SAM is mapping between host and guest UUIDs.

Even if virt-who remembers that the new UUID has the same hostname as some old UUID it can't do anything about it. Reporting the old UUID would be wrong.

I'm not even sure we can get the FQDN from all the hypervisors virt-who can talk to (ESX, Hyper-V, ...).

Comment 23 Oved Ourfali 2014-08-04 10:44:01 UTC
(In reply to Radek Novacek from comment #22)
> Only thing that virt-who report to the SAM is mapping between host and guest
> UUIDs.
> 
> Even if virt-who remembers that the new UUID has the same hostname as some
> old UUID it can't do anything about it. Reporting the old UUID would be
> wrong.
> 
> I'm not even sure we can get the FQDN from all the hypervisors virt-who can
> talk to (ESX, Hyper-V, ...).

Can someone explain the flow of data here?

Is virt-who reporting the hosts from the rhev-m periodically?

If so, SAM can tell when a host that was reported in the past is no longer reported, and then assume it was removed, so the entitlement can be re-used.

Comment 24 Liushihui 2014-08-05 15:34:52 UTC
Yes.virt-who reporting the hosts from the rhev-m periodically
Actually,  SAM can't remove any host automatically no matter it was still reporting or not. so it means the junk data can't be removed automatically. it only can be deleted manually.

Comment 25 Oved Ourfali 2014-08-06 04:53:27 UTC
Okay.
In that case I think we should go with exposing the host unique ID through the REST API, which will allow virt-who to use that one instead of the regular host ID.

Does that make sense?

Comment 26 Liushihui 2014-08-06 05:16:51 UTC
Yes, I think so. Thanks.

Comment 27 Oved Ourfali 2014-08-10 08:54:53 UTC
(In reply to Liushihui from comment #26)
> Yes, I think so. Thanks.

After exploring this alternative I saw that the unique ID has some limitations, so it can't be relied on for this use-case.

The only way I see in solving this issue is to add support in removing hosts from SAM (and also query hosts) and then you'll be able to compare the hosts that the RHEV-M engine reports with the ones SAM reports, and remove "dead" hosts.

Comment 28 Oved Ourfali 2014-08-10 10:10:08 UTC
Moving back to virt-who for further examination.

Comment 30 Radek Novacek 2015-03-19 10:00:57 UTC
virt-who can now optionally identify hypervisor using hostname or hardware uuid instead of uuid. It should fix the issue.

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


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