Bug 1660902

Summary: REST/SDK create VM snapshot with the same image id as an existing image id in that VM -> Engine Error Image IDs ${ImageId} appear
Product: [oVirt] ovirt-engine Reporter: Avihai <aefrat>
Component: BLL.StorageAssignee: shani <sleviim>
Status: CLOSED CURRENTRELEASE QA Contact: Avihai <aefrat>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.3.0CC: bugs, fkust
Target Milestone: ovirt-4.3.1Keywords: Automation
Target Release: ---Flags: rule-engine: ovirt-4.3+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-4.3.1.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-13 16:39:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
engine log none

Description Avihai 2018-12-19 15:03:43 UTC
Created attachment 1515622 [details]
engine log

Description of problem:
REST/SDK create VM snapshot with the same image id as an existing image id in that VM ->  Engine Error Image IDs ${ImageId} appear:

I would expect instead of the ${ImageId} that a real value with the existing imageId will appear 

Engine log:
2018-12-19 16:39:14,628+02 WARN  [org.ovirt.engine.core.bll.snapshots.CreateSnapshotForVmCommand] (default task-66) [129f219f-3477-42d6-8fbc-0e4073eeb6c7] Validation of action 'CreateSnapshotForVm' failed for us
er admin@internal-authz. Reasons: VAR__ACTION__CREATE,VAR__TYPE__SNAPSHOT,ACTION_TYPE_FAILED_VM_SNAPSHOT_IMAGE_ALREADY_EXISTS,$ImageIds      5eb35e6f-af89-4379-ba76-6880a3d106f7,$ImageIds_COUNTER 1
2018-12-19 16:39:14,630+02 INFO  [org.ovirt.engine.core.bll.snapshots.CreateSnapshotForVmCommand] (default task-66) [129f219f-3477-42d6-8fbc-0e4073eeb6c7] Lock freed to object 'EngineLock:{exclusiveLocks='[cbdc5
9db-9b4e-45c7-b2b4-276b9968773a=VM]', sharedLocks=''}'
2018-12-19 16:39:14,642+02 ERROR [org.ovirt.engine.api.restapi.resource.AbstractBackendResource] (default task-66) [] Operation Failed: [Cannot create Snapshot. Image IDs ${ImageId} are already used by a snapsho
t.]


Version-Release number of selected component (if applicable):
4.3.0-0.4.master.20181217152209.git3c9ccc7.el7.noarch

How reproducible:
100%

Steps to Reproduce:
1.Create VM + disk and snapshot
2.Try via SDK/REST to create a new snapshot with the same imageID

I used the following Resquest:

< POST /ovirt-engine/api/vms/cbdc59db-9b4e-45c7-b2b4-276b9968773a/snapshots HTTP/1.1
< Host: storage-ge-08.scl.lab.tlv.redhat.com
< User-Agent: PythonSDK/4.2.9
< Version: 4
< Content-Type: application/xml
< Accept: application/xml
< Authorization: Bearer 5Cq9kxY7DbxXv4QUeVYIxVP0HZlI2wB4oh_m-
< Content-Length: 285
< <snapshot>
<   <description>Snapshot0</description>
<   <disk_attachments>
<     <disk_attachment>
<disk id="c79759e8-4f62-497c-8f8a-c34611a742db">
<         <image_id>5eb35e6f-af89-4379-ba76-6880a3d106f7</image_id>
<       </disk>
<     </disk_attachment>
<   </disk_attachments>
</snapshot>


Actual results:
Engine Error Image IDs ${ImageId} appear instead of the real value

Expected results:
I would expect instead of the ${ImageId} that a real value with the existing imageId will appear 

Additional info:

Comment 1 Sandro Bonazzola 2019-01-28 09:34:10 UTC
This bug has not been marked as blocker for oVirt 4.3.0.
Since we are releasing it tomorrow, January 29th, this bug has been re-targeted to 4.3.1.

Comment 2 Avihai 2019-03-06 18:48:37 UTC
verified on ovirt-engine Software Version:4.3.2-0.1.el7

Comment 3 Sandro Bonazzola 2019-03-13 16:39:33 UTC
This bugzilla is included in oVirt 4.3.1 release, published on February 28th 2019.

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