Quantcast
Channel: VMware Communities : All Content - vRealize Automation Tools
Viewing all articles
Browse latest Browse all 9859

Reconfigure Virtual Machine vRA to Change CPU/Memory

$
0
0

Hello,

Does anybody have an idea on what are the property ss needed to change the cpu and memory from vRO workflow in vRA to Reconfigure a VM to change the CPU/Memory?  I can't seem to find any documentation below is the code I have thus far :

 

System.log("+ Starting Item: Reconfigure CPU/Memory");
var vmResources = vCACCAFEEntitiesFinder.findCatalogResources(cafeHost,vcacVM.virtualMachineName);

for (var i = 0; i < vmResources.length; i++){
var vmResource = vmResources[i];
if (vmResource.resourceTypeRef.getLabel() == 'Virtual Machine') {
  System.log("Found vmResource " + vmResource.name + " Reconfiguring CPU/Memory.");
  var inputs = new Properties();
  var d = "Reconfiguring VIrtual Machine";
  inputs.description = d;

System.log("Creating Property Set for Inputs");

System.log("New CPU Value: " + updatedCPU);

inputs.put("VirtualMachine.CPU.Count", updatedCPU);

System.log("New Memory Size (MB): " + newMemoryGB);

inputs.put("VirtualMachine.Memory.Size", newMemoryGB);
  inputs.reasons = "Request to update CPU/Memory.";
  var operations = vmResource.operations;
  for each (operation in operations) {
   if (operation.name.match(/reconfigure/i)) {
    System.log(d);
    //System.log(operation.name);
    System.getModule("com.vmware.library.vcaccafe.request").requestResourceAction(operation, inputs);
   }
  }
}


Viewing all articles
Browse latest Browse all 9859

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>