Hi,
I am using SDK API's to set vmMonitoring state per VM. I have set the following parameters as per vmware documentation. All API calls are working and also I can see reconfiguration operation in vsphere completed successfully. However when I try to retrieve the value, it returns 'invalid' each time. There are no details provided of this state in the link (http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc_50%2Fvim.cluster.DasConfigInfo.VmMonitoringState.html)
I am not getting why "invalid" state is coming as API/reconfiguration tasks are completed successfully. The reconfiguration task should give error if something is wrong in it.
Sensitivity values are setting properly and I am see them through vsphere window. BTW, how to check or set VM specific vmMonitoring state through vsphere window. I know how to set cluster wide vm monitoring state but not getting how to set for VM only.
I stuck due to this issue. Please help me to understand and fix this issue.
Code:
ClusterDasVmConfigInfo vmInfo = new ClusterDasVmConfigInfo();
vmInfo.dasSettings = new ClusterDasVmSettings();
vmInfo.dasSettings.vmToolsMonitoringSettings =
new ClusterVmToolsMonitoringSettings();
vmInfo.setKey( vm.getMOR() );
vmInfo.dasSettings.vmToolsMonitoringSettings.setClusterSettings(false);
vmInfo.dasSettings.vmToolsMonitoringSettings.setEnabled(true);
vmInfo.dasSettings.vmToolsMonitoringSettings.setVmMonitoring(“vmAndAppMonitoring”); <<<<<< this is not working
vmInfo.dasSettings.vmToolsMonitoringSettings.failureInterval = 60; <<<<<<<<<<< these setting are working
vmInfo.dasSettings.vmToolsMonitoringSettings.maxFailures = 3;
vmInfo.dasSettings.vmToolsMonitoringSettings.maxFailureWindow = 86400;
vmInfo.dasSettings.vmToolsMonitoringSettings.minUpTime = 240;
ClusterDasVmConfigSpec[] dasVmConfigSpecs = new ClusterDasVmConfigSpec[1];
dasVmConfigSpecs[0] = new ClusterDasVmConfigSpec();
dasVmConfigSpecs[0].operation = ArrayUpdateOperation.edit;
dasVmConfigSpecs[0].info = vmInfo;
clusterConfig.setDasVmConfigSpec(dasVmConfigSpecs);
reconfigureCluster(clusterConfig);
Thanks,
Ganesh