Bug 2152015

Summary: Discrepancy tool fails with KeyError
Product: Red Hat Enterprise Virtualization Manager Reporter: Germano Veit Michel <gveitmic>
Component: rhv-log-collector-analyzerAssignee: Germano Veit Michel <gveitmic>
Status: CLOSED ERRATA QA Contact: Lukas Svaty <lsvaty>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.5.3CC: didi, mperina, sbonazzo
Target Milestone: ovirt-4.5.3-1   
Target Release: 4.5.3   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: rhv-log-collector-analyzer-1.0.16-1.el8ev Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-01-11 11:25:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Germano Veit Michel 2022-12-08 21:30:47 UTC
Description of problem:

	Checking storage domain 'SSD_Volume03' (f8911b40-8918-42c9-8d31-273545094f19) from data-center RHVDC2, SPM is HVN09
	Image 8faa8a54-6305-4470-8cb5-b54c93e70ecb
		Disk: 355d51d5-5fa2-47d9-ba02-6dc728c20153 (GlanceDisk-565db30)
		Attached to VM: Traceback (most recent call last):
	File "/usr/bin/rhv-image-discrepancies", line 418, in <module>
		problems = check_dumps(args.pool_uuid, args.storage_uuid)
	File "/usr/bin/rhv-image-discrepancies", line 376, in check_dumps
		sd_images, db_images, to_vds
	File "/usr/bin/rhv-image-discrepancies", line 305, in report_image_discrepancies
		sd_images
	File "/usr/bin/rhv-image-discrepancies", line 177, in print_img
		vds = to_vds[vm]
	KeyError: 'CentOS8.2-v20200611'

It found some problem with a template disk, and its trying to find on what host the template is running, but its a template so it cannot be running :)

Comment 1 Casper (RHV QE bot) 2022-12-08 22:00:37 UTC
This bug has low overall severity and is not going to be further verified by QE. If you believe special care is required, feel free to properly align relevant severity, flags and keywords to raise PM_Score or use one of the Bumps ('PrioBumpField', 'PrioBumpGSS', 'PrioBumpPM', 'PrioBumpQA') in Keywords to raise it's PM_Score above verification threashold (1000).

Comment 2 Germano Veit Michel 2022-12-15 01:07:58 UTC
Suggestion for Doc Text:

The fix adds proper supports for Templates and will now print the template name and version the bad image is associated to.

Example:

Checking storage domain 'NFS' (08af2efb-8492-43ff-aa0e-e96e331dc611) from data-center Default, SPM is rhvh-3.lab.toca.local
  Image bdd2cc49-ae1d-47a1-9b19-957d29c42d7b
    Disk: 139609e2-800f-40b8-bcf8-c6537a00ee32 (VM_Disk1)
    Attached to Template: MyTemplate, version 'TemplateV2'
    Problem: attribute capacity differs in storage(10737418240) and in database(1073741824)
  Image 61cdd8d8-c9c5-4479-9f71-cb033bab3709
    Disk: 3848b583-9169-47be-ba52-045e3e3ae9e6 (VM_Disk1)
    Attached to Template: MyTemplate, version 'base version'
    Problem: attribute capacity differs in storage(10737418240) and in database(1073741824)

Will push patch soon.

Comment 3 Germano Veit Michel 2022-12-15 02:50:02 UTC
But CI issues are blocking patch verification

Comment 5 Germano Veit Michel 2022-12-20 23:22:24 UTC
# rhv-image-discrepancies 
IT IS HIGHLY RECOMMENDED YOU RUN THIS WITH RED HAT SUPPORT INVOLVED
Do you want to continue? [y/N]
y
Running dump-volume-chains 08af2efb-8492-43ff-aa0e-e96e331dc611 on rhvh-1.lab.toca.local
Running dump-volume-chains e997f75a-d058-47da-b0c6-59de984e6876 on rhvh-1.lab.toca.local
Running dump-volume-chains eb397f79-3712-46fd-8d03-350bc4c6d615 on rhvh-1.lab.toca.local

