VMware Cloud Community
zik
Enthusiast
Enthusiast

Converting a Template to a VM

My users have the privilege to "Mark as template" and "Mark as virtual machine" but the client wants to place the VM on a host.  This they don't have privilege to do.

My thought is to have them use "Set-Template -ToVM" which looks like it doesn't need additional privileges.

However:

PowerCLI C:\> Get-Template -Name WIN_2012R2_STD_X64 | Set-Template -ToVM

Set-Template : 4/1/2016 3:38:04 PM    Set-Template        Object reference not set to an instance of an object.   

At line:1 char:41

+ Get-Template -Name WIN_2012R2_STD_X64 | Set-Template -ToVM

+                                         ~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (WIN_2012R2_STD_X64:TemplateImpl) [Set-Template], ViError

    + FullyQualifiedErrorId : Client20_VMServiceImpl_ConvertTemplateToVm_ViError,VMware.VimAutomation.ViCore.Cmdlets.Commands.SetTemplate

Works when I run the command as an administrator.

What privilege am I missing?

0 Kudos
3 Replies
LucD
Leadership
Leadership

From the error message I would think that the account doesn't even has permission to list the template.

What access does the account have on the folder in which the template is sitting ?

And the VMHost ? Datastore ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
zik
Enthusiast
Enthusiast

List works:

PowerCLI C:\> get-template

Name                                             

----                                             

Template-Test                                    

Read-only permission to the host, no permission on the datastore, and following on the VM:

Name                  

----                  

Anonymous             

View                  

Read                  

Cancel task           

Create folder         

Delete folder         

Rename folder         

Move folder           

Move                  

Power On              

Power Off             

Suspend               

Reset                 

Answer question       

Console interaction   

Device connection     

Configure CD media    

Configure floppy media

VMware Tools install  

Add or remove device  

Modify device settings

Settings              

Create snapshot       

Revert to snapshot    

Remove Snapshot       

Rename Snapshot       

Mark as template      

Mark as virtual machine

Create alarm          

Remove alarm          

Modify alarm          

Acknowledge alarm     

Set alarm status      

Disable alarm action  

Create tasks          

Remove task           

Run task              

Modify task           

Export                

0 Kudos
LucD
Leadership
Leadership

The error is on the Set-Template, the proper working of Get-Template is not sufficient.

You have to find out which of the privileges is missing.

Can you do the same action from the Web Client ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos