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'
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?
Previous 3 commentaires
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.
>>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.
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.
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?
Ask, Discuss, Answer