Project

General

Profile

Feature #26600

Don't duplicate host record when hypervisor_id changes in virt-who report

Added by Jonathon Turel about 2 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1410601

Description of problem:
for a hypervisor mode, if configure hypervisor_id option to 3 different values(uuid, hostname, hwuuid), it will create 3 entries for the same hypervisor, it should keep an unique entry no matter what hypervisor_id configured.

Version-Release number of selected component (if applicable):
virt-who-0.17-10.el7sat.noarch
subscription-manager-1.17.15-1.el7.x86_64
python-rhsm-1.17.9-1.el7.x86_64
Satellite-6.2.0-RHEL-7-20161219.0/

How reproducible:
always

Steps to Reproduce:
1. configure virt-who for esx mode /etc/virt-who.d/, make sure set hypervisor_id to uuid,such as:
type=esx
hypervisor_id=hostname
owner=Default_Organization
env=Library
server=10.73.130.242
username=
password=Welcome1!

2. restart virt-who service and check the hypervisor should be sent with uuid:
Host-to-guest mapping: {
"ff9f4d56-f277-a538-9b51-103919b67710": [],
"20024d56-9faa-4267-75c9-0623ef215a23": [ {
"guestId": "422d664a-db1c-2773-462a-d5f308888a54",
"state": 1,
"attributes": {
"active": 1,
"virtWhoType": "esx"
}
}, {
"guestId": "422dbb1d-c5ef-4d58-86f8-fd799f056a9b",
"state": 5,
"attributes": {
"active": 0,
"virtWhoType": "esx"
}
}
]
}

3. check the content host in Satellite webUI, the hypervisors should be registered with uuid:
virt-who-ff9f4d56-f277-a538-9b51-103919b67710-1
virt-who-20024d56-9faa-4267-75c9-0623ef215a23-1

4. change the hypervisor_id to hostname, restart virt-who service, and make sure the hypervisor should be sent with hostname:
Host-to-guest mapping: {
"bootp-73-131-189.rhts.eng.pek2.redhat.com": [],
"bootp-73-130-246.rhts.eng.pek2.redhat.com": [ {
"guestId": "422d664a-db1c-2773-462a-d5f308888a54",
"state": 1,
"attributes": {
"active": 1,
"virtWhoType": "esx"
}
}, {
"guestId": "422dbb1d-c5ef-4d58-86f8-fd799f056a9b",
"state": 5,
"attributes": {
"active": 0,
"virtWhoType": "esx"
}
}
]
}

5. check the content host in Satellite webUI, the hypervisors should be registered with hostname again, but the old uuid entries still exist.
hostname entry:
virt-who-bootp-73-130-246.rhts.eng.pek2.redhat.com-1
virt-who-bootp-73-131-189.rhts.eng.pek2.redhat.com-1

uuid entry:
virt-who-ff9f4d56-f277-a538-9b51-103919b67710-1
virt-who-20024d56-9faa-4267-75c9-0623ef215a23-1

6. change the hypervisor_id to hwuuid, restart virt-who service, and make sure the hypervisor should be sent with hwuuid:
Host-to-guest mapping: {
"host-9": [],
"host-14": [ {
"guestId": "422d664a-db1c-2773-462a-d5f308888a54",
"state": 1,
"attributes": {
"active": 1,
"virtWhoType": "esx"
}
}, {
"guestId": "422dbb1d-c5ef-4d58-86f8-fd799f056a9b",
"state": 5,
"attributes": {
"active": 0,
"virtWhoType": "esx"
}
}
]

7. check the content host in Satellite webUI, the hypervisors should be registered with hwuuid again, but the old uuid entries still exist, now we have three different entries for the same hypervisor:
hwuuid entry:
virt-who-host-14-1
virt-who-host-9-1

hostname entry:
virt-who-bootp-73-130-246.rhts.eng.pek2.redhat.com-1
virt-who-bootp-73-131-189.rhts.eng.pek2.redhat.com-1

uuid entry:
virt-who-ff9f4d56-f277-a538-9b51-103919b67710-1
virt-who-20024d56-9faa-4267-75c9-0623ef215a23-1

Actual results:
for the same hypervisor, will create 3 different entries in Satellite WebUI

Expected results:
for the same hypervisor, no matter what I change the different hypervisor_id value, it should keep the unique entry. for example:
if hypervisor_id=uuid, send the uuid entry to satellite, delete other entries.
if hypervisor_id=hostname, send the hostname entry to satellite, delete other entries.
if hypervisor_id=hwuuid, send the hwuuid entry to satellite, delete other entries.

Associated revisions

Revision 86c91f89 (diff)
Added by Jonathon Turel about 2 years ago

Fixes #26600 - Duplicate host record when hypervisor_id changes

Revision 1d0d2370 (diff)
Added by Jonathon Turel about 2 years ago

Refs #26600 - Fix intermittent HypervisorsVcrTest

History

#1 Updated by Jonathon Turel about 2 years ago

  • Target version set to Katello 3.12.0
  • Assignee set to Jonathon Turel
  • Subject changed from make sure there is only one entry in content host for the same hypervisor when configure hypervisor_id for uuid or hostname or hwuuid to Don't duplicate host record when hypervisor_id changes in virt-who report

#2 Updated by The Foreman Bot about 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/8076 added

#3 Updated by Jonathon Turel about 2 years ago

  • Status changed from Ready For Testing to Closed

#4 Updated by Samir Jha about 2 years ago

  • Triaged changed from No to Yes

#5 Updated by The Foreman Bot about 2 years ago

  • Pull request https://github.com/Katello/katello/pull/8081 added

Also available in: Atom PDF