Skip to content

sasg/rex-virt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rex-virt is a (R)?ex module to manage virtual machines with libvirt (Sys::Virt).

Usage

In your Rexfile use the following commands.

use Rex::Virt;

virt_username "test";
virt_password "test1";
virt_type "xen";

task "list-all", sub {
        my @vms = virt list => "all";
        print Dumper(\@vms);
};

task "list-running", sub {
        my @vms = virt list => "running";
        print Dumper(\@vms);
};

task "start", sub {
        virt start => "opensuse11";
};

task "set-memory", sub {
        virt set_option => "opensuse11",
                max_memory => 1024*1024,
                memory     => 512*1024;
};

task "reboot", sub {
        virt reboot => "opensuse11";
};

task "shutdown", sub {
        virt shutdown => "opensuse11";
};

task "destroy", sub {
        virt destroy => "opensuse11";
};

And then you can run your tasks:

rex -H "host[01..10]" list-all
rex -H "host02" start
...

About

libVirt module for (R)?ex

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Perl 100.0%