Hi,
I have been trying to create performance interval for VMware VirtualCenter 2.5.0 with samplingPeriod = 40 sec. Following is the perl code snippet :
{{{
#!/usr/bin/perl -w
create performance interval for host or vm
use strict;
use warnings;
use VMware::VIM25Runtime;
use VMware::VILib;
performance manager view
my $perfmgr_view;
read/validate options
Opts::parse();
Opts::validate();
connect to the server
Util::connect();
$perfmgr_view = Vim::get_view(mo_ref => Vim::get_service_content()->perfManager);
my $interval = PerfInterval->new(name => 'Past Day',
enabled => 'true',
samplingPeriod => 40,
length => 7200);
get performance data
$perfmgr_view->CreatePerfInterval(interval => $interval);
Util::disconnect();
}}}
but this program giving following error :
{{{
Unexpected arguments: interval at /usr/lib/perl5/5.8.8/VMware/VIM25Stub.pm line 31390
VimService::build_arg_string('ARRAY(0x152c2630)', 'HASH(0x152c25b0)') called at /usr/lib/perl5/5.8.8/VMware/VIM25Stub.pm line 32588
VimService::CreatePerfInterval('VimService=HASH(0x142f7050)', '_this', 'ManagedObjectReference=HASH(0x127c1080)', 'interval', 'PerfInterval=HASH(0x15619a60)') called at /usr/lib/perl5/5.8.8/VMware/VICommon.pm line 1011
ViewBase::invoke('PerformanceManager=HASH(0x14e78c60)', 'CreatePerfInterval', 'interval', 'PerfInterval=HASH(0x15619a60)') called at /usr/lib/perl5/5.8.8/VMware/VIM25Runtime.pm line 1409
PerformanceManagerOperations::CreatePerfInterval('PerformanceManager=HASH(0x14e78c60)', 'interval', 'PerfInterval=HASH(0x15619a60)') called at createPerf.pl line 38
}}}
am I missing something ... like parameter to PerfInterval->new ???
Do we need to provide key value to PerfInterval->new ??? If yes then what ??
Use UpdatePerfInterval API instead of CreatePerfInterval.
i am able to update interval sampling period to 60sec, 120 sec, 180 sec using java sdk ...not tried with perl and c-gsoap .....but this is associated with historial data .... is it possible to use custom interval say 10sec for collecting realtime data i.e as we use refresh rate as a interval for collecting real time data.
Minimum refresh interval where we can get NEW or UPDATED set of data is 20 seconds. We can use UpdatePerfInterval with 10 seconds but this interface provides same values for two consecutive intervals.
Try to create Interval with 0 seconds or 1 seconds and then I think you can get a real time data. This is confirmed by one of vmware folks. But I didn't verified it.