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

Set restart priority for a VM

$
0
0

Hi,

I try to set the restart priority for a VM in a cluster. I worked along the THIS DISCUSSION to create this script:

var myVcClusterDasConfigInfo = new VcClusterDasConfigInfo() ;
var myVcClusterDasVmConfigSpec = new VcClusterDasVmConfigSpec() ;
myVcClusterDasVmConfigSpec.operation = VcArrayUpdateOperation.add;
var myVcClusterDasVmConfigInfo = new VcClusterDasVmConfigInfo() ;
myVcClusterDasVmConfigInfo.key = VM;
myVcClusterDasVmConfigInfo.restartPriority =  VcDasVmPriority.high;
myVcClusterDasVmConfigSpec.info = myVcClusterDasVmConfigInfo;
var myVcClusterDasVmConfigSpecArray = new Array() ;
myVcClusterDasVmConfigSpecArray.push( myVcClusterDasVmConfigSpec );
var myVcClusterConfigSpecEx = new VcClusterConfigSpecEx() ;
myVcClusterConfigSpecEx.dasConfig = myVcClusterDasConfigInfo;
myVcClusterConfigSpecEx.dasVmConfigSpec = myVcClusterDasVmConfigSpecArray;
Cluster.reconfigureComputeResource_Task( myVcClusterConfigSpecEx, true );

 

Where Cluster and VM are objects from the WF input.

 

The scripts runs thought, however in VC I get the error "The setting of {entry.@enum.InvalidDasConfigArgument.EntryForInvalidArgument} is invalid for cluster"

 

It is properly simple....but I just cant work it out.

 

Thanks guys


Viewing all articles
Browse latest Browse all 6251

Trending Articles



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