image

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.

image

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 🙂

image

5 thoughts on “vSphere: Deploy Template grayed out

  1. 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 *

  2. 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.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.