Hi,
Is there a workflow\action which get all the templates available in the Orchestrator?
I would like to allow the user to choose a template from a list of templates which inform him also about the vCenter it is connected
Thanks!
Hi,
There is a boolean flag in virtual machine configuration object, indicating whether the virtual machine is a template or not. Here is some sample scripting code showing how to get all templates from all configured vCenter server instances:
var vms = VcPlugin.allVirtualMachines;
var templates = []; // templates will be stored into this array
for each (var vm in vms) {
if (vm.config != null && vm.config.template) {
templates.push(vm);
}
}
// iterate over all found templates and print their names
for each (var t in templates) {
System.log("template -> " + t.name);
}
Hi,
There is a boolean flag in virtual machine configuration object, indicating whether the virtual machine is a template or not. Here is some sample scripting code showing how to get all templates from all configured vCenter server instances:
var vms = VcPlugin.allVirtualMachines;
var templates = []; // templates will be stored into this array
for each (var vm in vms) {
if (vm.config != null && vm.config.template) {
templates.push(vm);
}
}
// iterate over all found templates and print their names
for each (var t in templates) {
System.log("template -> " + t.name);
}
Can i know on which vCenter the image is located?
from mind: I think vm.sdkConnection should return the sdkConnection object that represents the vCenter connection this VM/template is located.
Regards,
Joerg
I found the sdkConnection parameters.
Thanks!