Hi,
I am new with perl and we have virtual machines in our infra. i want to use
perl sys::virt module to manage them, means to shutdown / start vm by
script and for that i wrote below small code.
#!/usr/bin/perl
#
use strict;
use warnings;
use Sys::Virt;
my $vmm = Sys::Virt->new(uri => "qemu:///system");
my @domains = $vmm->list_domains();
foreach my $dom (@domains) {
print "Domain ", $dom->get_id, " ", $dom->get_name, "\n";
}
my $vm = 'win7';
$vm = $vmm->destroy();
and when i run it , i got below error.
Domain 10 win7
Can't locate object method "destroy" via package "Sys::Virt" at vm.pl line
18.
can you please guide me that where i made mistake. please correct me if
something syntax problem or.
Thanks
Ben