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