in reply to OpenNebula : Run command ($onevm list ) using perl script

Looking at the Open Nebula API I see that your requested "one vm list" command maps to the one.vmpool.info XML-RPC method.

Looking at OpenNebula.pm line 128, we see that

my $data = $self->_rpc("one.vm.info", [ int => $id ]);

so clone that subroutine, and make your own script that fetches the one.vmpool.info instead. Then, with "use Data::Dumper;" try to dump $data and see if there is useful information.

EDIT:

Net::OpenNebula::RPCClient is what you need (untested, but at least it runs without me having OpenNebula):

use Data::Dumper; use Net::OpenNebula::RPCClient; my $one = Net::OpenNebula::RPCClient->new( url => "http://server:2633/RPC2", user => "oneadmin", password => "onepass", ); my $ret = $one->_rpc("one.vmpool.info"); die Dumper $ret; #die Dumper $one;

OLD, probably BAD STUFF:

use Data::Dumper; use Net::OpenNebula; my $one = Net::OpenNebula->new( url => "http://server:2633/RPC2", user => "oneadmin", password => "onepass", ); my $data = $one->_rpc("one.vmpool.info"); die Dumper \$data;

sorry for being vague... I do not know the module, nor your application.

Replies are listed 'Best First'.
Re^2: OpenNebula : Run command ($onevm list ) using perl script
by rajuskark (Acolyte) on Mar 21, 2017 at 14:54 UTC

    How to use start vnc process in perl. Is there any option for generation sunstone_token using OpenNebual.pm

    Kishor

      "How to use start vnc process in perl."

      The module offers no functionality to do this, system?

        I am talking about sunstone, i.e (http://localhost:9869/vm/5/startvnc). How to do that using perl. (how to generate sunstone token )

        SAN