> Is it possible to have multiple templates that are just pointers to the 
> existing bits of the source template on secondary storage?
Not entirely impossible. I mean its' not going to be pointers, but if you were 
looking to save time it takes to upload 20 copies, you could manually setup the 
templates. This requires manual copy and DB updates. You can get a hint of 
what's required by looking at the script used to prepare the secondary storage 
for system templates.

> However, this looks like it's just going to download the same VHD to 
> secondary storage multiple times, creating multiple copies of the template on 
> disk.
I thought that's what you were looking for.

Copy template is definitely not what you are looking for, because, it is copy 
from on secondary to another, doesn't involve primary storage.

Somesh
CloudPlatform Escalations
Citrix Systems, Inc.

-----Original Message-----
From: Kyle Flavin [mailto:kyle.fla...@citrix.com] 
Sent: Thursday, January 22, 2015 6:06 PM
To: users@cloudstack.apache.org
Subject: RE: Clearing template cache on primary storage

Hi Somesh, 
Is it possible to have multiple templates that are just pointers to the 
existing bits of the source template on secondary storage? 

I've tried the following two approaches.

First, with Cloudmonkey, I tried to register a new template using something 
like the following:
cloudmonkey register template displaytext="Windows Test Template 1" format=VHD 
hypervisor=XenServer name="WindowsTestTemplate1" ostypeid=<osid> 
url=http://<url_to_vhd> zoneid=<zoneid>

However, this looks like it's just going to download the same VHD to secondary 
storage multiple times, creating multiple copies of the template on disk.

Second, I tried making a copy of the template:
cloudmonkey copy template id=<templateid> destzoneid=<zoneid>

However, this looks like it will only copy the template between two different 
zones.  It doesn't seem to allow me to copy the template to the same zone, and 
give it a new name.

I don't believe either solution gives me what I'm looking for, because I want 
is to test the time it's taking the template to get from secondary storage to 
primary when I do my deployment.  Both of the possible solution above seem to 
include the additional step of copying the full VHD to secondary storage.  If I 
could somehow register a new template, and tell it to use the same bits on disk 
as the source template (no additional copying of anything to secondary 
storage), I think that'd give me what I want.  But I'm not sure if that's 
possible.  Am I looking at this wrong?

-----Original Message-----
From: Somesh Naidu [mailto:somesh.na...@citrix.com] 
Sent: Thursday, January 22, 2015 6:51 AM
To: users@cloudstack.apache.org
Subject: RE: Clearing template cache on primary storage

I do not believe there is any global config or API to achieve what you want 
(force template download from secondary to primary storage for every deployment 
on the same storage).

An easy way to work around this would be to make 20 copies of the template 
(basically register the same template 20 times with different names) and force 
VM deployments to use a new template each time.

Somesh
CloudPlatform Escalations
Citrix Systems, Inc.

-----Original Message-----
From: Kyle Flavin [mailto:kyle.fla...@citrix.com] 
Sent: Wednesday, January 21, 2015 4:53 PM
To: users@cloudstack.apache.org
Subject: Clearing template cache on primary storage

Is it possible to clear template cache on primary storage prior to VM 
deployment, via cloudmonkey or some other method?  I'm doing some performance 
tests on one of our Cloudstack clusters that is running Xenserver.  For testing 
purposes, I'd like to force the copy of the template from secondary storage to 
primary storage, with each deployment on this cluster.  I'm kicking off the vm 
instance deployments in batches of 20.  I want the template to be pulled down 
to primary storage each time a deployment starts.

I've looked over the API and I don't see anything that quite matches what I'm 
looking for.  It looks like "prepareTemplate" will allow me to cache the 
template on primary storage, but I'd like to "uncache" prior to deploying a new 
instance: 
https://cloudstack.apache.org/docs/api/apidocs-4.2/root_admin/prepareTemplate.html,
 and there doesn't appear to be an obvious way to do so.

Thanks,
Kyle

Reply via email to