Goal: I have a simple goal of uploading existing template to Content Library. (Code snippet is attached below)
I am able to achieve that using vsphere-clone but only problem is I have to create a VM from template with new name. I want to know if there is anyway to convert a template to a VM using vsphere-clone? It seems both "vm_name" and "template" are required variables so both have to be of different name.
{
"builders": [
{
"type": "vsphere-clone",
"vcenter_server": "{{user `VCENTER_URL`}}",
"cluster": "myCluster",
"host": "{{user `ESXI_HOST`}}",
"datastore": "{{user `DATASTORE`}}",
"datacenter": "{{user `DATACENTER`}}",
"folder": "{{user `VM_FOLDER`}}",
"insecure_connection": "true",
"template": "{{user `VM_TEMPLATE`}}",
"username": "{{user `VCENTER_USER`}}",
"password": "{{user `VCENTER_PASS`}}",
"vm_name": "{{user `VM_NAME`}}",
"content_library_destination" : {
"library": "myCL",
"ovf": true
},
"communicator": "none"
}
]
}
Manish G.