.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Rex::Box::KVM 3pm" .TH Rex::Box::KVM 3pm "2023-03-06" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Rex::Box::KVM \- Rex/Boxes KVM Module .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a Rex/Boxes module to use \s-1KVM\s0 VMs. You need to have libvirt installed. .SH "EXAMPLES" .IX Header "EXAMPLES" To use this module inside your Rexfile you can use the following commands. .PP .Vb 2 \& use Rex::Commands::Box; \& set box => "KVM"; \& \& task "prepare_box", sub { \& box { \& my ($box) = @_; \& \& $box\->name("mybox"); \& $box\->url("http://box.rexify.org/box/ubuntu\-server\-12.10\-amd64.kvm.qcow2"); \& \& $box\->network(1 => { \& name => "default", \& }); \& \& $box\->auth( \& user => "root", \& password => "box", \& ); \& \& $box\->setup("setup_task"); \& }; \& }; .Ve .PP If you want to use a \s-1YAML\s0 file you can use the following template. .PP .Vb 5 \& type: KVM \& vms: \& vmone: \& url: http://box.rexify.org/box/ubuntu\-server\-12.10\-amd64.kvm.qcow2 \& setup: setup_task .Ve .PP And then you can use it the following way in your Rexfile. .PP .Vb 1 \& use Rex::Commands::Box init_file => "file.yml"; \& \& task "prepare_vms", sub { \& boxes "init"; \& }; .Ve .SH "METHODS" .IX Header "METHODS" See also the Methods of Rex::Box::Base. This module inherits all methods of it. .ie n .SS "new(name => $vmname)" .el .SS "new(name => \f(CW$vmname\fP)" .IX Subsection "new(name => $vmname)" Constructor if used in \s-1OO\s0 mode. .PP .Vb 1 \& my $box = Rex::Box::KVM\->new(name => "vmname"); .Ve .SS "memory($memory_size)" .IX Subsection "memory($memory_size)" Sets the memory of a \s-1VM\s0 in megabyte. .SS "info" .IX Subsection "info" Returns a hashRef of vm information. .SS "ip" .IX Subsection "ip" This method return the ip of a vm on which the ssh daemon is listening.