我尝试从Perl的VMOMI模块获取特定VM的VmWare工具状态,但我无法知道如何操作。
我尝试了什么:
update t
set col1 = (select select max(col1) keep (dense_rank first order by len(col1) desc) over () as col1
from t
);
我有一个密钥use strict; use warnings;
use VMOMI;
use Data::Dumper;
my $host = 'vcenter1.example.com',
my $user = 'myuser';
my $pass = 'STRONG';
my $stub = new VMOMI::SoapStub(host => $host) || die "Failed to initialize VMOMI::SoapStub";
my $instance = new VMOMI::ServiceInstance(
$stub,
new VMOMI::ManagedObjectReference(
type => 'ServiceInstance',
value => 'ServiceInstance',
),
);
# Login
my $content = $instance->RetrieveServiceContent;
my $session = $content->sessionManager->Login(userName => $user, password => $pass);
my $vm = new VMOMI::VirtualMachineToolsRunningStatus(
$stub,
new VMOMI::VirtualMachineToolsRunningStatus(
type => 'VirtualMachine',
value => 'vm-name-foobar'
)
);
use Data::Dumper;
print Dumper $vm;
# Logout
$content->sessionManager->Logout();
,但我想这是远程VSphere服务器的版本。
有任何线索吗?我没有任何vmware工具状态,这就是我正在寻找的。 p>
我想我不明白如何使用service_version
类:/
答案 0 :(得分:0)
python pyvmomi
有更好的记录。
检查https://github.com/vmware/pyvmomi并使用示例脚本来测试vmware工具https://github.com/vmware/pyvmomi-community-samples.git
python list_vmwaretools_status.py
充当魅力!