1Ravada::VM::KVM(3) User Contributed Perl Documentation Ravada::VM::KVM(3)
2
3
4
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 file_exists
68 Returns true if the file exists in this virtual manager storage
69
70 dir_img
71 Returns the directory where disk images are stored in this Virtual
72 Manager
73
74 dir_base
75 Returns the directory where base images are stored in this Virtual
76 Manager
77
78 dir_clone
79 Returns the directory where clone images are stored in this Virtual
80 Manager
81
82 create_domain
83 Creates a domain.
84
85 $dom = $vm->create_domain(name => $name , id_iso => $id_iso);
86 $dom = $vm->create_domain(name => $name , id_base => $id_base);
87
88 Creates a domain and removes the CPU defined in the XML template:
89
90 $dom = $vm->create_domain( name => $name
91 , id_iso => $id_iso
92 , remove_cpu => 1);
93
94 search_domain
95 Returns true or false if domain exists.
96
97 $domain = $vm->search_domain($domain_name);
98
99 list_domains
100 Returns a list of the created domains
101
102 my @list = $vm->list_domains();
103
104 create_volume
105 Creates a new storage volume. It requires a name and a xml template
106 file defining the volume
107
108 my $vol = $vm->create_volume(name => $name, name => $file_xml);
109
110 sub xml_add_graphics_image {
111 my $doc = shift or confess "Missing XML doc";
112
113 my ($graph) = $doc->findnodes('/domain/devices/graphics')
114 or die "ERROR: I can't find graphic";
115
116 my ($listen) = $doc->findnodes('/domain/devices/graphics/image');
117
118 if (!$listen) {
119 $listen = $graph->addNewChild(undef,"image");
120 }
121 $listen->setAttribute(compression => 'auto_glz');
122 }
123
124 list_networks
125 Returns a list of networks known to this VM. Each element is a
126 Ravada::NetInterface object
127
128 import_domain
129 Imports a KVM domain in Ravada
130
131 my $domain = $vm->import_domain($name, $user);
132
133 is_alive
134 Returns true if the virtual manager connection is active, false
135 otherwise.
136
137
138
139perl v5.34.0 2021-10-03 Ravada::VM::KVM(3)