VMware Cloud Community
Oli_L
Enthusiast
Enthusiast

Supplying VM list to enable DRS affinity group

I have a query around the output I got from ONYX... see here:

var spec = new VcClusterConfigSpecEx();

spec.vmSwapPlacement = "vmDirectory";

spec.dasConfig = new VcClusterDasConfigInfo();

spec.dasConfig.vmMonitoring = "vmAndAppMonitoring";

spec.dasConfig.defaultVmSettings = new VcClusterDasVmSettings();

spec.dasConfig.defaultVmSettings.restartPriority = "medium";

spec.dasConfig.defaultVmSettings.isolationResponse = "none";

spec.dasConfig.defaultVmSettings.vmToolsMonitoringSettings = new VcClusterVmToolsMonitoringSettings();

spec.dasConfig.defaultVmSettings.vmToolsMonitoringSettings.enabled = true;

spec.dasConfig.defaultVmSettings.vmToolsMonitoringSettings.vmMonitoring = "vmMonitoringOnly";

spec.dasConfig.defaultVmSettings.vmToolsMonitoringSettings.failureInterval = 120;

spec.dasConfig.defaultVmSettings.vmToolsMonitoringSettings.minUpTime = 480;

spec.dasConfig.defaultVmSettings.vmToolsMonitoringSettings.maxFailures = 3;

spec.dasConfig.defaultVmSettings.vmToolsMonitoringSettings.maxFailureWindow = 604800;

spec.drsConfig = new VcClusterDrsConfigInfo();

spec.drsConfig.enabled = true;

spec.drsConfig.defaultVmBehavior = VcDrsBehavior.fullyAutomated;

spec.drsConfig.vmotionRate = 3;

spec.dpmConfig = new VcClusterDpmConfigInfo();

spec.dpmConfig.enabled = false;

spec.dpmConfig.hostPowerActionRate = 3;

spec.groupSpec = System.getModule("com.vmware.onyx").array(VcClusterGroupSpec, 1);

spec.groupSpec[0] = new VcClusterGroupSpec();

spec.groupSpec[0].operation = VcArrayUpdateOperation.edit;

spec.groupSpec[0].info = new VcClusterVmGroup();

spec.groupSpec[0].info.name = "My VM group";

spec.groupSpec[0].info.vm = System.getModule("com.vmware.onyx").array(VcManagedObjectReference, 1);

spec.groupSpec[0].info.vm[0] = Server.findForType("VC:VirtualMachine", managedObject.vimHost.id + "/vm-123");;

managedObject.reconfigureComputeResource_Task(spec, true);  // ClusterComputeResource

My question is how does the list of VMs get created? How does the cluster name get specified? And does spec hold all the configuration values? I ask this as I would like to understand how to pass in a list of VMs from say a vCAC stub workflow. I know there is a vCO workflow to do this, but need to know how the VM list is created in more detail.

Many thanks,

Oli

Tags (2)
0 Kudos
0 Replies