I wanted to deploy a template via the vSphere client but I was unable to achieve this task because the option was grayed out. After restarting the vCenter services and the vCenter server I was still unable to deploy a template.
Non of the options where available. So PowerCLI to the rescue:
$templates = Get-Template * foreach($item in $templates){ $template = $item.Name #Convert Template back to VM Set-Template $template -ToVM -RunAsync #Convert Template back to template :S $vmview = Get-VM $template | Get-View $vmview.MarkAsTemplate() }
After running the script above. I was able to deploy my templates again 🙂
Why would you ever want to do this?
$templates = Get-Template -Name* |Export-Csv -NoTypeInformation $tmpfile
$csv = Import-CSV $tmpfile
And not this?
$csv = Get-Template -Name *
I had to use this as a workaround in the past. But your solution works also. So I will update the post.
The easiest way to do this is to scan the template with Update Manager. (It will automatically convert it to a VM, scan for VMware tools updates, and then convert it back to a template). It fixed this issue for me when the “convert to VM” was greyed out.