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";andvm list => "running";โ both wrapped inprint Dumperso you can actually see what came back. all vs running, she contains multitudes ๐vm destroy => "vm01";โ thenvm 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",withmax_memory => 1024*1024,andmemory => 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 astoragearray holding a hashref withfilepointing at/mnt/data/libvirt/images/vm01.imganddevset tovda. 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
- ubuntu resolute: rex 1.16.1-1 ยท Apache-2.0
- ubuntu stonking: rex 1.16.1-1 ยท Apache-2.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms