VMware Cloud Community
mcssschaefer
Enthusiast
Enthusiast

Performance Values

Hi guys,

I have a problem with Orchestrator (Version 4.1.1 Build 733) and vCenter (4.1 Build 28902).

When I try to get performance values via VM.summary.quickStats.overallCpuUsage or via VM.sdkConnection.perfManager.queryPerf(querySpec) i only receive 0 or null as result. Running the same workflows in an other evironment workfs flawless.

When I use Perl SDK to get performance values from the VM in this environment it also works perfectly. It seems that something is broken insinde VCO, but the Orchestrator logs looks ok (DEBUG on). I also tried to restart Orchestrator, but this didn't help too.

Any ideas?

Best regards,

Stephan

http://blog.mightycare.de http://www.mightycare.de
Reply
0 Kudos
16 Replies
tschoergez
Leadership
Leadership

Hi!

Do you have some code examples?

(I remember in the past that some things come back as array, ...)

See some links (on is in german, but that shouldn't be a problem 🙂 😞

http://communities.vmware.com/message/1646292

http://vmware-forum.de/viewtopic.php?t=23887

http://mighty-virtualization.blogspot.com/2010/11/vco-get-performance-data-from-vm-build.html

Regards,

Joerg

Reply
0 Kudos
mcssschaefer
Enthusiast
Enthusiast

Hi Jörg,

I know what you're driving at, but this is not the problem. It seems the VCO iam using is unable to get performance values for whatever reason.

Even when I use the quickStats it returns zero, if I use Perl SDK and access exact the same object (VM) the data is set correctly.

VCO:

i.e. System.debug(VM.summary.quickStats.overallCpuUsage); Prints 0

Perl:

print_log($vm_view->summary->quickStats->overallCpuUsage); Prints 216

But I don't see a hint in the VCO Logs.

Best regards,

Stephan

http://blog.mightycare.de http://www.mightycare.de
Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee

mcssschaefer wrote:


I have a problem with Orchestrator (Version 4.1.1 Build 733) and vCenter (4.1 Build 28902).

When I try to get performance values via VM.summary.quickStats.overallCpuUsage or via VM.sdkConnection.perfManager.queryPerf(querySpec) i only receive 0 or null as result. Running the same workflows in an other evironment workfs flawless.

Hi Stefan,

What was the other environment the worklow worked flawlessly in ?

I have used perf manager on many occasions but maybe never on this build of vCenter (is this U1 ?).

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
mcssschaefer
Enthusiast
Enthusiast

Hi Christophe,

I have to check this tomorrow, but for all who are interested, here is the code for collecting the performance data in the way intended by VMware (I guess.) It's a beta so there are no performance tunes. I know it's slow... :smileygrin:

It would be great if someone can create a "Workflow" with a scriptable task including the following code (It get's one sample from the last 20 seconds of all metrics available for a VC:VirtualMachine) and can re-check in a newer vCenter/VCO, because there seems another bug with the "csv" metric format. (Maybe conversion Java -> Javscript, delimiter "," is not a good idea when using float/double/real values)

vCenter (Performance graph)

CPU usage (percent) :  0,32

Mem usage (percent) : 0,99

Orchestrator Debug:

[2011-11-08 17:50:22.037] [D] PerfCounterId:16, Human readable: mem.usage (percent)
   CSV sample values:99

[2011-11-08 17:50:15.537] [D] PerfCounterId:2, Human readable: cpu.usage (percent)
   CSV sample values:32

See, 0,32 -> 32, and 0,99 -> 99 . You can see this also when you change the code to get some more samples.

var qSpec = createPerfQuerySpec(srcVM, perfMetricIds, 1, perfProviderSummary.refreshRate); // Scripting object

Change 1 to 3 for example.

Unfortunaely I can't access the raw values since "value" is CSV string sperated by "," and this is causing the problem.

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

if (srcVM.runtime.powerState.value != "poweredOn" ) {
throw "VM is powered-off, no performance metric available";
}
var perfManager = srcVM.sdkConnection.perfManager; // Scripting Object PerformanceManager
var perfProviderSummary = perfManager.queryPerfProviderSummary(VcPlugin.toManagedObjectRef(srcVM)); // Scripting object VcPerfProviderSummary

System.debug("Supports real-time (current) statistics:" + perfProviderSummary.currentSupported);
System.debug("Supports historical (aggregated) statistics:" + perfProviderSummary.summarySupported);
System.debug("Refresh rate for this object: " + perfProviderSummary.refreshRate);

var perfMetricIds = perfManager.queryAvailablePerfMetric(VcPlugin.toManagedObjectRef(srcVM), null, null, perfProviderSummary.refreshRate); //Scripting object VcPerfMetricId
System.debug("Anzahl von Metrics für das VM Objekt:" +perfMetricIds.length);
for (var metric in perfMetricIds ) {
System.debug("Metric " + metric + ", counterId: " + perfMetricIds[metric].counterId + ", Instance:" + perfMetricIds[metric].instance);
}

var qSpec = createPerfQuerySpec(srcVM, perfMetricIds, 1, perfProviderSummary.refreshRate); // Scripting object VcPerfQuerySpec

//Retrieves the performance metrics for the specified entity (or entities) based on the properties specified in the VcPerfQuerySpec data object.
var pValues = perfManager.queryPerf(new Array(qSpec)); // Scripting object VcPerfEntityMetricBase

System.debug ("Anzahl Entitys: " +pValues.length);
for (var entity in pValues) {
System.debug("SampleInfoCSV: " + pValues[entity].sampleInfoCSV);
var csvs =  pValues[entity].value; //  Scripting object PerfMetricSeriesCSV
for ( var value in csvs ) {
  var number = new Array ();
  number.push(csvs[value].id.counterId);
  var counterInfo = perfManager.queryPerfCounter(number); // Scripting obejct VcPerfCounterInfo
// System.debug(counterInfo);
  System.debug("PerfCounterId:" + csvs[value].id.counterId + ", Human readable: " + counterInfo[0].groupInfo.key + "." + counterInfo[0].nameInfo.key + " (" + counterInfo[0].unitInfo.key + ")\n\tCSV sample values:" + csvs[value].value);
  //   System.debug("\n\tCSV sample values:" + csvs[value].value);
}
}    

function createPerfQuerySpec (managedEntity, metricIds, maxSample, interval ) {

qSpec = new VcPerfQuerySpec();
qSpec.entity = VcPlugin.toManagedObjectRef(srcVM);
qSpec.maxSample = maxSample;
qSpec.metricId = metricIds;
qSpec.format = "csv"; //csv format,we don't want normal
qSpec.intervalId = interval;
return qSpec;

}

http://blog.mightycare.de http://www.mightycare.de
Reply
0 Kudos
tschoergez
Leadership
Leadership

Hi!

I gave it a short try: the line

System.debug(VM.summary.quickStats.overallCpuUsage);

works in my combination (vCO 4.1.1 Build 733, vCenter 4.1.0 Build 345043 (should be U1, but not sure)...

the "long" scriptable task works as well, spits out a lot of data/values. The comma in CSV is just removed, so e.g. a average cpu usage of 2,62 percent shows as

[2011-11-08 18:48:38.408] [D] PerfCounterId:2, Human readable: cpu.usage (percent)
   CSV sample values:262

running it against a vCenter 5.0 (same vco server, so I think I have used the 5.0-vcenter-plugin for all tests 😉 ) works as well: single summary line and the long example returns values, still no commas (6,69 percent shows as 669).

Regards,

Joerg

Reply
0 Kudos
mcssschaefer
Enthusiast
Enthusiast

Hi Jörg,

thanks for the quick reply. Unfortunately you brought bad news :smileygrin: It could be anything from machine is idle (0,669 - 6,69) over machine have normal cpu load (66,9) to a value out of range 669 (It just measures up to 100 % even with 6-7 cores, there is no 600 % = 6 cores)

Tomorrow I'll try the "normal"-metric mode and see if this works (Objects). If nothing works I'll use the Perl SDK.

Best regards,

Stephan

http://blog.mightycare.de http://www.mightycare.de
Reply
0 Kudos
tschoergez
Leadership
Leadership

Suggestion: if possible, file an official support request! Maybe we get a confirmed bug with higher chance to get fixed in future....

Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee

I have some code I worte a long time ago here (calculating VM performance average and maximum from start to end date) and I do not think I have the coma issue since it is displaying values < 10.

Please check if this works for you. It does for me on vCO 4.1 build 581, vC4 plug-in and vCenter 5.0

I may need to put a tutorial on this but most of my code need rework since it was done for the VIM3 plug-in.

This make me think I forgot the perl to vCO article ! Smiley Sad  So many think to share and so little time ...

if (performanceIds == null) performanceIds = [6,90,110,98];

var performanceManager = vm.vimHost.performanceManager;
var counters = performanceManager.queryPerfCounter(performanceIds);
var perfIdsCountersProp = new Properties();
for (var i in performanceIds) {
    perfIdsCountersProp.put(performanceIds[i], counters[i].groupInfo.label + " " + counters[i].nameInfo.label + " (" + counters[i].unitInfo.label + ")");   
}   

var perfMetricIds = new Array();
for (var i in performanceIds) {
    var perfMetricId = new VcPerfMetricId();
    perfMetricId.counterId = performanceIds[i];
    System.log("adding perf :" + performanceIds[i]);
    perfMetricId.instance = "";
    perfMetricIds.push(perfMetricId);

}

var perfQuerySpecs = new Array();

var perfQuerySpec = new VcPerfQuerySpec();
perfQuerySpec.entity = vm.reference;
perfQuerySpec.startTime = startDate;
perfQuerySpec.endTime = endDate;
perfQuerySpec.maxSample = 180;
perfQuerySpec.intervalId = 20;
perfQuerySpec.format = "csv";
perfQuerySpec.metricId = perfMetricIds;
perfQuerySpecs.push(perfQuerySpec);

System.log("Query started");
var metrics = performanceManager.queryPerf(perfQuerySpecs);
System.log("Query finished");
           
if (metrics != null) {
    System.log("found " + metrics.length + " metrics");
     for each (var metric in metrics) {
       
        //System.log(metric.sampleInfoCSV); // This defines the timing of the data collected
        //Collecting properties Data
        var prop = new Properties();
       
        for (var c in metric.value) {
            var csvLine = metric.value[c].value
            var counterId = metric.value[c].id.counterId;
             var label = perfIdsCountersProp.get(counterId);
            var max;
            var csvLineValuesNb = 0;
            var csvLineValuesSum =0;
            var csvLineValues = csvLine.split(",");
            if (csvLineValues.length >=1) {
                var max = Math.max.apply(null, csvLineValues);
                for each (var csvLineValue in csvLineValues) {
                    csvLineValuesSum += csvLineValue * 1;
                    csvLineValuesNb ++;
                }
            var average = Math.round(csvLineValuesSum/csvLineValuesNb);
            }
            prop.put("Average " + label, average);
            prop.put("Maximum " + label, max);
            prop.put("startDate", startDate);
            prop.put("endDate", endDate);
            System.log("label : "  + label + " max : " + max + " average : " + average);       
        }
        return prop;
    }                                       
}
else return null;

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
mcssschaefer
Enthusiast
Enthusiast

Hi Christophe,

maybe you understand us wrong. It has nothing to do with numbers < 10. The problem are floating point numbers which are comma seperated. (The problem occurs, becausee somewhere in VCO the performance values are converted to CVS-Format which also uses comma as delimiter).

The reason you hadn't the problem is, that your  scripts asks for metricID's: 6 (cpu.ugage (Mhz)) , 90 (mem.cosumed (kiloBytes)), 110 (disk.commandsAbored (number)), 98 (mem.compression kiloBytesPerSecond)). As far as I can these metrics are (unsigned) intergers. Attached you find a modified version of your script (replaced parametes,i.e. start-/endDate so the script works out of the box) which also shows the values for metricIds 2,16. (Which returns floating point numbers, see vCenter)

var performanceIds = [6,90,110,98,2,16];

var performanceManager = vm.vimHost.performanceManager;
var counters = performanceManager.queryPerfCounter(performanceIds);
var perfIdsCountersProp = new Properties();
for (var i in performanceIds) {
    perfIdsCountersProp.put(performanceIds[i], counters[i].groupInfo.label + " " + counters[i].nameInfo.label + " (" + counters[i].unitInfo.label + ")");   
}   

var perfMetricIds = new Array();
for (var i in performanceIds) {
    var perfMetricId = new VcPerfMetricId();
    perfMetricId.counterId = performanceIds[i];
    System.log("adding perf :" + performanceIds[i]);
    perfMetricId.instance = "";
    perfMetricIds.push(perfMetricId);

}

var perfQuerySpecs = new Array();
var startDate = new Date();
var endDate = new Date();
startDate.setTime(endDate.getTime() - 3600 * 1000);
var perfQuerySpec = new VcPerfQuerySpec();
perfQuerySpec.entity = vm.reference;
perfQuerySpec.startTime = startDate;
perfQuerySpec.endTime = endDate;
perfQuerySpec.maxSample = 180;
perfQuerySpec.intervalId = 20;
perfQuerySpec.format = "csv";
perfQuerySpec.metricId = perfMetricIds;
perfQuerySpecs.push(perfQuerySpec);

System.log("Query started");
var metrics = performanceManager.queryPerf(perfQuerySpecs);
System.log("Query finished");
           
if (metrics != null) {
    System.log("found " + metrics.length + " metrics");
     for each (var metric in metrics) {
       
        //System.log(metric.sampleInfoCSV); // This defines the timing of the data collected
        //Collecting properties Data
        var prop = new Properties();
       
        for (var c in metric.value) {
            var csvLine = metric.value[c].value
            var counterId = metric.value[c].id.counterId;
             var label = perfIdsCountersProp.get(counterId);
            var max;
            var csvLineValuesNb = 0;
            var csvLineValuesSum =0;
            var csvLineValues = csvLine.split(",");
            if (csvLineValues.length >=1) {
                var max = Math.max.apply(null, csvLineValues);
                for each (var csvLineValue in csvLineValues) {
                    csvLineValuesSum += csvLineValue * 1;
                    csvLineValuesNb ++;
                }
            var average = Math.round(csvLineValuesSum/csvLineValuesNb);
            }
            prop.put("Average " + label, average);
            prop.put("Maximum " + label, max);
            prop.put("startDate", startDate);
            prop.put("endDate", endDate);
            System.log("label : "  + label + " max : " + max + " average : " + average);       
        }
    }                                       
}


Output:

[2011-11-09 09:12:52.052] [I] label : CPU Usage in MHz (MHz) max : 15 average : 7
[2011-11-09 09:12:52.052] [I] label : Memory Consumed (KB) max : 188744 average : 188679
[2011-11-09 09:12:52.052] [I] label : Memory Compression rate (KBps) max : 0 average : 0
[2011-11-09 09:12:52.068] [I] label : CPU Usage (Percent) max : 75 average : 33
[2011-11-09 09:12:52.068] [I] label : Memory Usage (Percent) max : 399 average : 122


The machine has a CPU Usage (Percent) Max-Value of  0,75 and an Average-Value of 3,33, not 75 and 33 like returned in the CVS-String (Developers have to change the delimiter so soemthing else, i.e. ';'). The same applies to Memory Usage (Percent).

And yes, shame on you, you forgot to create the Perl tutorial!! Smiley Wink

btw: How/Where can I create a bug-report for this?

http://blog.mightycare.de http://www.mightycare.de
Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee

As a work around, can't you get the same ID as I do for CPU usage and average it as I have done in my script ?

To open a bug report just contact VMware GSS and say you have found a bug and provide sample code. GSS will then handle this with engineering. This is the best way to track these issues and get things solved.

I definitely ned to reserve time for the Perl tutorial. Will see what I can do.

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
mcssschaefer
Enthusiast
Enthusiast

Hi Christophe,

unfortunately not, because I need the percent value. The CPU Usae (Mhz) says nothing about the workload becuase I don't have a reference value somewhere in the API. I only see the number of vCPU's in a VM, but the vCPU could have 1Ghz or 4 Ghz. The value from memory usage (KB) is not perfect but should be okay for calculation because I have a reference in value in VC:VirtualMachine.

@Jörg:

I also made a short test whith "Normal-Metrics", see below. Unfortunately with the same result, the type of the reurned values is VcPerfMetricIntSeries and this use 64-bit int values, see:

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

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

2011-11-09 09:52:53.240] [D] Id: 140, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 115, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 273, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 106, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 144, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 121, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 123, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 268, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 2, Value: 32
[2011-11-09 09:52:53.240] [D] Id: 248, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 134, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 270, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 279, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 120, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 294, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 143, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 139, Value: 5
[2011-11-09 09:52:53.240] [D] Id: 258, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 6, Value: 6
[2011-11-09 09:52:53.240] [D] Id: 86, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 269, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 97, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 266, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 137, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 271, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 105, Value: 2
[2011-11-09 09:52:53.240] [D] Id: 14, Value: 49
[2011-11-09 09:52:53.240] [D] Id: 267, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 136, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 122, Value: 60163
[2011-11-09 09:52:53.240] [D] Id: 111, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 82, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 283, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 112, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 138, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 110, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 126, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 12, Value: 3
[2011-11-09 09:52:53.240] [D] Id: 16, Value: 99
[2011-11-09 09:52:53.240] [D] Id: 94, Value: 44812
[2011-11-09 09:52:53.240] [D] Id: 274, Value: 160
[2011-11-09 09:52:53.240] [D] Id: 260, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 261, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 141, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 263, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 264, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 33, Value: 944
[2011-11-09 09:52:53.240] [D] Id: 109, Value: 5
[2011-11-09 09:52:53.240] [D] Id: 272, Value: 0
[2011-11-09 09:52:53.240] [D] Id: 101, Value: 0
[2011-11-09 09:52:53.255] [D] Id: 104, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 106, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 291, Value: 105904
[2011-11-09 09:52:53.271] [D] Id: 77, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 25, Value: 10484
[2011-11-09 09:52:53.271] [D] Id: 99, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 121, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 29, Value: 8140
[2011-11-09 09:52:53.271] [D] Id: 21, Value: 193212
[2011-11-09 09:52:53.271] [D] Id: 248, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 90, Value: 188672
[2011-11-09 09:52:53.271] [D] Id: 119, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 12, Value: 3
[2011-11-09 09:52:53.271] [D] Id: 293, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 145, Value: 5
[2011-11-09 09:52:53.271] [D] Id: 10, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 107, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 247, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 98, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 275, Value: 6000
[2011-11-09 09:52:53.271] [D] Id: 259, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 118, Value: 1
[2011-11-09 09:52:53.271] [D] Id: 6, Value: 5
[2011-11-09 09:52:53.271] [D] Id: 262, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 66, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 290, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 328, Value: 2
[2011-11-09 09:52:53.271] [D] Id: 120, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 107, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 113, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 62, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 142, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 265, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 135, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 78, Value: 0
[2011-11-09 09:52:53.271] [D] Id: 11, Value: 19949

Id: 2 cpu.usage (percent) = 32 should be 0,32

Id: 16 mem.usage (percent) = 99 should be 0,99

if (srcVM.runtime.powerState.value != "poweredOn" ) {
throw "VM is powered-off, no performance metric available";
}
var perfManager = srcVM.sdkConnection.perfManager; // Scripting Object PerformanceManager
var perfProviderSummary = perfManager.queryPerfProviderSummary(VcPlugin.toManagedObjectRef(srcVM)); // Scripting object VcPerfProviderSummary

System.debug("Supports real-time (current) statistics:" + perfProviderSummary.currentSupported);
System.debug("Supports historical (aggregated) statistics:" + perfProviderSummary.summarySupported);
System.debug("Refresh rate for this object: " + perfProviderSummary.refreshRate);

var perfMetricIds = perfManager.queryAvailablePerfMetric(VcPlugin.toManagedObjectRef(srcVM), null, null, perfProviderSummary.refreshRate); //Scripting object VcPerfMetricId
System.debug("Anzahl von Metrics für das VM Objekt:" +perfMetricIds.length);
for (var metric in perfMetricIds ) {
System.debug("Metric " + metric + ", counterId: " + perfMetricIds[metric].counterId + ", Instance:" + perfMetricIds[metric].instance);
}


var qSpec = createPerfQuerySpec(srcVM, perfMetricIds, 1, perfProviderSummary.refreshRate); // Scripting object VcPerfQuerySpec

//Retrieves the performance metrics for the specified entity (or entities) based on the properties specified in the VcPerfQuerySpec data object.
var pValues = perfManager.queryPerf(new Array(qSpec)); // Scripting object VcPerfEntityMetricBase

System.debug ("Anzahl Entitys: " +pValues.length);
for (var entity in pValues) {
var vals = pValues[entity].value;
for ( var i in vals ) {
  for (var j in vals[i].value)
   System.debug("Id: " + vals[i].id.counterId + ", Value: " + vals[i].value[j]);  
}
}    

function createPerfQuerySpec (managedEntity, metricIds, maxSample, interval ) {

qSpec = new VcPerfQuerySpec();
qSpec.entity = VcPlugin.toManagedObjectRef(srcVM);
qSpec.maxSample = maxSample;
qSpec.metricId = metricIds;
qSpec.format = "normal"; // normal mode for testing

qSpec.intervalId = interval;
return qSpec;

}

So, at the moment there is no way to get the correct values for float-point metrics via VCO. I'll install the Perl SDK at customer side and craate a small Perl script for getting the metrics.

Btw.: What's about the Wavemaker tutorial? I can provide a sample (In short time) if you want to? (Java + Javascript + VCO Workflow + Wavemaker project.)

Nachricht geändert durch mcssschaefer

http://blog.mightycare.de http://www.mightycare.de
Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee

Please open a GSS support request so this can be fixed in next vCO / vCenter plug-in.

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
mcssschaefer
Enthusiast
Enthusiast

Hi Christophe,

can you open it, since we only have a small number of SR's left?!

Best regards,

Stephan

http://blog.mightycare.de http://www.mightycare.de
Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee

I can not open a support request since I am not a VMware customer / partner.

As a VMware customer / partner under support you should not be limited in the number of SR, or if so this is new to me.

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos
mcssschaefer
Enthusiast
Enthusiast

Ok, it seems to be a bigger problem, it's not related to the vCenter Plugin of vCO. It seems to be broken inside the WebService of vCenter since Iam having exact the same behaviour with the originial VMware Perl scripts from the latest Perl SDK. I wonder that no one has recongnized this before.... It also doesn't matter if I run the scripts agaisnt a vCenter 4/5 or ESXI 4/5, see below:


C:\Program Files (x86)\VMware\VMware vSphere CLI\Perl\apps\performance>viperformance.pl --url https://XXXXXXXXX --host XXXXXXXX --username XXXXXX --password XXXXXX
--countertype mem --samples 1
Performance data for: XXXXXXXXXXX

Counter: Nutzung
Instance :
Description: Die Arbeitsspeichernutzung als Prozentsatz des konfigurierten oder verf³gbaren Gesamtarbeitsspeichers
Units: Prozent
Sample info : 20,2011-11-10T09:55:20Z
Value: 5132

[...]

5132 Percent Mem Usage ... It is 51,32 according to vCenter 4/5.

I also tested this with the Perl SDK for Linux (SLES11SP1) and vMA. The WebService of vCenter 4/5 has a bug,

http://blog.mightycare.de http://www.mightycare.de
Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee

Another good reason to open a support request.

Christophe.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos