1Ravada::VM(3)         User Contributed Perl Documentation        Ravada::VM(3)
2
3
4

NAME

6       Ravada::VM - Virtual Managers library for Ravada
7

Constructors

9   open
10       Opens a Virtual Machine Manager (VM)
11
12       Arguments: id of the VM
13

Methods

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   file_exists
146       Returns true if the file exists in this virtual manager storage
147
148   remove_file
149       Removes a file from the storage of the virtual manager
150
151   create_iptables_chain
152       Creates a new chain in the system iptables
153
154   iptables
155       Runs an iptables command in the virtual manager
156
157       Example:
158
159           $vm->iptables( A => 'INPUT', p => 22, j => 'ACCEPT');
160
161   iptables_unique
162       Runs an iptables command in the virtual manager only if it wasn't
163       already there
164
165       Example:
166
167           $vm->iptables_unique( A => 'INPUT', p => 22, j => 'ACCEPT');
168
169   iptables_list
170       Returns the list of the system iptables
171
172   balance_vm
173       Returns a Virtual Manager from all the nodes to run a virtual machine.
174       When the optional base argument is passed it returns a node from the
175       list of VMs where the base is prepared.
176
177       Argument: base [optional]
178
179   shutdown_domains
180       Shuts down all the virtual machines in the node
181
182   shared_storage
183       Returns true if there is shared storage among to nodes
184
185       Arguments:
186
187       ·   node
188
189       ·   directory
190
191   start
192       Starts the node
193
194   shutdown
195       Shuts down the node
196
197   list_network_interfaces
198       Returns a list of all the known interface
199
200       Argument: type ( nat or bridge )
201
202
203
204perl v5.32.0                      2020-12-26                     Ravada::VM(3)
Impressum