GitHub user syed reopened a pull request:
https://github.com/apache/cloudstack/pull/1424
[CLOUDSTACK-8973] Fix create template from snapshot returning null in case
of region store
This PR fixes a case where when we create a template from a snpashot in a
region wide store, we don't set the cross zone flag which causes a null
response to be returned
Tests:
Before fix
```
(local) � > create template
snapshotid=33aa3f3b-5a47-4d2a-8d27-12952c01ebed displaytext=t2
ostypeid=20c8ead6-d750-11e5-9f8c-06524200007c name=t9
accountid = 1b13d7c2-d750-11e5-9f8c-06524200007c
cmd =
org.apache.cloudstack.api.command.admin.template.CreateTemplateCmdByAdmin
created = 2016-02-23T16:09:24+0000
jobid = 4f9f5ff9-e7f0-4af6-999c-799431fd47de
jobinstanceid = a08a9711-bd31-43bb-80a2-49cf9d722a19
jobinstancetype = Template
jobprocstatus = 0
jobresult:
null:
crossZones = False
isfeatured = False
ispublic = False
isready = False
tags:
jobresultcode = 0
jobresulttype = object
jobstatus = 1
userid = 1b140f08-d750-11e5-9f8c-06524200007c
```
See the *null* in response
After fix:
```
(local) � > create template
snapshotid=33aa3f3b-5a47-4d2a-8d27-12952c01ebed displaytext=t2
ostypeid=20c8ead6-d750-11e5-9f8c-06524200007c name=t11
accountid = 1b13d7c2-d750-11e5-9f8c-06524200007c
cmd =
org.apache.cloudstack.api.command.admin.template.CreateTemplateCmdByAdmin
created = 2016-02-25T21:47:03+0000
jobid = 1b74209b-b3c1-4168-a243-f559aa0c081b
jobinstanceid = 06ecee5a-b1f2-4e67-80fb-f0f44b0aa198
jobinstancetype = Template
jobprocstatus = 0
jobresult:
template:
id = 06ecee5a-b1f2-4e67-80fb-f0f44b0aa198
name = t11
account = admin
created = 2016-02-25T21:47:03+0000
crossZones = True
displaytext = t2
domain = ROOT
domainid = 1b13ab80-d750-11e5-9f8c-06524200007c
format = VHD
hypervisor = XenServer
isdynamicallyscalable = False
isextractable = True
isfeatured = False
ispublic = False
isready = True
ostypeid = 20c8ead6-d750-11e5-9f8c-06524200007c
ostypename = CentOS 5 (64-bit)
passwordenabled = False
size = 21474836480
sourcetemplateid = 1af0f0cc-d750-11e5-9f8c-06524200007c
sshkeyenabled = False
status = Download Complete
tags:
templatetype = USER
jobresultcode = 0
jobresulttype = object
jobstatus = 1
userid = 1b140f08-d750-11e5-9f8c-06524200007c
```
Works correctly
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/syed/cloudstack create-template-api-bug
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cloudstack/pull/1424.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1424
----
commit 7b5d5648d80a603d68a1232f663127819799c89a
Author: Syed <[email protected]>
Date: 2016-02-25T21:29:58Z
Fix create template from snapshot returning null in case of region store
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---