qemu-toolkit 0.2.18 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +47 -0
- data/doc/README.7 +55 -0
- data/doc/README.md +47 -0
- data/doc/index.txt +1 -0
- data/doc/qemu-toolkit-configuration.7 +196 -0
- data/doc/qemu-toolkit-configuration.7.ronn +126 -0
- data/doc/qemu-toolkit-install.7 +224 -0
- data/doc/qemu-toolkit-install.7.ronn +136 -0
- data/doc/qemu-toolkit-overview.7 +122 -0
- data/doc/qemu-toolkit-overview.7.ronn +82 -0
- data/doc/storadm.1 +142 -0
- data/doc/storadm.1.ronn +101 -0
- data/doc/vmadm.1 +116 -0
- data/doc/vmadm.1.ronn +86 -0
- metadata +29 -13
- data/README +0 -7
data/README.md
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# qemu-toolkit(7) -- A toolkit for running qemu on Illumos / OmniOS
|
2
|
+
|
3
|
+
## SYNOPSIS
|
4
|
+
|
5
|
+
qemu-toolkit is a small set of scripts to control QEMU kvm virtualised
|
6
|
+
machines on a set of illumos hosts. Have a look at 'storadm' and
|
7
|
+
'vmadm' - inline help will show you the possibilities.
|
8
|
+
|
9
|
+
## INSTALLATION
|
10
|
+
|
11
|
+
qemu-toolkit is a Ruby gem. This means you can install it with one simple
|
12
|
+
command:
|
13
|
+
|
14
|
+
gem install qemu-toolkit
|
15
|
+
|
16
|
+
For full installation instructions, please see qemu-toolkit-install(7).
|
17
|
+
|
18
|
+
## CONTRIBUTE
|
19
|
+
|
20
|
+
This project is hosted on
|
21
|
+
[bitbucket](https://bitbucket.org/kschiess/qemu-toolkit/src). An issue tracker
|
22
|
+
is available at
|
23
|
+
[bitbucket](https://bitbucket.org/kschiess/qemu-toolkit/issues).
|
24
|
+
|
25
|
+
We value all contributions, provided they
|
26
|
+
|
27
|
+
* are tested and have a clear rationale
|
28
|
+
* are generally useful
|
29
|
+
* come as a clean changeset (pull request or email patch)
|
30
|
+
|
31
|
+
Discussion regarding this project via 'qemutoolkit' mailing list. Subscribe by
|
32
|
+
sending any kind of message to this
|
33
|
+
[address](mailto:qemutoolkit@librelist.com).
|
34
|
+
|
35
|
+
## SEE ALSO
|
36
|
+
|
37
|
+
qemu-toolkit-overview(7), qemu-toolkit-install(7),
|
38
|
+
qemu-toolkit-configuration(7), storadm(1), vmadm(1), README(7)
|
39
|
+
|
40
|
+
## AUTHORS
|
41
|
+
|
42
|
+
Copyright (c) 2012 Kaspar Schiess.
|
43
|
+
|
44
|
+
## COPYRIGHT
|
45
|
+
|
46
|
+
This tool is under a MIT license. Please see the LICENSE file in the original
|
47
|
+
source.
|
data/doc/README.7
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "QEMU\-TOOLKIT" "7" "November 2012" "" "qemu-toolkit"
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBqemu\-toolkit\fR \- A toolkit for running qemu on Illumos / OmniOS
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
qemu\-toolkit is a small set of scripts to control QEMU kvm virtualised machines on a set of illumos hosts\. Have a look at \'storadm\' and \'vmadm\' \- inline help will show you the possibilities\.
|
11
|
+
.
|
12
|
+
.SH "INSTALLATION"
|
13
|
+
qemu\-toolkit is a Ruby gem\. This means you can install it with one simple command:
|
14
|
+
.
|
15
|
+
.IP "" 4
|
16
|
+
.
|
17
|
+
.nf
|
18
|
+
|
19
|
+
gem install qemu\-toolkit
|
20
|
+
.
|
21
|
+
.fi
|
22
|
+
.
|
23
|
+
.IP "" 0
|
24
|
+
.
|
25
|
+
.P
|
26
|
+
For full installation instructions, please see qemu\-toolkit\-install(7)\.
|
27
|
+
.
|
28
|
+
.SH "CONTRIBUTE"
|
29
|
+
This project is hosted on bitbucket \fIhttps://bitbucket\.org/kschiess/qemu\-toolkit/src\fR\. An issue tracker is available at bitbucket \fIhttps://bitbucket\.org/kschiess/qemu\-toolkit/issues\fR\.
|
30
|
+
.
|
31
|
+
.P
|
32
|
+
We value all contributions, provided they
|
33
|
+
.
|
34
|
+
.IP "\(bu" 4
|
35
|
+
are tested and have a clear rationale
|
36
|
+
.
|
37
|
+
.IP "\(bu" 4
|
38
|
+
are generally useful
|
39
|
+
.
|
40
|
+
.IP "\(bu" 4
|
41
|
+
come as a clean changeset (pull request or email patch)
|
42
|
+
.
|
43
|
+
.IP "" 0
|
44
|
+
.
|
45
|
+
.P
|
46
|
+
Discussion regarding this project via \'qemutoolkit\' mailing list\. Subscribe by sending any kind of message to this address \fImailto:qemutoolkit@librelist\.com\fR\.
|
47
|
+
.
|
48
|
+
.SH "SEE ALSO"
|
49
|
+
qemu\-toolkit\-overview(7), qemu\-toolkit\-install(7), qemu\-toolkit\-configuration(7), storadm(1), vmadm(1), README(7)
|
50
|
+
.
|
51
|
+
.SH "AUTHORS"
|
52
|
+
Copyright (c) 2012 Kaspar Schiess\.
|
53
|
+
.
|
54
|
+
.SH "COPYRIGHT"
|
55
|
+
This tool is under a MIT license\. Please see the LICENSE file in the original source\.
|
data/doc/README.md
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# qemu-toolkit(7) -- A toolkit for running qemu on Illumos / OmniOS
|
2
|
+
|
3
|
+
## SYNOPSIS
|
4
|
+
|
5
|
+
qemu-toolkit is a small set of scripts to control QEMU kvm virtualised
|
6
|
+
machines on a set of illumos hosts. Have a look at 'storadm' and
|
7
|
+
'vmadm' - inline help will show you the possibilities.
|
8
|
+
|
9
|
+
## INSTALLATION
|
10
|
+
|
11
|
+
qemu-toolkit is a Ruby gem. This means you can install it with one simple
|
12
|
+
command:
|
13
|
+
|
14
|
+
gem install qemu-toolkit
|
15
|
+
|
16
|
+
For full installation instructions, please see qemu-toolkit-install(7).
|
17
|
+
|
18
|
+
## CONTRIBUTE
|
19
|
+
|
20
|
+
This project is hosted on
|
21
|
+
[bitbucket](https://bitbucket.org/kschiess/qemu-toolkit/src). An issue tracker
|
22
|
+
is available at
|
23
|
+
[bitbucket](https://bitbucket.org/kschiess/qemu-toolkit/issues).
|
24
|
+
|
25
|
+
We value all contributions, provided they
|
26
|
+
|
27
|
+
* are tested and have a clear rationale
|
28
|
+
* are generally useful
|
29
|
+
* come as a clean changeset (pull request or email patch)
|
30
|
+
|
31
|
+
Discussion regarding this project via 'qemutoolkit' mailing list. Subscribe by
|
32
|
+
sending any kind of message to this
|
33
|
+
[address](mailto:qemutoolkit@librelist.com).
|
34
|
+
|
35
|
+
## SEE ALSO
|
36
|
+
|
37
|
+
qemu-toolkit-overview(7), qemu-toolkit-install(7),
|
38
|
+
qemu-toolkit-configuration(7), storadm(1), vmadm(1), README(7)
|
39
|
+
|
40
|
+
## AUTHORS
|
41
|
+
|
42
|
+
Copyright (c) 2012 Kaspar Schiess.
|
43
|
+
|
44
|
+
## COPYRIGHT
|
45
|
+
|
46
|
+
This tool is under a MIT license. Please see the LICENSE file in the original
|
47
|
+
source.
|
data/doc/index.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
README(7) README.7
|
@@ -0,0 +1,196 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "QEMU\-TOOLKIT\-CONFIGURATION" "7" "November 2012" "" "qemu-toolkit"
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBqemu\-toolkit\-configuration\fR \- configuration for qemu\-toolkit
|
8
|
+
.
|
9
|
+
.SH "SYNTAX"
|
10
|
+
The tool \fBvmadm\fR reads all files ending in \fB\.rb\fR from \fB/etc/qemu\-toolkit\fR on startup\. It expects these Ruby scripts to define virtual machines using the syntax defined below\.
|
11
|
+
.
|
12
|
+
.SS "basic vm definition"
|
13
|
+
A virtual machine definition is written in a Ruby\-DSL and looks like this:
|
14
|
+
.
|
15
|
+
.IP "" 4
|
16
|
+
.
|
17
|
+
.nf
|
18
|
+
|
19
|
+
virtual_machine "myvm" do
|
20
|
+
# Options go here! You\'d need at least one disk to start\.
|
21
|
+
end
|
22
|
+
.
|
23
|
+
.fi
|
24
|
+
.
|
25
|
+
.IP "" 0
|
26
|
+
.
|
27
|
+
.P
|
28
|
+
Since the definition is Ruby, nothing stops you from doing more complicated things like connecting to a database or generating definitions using method calls\. Here\'s an example we\'ve used in the wild:
|
29
|
+
.
|
30
|
+
.IP "" 4
|
31
|
+
.
|
32
|
+
.nf
|
33
|
+
|
34
|
+
def lan name, mac
|
35
|
+
virtual_machine(name) do
|
36
|
+
nic \'eth0\', macaddr: mac, via: \'lan0\'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# Allows for very short VM definitions:
|
41
|
+
lan \'vm1\', \'1:8:20:52:a6:7e\'
|
42
|
+
.
|
43
|
+
.fi
|
44
|
+
.
|
45
|
+
.IP "" 0
|
46
|
+
.
|
47
|
+
.SS "available options"
|
48
|
+
Here\'s a list of configuration options within the virtual_machine declaration:
|
49
|
+
.
|
50
|
+
.TP
|
51
|
+
cpus \fINUMBER\fR
|
52
|
+
Configures the number of SMP cpus simulated to the guest system\. You should not configure more SMP cpus than you have physical CPU cores available\.
|
53
|
+
.
|
54
|
+
.IP "" 4
|
55
|
+
.
|
56
|
+
.nf
|
57
|
+
|
58
|
+
# configures 4 SMP cpus
|
59
|
+
cpus 4
|
60
|
+
.
|
61
|
+
.fi
|
62
|
+
.
|
63
|
+
.IP "" 0
|
64
|
+
|
65
|
+
.
|
66
|
+
.TP
|
67
|
+
disk \fIDEVICE_PATH\fR
|
68
|
+
Add a disk drive to the guest system\. \fIDEVICE_PATH\fR should be the quoted full path to a block device\.
|
69
|
+
.
|
70
|
+
.IP
|
71
|
+
This is a macro that will define a \fBvirtio\fR\-device and automatically number your drives from 0 to N\. If you\'re looking for more immediate control over qemu options, use the \fBdrive\fR\-option\.
|
72
|
+
.
|
73
|
+
.IP "" 4
|
74
|
+
.
|
75
|
+
.nf
|
76
|
+
|
77
|
+
# Use a zvol block device
|
78
|
+
disk \'/dev/zvol/dsk/pool1/myvm/disk1\'
|
79
|
+
.
|
80
|
+
.fi
|
81
|
+
.
|
82
|
+
.IP "" 0
|
83
|
+
|
84
|
+
.
|
85
|
+
.TP
|
86
|
+
drive \fIOPTIONS\fR
|
87
|
+
Directly add a drive directive to qemu options\. If you use this, you\'ll need to provide all key\-value pairs for the directive as a Ruby hash\. Note that if you do not specify \'index\', your drive will get the next free disk index\. (as is the case with \fBdisk\fR) For the full list of options, please refer to the QEMU documentation \fIhttp://qemu\.weilnetz\.de/qemu\-doc\.html\fR\.
|
88
|
+
.
|
89
|
+
.IP "" 4
|
90
|
+
.
|
91
|
+
.nf
|
92
|
+
|
93
|
+
# Manual drive configuration:
|
94
|
+
drive if: \'floppy\', file: \'floppy\.dsk\'
|
95
|
+
.
|
96
|
+
.fi
|
97
|
+
.
|
98
|
+
.IP "" 0
|
99
|
+
|
100
|
+
.
|
101
|
+
.TP
|
102
|
+
net \fITYPE\fR, \fIOPTIONS\fR
|
103
|
+
Manual network configuration\. This gives you full access to QEMU options, with the disadvantage of a slightly more complicated set of options\. Here\'s what you would need to do to duplicate the convencience macro \fBnic\fR below:
|
104
|
+
.
|
105
|
+
.IP "" 4
|
106
|
+
.
|
107
|
+
.nf
|
108
|
+
|
109
|
+
net :vnic, vlan: 1, name: \'vm1\', ifname: \'vm1\',
|
110
|
+
macaddr: \'1:8:20:52:a6:7e\'
|
111
|
+
net :nic, vlan: 1, name: "vm1", model: "virtio",
|
112
|
+
macaddr: \'1:8:20:52:a6:7e\'
|
113
|
+
.
|
114
|
+
.fi
|
115
|
+
.
|
116
|
+
.IP "" 0
|
117
|
+
|
118
|
+
.
|
119
|
+
.TP
|
120
|
+
nic \fINAME\fR, \fIOPTIONS\fR
|
121
|
+
Add a virtual network card to the guest\. Virtual network cards are made to correspond to vnic links on the host system\. These vnic links are automatically generated for you, all you have to do is to specify a \fBvia:\fR option here\.
|
122
|
+
.
|
123
|
+
.IP
|
124
|
+
The \fBvia:\fR option takes either physical links or etherstub switches as value\. You can also specify a VLAN tag, separated by a colon\. (ie: e1000g0:4)
|
125
|
+
.
|
126
|
+
.IP
|
127
|
+
nic \fBmodel:\fR will default to \fBvirtio\fR\.
|
128
|
+
.
|
129
|
+
.IP
|
130
|
+
NOTE: QEMU/kvm on Illumos will default to providing a single pseudo\-nic that has a DHCP server attached to it by default\. If you do not specify a \fBnic\fR, this is what you\'ll get\.
|
131
|
+
.
|
132
|
+
.IP "" 4
|
133
|
+
.
|
134
|
+
.nf
|
135
|
+
|
136
|
+
# Create eth0 interface with given mac address via \'igb1\'\.
|
137
|
+
nic \'eth0\', macaddr: \'2:8:20:52:a6:7e\', via: \'igb1\'
|
138
|
+
.
|
139
|
+
.fi
|
140
|
+
.
|
141
|
+
.IP "" 0
|
142
|
+
|
143
|
+
.
|
144
|
+
.TP
|
145
|
+
ram \fIMEGABYTES\fR
|
146
|
+
Configures the amount of RAM the guest system sees\. Note that the qemu on Illumos locks memory down for the guest and never swaps it out\. This means that you cannot simulate RAM you don\'t have available\. (free)
|
147
|
+
.
|
148
|
+
.IP "" 4
|
149
|
+
.
|
150
|
+
.nf
|
151
|
+
|
152
|
+
# One gigabyte of RAM should be enough for everyone\. (default)
|
153
|
+
ram 1024
|
154
|
+
.
|
155
|
+
.fi
|
156
|
+
.
|
157
|
+
.IP "" 0
|
158
|
+
|
159
|
+
.
|
160
|
+
.TP
|
161
|
+
vnc \fIPORT\fR
|
162
|
+
Enables VNC server on port \fIPORT\fR\. Caution: This will listen for connections from all networks and allow unauthorized access to the guests console\. Don\'t use this in real world deployments\. Instead, use \fBvmadm console\fR or connect directly to the unix socket using socat\.
|
163
|
+
.
|
164
|
+
.IP "" 4
|
165
|
+
.
|
166
|
+
.nf
|
167
|
+
|
168
|
+
# Make vnc listen on a given port: (5900 + display = tcp/ip port)
|
169
|
+
vnc_display 0
|
170
|
+
.
|
171
|
+
.fi
|
172
|
+
.
|
173
|
+
.IP "" 0
|
174
|
+
|
175
|
+
.
|
176
|
+
.TP
|
177
|
+
extra_arg \fIARGUMENT\fR
|
178
|
+
Extra argument for QEMU, appended to the QEMU command line on launch\. If you\'d like to do something that you cannot achieve with the above options, this is your last resort\.
|
179
|
+
.
|
180
|
+
.IP
|
181
|
+
Note that we\'re interested in extending the DSL for common use cases, so you might want to mention your extra_arg usage on the mailing list and get proper treatment from qemu\-toolkit\.
|
182
|
+
.
|
183
|
+
.IP "" 4
|
184
|
+
.
|
185
|
+
.nf
|
186
|
+
|
187
|
+
# Arguments that are appended to the qemu launch command line:
|
188
|
+
extra_arg \'\-foo\'
|
189
|
+
.
|
190
|
+
.fi
|
191
|
+
.
|
192
|
+
.IP "" 0
|
193
|
+
|
194
|
+
.
|
195
|
+
.SH "SEE ALSO"
|
196
|
+
qemu\-toolkit\-overview(7), qemu\-toolkit\-install(7), qemu\-toolkit\-configuration(7), storadm(1), vmadm(1), README(7)
|
@@ -0,0 +1,126 @@
|
|
1
|
+
# qemu-toolkit-configuration(7) -- configuration for qemu-toolkit
|
2
|
+
|
3
|
+
## SYNTAX
|
4
|
+
|
5
|
+
The tool `vmadm` reads all files ending in `.rb` from `/etc/qemu-toolkit` on
|
6
|
+
startup. It expects these Ruby scripts to define virtual machines using the
|
7
|
+
syntax defined below.
|
8
|
+
|
9
|
+
### basic vm definition
|
10
|
+
|
11
|
+
A virtual machine definition is written in a Ruby-DSL and looks like this:
|
12
|
+
|
13
|
+
virtual_machine "myvm" do
|
14
|
+
# Options go here! You'd need at least one disk to start.
|
15
|
+
end
|
16
|
+
|
17
|
+
Since the definition is Ruby, nothing stops you from doing more complicated
|
18
|
+
things like connecting to a database or generating definitions using method
|
19
|
+
calls. Here's an example we've used in the wild:
|
20
|
+
|
21
|
+
def lan name, mac
|
22
|
+
virtual_machine(name) do
|
23
|
+
nic 'eth0', macaddr: mac, via: 'lan0'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# Allows for very short VM definitions:
|
28
|
+
lan 'vm1', '1:8:20:52:a6:7e'
|
29
|
+
|
30
|
+
### available options
|
31
|
+
|
32
|
+
Here's a list of configuration options within the virtual_machine declaration:
|
33
|
+
|
34
|
+
* cpus <NUMBER>:
|
35
|
+
Configures the number of SMP cpus simulated to the guest system.
|
36
|
+
You should not configure more SMP cpus than you have physical CPU cores
|
37
|
+
available.
|
38
|
+
|
39
|
+
# configures 4 SMP cpus
|
40
|
+
cpus 4
|
41
|
+
|
42
|
+
* disk <DEVICE_PATH>:
|
43
|
+
Add a disk drive to the guest system. <DEVICE_PATH> should be the
|
44
|
+
quoted full path to a block device.
|
45
|
+
|
46
|
+
This is a macro that will define a `virtio`-device and automatically number
|
47
|
+
your drives from 0 to N. If you're looking for more immediate control
|
48
|
+
over qemu options, use the `drive`-option.
|
49
|
+
|
50
|
+
# Use a zvol block device
|
51
|
+
disk '/dev/zvol/dsk/pool1/myvm/disk1'
|
52
|
+
|
53
|
+
* drive <OPTIONS>:
|
54
|
+
Directly add a drive directive to qemu options. If you use this, you'll
|
55
|
+
need to provide all key-value pairs for the directive as a Ruby hash. Note
|
56
|
+
that if you do not specify 'index', your drive will get the next free disk
|
57
|
+
index. (as is the case with `disk`) For the full list of options, please
|
58
|
+
refer to the [QEMU documentation](http://qemu.weilnetz.de/qemu-doc.html).
|
59
|
+
|
60
|
+
# Manual drive configuration:
|
61
|
+
drive if: 'floppy', file: 'floppy.dsk'
|
62
|
+
|
63
|
+
* net <TYPE>, <OPTIONS>:
|
64
|
+
Manual network configuration. This gives you full access to QEMU options,
|
65
|
+
with the disadvantage of a slightly more complicated set of options.
|
66
|
+
Here's what you would need to do to duplicate the convencience macro `nic`
|
67
|
+
below:
|
68
|
+
|
69
|
+
net :vnic, vlan: 1, name: 'vm1', ifname: 'vm1',
|
70
|
+
macaddr: '1:8:20:52:a6:7e'
|
71
|
+
net :nic, vlan: 1, name: "vm1", model: "virtio",
|
72
|
+
macaddr: '1:8:20:52:a6:7e'
|
73
|
+
|
74
|
+
|
75
|
+
* nic <NAME>, <OPTIONS>:
|
76
|
+
Add a virtual network card to the guest. Virtual network cards are made
|
77
|
+
to correspond to vnic links on the host system. These vnic links are
|
78
|
+
automatically generated for you, all you have to do is to specify a `via:`
|
79
|
+
option here.
|
80
|
+
|
81
|
+
The `via:` option takes either physical links or etherstub switches as
|
82
|
+
value.
|
83
|
+
You can also specify a VLAN tag, separated by a colon. (ie: e1000g0:4)
|
84
|
+
|
85
|
+
nic `model:` will default to `virtio`.
|
86
|
+
|
87
|
+
NOTE: QEMU/kvm on Illumos will default to providing a single pseudo-nic
|
88
|
+
that has a DHCP server attached to it by default. If you do not specify
|
89
|
+
a `nic`, this is what you'll get.
|
90
|
+
|
91
|
+
# Create eth0 interface with given mac address via 'igb1'.
|
92
|
+
nic 'eth0', macaddr: '2:8:20:52:a6:7e', via: 'igb1'
|
93
|
+
|
94
|
+
* ram <MEGABYTES>:
|
95
|
+
Configures the amount of RAM the guest system sees. Note that the qemu
|
96
|
+
on Illumos locks memory down for the guest and never swaps it out. This
|
97
|
+
means that you cannot simulate RAM you don't have available. (free)
|
98
|
+
|
99
|
+
# One gigabyte of RAM should be enough for everyone. (default)
|
100
|
+
ram 1024
|
101
|
+
|
102
|
+
* vnc <PORT>:
|
103
|
+
Enables VNC server on port <PORT>. Caution: This will listen for
|
104
|
+
connections from all networks and allow unauthorized access to the guests
|
105
|
+
console. Don't use this in real world deployments. Instead, use `vmadm
|
106
|
+
console` or connect directly to the unix socket using socat.
|
107
|
+
|
108
|
+
# Make vnc listen on a given port: (5900 + display = tcp/ip port)
|
109
|
+
vnc_display 0
|
110
|
+
|
111
|
+
* extra_arg <ARGUMENT>:
|
112
|
+
Extra argument for QEMU, appended to the QEMU command line on launch. If
|
113
|
+
you'd like to do something that you cannot achieve with the above options,
|
114
|
+
this is your last resort.
|
115
|
+
|
116
|
+
Note that we're interested in extending the DSL for common use cases, so
|
117
|
+
you might want to mention your extra_arg usage on the mailing list and
|
118
|
+
get proper treatment from qemu-toolkit.
|
119
|
+
|
120
|
+
# Arguments that are appended to the qemu launch command line:
|
121
|
+
extra_arg '-foo'
|
122
|
+
|
123
|
+
## SEE ALSO
|
124
|
+
|
125
|
+
qemu-toolkit-overview(7), qemu-toolkit-install(7),
|
126
|
+
qemu-toolkit-configuration(7), storadm(1), vmadm(1), README(7)
|
@@ -0,0 +1,224 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "QEMU\-TOOLKIT\-INSTALL" "7" "November 2012" "" "qemu-toolkit"
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBqemu\-toolkit\-install\fR \- installations instructions for the qemu\-toolkit
|
8
|
+
.
|
9
|
+
.SH "PREREQUISITES"
|
10
|
+
For this to run, you need at least one physical host running OmniOS \fIhttp://omnios\.omniti\.com/\fR or another Illumos \fIhttps://en\.wikipedia\.org/wiki/Illumos\fR\-based distro\. The host needs to support VT/x extensions to be able to run KVM\-based virtualisation\. Also, some basic working knowledge of Illumos is of help\.
|
11
|
+
.
|
12
|
+
.SH "INSTALLATION"
|
13
|
+
These instructions assume that you install on a clean OmniOS machine\. If you use another distribution, your mileage may vary\. If you have first\-hand experience on other distributions of Illumos, we\'d be interested to hear from you!
|
14
|
+
.
|
15
|
+
.SS "RVM & Ruby"
|
16
|
+
Install packages needed to build Ruby:
|
17
|
+
.
|
18
|
+
.IP "" 4
|
19
|
+
.
|
20
|
+
.nf
|
21
|
+
|
22
|
+
pkg install git autoconf gnu\-m4 gnu\-make gcc\-3 gnu\-patch \e
|
23
|
+
lint system/header header\-math gnu\-coreutils readline \e
|
24
|
+
gnu\-binutils gnu\-tar developer/linker
|
25
|
+
.
|
26
|
+
.fi
|
27
|
+
.
|
28
|
+
.IP "" 0
|
29
|
+
.
|
30
|
+
.P
|
31
|
+
Then make sure that you have \fB/usr/sfw/bin\fR in your PATH and that your linker is functional\.
|
32
|
+
.
|
33
|
+
.P
|
34
|
+
Install YAML:
|
35
|
+
.
|
36
|
+
.IP "" 4
|
37
|
+
.
|
38
|
+
.nf
|
39
|
+
|
40
|
+
wget http://pyyaml\.org/download/libyaml/yaml\-0\.1\.4\.tar\.gz
|
41
|
+
tar xzvf yaml\-0\.1\.4\.tar\.gz
|
42
|
+
cd yaml\-0\.1\.4
|
43
|
+
\./configure \-\-prefix=/usr
|
44
|
+
make
|
45
|
+
make install
|
46
|
+
.
|
47
|
+
.fi
|
48
|
+
.
|
49
|
+
.IP "" 0
|
50
|
+
.
|
51
|
+
.P
|
52
|
+
Then Ruby (via RVM):
|
53
|
+
.
|
54
|
+
.IP "" 4
|
55
|
+
.
|
56
|
+
.nf
|
57
|
+
|
58
|
+
curl \-L https://get\.rvm\.io | bash \-s stable \-\-ruby
|
59
|
+
.
|
60
|
+
.fi
|
61
|
+
.
|
62
|
+
.IP "" 0
|
63
|
+
.
|
64
|
+
.P
|
65
|
+
Please see the RVM website \fIhttps://rvm\.io/\fR for more information\.
|
66
|
+
.
|
67
|
+
.SS "\'socat\'"
|
68
|
+
socat is a tool that connects different types of sockets together\. The qemu\-toolkit toolchain uses it to make VNC and VM monitor available\.
|
69
|
+
.
|
70
|
+
.IP "" 4
|
71
|
+
.
|
72
|
+
.nf
|
73
|
+
|
74
|
+
wget \-\-no\-check\-certificate http://bit\.ly/TwNMrJ \-O socat\-1\.7\.1\.3\.tar\.gz
|
75
|
+
tar xzvf socat\-1\.7\.1\.3\.tar\.gz
|
76
|
+
cd socat\-1\.7\.1\.3
|
77
|
+
# PATCH for this to work: cat patch\.txt | patch
|
78
|
+
\./configure
|
79
|
+
make
|
80
|
+
make install
|
81
|
+
.
|
82
|
+
.fi
|
83
|
+
.
|
84
|
+
.IP "" 0
|
85
|
+
.
|
86
|
+
.P
|
87
|
+
Note that the above installation only succeeds if you patch socat using this patch:
|
88
|
+
.
|
89
|
+
.IP "" 4
|
90
|
+
.
|
91
|
+
.nf
|
92
|
+
|
93
|
+
\-\-\- sysincludes\.h\.orig 2012\-09\-03 16:59:09\.351904279 +0000
|
94
|
+
+++ sysincludes\.h 2012\-09\-03 16:59:54\.388720160 +0000
|
95
|
+
@@ \-131,6 +131,8 @@
|
96
|
+
#include <netpacket/packet\.h>
|
97
|
+
#endif
|
98
|
+
#if HAVE_NETINET_IF_ETHER_H
|
99
|
+
+#include <net/if\.h>
|
100
|
+
+#include <netinet/in\.h>
|
101
|
+
#include <netinet/if_ether\.h>
|
102
|
+
#endif
|
103
|
+
#if HAVE_LINUX_IF_TUN_H
|
104
|
+
.
|
105
|
+
.fi
|
106
|
+
.
|
107
|
+
.IP "" 0
|
108
|
+
.
|
109
|
+
.SS "iSCSI target"
|
110
|
+
If you want to use the machine as iSCSI target (as a storage provider), you\'ll need to do at least this:
|
111
|
+
.
|
112
|
+
.IP "" 4
|
113
|
+
.
|
114
|
+
.nf
|
115
|
+
|
116
|
+
pkg install network/iscsi/target
|
117
|
+
svcadm enable \-r svc:/network/iscsi/target:default
|
118
|
+
.
|
119
|
+
.fi
|
120
|
+
.
|
121
|
+
.IP "" 0
|
122
|
+
.
|
123
|
+
.P
|
124
|
+
The tools expect a target portal group named \fBfrontend\fR\. To create it, use something like the following command, where \fIIP\fR must be an TCP/IP address of the host you\'re doing this for:
|
125
|
+
.
|
126
|
+
.IP "" 4
|
127
|
+
.
|
128
|
+
.nf
|
129
|
+
|
130
|
+
itadm create\-tpg frontend IP
|
131
|
+
.
|
132
|
+
.fi
|
133
|
+
.
|
134
|
+
.IP "" 0
|
135
|
+
.
|
136
|
+
.SS "QEMU / KVM"
|
137
|
+
For qemu to work properly, you must make sure that you have at least as much swap space as you have RAM\. Default configuration only gives you 4GB of swap\. To fix this, do something like the following: (assumes that you\'ve got 30GB of RAM)
|
138
|
+
.
|
139
|
+
.IP "" 4
|
140
|
+
.
|
141
|
+
.nf
|
142
|
+
|
143
|
+
zfs set volsize=30G rpool/swap
|
144
|
+
.
|
145
|
+
.fi
|
146
|
+
.
|
147
|
+
.IP "" 0
|
148
|
+
.
|
149
|
+
.P
|
150
|
+
Also, perhaps obviously, you will need to load the kvm kernel driver\. This is accomplished by
|
151
|
+
.
|
152
|
+
.IP "" 4
|
153
|
+
.
|
154
|
+
.nf
|
155
|
+
|
156
|
+
add_drv kvm
|
157
|
+
.
|
158
|
+
.fi
|
159
|
+
.
|
160
|
+
.IP "" 0
|
161
|
+
.
|
162
|
+
.P
|
163
|
+
You will want to reboot the machine after these two steps for two reasons: Sometimes loading \fBkvm\fR interferes with reboot behaviour, you\'ll want to know that before you continue\. And swap resizing takes effect on reboot only\.
|
164
|
+
.
|
165
|
+
.SS "qemu\-toolkit"
|
166
|
+
Once you\'ve done all this, you\'re ready to install \fBqemu\-toolkit\fR\. Simply:
|
167
|
+
.
|
168
|
+
.IP "" 4
|
169
|
+
.
|
170
|
+
.nf
|
171
|
+
|
172
|
+
gem install qemu\-toolkit
|
173
|
+
.
|
174
|
+
.fi
|
175
|
+
.
|
176
|
+
.IP "" 0
|
177
|
+
.
|
178
|
+
.P
|
179
|
+
You should now have \fBvmadm\fR and \fBstoradm\fR in your path\.
|
180
|
+
.
|
181
|
+
.SH "FIRST STEPS"
|
182
|
+
Create a block device for your virtual machine\. Assuming you want to create it on \fIPOOL\fR:
|
183
|
+
.
|
184
|
+
.IP "" 4
|
185
|
+
.
|
186
|
+
.nf
|
187
|
+
|
188
|
+
storadm create POOL/myvm 10G
|
189
|
+
.
|
190
|
+
.fi
|
191
|
+
.
|
192
|
+
.IP "" 0
|
193
|
+
.
|
194
|
+
.P
|
195
|
+
This should create a dataset called \fIPOOL\fR\fB/myvm\fR and a subordinate zvol called \'disk1\'\. Let\'s connect a virtual machine to that disk:
|
196
|
+
.
|
197
|
+
.IP "" 4
|
198
|
+
.
|
199
|
+
.nf
|
200
|
+
|
201
|
+
vmadm create myvm
|
202
|
+
.
|
203
|
+
.fi
|
204
|
+
.
|
205
|
+
.IP "" 0
|
206
|
+
.
|
207
|
+
.P
|
208
|
+
This will create a configuration file called \fB/etc/qemu\-toolkit/myvm\.rb\fR\. Feel free to edit this\. Once you\'ve customized it to your liking, start the virtual machine and boot from an \fIISO\fR image:
|
209
|
+
.
|
210
|
+
.IP "" 4
|
211
|
+
.
|
212
|
+
.nf
|
213
|
+
|
214
|
+
vmadm start myvm \-\-bootiso=ISO
|
215
|
+
.
|
216
|
+
.fi
|
217
|
+
.
|
218
|
+
.IP "" 0
|
219
|
+
.
|
220
|
+
.P
|
221
|
+
If you\'re interested in configuring your virtual machine (qemu), please see qemu\-toolkit\-configuration(7)\.
|
222
|
+
.
|
223
|
+
.SH "SEE ALSO"
|
224
|
+
qemu\-toolkit\-overview(7), qemu\-toolkit\-install(7), qemu\-toolkit\-configuration(7), storadm(1), vmadm(1), README(7)
|