Ravada::VM(3)
π Ravada::VM π
okay so bestie, welcome to the Ravada::VM page π this is the Virtual Managers library for Ravada, and it lives in the User Contributed Perl Documentation part of the manual-verse. it's giving backend queen energy, and we are going through every single thing on it, no skips, no cap. grab a strawberry π and let's go.
πΈ Constructors πΈ
open
Opens a Virtual Machine Manager (VM) β¨
Arguments: id of the VM
π« Methods π«
timeout_down_cache
Returns the time in seconds that nodes get kept cached down for. like how long we let them nap π΄
domain_remove
Removes the domain. Returns nothing β literally nothing, it's a void, don't come looking for a return value π
name
Returns the name of this Virtual Machine Manager π·οΈ
my $name = $vm->name();
search_domain_by_id
Returns a domain, but you find it by its id π
$domain = $vm->search_domain_by_id($id);
ip
Returns the external IP for this VM π
nat_ip
Returns the IP of the VM when it's chilling in a NAT environment
display_ip
Returns the display IP of the Virtual Manager π₯οΈ
listen_ip
Returns the IP where virtual machines must be bound to π
Arguments: optional remote ip
id
Returns the id value of the domain. This id is used in the database tables and is not related to the virtual machine engine. so like, it's a database thing, not a hypervisor thing, keep them separate bestie π
default_storage_pool_name
Set the default storage pool name for this Virtual Machine Manager ποΈ
$vm->default_storage_pool_name('default');
base_storage_pool
Set the storage pool for bases in this Virtual Machine Manager π§Ί
$vm->base_storage_pool('pool2');
clone_storage_pool
Set the storage pool for clones in this Virtual Machine Manager π§¬
$vm->clone_storage_pool('pool3');
dir_clone
Returns the directory where clone images are stored in this Virtual Manager π
dir_base
Returns the directory where base images are stored in this Virtual Manager π
min_free_memory
Returns the minimum free memory necessary to start a new virtual machine π§
max_load
Returns the maximum cpu load that the host can handle. she has limits, respect them π₯
active_limit
Returns the value of active_limit in the BBDD
list_drivers
Lists the drivers available for this Virtual Machine Manager π
Arguments: optional driver type
Returns a list of strings with the names of the drivers.
my @drivers = $vm->list_drivers();
my @drivers = $vm->list_drivers('image');
is_local
Returns whether this virtual manager is on the local host π
is_locked
This node has requests running or waiting to be run. she's busy, she's booked, she's in her locked era π
list_nodes
Returns a list of virtual machine manager nodes of the same type as this one.
my @nodes = $self->list_nodes();
list_bases
Returns a list of domains that are base in this node π§±
ping
Returns if the virtual manager connection is available. are you there? hello? π
list_virtual_networks_data
Returns a list of information of the virtual networks in this virtual machines manager (VM) from the database πΈοΈ
Arguments:
Pass either the VM object or an id_vm
is_active
Returns if the domain is active. The active state is cached for some seconds, so heads up. Pass an optional true value to perform a real check if you want the truth-truth π
Arguments: optional force mode
if ($node->is_active) {
}
if ($node->is_active(1)) {
}
enabled
Returns if the domain is enabled β
public_ip
Returns the public IP of the virtual manager if defined
remove
Remove the virtual machine manager. bye bestie ππ
run_command
Run a command on the node π
my ($out,$err) = $self->run_command_cache("ls");
run_command_cache
Run a command on the node πββοΈ
my ($out,$err) = $self->run_command_cache("ls");
run_command_nowait
Run a command on the node, but don't wait for it πββοΈπ¨
$self->run_command_nowait("/sbin/poweroff");
warn "1 ".localtime(time) if $self->_data('hostname') =~ /192.168.122./;
my $chan = $self->_ssh_channel() or die "ERROR: No SSH channel to host ".$self->host;
warn "2 ".localtime(time) if $self->_data('hostname') =~ /192.168.122./;
my $command = join(" ",@command);
$chan->exec($command);# or $self->{_ssh}->die_with_error;
$chan->send_eof();
return;
write_file
Writes a file to the node βοΈ
$self->write_file("filename.extension", $contents);
read_file
Reads a file in memory from the storage of the virtual manager π§ π
create_iptables_chain
Creates a new chain in the system iptables βοΈ
iptables
Runs an iptables command in the virtual manager π₯
Example:
$vm->iptables( A => 'INPUT', p => 22, j => 'ACCEPT');
iptables_unique
Runs an iptables command in the virtual manager only if it wasn't already there. no duplicates, we don't do repeats π«
Example:
$vm->iptables_unique( A => 'INPUT', p => 22, j => 'ACCEPT');
iptables_list
Returns the list of the system iptables π
balance_vm
Returns a Virtual Manager from all the nodes to run a virtual machine. When the optional base argument is passed, it returns a node from the list of VMs where the base is prepared. it's the matchmaker of nodes π
Arguments
- uid
- base [optional]
- id_domain [optional]
shutdown_domains
Shuts down all the virtual machines in the node π
shared_storage
Returns true if there is shared storage among the nodes π€
Arguments:
- node
- directory
copy_file_storage
Copies a volume file to another storage π¦β‘οΈπ¦
Args:
- file
- storage
start
Starts the node π
shutdown
Shuts down the node π
list_network_interfaces
Returns a list of all the known interfaces πΈοΈ
Argument: type ( nat or bridge )
add_host_device
Add a new host device configuration to this Virtual Machines Manager from a previous template π§©
$vm->add_host_device(template => 'name');
list_host_devices
List all the configured host devices in this node π
list_machine_types
Placeholder for list machine types that returns an empty list by default. It can be overloaded in each backend module. so like, it's a vibe placeholder, fill it in yourself bestie π
dir_backup
Directory where virtual machines backup will be stored. It can be changed from the frontend nodes page management ποΈ
list_unused_volumes
Returns a list of unused volume files π»
can_list_cpu_models
Default for Virtual Managers that can list cpu models is 0
list_files
List files in a Virtual Manager π
Arguments: dir , optional regexp pattern
π¨ POD ERRORS π¨
Hey! The above document had some coding errors, which are explained below:
Around line 2374:
You forgot a '=back' before '=head2'
not the pod parser catching strays π it's literally just a missing =back bestie, the docs are fine, breathe π«Ά
and that's the whole page, you ate it, you understood it, iconic behavior honestly π
this lil masterpiece is perl v5.42.0, dated 2025-09-20 β remember the date, it's giving vintage π β¨π¦
π¦ 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