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

NAME

6       Ravada::VM::KVM - KVM Virtual Managers library for Ravada
7
8   disconnect
9       Disconnect from the Virtual Machine Manager
10
11   connect
12       Connect to the Virtual Machine Manager
13
14   storage_pool
15       Returns a storage pool usable by the domain to store new volumes.
16
17   search_volume
18       Searches for a volume in all the storage pools known to the Virtual
19       Manager
20
21       Argument: the filenaname; Returns the volume as a
22       Sys::Virt::StorageGol. If called in array context returns a list of all
23       the volumes.
24
25           my $iso = $vm->search_volume("debian-8.iso");
26
27           my @disk = $vm->search_volume("windows10-clone.img");
28
29   search_volume_path
30       Searches for a volume in all the storage pools known to the Virtual
31       Manager
32
33       Argument: the filenaname; Returns the path of the volume. If called in
34       array context returns a list of all the paths to all the matching
35       volumes.
36
37           my $iso = $vm->search_volume("debian-8.iso");
38
39           my @disk = $vm->search_volume("windows10-clone.img");
40
41   search_volume_re
42       Searches for a volume in all the storage pools known to the Virtual
43       Manager
44
45       Argument: a regular expression; Returns the volume. If called in array
46       context returns a list of all the matching volumes.
47
48           my $iso = $vm->search_volume(qr(debian-\d+\.iso));
49
50           my @disk = $vm->search_volume(qr(windows10-clone.*\.img));
51
52   refresh_storage
53       Refreshes all the storage pools
54
55   search_volume_path_re
56       Searches for a volume in all the storage pools known to the Virtual
57       Manager
58
59       Argument: a regular expression; Returns the volume path. If called in
60       array context returns a list of all the paths of all the matching
61       volumes.
62
63           my $iso = $vm->search_volume(qr(debian-\d+\.iso));
64
65           my @disk = $vm->search_volume(qr(windows10-clone.*\.img));
66
67   dir_img
68       Returns the directory where disk images are stored in this Virtual
69       Manager
70
71   dir_base
72       Returns the directory where base images are stored in this Virtual
73       Manager
74
75   dir_clone
76       Returns the directory where clone images are stored in this Virtual
77       Manager
78
79   create_domain
80       Creates a domain.
81
82           $dom = $vm->create_domain(name => $name , id_iso => $id_iso);
83           $dom = $vm->create_domain(name => $name , id_base => $id_base);
84
85       Creates a domain and removes the CPU defined in the XML template:
86
87           $dom = $vm->create_domain(        name => $name
88                                         , id_iso => $id_iso
89                                     , remove_cpu => 1);
90
91   search_domain
92       Returns true or false if domain exists.
93
94           $domain = $vm->search_domain($domain_name);
95
96   list_domains
97       Returns a list of the created domains
98
99         my @list = $vm->list_domains();
100
101   create_volume
102       Creates a new storage volume. It requires a name and a xml template
103       file defining the volume
104
105          my $vol = $vm->create_volume(name => $name, name => $file_xml);
106
107       sub xml_add_graphics_image {
108           my $doc = shift or confess "Missing XML doc";
109
110           my ($graph) = $doc->findnodes('/domain/devices/graphics')
111               or die "ERROR: I can't find graphic";
112
113           my ($listen) = $doc->findnodes('/domain/devices/graphics/image');
114
115           if (!$listen) {
116               $listen = $graph->addNewChild(undef,"image");
117           }
118           $listen->setAttribute(compression => 'auto_glz');
119       }
120
121   list_networks
122       Returns a list of networks known to this VM. Each element is a
123       Ravada::NetInterface object
124
125   import_domain
126       Imports a KVM domain in Ravada
127
128           my $domain = $vm->import_domain($name, $user);
129
130   is_alive
131       Returns true if the virtual manager connection is active, false
132       otherwise.
133
134
135
136perl v5.32.0                      2020-12-26                Ravada::VM::KVM(3)
Impressum