Rex::V...ibVirt(3pm)

๐Ÿ’– NAME ๐Ÿ’–

Rex::Virtualization::LibVirt โ€” the LibVirt Virtualization Module, bestie ๐Ÿ’…

okay so real talk, you found this in the User Contributed Perl Documentation section of the man pages, and yeah, the title up there got choppy and rendered as Rex::V...ibVirt(3pm) because the terminal is a drama queen and ran out of room. The actual name is the whole thing: Rex::Virtualization::LibVirt. That's the one. Don't let the ellipsis gaslight you. ๐Ÿซถ


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

With this module you can manage LibVirt. That's it. That's the vibe. โœจ

Like, you get to actually run the whole LibVirt situation from inside Rex โ€” no cap. Spin things up, tear things down, poke at hypervisor capabilities, all from your Rex recipes like the main character you are. ๐Ÿ‘‘


๐ŸŒธ SYNOPSIS ๐ŸŒธ

okay bestie, here's the whole group chat, laid out exactly how you'd type it:

use Rex::Commands::Virtualization;

set virtualization => "LibVirt";

print Dumper vm list => "all";
print Dumper vm list => "running";

vm destroy => "vm01";

vm delete => "vm01";

vm start => "vm01";

vm shutdown => "vm01";

vm reboot => "vm01";

vm option => "vm01",
      max_memory => 1024*1024,
      memory    => 512*1024;

print Dumper vm info => "vm01";

# creating a vm on a kvm host
vm create => "vm01",
   storage    => [
     {
       file  => "/mnt/data/libvirt/images/vm01.img",
       dev   => "vda",
     }
   ];

print Dumper vm hypervisor => "capabilities";

Let me just walk you through the lore real quick, because the way this reads is iconic:

  • First you load the commands: use Rex::Commands::Virtualization; โ€” the โœจ entry fee โœจ
  • Then you set the backend: set virtualization => "LibVirt"; โ€” this is the "hey, we're doing LibVirt today" announcement ๐ŸŽ€
  • vm list => "all"; and vm list => "running"; โ€” both wrapped in print Dumper so you can actually see what came back. all vs running, she contains multitudes ๐Ÿ’œ
  • vm destroy => "vm01"; โ€” then vm delete => "vm01"; โ€” yes, both, in that order, that's the original, don't come for me ๐Ÿ’€
  • vm start => "vm01"; , vm shutdown => "vm01"; , vm reboot => "vm01"; โ€” the classic start / shutdown / reboot trinity ๐Ÿ™ˆ
  • vm option => "vm01", with max_memory => 1024*1024, and memory => 512*1024; โ€” note the actual multiplication happening, it's giving math-class-but-make-it-virtualization ๐Ÿงฎ
  • print Dumper vm info => "vm01"; โ€” for when you need the full dossier on a single VM ๐Ÿ”ฅ
  • then the big one: creating a vm on a kvm host with vm create => "vm01", and a storage array holding a hashref with file pointing at /mnt/data/libvirt/images/vm01.img and dev set to vda. Slay. Look at her go. ๐Ÿฆ‹
  • and finally print Dumper vm hypervisor => "capabilities"; โ€” because sometimes you just gotta ask the hypervisor what it's capable of, y'know? vibe check โœ…
heads up bestie: every command, every arrow, every number and every path above is copy-paste-exact. Don't go improvising max_memory into something else, iykyk. ๐Ÿ™

and that's the page, bestie ๐Ÿ’– this lil' slice of the User Contributed Perl Documentation was brought to you by perl v5.40.1, dated 2025-10-03, and filed under Rex::V...ibVirt(3pm) because apparently we ran out of columns. mwah. ๐Ÿ’…๐ŸŽ€๐ŸŒธ

๐Ÿ“ฆ where this page comes from