Guest User

Untitled

a guest
Nov 15th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. // VMware vRealize Orchestrator action sample
  2. //
  3. // Update the notes for a vCenter VM
  4. //
  5. // For vRO 7.0+
  6. //
  7. // Action Inputs:
  8. // vm - VC:VirtualMachine - vCenter VM Object
  9. // notes - string - New vCenter VM Notes
  10. //
  11. // Return type: string - Notes for VM
  12.  
  13. if (!vm) { throw "VM not provided" }
  14. if (!notes) { notes = ""; }
  15.  
  16. var oldNotes = vm.summary.config.annotation;
  17. if (!oldNotes) { oldNotes = ""; }
  18.  
  19. System.debug("Old VM Notes: "+oldNotes);
  20. System.debug("New VM Notes: "+notes);
  21.  
  22. var configSpec = new VcVirtualMachineConfigSpec();
  23. configSpec.annotation = notes;
  24. // Start VM reconfigure task
  25. var task = vm.reconfigVM_Task(configSpec);
  26. // Wait for task to end
  27. var progress = false;
  28. var pollRate = 5;
  29. System.getModule("com.vmware.library.vc.basic").vim3WaitTaskEnd(task,progress,pollRate) ;
Add Comment
Please, Sign In to add comment