Checking storage domain 'NFS' (08af2efb-8492-43ff-aa0e-e96e331dc611) from data-center Default, SPM is rhvh-3.lab.toca.local
  Image d5a0c043-1287-46c5-9a8c-1ccd5c9b6587
    Disk: dbea8051-3b26-43f2-bd57-d8a485baf67e (aaaaa)
    Problem: attribute capacity differs in storage(161061273600) and in database(16106127360)
  Image 3c5b9ae1-5e3f-4dd6-8a91-f968b68d4ada
    Disk: 3e65768b-5d57-46af-8c36-1c223844021c (VM_Disk1)
    Problem: attribute capacity differs in storage(10737418240) and in database(1073741824)
  Image bdd2cc49-ae1d-47a1-9b19-957d29c42d7b
    Disk: 139609e2-800f-40b8-bcf8-c6537a00ee32 (VM_Disk1)
    Attached to VM: Traceback (most recent call last):
  File "/usr/bin/rhv-image-discrepancies", line 418, in <module>
    problems = check_dumps(args.pool_uuid, args.storage_uuid)
  File "/usr/bin/rhv-image-discrepancies", line 376, in check_dumps
    sd_images, db_images, to_vds
  File "/usr/bin/rhv-image-discrepancies", line 305, in report_image_discrepancies
    sd_images
  File "/usr/bin/rhv-image-discrepancies", line 177, in print_img
    vds = to_vds[vm]
KeyError: 'Template'

[root@rhvm ~]# rpm -U /tmp/rhv-log-collector-analyzer-1.0.16-1.el8ev.noarch.rpm 


[root@rhvm ~]# 
[root@rhvm ~]# 
[root@rhvm ~]# rhv-image-discrepancies 
IT IS HIGHLY RECOMMENDED YOU RUN THIS WITH RED HAT SUPPORT INVOLVED
Do you want to continue? [y/N]
y
Running dump-volume-chains 08af2efb-8492-43ff-aa0e-e96e331dc611 on rhvh-1.lab.toca.local
Running dump-volume-chains e997f75a-d058-47da-b0c6-59de984e6876 on rhvh-1.lab.toca.local
Running dump-volume-chains eb397f79-3712-46fd-8d03-350bc4c6d615 on rhvh-1.lab.toca.local

Checking storage domain 'NFS' (08af2efb-8492-43ff-aa0e-e96e331dc611) from data-center Default, SPM is rhvh-3.lab.toca.local
  Image d5a0c043-1287-46c5-9a8c-1ccd5c9b6587
    Disk: dbea8051-3b26-43f2-bd57-d8a485baf67e (aaaaa)
    Problem: attribute capacity differs in storage(161061273600) and in database(16106127360)
  Image 3c5b9ae1-5e3f-4dd6-8a91-f968b68d4ada
    Disk: 3e65768b-5d57-46af-8c36-1c223844021c (VM_Disk1)
    Problem: attribute capacity differs in storage(10737418240) and in database(1073741824)
  Image bdd2cc49-ae1d-47a1-9b19-957d29c42d7b
    Disk: 139609e2-800f-40b8-bcf8-c6537a00ee32 (VM_Disk1)
    Attached to Template: Template, version 'TemplateV2'
    Problem: attribute capacity differs in storage(10737418240) and in database(1073741824)
  Image 61cdd8d8-c9c5-4479-9f71-cb033bab3709
    Disk: 3848b583-9169-47be-ba52-045e3e3ae9e6 (VM_Disk1)
    Attached to Template: Template, version 'base version'
    Problem: attribute capacity differs in storage(10737418240) and in database(1073741824)

Checking storage domain 'hosted_storage' (e997f75a-d058-47da-b0c6-59de984e6876) from data-center Default, SPM is rhvh-3.lab.toca.local
  Image 5703ce0d-a359-4803-9383-0ca7704837e7
    Disk: a75bd7f9-150d-4e04-a764-01841f2a2fb7 (HostedEngineConfigurationImage)
    Problem: size in storage(20480) < capacity(1073741824), but is preallocated

Checking storage domain 'iSCSI' (eb397f79-3712-46fd-8d03-350bc4c6d615) from data-center Default, SPM is rhvh-3.lab.toca.local
  No problems found

Total problems found: 5

Comment 11 errata-xmlrpc 2023-01-11 11:25:38 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 (Important: RHV 4.4 SP1 [ovirt-4.5.3-3] security update), 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-2023:0074