Bug 1550123
| Summary: | NullPointerException in LibvirtVmXmlBuilder.writeRng if SpecParams is missing | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Richard W.M. Jones <rjones> | ||||
| Component: | ovirt-engine | Assignee: | Nobody <nobody> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | meital avital <mavital> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | low | ||||||
| Version: | 4.2.2 | CC: | dfediuck, lsurette, michal.skrivanek, Rhev-m-bugs, rjones, srevivo, tgolembi | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | |||||||
| : | 1550168 (view as bug list) | Environment: | |||||
| Last Closed: | 2018-11-14 11:24:38 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | Virt | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 1550168 | ||||||
| Attachments: |
|
||||||
Created attachment 1401907 [details]
engine.log
See correlation ID b88ef6ff-62ea-4803-8bfc-15a328b6121b
Oh and the error message the user sees is completely bogus and irrelevant to the actual failure: There are no hosts to use. Check that the cluster contains at least one host in Up state. Similar issue exists in memballoon:
nd] (default task-31) [a2b8be14-3f72-405f-8ea4-1115443bdf4f] Failed to create VM
: java.lang.NullPointerException
at org.ovirt.engine.core.vdsbroker.builder.vminfo.LibvirtVmXmlBuilder.writeBalloon(LibvirtVmXmlBuilder.java:2155) [vdsbroker.jar:]
Code in OvfReader suggest such situations should be handled. It's probably broken. https://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=blob;f=backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfReader.java;h=70b5b8a1ec6f3c20843d7d95c9db8b6a807b5332;hb=HEAD#l272 (In reply to Tomáš Golembiovský from comment #4) > Code in OvfReader suggest such situations should be handled. It's probably > broken. > > https://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=blob;f=backend/manager/ > modules/utils/src/main/java/org/ovirt/engine/core/utils/ovf/OvfReader.java; > h=70b5b8a1ec6f3c20843d7d95c9db8b6a807b5332;hb=HEAD#l272 Note that the code being referenced here sets empty spec-params when spec-params are not specified. The problem happens afterward, because some devices (like RNG and memballoon) hold in their spec-params mandatory properties in oVirt. IMHO, the simplest solution (because of a technical issue to provide defaults in those cases in oVirt) would be to produce those properties by virt-v2v, like RNG source: <SpecParams> <source>urandom</source> </SpecParams> (In reply to Richard W.M. Jones from comment #3) > Similar issue exists in memballoon: > > nd] (default task-31) [a2b8be14-3f72-405f-8ea4-1115443bdf4f] Failed to > create VM > : java.lang.NullPointerException > at > org.ovirt.engine.core.vdsbroker.builder.vminfo.LibvirtVmXmlBuilder. > writeBalloon(LibvirtVmXmlBuilder.java:2155) [vdsbroker.jar:] For memballoon: <SpecParams> <model>virtio</model> </SpecParams> For smartcard: <SpecParams> <mode>passthrough</mode> <type>spicevmc</type> </SpecParams> For serial console: <SpecParams> <consoleType>serial</consoleType> </SpecParams> Is this still relevant? Possibly. We have worked around it in virt-v2v so we will no longer see it with virt-v2v, but other API clients which supply OVF might see this. This will not make it in a reasonable time. Please re-open if you still feel this should be fixed |
Description of problem: Create a VM from OVF which has: <Item> <rasd:Caption>RNG Device</rasd:Caption> <rasd:InstanceId>feeae0f9-ce77-4df7-8daf-0d128ef0e0e2</rasd:InstanceId> <rasd:ResourceType>0</rasd:ResourceType> <Type>rng</Type> <Device>virtio</Device> </Item> Note that <SpecParams> is missing from the virtio-rng device. This causes a NullPointerException in LibvirtVmXmlBuilder.writeRng Version-Release number of selected component (if applicable): ovirt-engine-4.2.2.2-0.0.master.20180225172203.gitd7cf125.el7.centos.noarch How reproducible: 100% Steps to Reproduce: 1. See description