Bug 1503172 - NullPointerException when trying to restore a snapshot with disks parameters on REST API
Summary: NullPointerException when trying to restore a snapshot with disks parameters ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.2.2
: ---
Assignee: shani
QA Contact: Kevin Alon Goldblatt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-17 13:27 UTC by shani
Modified: 2018-04-05 09:39 UTC (History)
8 users (show)

Fixed In Version: ovirt-engine-4.2.2.4
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-05 09:39:28 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.2+
ylavi: exception+


Attachments (Terms of Use)
NullPointerException when trying to restore a snapshot with disks parameters on REST API (292.08 KB, image/png)
2017-10-17 13:27 UTC, shani
no flags Details
engine.log (96.25 KB, text/plain)
2017-10-18 06:16 UTC, shani
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1537119 0 medium CLOSED When trying to preview a snapshot of a VM using REST-API, and supplying a list of disks, operation fails with NPE 2021-02-22 00:41:40 UTC
oVirt gerrit 87748 0 master MERGED restapi: Missing disks' image ids on snapshot's restore 2018-02-15 15:42:58 UTC
oVirt gerrit 87806 0 ovirt-engine-4.2 MERGED restapi: Missing disks' image ids on snapshot's restore 2018-02-18 11:50:42 UTC
oVirt gerrit 87831 0 master MERGED restapi: update documentation for 'disks' param in snapshot restore 2018-02-28 08:37:24 UTC
oVirt gerrit 88345 0 model_4.2 MERGED restapi: update documentation for 'disks' param in snapshot restore 2018-03-01 12:42:12 UTC
oVirt gerrit 88355 0 master MERGED core: Back to List<DiskImage> on snapshot preview & restore 2018-03-12 04:05:12 UTC
oVirt gerrit 88783 0 ovirt-engine-4.2 MERGED core: Back to List<DiskImage> on snapshot preview & restore 2018-03-13 09:40:52 UTC

Internal Links: 1537119

Description shani 2017-10-17 13:27:56 UTC
Created attachment 1339728 [details]
NullPointerException when trying to restore a snapshot with disks parameters on REST API

Description of problem:
When trying to restore a snapshot with disks parameters on REST API, the user gets NullPointerException.

Version-Release number of selected component (if applicable):
Reproduced for 4.2 version, although according to the code, was probably present before that.

How reproducible:
100%

Steps to Reproduce:
1. Using the REST API, run the following:

Method:
-------
POST

URL:
----
https://xxxx.xxxx.xxxx.xxxx.com/ovirt-engine/api/vms/<VM_ID>/snapshots/<SNAPSHOT_ID>/restore

Body:
-----
<action>
	<disks>
		<disk id = "DISK_GUID"></disk>
	</disks>
</action>

Actual results:
NullPointerException

Expected results:
The snapshot's restore should be performed.

Additional info:
See attached screenshot.

Comment 1 Allon Mureinik 2017-10-17 14:57:50 UTC
Can you attach the logs too pleaes?

Comment 2 shani 2017-10-18 06:16:12 UTC
Created attachment 1340000 [details]
engine.log

Comment 3 shani 2018-02-26 08:48:47 UTC
Moving back to "assigned", due to some code changes I should do and will affect this bug.

Comment 4 Kevin Alon Goldblatt 2018-04-02 12:10:08 UTC
Verified with the following code:
----------------------------------------
ovirt-engine-4.2.2.6-0.1.el7.noarch
vdsm-4.20.23-1.el7ev.x86_64


Verified with the following scenario:
----------------------------------------
Method
POST

Url
https://storage-ge-10.scl.lab.tlv.redhat.com/ovirt-engine/api/vms/9f00362d-3712-44e5-b846-7e6298690ad7/snapshots/967d52c6-0aab-4947-8550-e586e541dfe2/restore

Content-Type
application/xml

Body
<action>
	<disks>
		<disk id = "a2487ec9-53db-42d6-b112-687dd8ddd846">
<image_id>c5b95c67-5713-4a93-8963-987dcdb70835</image_id>
</disk>
	</disks>
</action>

Response
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<action>
    <async>false</async>
    <disks>
        <disk id="a2487ec9-53db-42d6-b112-687dd8ddd846">
            <image_id>c5b95c67-5713-4a93-8963-987dcdb70835</image_id>
        </disk>
    </disks>
    <job href="/ovirt-engine/api/jobs/3e9fd1ee-f3d5-44fb-a8c0-50c6c58903e9" id="3e9fd1ee-f3d5-44fb-a8c0-50c6c58903e9"/>
    <snapshot href="/ovirt-engine/api/vms/9f00362d-3712-44e5-b846-7e6298690ad7/snapshots/967d52c6-0aab-4947-8550-e586e541dfe2" id="967d52c6-0aab-4947-8550-e586e541dfe2">
        <actions>
            <link href="/ovirt-engine/api/vms/9f00362d-3712-44e5-b846-7e6298690ad7/snapshots/967d52c6-0aab-4947-8550-e586e541dfe2/restore" rel="restore"/>
        </actions>
        <link href="/ovirt-engine/api/vms/9f00362d-3712-44e5-b846-7e6298690ad7/snapshots/967d52c6-0aab-4947-8550-e586e541dfe2/cdroms" rel="cdroms"/>
        <link href="/ovirt-engine/api/vms/9f00362d-3712-44e5-b846-7e6298690ad7/snapshots/967d52c6-0aab-4947-8550-e586e541dfe2/nics" rel="nics"/>
        <link href="/ovirt-engine/api/vms/9f00362d-3712-44e5-b846-7e6298690ad7/snapshots/967d52c6-0aab-4947-8550-e586e541dfe2/disks" rel="disks"/>
        <vm href="/ovirt-engine/api/vms/9f00362d-3712-44e5-b846-7e6298690ad7" id="9f00362d-3712-44e5-b846-7e6298690ad7"/>
    </snapshot>
    <status>complete</status>
</action>


The restore snapshot operation was successfull

Moving to VERIFIED

Comment 5 Sandro Bonazzola 2018-04-05 09:39:28 UTC
This bugzilla is included in oVirt 4.2.2 release, published on March 28th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.2 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.