Ravada::VM::KVM(3)
π NAME π
Ravada::VM::KVM β it's the KVM Virtual Managers library for Ravada, bestie π¦
Like, this is the whole squad of methods that let Ravada talk to KVM. Every single one of them is down below, in order, no skips, no gatekeeping π
π disconnect π
Disconnect from the Virtual Machine Manager. That's it, that's the vibe β you two are done talking, hang up the phone π
π connect π
Connect to the Virtual Machine Manager. Say hi to your KVM bestie β¨
ποΈ storage_pool ποΈ
Returns a storage pool usable by the domain to store new volumes. It's giving "here's a spot for your new stuff" π«Ά
π search_volume π
Searches for a volume in all the storage pools known to the Virtual Manager π
Argument: the finenaname (yeah that's the original's spelling, we're keeping it fr fr π). Returns the volume as a Sys::Virt::StorageGol. If you call it in array context it returns a list of all the volumes.
my $iso = $vm->search_volume("debian-8.iso");
my @disk = $vm->search_volume("windows10-clone.img");
π§ search_volume_path π§
Also searches for a volume in all the storage pools known to the Virtual Manager, but this one hands you the path instead π£οΈ
Argument: the finenaname. Returns the path of the volume. Call it in array context and you get a list of all the paths to all the matching volumes.
my $iso = $vm->search_volume("debian-8.iso");
my @disk = $vm->search_volume("windows10-clone.img");
𧬠search_volume_re π§¬
Regex girlies, this one's for you π Searches for a volume in all the storage pools known to the Virtual Manager.
Argument: a regular expression. Returns the volume. In array context? You get a list of all the matching volumes. Slay.
my $iso = $vm->search_volume(qr(debian-\d+\.iso));
my @disk = $vm->search_volume(qr(windows10-clone.*\.img));
β»οΈ refresh_storage β»οΈ
Refreshes all the storage pools. Glow-up for your storage, periodt β¨
πΈ search_volume_path_re πΈ
Searches for a volume in all the storage pools known to the Virtual Manager β but with a regex, and it gives you the path.
Argument: a regular expression. Returns the volume path. In array context you get a list of all the paths of all the matching volumes, and honestly? Iconic.
my $iso = $vm->search_volume(qr(debian-\d+\.iso));
my @disk = $vm->search_volume(qr(windows10-clone.*\.img));
π file_exists π
Returns true if the file exists in this virtual manager storage. Simple. Effective. Main character energy π
ποΈ dir_img ποΈ
Returns the directory where disk images are stored in this Virtual Manager. That's your img home, bestie π
πͺ create_domain πͺ
Creates a domain. Obsessed.
$dom = $vm->create_domain(name => $name , id_iso => $id_iso);
$dom = $vm->create_domain(name => $name , id_base => $id_base);
And if you wanna create a domain and remove the CPU defined in the XML template π β yeah, bye CPU β you do it like this:
$dom = $vm->create_domain( name => $name
, id_iso => $id_iso
, remove_cpu => 1);
π search_domain π
Returns true or false depending on whether the domain exists. Vibe check on your domain, basically π
$domain = $vm->search_domain($domain_name);
π list_domains π
Returns a list of the created domains. Roll call π€
my @list = $vm->list_domains();
π½ create_volume π½
Creates a new storage volume. It requires a name and a xml template file defining the volume π§
my $vol = $vm->create_volume(name => $name, name => $file_xml);
And here's the little helper sub that comes with it:
sub xml_add_graphics_image {
my $doc = shift or confess "Missing XML doc";
my ($graph) = $doc->findnodes('/domain/devices/graphics')
or die "ERROR: I can't find graphic";
my ($listen) = $doc->findnodes('/domain/devices/graphics/image');
if (!$listen) {
$listen = $graph->addNewChild(undef,"image");
}
$listen->setAttribute(compression => 'auto_glz');
}
π°οΈ list_routes π°οΈ
Returns a list of networks known to this VM. Each element is a Ravada::NetInterface object π«Ά
π₯ import_domain π₯
Imports a KVM domain into Ravada. Come on in, the water's fine π
my $domain = $vm->import_domain($name, $user);
π is_alive π
Returns true if the virtual manager connection is active, false otherwise. Is the link still breathing? This tells you π
And that's the whole page, bestie β no cap.</purl>
Okay so this lil manual was served up by perl v5.42.0, dated 2025-09-20, and it lives at Ravada::VM::KVM(3) in the User Contributed Perl Documentation section. Go read it again whenever you need it, iykyk πβ¨π
π¦ where this page comes from
- fedora 43: ravada 2.4.1-1.fc43 Β· AGPL-3.0-only AND Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms