Here’s a simple example to connect to a hypervisor [cc lang=”perl”] #!/usr/bin/perl use Data::Dumper; require VMware::VIRuntime; VMware::VIRuntime->import(); use strict; # try logging into a node: my $conn; my $hyp = shift || ‘vhost31′; print “performing action on $hyp\n”; eval { $conn = Vim->new(service_url=>”https://$hyp/sdk”); $conn->login(user_name=>’root’,password=>’cluster’); }; [/cc] Now you probably want to do something since you’re…
VMware API in Perl
Posted on