Hello guys,
I have vCenter Orchestrator 4.1.1 build 733 installed and it works fine, but I need your help for the two following problems:
1) I want to set the description/notes of a vm by using a workflow. But I didn’t found any helpful API to create such a workflow (I don’t mean the custom attributes, see attachment for more details).
2) How can I get the name of the datastore, where the vm is located? I need this name for a workflow.
I need your help.
Thanks in advance!
In regards to the VM notes, the following code (see attached package) can do that:
var oldNotes = vm.summary.config.annotation;
if (oldNotes == null){oldNotes = "";}
System.log("Current VM Notes: "+oldNotes);
// Now set the new Notes:
// Start by creating a ConfigSpec
var configSpec = new VcVirtualMachineConfigSpec();
// Update the annotation property with new value
configSpec.annotation = notes;
// launch task to reconfig the vm with the new configspec
// NOTE: This is safe to apply with powered on VM
var task = vm.reconfigVM_Task(configSpec);
And, in regards to VM information, take a look at the Library workflow: \Library\vCenter\Virtual Machine management\Others\Extract virtual machine information
In regards to the VM notes, the following code (see attached package) can do that:
var oldNotes = vm.summary.config.annotation;
if (oldNotes == null){oldNotes = "";}
System.log("Current VM Notes: "+oldNotes);
// Now set the new Notes:
// Start by creating a ConfigSpec
var configSpec = new VcVirtualMachineConfigSpec();
// Update the annotation property with new value
configSpec.annotation = notes;
// launch task to reconfig the vm with the new configspec
// NOTE: This is safe to apply with powered on VM
var task = vm.reconfigVM_Task(configSpec);
And, in regards to VM information, take a look at the Library workflow: \Library\vCenter\Virtual Machine management\Others\Extract virtual machine information
Hi everybody,
the solution here works fine for the notes: section in annotations.
And how is it possible to get/set the other annotations that can be defined individually.
Regards
Sven