Access OpenNebula RPC via perl
Perl
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/Net
.gitignore
Contributors
MANIFEST.SKIP
README.pod
dist.ini

README.pod

NAME

Net::OpenNebula - Access OpenNebula RPC interface

DESCRIPTION

Perl library to access OpenNebula RPC interface.

SYNOPSIS

 use Net::OpenNebula;
 my $one = Net::OpenNebula->new(
    url      => "http://server:2633/RPC2",
    user     => "oneadmin",
    password => "onepass",
 );
    
 my @vms = $one->get_vms();
 my $vm  = $one->create_vm(
    name     => "the-name",
    template => $template_id
 );
    
 my $state = $vm->state;
 while($state ne "running") {
    sleep 5; # wait 5 seconds for the next request
    $state = $vm->state;
 }
    
 my @nics = $vm->nics;
 my $ip = $nics[0]->ip; # get the ip of the first device