Bug 1974181 - Can't create/update instance type via API with display section specified
Summary: Can't create/update instance type via API with display section specified
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: General
Version: 4.4.7.3
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.4.7
: ---
Assignee: Arik
QA Contact: Qin Yuan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-21 05:12 UTC by Qin Yuan
Modified: 2021-07-06 07:28 UTC (History)
4 users (show)

Fixed In Version: ovirt-engine-4.4.7.5
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-07-06 07:28:21 UTC
oVirt Team: Virt
Embargoed:
ahadas: ovirt-4.4+
ahadas: blocker-


Attachments (Terms of Use)
engine.log (126.90 KB, text/plain)
2021-06-21 05:12 UTC, Qin Yuan
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 115330 0 master MERGED core: fix NPE when creating an instance type from API 2021-06-21 12:20:12 UTC

Description Qin Yuan 2021-06-21 05:12:58 UTC
Created attachment 1792595 [details]
engine.log

Description of problem:
Can't create a new instance type, or update an existing one via API with display section specified, see errors:

2021-06-21 07:51:42,824+03 ERROR [org.ovirt.engine.core.bll.CommandsFactory] (default task-70) [4a20edb6-eb5e-4c2c-a014-833f462e1de3] An exception has occurred while trying to create a command object for command 'AddVmTemplate' with parameters 'AddVmTemplateParameters:{commandId='fd72440b-af8b-40a8-bf5e-e61c50e765ae', user='null', commandType='Unknown'}': WELD-000049: Unable to invoke protected final void org.ovirt.engine.core.bll.CommandBase.postConstruct() on org.ovirt.engine.core.bll.AddVmTemplateCommand@6800b0ab
2021-06-21 07:51:42,825+03 ERROR [org.ovirt.engine.core.bll.CommandsFactory] (default task-70) [4a20edb6-eb5e-4c2c-a014-833f462e1de3] Exception: java.lang.NullPointerException
	at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.VmHandler.autoSelectDefaultDisplayType(VmHandler.java:1354)
	at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.VmHandler$Proxy$_$$_WeldClientProxy.autoSelectDefaultDisplayType(Unknown Source)
	at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.AddVmTemplateCommand.init(AddVmTemplateCommand.java:230)
...

2021-06-21 07:53:24,317+03 ERROR [org.ovirt.engine.core.bll.CommandsFactory] (default task-70) [b1c5aab2-796b-4884-b6d3-a63bcb0f60d0] An exception has occurred while trying to create a command object for command 'UpdateVmTemplate' with parameters 'UpdateVmTemplateParameters:{commandId='e40d0ad2-7d53-47e1-9818-e4e74db55e8e', user='null', commandType='Unknown'}': WELD-000049: Unable to invoke protected final void org.ovirt.engine.core.bll.CommandBase.postConstruct() on org.ovirt.engine.core.bll.UpdateVmTemplateCommand@6c4d801d
2021-06-21 07:53:24,317+03 ERROR [org.ovirt.engine.core.bll.CommandsFactory] (default task-70) [b1c5aab2-796b-4884-b6d3-a63bcb0f60d0] Exception: java.lang.NullPointerException
	at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.VmHandler.autoSelectDefaultDisplayType(VmHandler.java:1354)
	at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.VmHandler$Proxy$_$$_WeldClientProxy.autoSelectDefaultDisplayType(Unknown Source)
	at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.UpdateVmTemplateCommand.init(UpdateVmTemplateCommand.java:123)
	at deployment.engine.ear.bll.jar//org.ovirt.engine.core.bll.CommandBase.postConstruct(CommandBase.java:217)
...


Version-Release number of selected component (if applicable):
ovirt-engine-4.4.7.4-0.9.el8ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create a new instance type via API with display section specified:
<instance_type>
    <name>create_instance_type</name>
    <display>
        <disconnect_action>NONE</disconnect_action>
        <monitors>1</monitors>
        <smartcard_enabled>true</smartcard_enabled>
        <type>spice</type>
    </display>
</instance_type>

2. Update an instance type via API with display section specified:
<instance_type>
    <display>
        <smartcard_enabled>true</smartcard_enabled>
        <type>vnc</type>
    </display>
</instance_type>


Actual results:
1. Failed to create new instance type via API with display section specified.
2. Failed to update instance type via API with display section specified.

Expected results:
Can create or update instance type via API with display section specified.

Additional info:

Comment 1 Arik 2021-06-21 06:38:31 UTC
Increasing severity to high since it breaks the tests.

Shmuel, looks like a result of setting the display to bochs from the API - the bios type of instance types is set to null

Comment 2 RHEL Program Management 2021-06-21 06:38:53 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 3 Qin Yuan 2021-06-29 08:29:04 UTC
Verified with:
ovirt-engine-4.4.7.5-0.9.el8ev.noarch

Steps:
The same steps as in Bug description

Results:
1. Can create new instance type via API with display section specified.
2. Can update instance type via API with display section specified.

Comment 4 Sandro Bonazzola 2021-07-06 07:28:21 UTC
This bugzilla is included in oVirt 4.4.7 release, published on July 6th 2021.

Since the problem described in this bug report should be resolved in oVirt 4.4.7 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


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