Community
 
 
 

CloudPlatform 4.x

284 followers
 
Avatar
colin free

updateTemplatePermissions allows a template to be added to a project. Created template not accessible

I am trying to look at how a templates can be created once and shared amongst projects you have access to. I am creating a windows template from ISO and then snapshotting the root volume and creating a template from the snapshot.

 

If I create it within a project, it is owned by the project and I can't share it with other projects.

If I create it in my default view, it is owned by me and I can share it with the projects using the commend below. If I list permissions on the template then the project is listed. But, it is not visible in the project because I own it and not the project.

 

adding project to template

cloudstack-cli command updateTemplatePermissions id='7cdd4328-1048-491f-bd41-56efaa25bb0f' op='add' projectids='4e9b6b09-51d9-4943-8fe4-19f64619dbf2'

 

updated permissions

---
id: 7cdd4328-1048-491f-bd41-56efaa25bb0f
ispublic: false
account:
- BT_Cloud_Compute_GBP_colin.free@bt.com
projectids:
- 4e9b6b09-51d9-4943-8fe4-19f64619dbf2
- 52694426-b1eb-4f61-91ee-3d964320295d
- 736c1c2a-08ae-4b20-ae6e-4b89ac3240f9
- 2a429dd5-ff0b-41a3-a525-883b21bbf5ca

 

Attempting to make it visible to the projects by making public is prohibited

cloudstack-cli command updateTemplatePermissions id='7cdd4328-1048-491f-bd41-56efaa25bb0f' ispublic='true'

[31mERROR[0m: ApiError - Status 431: Only private templates can be created..

 

How is the creation of a template for all your projects supposed to work?

 

3 comments
0

Please sign in to leave a comment.

 
 

Previous 3 comments

Avatar
Prashanth Reddy Mandadi

Hi Colin,

Is marking a template as public ( when creating it) an option for you? Or do you want this template only to be exposed to particular Projects?

Comment actions Permalink
Avatar
colin free

The user account do not have the privilege to make public templates, only private ones. If I try to make the template featured the API commands says successful,  but, looking at the portal the isFeature remained at false.

 

I have found a work around which is to build a VM in the default view and storage snapshot it. Then Create a template in each of the projects from the snapshot in the default view. I still seem to be able to delete a specific template via the  API as a user, as long as it is not in use.

 

However, this means I have N templates(1  for each project) rather than a single template shared to all projects. Less space efficient.

Comment actions Permalink
Avatar
Prashanth Reddy Mandadi

>>The user account do not have the privilege to make public templates, only private ones.

Just curious, is this a limitation on your front end? I ask this since ACP allows users to create public templates.

 

>>I have found a work around which is to build a VM in the default view and storage snapshot it. Then Create a template in each of the projects from the snapshot in the default view.

 

I did the following tests and it worked for me. 

 

Test 1:

I have following accounts ( in different domains)

Account A ( belongs to project A) - Domain A

Account B ( no projects) - Domain B

 

Created a VM as account B and then created a volume snapshot out of it. Created a "public template" from this snapshot.

I can see this template from Account A ( default view) as well as  project View. Make sure you are viewing the "Community" templates in UI.

 

 

Test 2:

 

I have following accounts ( in same domain - DomainB)

Account A ( belongs to project A)

Account B ( no projects)

 

Created a VM as account B and then created a volume snapshot out of it. Created a "private template" from this snapshot. 

Assigned permissions to project A using updateTemplatePermissions API.

I can see this template from Account A ( project View). When viewing the "shared" templates in UI.

 

does any of the above tests address your scenario? 

Comment actions Permalink

Top Contributors