Red Hat Bugzilla – Bug 976243
[rest-api] When creating template, target domain is passed as a source
Last modified: 2015-09-22 09:09 EDT
Created attachment 763312 [details]
engine vdsm logs
Description of problem:
When I have two storage domains (SD0 and SD1) and want to create a template on SD1, while source image is on SD0, it fails because target domain (SD1) is passed as a source - i.e. SD1 is passed instead of SD0
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Have two storage domains, VM with a disk on SD0
2. Via API create a template on SD1
GetImageInfoVDSCommand fails due to wrong SD uuid:
GetImageInfoVDSCommand( storagePoolId = a86b5970-7340-4808-96e0-0f0f9c3aaa10, ignoreFailoverLimit = false, compatabilityVersion = null, storageDomainId = b58d59a4-c5ba-4ea9-8dff-29685175cc59, imageGroupId = ecde57a6-e7fa-475a-97c0-24e0738a9707, imageId = 968de0cf-8051-4797-84bd-a1c6e34b1a65), log id: 43658fe7
Same as webadmin does:
GetImageInfoVDSCommand( storagePoolId = a86b5970-7340-4808-96e0-0f0f9c3aaa10, ignoreFailoverLimit = false, compatabilityVersion = null, storageDomainId = 6a083563-0483-46be-8ef0-ce7d5bce4e8f, imageGroupId = ecde57a6-e7fa-475a-97c0-24e0738a9707, imageId = 968de0cf-8051-4797-84bd-a1c6e34b1a65), log id: 6fbce0df
Logs are attached
Body sent to /api/templates:
It's looks like a regression from the following fix:
The fix in this patch is overriding the source image domain with the destination domain (and as long as they the same we didn't have any problem).
This patch will not fix your problem,
The reason that you have a different results in the UI and the API is that you need to set the API disks.
By doing so the API will build the diskInfoDestinationMap which you get for free in the UI.
This suppose to work for you without applying the patch.
merged at: http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=commit;h=94a9edd8e07fc32fd21175e2ea0db8f193185399
Verified in rhevm-3.3.0-0.23.master.el6ev (is16).
Creating a VM template via API with a request body described in comment#0 is now successful.
But as was explained in comment#1, tempate disk(s) will be created on the original storage domain (refereced as SD0 in the reproducer). In other words, the <storage_domain> element in the request body does not affect the target location of template disks.
Closing - RHEV 3.3 Released