Quantcast
Channel: VMware Communities : Discussion List - vRealize Orchestrator
Viewing all articles
Browse latest Browse all 6251

Set up System Resource Allocation via vCo or PowerCLI

$
0
0

Hi guys,

 

I'm been trying for a few days to automate some ESXi 5.5 post-install settings. Among several subject I want to set up system resource allocation for a HOST (not for a VM).

So I made some research through the API, finding this :

 

Method > updateSystemResource() documented here http://www.vmware.com/support/orchestrator/doc/vco_vsphere50_api/html/VcHostSystem.html

resourceInfo argument type VcHostSystemResourceInfo

 

VcHostSystemResourceInfo doc : http://www.vmware.com/support/orchestrator/doc/vco_vsphere50_api/html/VcHostSystemResourceInfo.html

config argument type VcResourceConfigSpec

 

vCResourceConfigSpec doc : http://www.vmware.com/support/orchestrator/doc/vco_vsphere50_api/html/VcResourceConfigSpec.html

argument cpuAllocation argument type VcResourceAllocationInfo

memoryAllocation argument type VcResourceAllocationInfo

 

VcResourceAllocationInfo doc : http://www.vmware.com/support/orchestrator/doc/vco_vsphere41_api/html/VcResourceAllocationInfo.html

limit and reservation arguments

 

From here I wrote this script into a simple workflow to update the settings with my custom parameters, :

 

 

var hostSystemResourceInfo = esxHost.systemResources;

var config = hostSystemResourceInfo.config;


config.cpuAllocation.reservation = "500";

config.cpuAllocation.limit = "1000";

config.cpuAllocation.expandableReservation = true;

 

config.memoryAllocation.reservation = "500";

config.memoryAllocation.limit = "1000";

config.memoryAllocation.expandableReservation = true;

 

esxHost.updateSystemResources(hostSystemResourceInfo);

 

esxHost is the host, which I select when I launch the workflow.

But all I get is an exception : A general system error occurred: Invalid fault (Workflow:Resource Allocation / RA conf (item1)#12)

 

A little help would be appreciated.

I put an alert on this topic, so any question or script testing, I can do that.

 

Thanks by advance !


Viewing all articles
Browse latest Browse all 6251

Trending Articles



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