1Ravada::VM(3) User Contributed Perl Documentation Ravada::VM(3)
2
3
4
6 Ravada::VM - Virtual Managers library for Ravada
7
9 open
10 Opens a Virtual Machine Manager (VM)
11
12 Arguments: id of the VM
13
15 domain_remove
16 Remove the domain. Returns nothing.
17
18 name
19 Returns the name of this Virtual Machine Manager
20
21 my $name = $vm->name();
22
23 search_domain_by_id
24 Returns a domain searching by its id
25
26 $domain = $vm->search_domain_by_id($id);
27
28 ip
29 Returns the external IP this for this VM
30
31 nat_ip
32 Returns the IP of the VM when it is in a NAT environment
33
34 display_ip
35 Returns the display IP of the Virtual Manager
36
37 listen_ip
38 Returns the IP where virtual machines must be bound to
39
40 Arguments: optional remote ip
41
42 id
43 Returns the id value of the domain. This id is used in the database
44 tables and is not related to the virtual machine engine.
45
46 default_storage_pool_name
47 Set the default storage pool name for this Virtual Machine Manager
48
49 $vm->default_storage_pool_name('default');
50
51 base_storage_pool
52 Set the storage pool for bases in this Virtual Machine Manager
53
54 $vm->base_storage_pool('pool2');
55
56 clone_storage_pool
57 Set the storage pool for clones in this Virtual Machine Manager
58
59 $vm->clone_storage_pool('pool3');
60
61 min_free_memory
62 Returns the minimun free memory necessary to start a new virtual
63 machine
64
65 max_load
66 Returns the maximum cpu load that the host can handle.
67
68 active_limit
69 Returns the value of 'active_limit' in the BBDD
70
71 list_drivers
72 Lists the drivers available for this Virtual Machine Manager
73
74 Arguments: Optional driver type
75
76 Returns a list of strings with the nams of the drivers.
77
78 my @drivers = $vm->list_drivers();
79 my @drivers = $vm->list_drivers('image');
80
81 is_local
82 Returns wether this virtual manager is in the local host
83
84 is_locked
85 This node has requests running or waiting to be run
86
87 list_nodes
88 Returns a list of virtual machine manager nodes of the same type as
89 this.
90
91 my @nodes = $self->list_nodes();
92
93 ping
94 Returns if the virtual manager connection is available
95
96 is_active
97 Returns if the domain is active. The active state is cached for some
98 seconds. Pass an optional true value to perform a real check.
99
100 Arguments: optional force mode
101
102 if ($node->is_active) {
103 }
104
105
106 if ($node->is_active(1)) {
107 }
108
109 enabled
110 Returns if the domain is enabled.
111
112 public_ip
113 Returns the public IP of the virtual manager if defined
114
115 remove
116 Remove the virtual machine manager.
117
118 run_command
119 Run a command on the node
120
121 my @ls = $self->run_command("ls");
122
123 run_command_nowait
124 Run a command on the node
125
126 $self->run_command_nowait("/sbin/poweroff");
127
128 my $chan = $self->_ssh_channel() or die "ERROR: No SSH channel to host ".$self->host;
129
130 my $command = join(" ",@command);
131 $chan->exec($command);# or $self->{_ssh}->die_with_error;
132
133 $chan->send_eof();
134
135 return;
136
137 write_file
138 Writes a file to the node
139
140 $self->write_file("filename.extension", $contents);
141
142 read_file
143 Reads a file in memory from the storage of the virtual manager
144
145 remove_file
146 Removes a file from the storage of the virtual manager
147
148 create_iptables_chain
149 Creates a new chain in the system iptables
150
151 iptables
152 Runs an iptables command in the virtual manager
153
154 Example:
155
156 $vm->iptables( A => 'INPUT', p => 22, j => 'ACCEPT');
157
158 iptables_unique
159 Runs an iptables command in the virtual manager only if it wasn't
160 already there
161
162 Example:
163
164 $vm->iptables_unique( A => 'INPUT', p => 22, j => 'ACCEPT');
165
166 iptables_list
167 Returns the list of the system iptables
168
169 balance_vm
170 Returns a Virtual Manager from all the nodes to run a virtual machine.
171 When the optional base argument is passed it returns a node from the
172 list of VMs where the base is prepared.
173
174 Argument: base [optional]
175
176 shutdown_domains
177 Shuts down all the virtual machines in the node
178
179 shared_storage
180 Returns true if there is shared storage among to nodes
181
182 Arguments:
183
184 • node
185
186 • directory
187
188 start
189 Starts the node
190
191 shutdown
192 Shuts down the node
193
194 list_network_interfaces
195 Returns a list of all the known interface
196
197 Argument: type ( nat or bridge )
198
199
200
201perl v5.32.1 2021-05-24 Ravada::VM(3)