> On Dec. 16, 2013, 6:51 p.m., Nitin Mehta wrote:
> > server/src/com/cloud/api/query/QueryManagerImpl.java, line 2857
> > <https://reviews.apache.org/r/15902/diff/2/?file=396910#file396910line2857>
> >
> >     Should this be findByIdIncludingRemoved as well ? See bug 5221 as per 
> > the comment here. Did you check that ?

Yes Nitin, this may need to be fixed.

But there is another problem apart from this.

I came to know that the template_View schema is defined such that entries in 
the template_view are only active templates.

CREATE VIEW `cloud`.`template_view` AS
   select 
        vm_template.id,
        vm_template.uuid,
        vm_template.unique_name,
        vm_template.name,
        ....
where
        vm_template.state='Active';

In CS when we remove templates we mark them as inactive in DB. Then 
template_view doesnot contains the removed entries, which means we cannot 
retrieve removed entries by any search criteria.

Alex added that where clause on master/4.3
 
        commit abbae2aa87471274cffa35b54ae8157c1efaade9 (4.3 commit)
        Author: Alex Huang <alex.hu...@citrix.com>
        Date:   Mon Aug 26 17:30:58 2013 -0700  
        
        Fixed the problem with offerings and templates.  These two items due to 
a previous patch all the way back in 2.1.x versions uses the removed column  
incorrectly.  No one fixed since then.  Hence, there's a bunch of 
findbyidincludingremoved calls in the cloudstack code around these two items.

Some how my code worked when I submitted my patch. But later came across this 
issue.

Can you suggest me on this ?
Thank you


- Harikrishna


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15902/#review30461
-----------------------------------------------------------


On Dec. 16, 2013, 8:54 a.m., Harikrishna Patnala wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/15902/
> -----------------------------------------------------------
> 
> (Updated Dec. 16, 2013, 8:54 a.m.)
> 
> 
> Review request for cloudstack, Kishan Kavala and Nitin Mehta.
> 
> 
> Bugs: CLOUDSTACK-4904
>     https://issues.apache.org/jira/browse/CLOUDSTACK-4904
> 
> 
> Repository: cloudstack-git
> 
> 
> Description
> -------
> 
> CLOUDSTACK-4904: Unable to see a derieved template if the parent template is 
> deleted
> 
> Added supported for listing all templates/ISOs with showremoved = true
> 
> 
> Diffs
> -----
> 
>   api/src/org/apache/cloudstack/api/ApiConstants.java e08923c 
>   api/src/org/apache/cloudstack/api/command/user/iso/ListIsosCmd.java c3f558b 
>   
> api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java 
> 4b34909 
>   server/src/com/cloud/api/query/QueryManagerImpl.java 58df38c 
>   server/src/com/cloud/api/query/dao/TemplateJoinDao.java f73f5bd 
>   server/src/com/cloud/api/query/dao/TemplateJoinDaoImpl.java 468fb83 
> 
> Diff: https://reviews.apache.org/r/15902/diff/
> 
> 
> Testing
> -------
> 
> Tested locally.
> 
> http://localhost:8096/client/api?command=listTemplates&listAll=true&page=1&pagesize=20&templatefilter=all&_=1385533457469&showremoved=true
> 
> In the below API response "win" template is removed.
> 
> <listtemplatesresponse cloud-stack-version="4.3.0-SNAPSHOT"><count>3</count>
> 
> <template><id>f0fdb4d8-fd2f-4fc2-9590-6b45689d2a29</id>
> <name>win</name>
> <displaytext>win</displaytext>
> </template>
> 
> <template><id>7240316e-5299-11e3-b8bd-9d3b4dd13283</id>
> <name>CentOS 5.6(64-bit) no GUI (XenServer)</name>
> <displaytext>CentOS 5.6(64-bit) no GUI (XenServer)</displaytext>
> </template>
> 
> <template><id>723ff2c6-5299-11e3-b8bd-9d3b4dd13283</id>
> <name>SystemVM Template (XenServer)</name><displaytext>SystemVM Template 
> (XenServer)</displaytext><ispublic>false</ispublic><created>2013-11-21T16:16:00+0530</created><isready>true</isready><passwordenabled>false</passwordenabled><format>VHD</format><isfeatured>false</isfeatured><crossZones>true</crossZones><ostypeid>72487d10-5299-11e3-b8bd-9d3b4dd13283</ostypeid><ostypename>Debian
>  GNU/Linux 
> 7(32-bit)</ostypename><account>system</account><zoneid>0b267864-376e-43ab-8804-57a1a6b9a135</zoneid><zonename>xen</zonename><status>Download
>  
> Complete</status><size>2101252608</size><templatetype>SYSTEM</templatetype><hypervisor>XenServer</hypervisor><domain>ROOT</domain><domainid>730b0240-5299-11e3-b8bd-9d3b4dd13283</domainid><isextractable>false</isextractable><checksum>fb1b6e032a160d86f2c28feb5add6d83</checksum><sshkeyenabled>false</sshkeyenabled><isdynamicallyscalable>false</isdynamicallyscalable></template></listtemplatesresponse>
> 
> 
> Thanks,
> 
> Harikrishna Patnala
> 
>

Reply via email to