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
@@ -0,0 +1,136 @@
|
|
1
|
+
# qemu-toolkit-install(7) -- installations instructions for the qemu-toolkit
|
2
|
+
|
3
|
+
## PREREQUISITES
|
4
|
+
|
5
|
+
For this to run, you need at least one physical host running
|
6
|
+
[OmniOS](http://omnios.omniti.com/) or another
|
7
|
+
[Illumos](https://en.wikipedia.org/wiki/Illumos)-based distro. The host needs
|
8
|
+
to support VT/x extensions to be able to run KVM-based virtualisation. Also,
|
9
|
+
some basic working knowledge of Illumos is of help.
|
10
|
+
|
11
|
+
## INSTALLATION
|
12
|
+
|
13
|
+
These instructions assume that you install on a clean OmniOS machine. If you
|
14
|
+
use another distribution, your mileage may vary. If you have first-hand
|
15
|
+
experience on other distributions of Illumos, we'd be interested to hear from
|
16
|
+
you!
|
17
|
+
|
18
|
+
### RVM & Ruby
|
19
|
+
|
20
|
+
Install packages needed to build Ruby:
|
21
|
+
|
22
|
+
pkg install git autoconf gnu-m4 gnu-make gcc-3 gnu-patch \
|
23
|
+
lint system/header header-math gnu-coreutils readline \
|
24
|
+
gnu-binutils gnu-tar developer/linker
|
25
|
+
|
26
|
+
Then make sure that you have `/usr/sfw/bin` in your PATH and that your
|
27
|
+
linker is functional.
|
28
|
+
|
29
|
+
Install YAML:
|
30
|
+
|
31
|
+
wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
|
32
|
+
tar xzvf yaml-0.1.4.tar.gz
|
33
|
+
cd yaml-0.1.4
|
34
|
+
./configure --prefix=/usr
|
35
|
+
make
|
36
|
+
make install
|
37
|
+
|
38
|
+
Then Ruby (via RVM):
|
39
|
+
|
40
|
+
curl -L https://get.rvm.io | bash -s stable --ruby
|
41
|
+
|
42
|
+
Please see the RVM [website](https://rvm.io/) for more information.
|
43
|
+
|
44
|
+
### 'socat'
|
45
|
+
|
46
|
+
socat is a tool that connects different types of sockets together. The
|
47
|
+
qemu-toolkit toolchain uses it to make VNC and VM monitor available.
|
48
|
+
|
49
|
+
wget --no-check-certificate http://bit.ly/TwNMrJ -O socat-1.7.1.3.tar.gz
|
50
|
+
tar xzvf socat-1.7.1.3.tar.gz
|
51
|
+
cd socat-1.7.1.3
|
52
|
+
# PATCH for this to work: cat patch.txt | patch
|
53
|
+
./configure
|
54
|
+
make
|
55
|
+
make install
|
56
|
+
|
57
|
+
Note that the above installation only succeeds if you patch socat using this
|
58
|
+
patch:
|
59
|
+
|
60
|
+
--- sysincludes.h.orig 2012-09-03 16:59:09.351904279 +0000
|
61
|
+
+++ sysincludes.h 2012-09-03 16:59:54.388720160 +0000
|
62
|
+
@@ -131,6 +131,8 @@
|
63
|
+
#include <netpacket/packet.h>
|
64
|
+
#endif
|
65
|
+
#if HAVE_NETINET_IF_ETHER_H
|
66
|
+
+#include <net/if.h>
|
67
|
+
+#include <netinet/in.h>
|
68
|
+
#include <netinet/if_ether.h>
|
69
|
+
#endif
|
70
|
+
#if HAVE_LINUX_IF_TUN_H
|
71
|
+
|
72
|
+
### iSCSI target
|
73
|
+
|
74
|
+
If you want to use the machine as iSCSI target (as a storage provider), you'll
|
75
|
+
need to do at least this:
|
76
|
+
|
77
|
+
pkg install network/iscsi/target
|
78
|
+
svcadm enable -r svc:/network/iscsi/target:default
|
79
|
+
|
80
|
+
The tools expect a target portal group named `frontend`. To create it, use
|
81
|
+
something like the following command, where <IP> must be an TCP/IP address
|
82
|
+
of the host you're doing this for:
|
83
|
+
|
84
|
+
itadm create-tpg frontend IP
|
85
|
+
|
86
|
+
### QEMU / KVM
|
87
|
+
|
88
|
+
For qemu to work properly, you must make sure that you have at least as much
|
89
|
+
swap space as you have RAM. Default configuration only gives you 4GB of swap.
|
90
|
+
To fix this, do something like the following: (assumes that you've got 30GB of
|
91
|
+
RAM)
|
92
|
+
|
93
|
+
zfs set volsize=30G rpool/swap
|
94
|
+
|
95
|
+
Also, perhaps obviously, you will need to load the kvm kernel driver. This is
|
96
|
+
accomplished by
|
97
|
+
|
98
|
+
add_drv kvm
|
99
|
+
|
100
|
+
You will want to reboot the machine after these two steps for two reasons:
|
101
|
+
Sometimes loading `kvm` interferes with reboot behaviour, you'll want to know
|
102
|
+
that before you continue. And swap resizing takes effect on reboot only.
|
103
|
+
|
104
|
+
### qemu-toolkit
|
105
|
+
|
106
|
+
Once you've done all this, you're ready to install `qemu-toolkit`. Simply:
|
107
|
+
|
108
|
+
gem install qemu-toolkit
|
109
|
+
|
110
|
+
You should now have `vmadm` and `storadm` in your path.
|
111
|
+
|
112
|
+
## FIRST STEPS
|
113
|
+
|
114
|
+
Create a block device for your virtual machine. Assuming you want to create
|
115
|
+
it on <POOL>:
|
116
|
+
|
117
|
+
storadm create POOL/myvm 10G
|
118
|
+
|
119
|
+
This should create a dataset called <POOL>`/myvm` and a subordinate zvol
|
120
|
+
called 'disk1'. Let's connect a virtual machine to that disk:
|
121
|
+
|
122
|
+
vmadm create myvm
|
123
|
+
|
124
|
+
This will create a configuration file called `/etc/qemu-toolkit/myvm.rb`.
|
125
|
+
Feel free to edit this. Once you've customized it to your liking, start the
|
126
|
+
virtual machine and boot from an <ISO> image:
|
127
|
+
|
128
|
+
vmadm start myvm --bootiso=ISO
|
129
|
+
|
130
|
+
If you're interested in configuring your virtual machine (qemu), please see
|
131
|
+
qemu-toolkit-configuration(7).
|
132
|
+
|
133
|
+
## SEE ALSO
|
134
|
+
|
135
|
+
qemu-toolkit-overview(7), qemu-toolkit-install(7),
|
136
|
+
qemu-toolkit-configuration(7), storadm(1), vmadm(1), README(7)
|
@@ -0,0 +1,122 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "QEMU\-TOOLKIT\-OVERVIEW" "7" "November 2012" "" "qemu-toolkit"
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBqemu\-toolkit\-overview\fR \- architecture and philosophy of qemu\-toolkit
|
8
|
+
.
|
9
|
+
.SH "OVERVIEW"
|
10
|
+
This is a toolkit for running qemu on OmniOS/Illumos\. Features:
|
11
|
+
.
|
12
|
+
.IP "\(bu" 4
|
13
|
+
VMs based on local zvols
|
14
|
+
.
|
15
|
+
.IP "\(bu" 4
|
16
|
+
VMs based on iSCSI targets
|
17
|
+
.
|
18
|
+
.IP "\(bu" 4
|
19
|
+
Full access to QEMUs options (through a nifty Ruby DSL)
|
20
|
+
.
|
21
|
+
.IP "\(bu" 4
|
22
|
+
Automatic vnic creation, supports VLAN tags
|
23
|
+
.
|
24
|
+
.IP "\(bu" 4
|
25
|
+
Secure VNC channel through unix socket
|
26
|
+
.
|
27
|
+
.IP "\(bu" 4
|
28
|
+
Access to VM monitor and serial console
|
29
|
+
.
|
30
|
+
.IP "" 0
|
31
|
+
.
|
32
|
+
.P
|
33
|
+
Here\'s a sample configuration file:
|
34
|
+
.
|
35
|
+
.IP "" 4
|
36
|
+
.
|
37
|
+
.nf
|
38
|
+
|
39
|
+
virtual_machine "vm_name" do
|
40
|
+
# Network configuration: vnic via igb1
|
41
|
+
nic \'eth0\', macaddr: \'2:8:20:52:a6:7e\', via: \'igb1\'
|
42
|
+
|
43
|
+
# Disks: via iSCSI iqn
|
44
|
+
iscsi_target \'iqn\.2010\-01\.com\.qemu\-toolkit:vm_name\', "10\.0\.30\.1"
|
45
|
+
|
46
|
+
# 4 SMP CPUs\.
|
47
|
+
cpus 4
|
48
|
+
end
|
49
|
+
.
|
50
|
+
.fi
|
51
|
+
.
|
52
|
+
.IP "" 0
|
53
|
+
.
|
54
|
+
.P
|
55
|
+
On\-disk layout is as follows:
|
56
|
+
.
|
57
|
+
.IP "" 4
|
58
|
+
.
|
59
|
+
.nf
|
60
|
+
|
61
|
+
foo base zfs dataset
|
62
|
+
foo/disk1 first disk, zvol block device
|
63
|
+
foo/disk2 second disk, zvol block device
|
64
|
+
.
|
65
|
+
.fi
|
66
|
+
.
|
67
|
+
.IP "" 0
|
68
|
+
.
|
69
|
+
.SH "DEPLOYMENT OPTIONS"
|
70
|
+
Using this toolkit, you can deploy your virtual machines in one of two ways:
|
71
|
+
.
|
72
|
+
.IP "\(bu" 4
|
73
|
+
All\-local, using zvols
|
74
|
+
.
|
75
|
+
.IP "\(bu" 4
|
76
|
+
SAN\-style, using iSCSI based block devices mapping to zvols
|
77
|
+
.
|
78
|
+
.IP "" 0
|
79
|
+
.
|
80
|
+
.SS "Local ZVOLs"
|
81
|
+
In this architectural style, you use both tools (storadm(1) and vmadm(1)) on the same machine\. To create a virtual machine from scratch, you would use the following sequence of commands:
|
82
|
+
.
|
83
|
+
.IP "" 4
|
84
|
+
.
|
85
|
+
.nf
|
86
|
+
|
87
|
+
$ storadm create pool1/foo 10G
|
88
|
+
$ vmadm create foo
|
89
|
+
$ vmadm start foo \-\-bootiso=installation\-disk\.iso
|
90
|
+
.
|
91
|
+
.fi
|
92
|
+
.
|
93
|
+
.IP "" 0
|
94
|
+
.
|
95
|
+
.P
|
96
|
+
This would create a base dataset pool1/foo with one 10G block device as root disk\. It then creates a file \fBfoo\.rb\fR below \fB/etc/qemu\-toolkit/\fR that defines base attributes for the virtual machine\. Finally, starting the machine using the \fB\-\-bootiso\fR parameter would allow you to install a base system to the virtual machine\.
|
97
|
+
.
|
98
|
+
.SS "SAN\-style"
|
99
|
+
Here you use two machines, one as storage host and one as VM host\. The virtual machines run on host A, but all storage is provided for by host B\. Here\'s a typical sequence of commands to create a virtual machine from scratch in this scenario:
|
100
|
+
.
|
101
|
+
.IP "" 4
|
102
|
+
.
|
103
|
+
.nf
|
104
|
+
|
105
|
+
Machine B:
|
106
|
+
$ storadm create pool1/foo 10G
|
107
|
+
$ storadm export pool1/foo
|
108
|
+
|
109
|
+
Machine A
|
110
|
+
$ vmadm create foo
|
111
|
+
# Edit foo\.rb at this point to include a valid iqn + IP pair for host B
|
112
|
+
$ vmadm start foo \-\-bootiso=installation\-disk\.iso
|
113
|
+
.
|
114
|
+
.fi
|
115
|
+
.
|
116
|
+
.IP "" 0
|
117
|
+
.
|
118
|
+
.P
|
119
|
+
This assumes that you\'ve got iSCSI set up on both machines\. (initiator on A, target on B) While this configuration is certainly more complex than the all\-local one above, it is also more flexible to administer\.
|
120
|
+
.
|
121
|
+
.SH "SEE ALSO"
|
122
|
+
qemu\-toolkit\-overview(7), qemu\-toolkit\-install(7), qemu\-toolkit\-configuration(7), storadm(1), vmadm(1), README(7)
|
@@ -0,0 +1,82 @@
|
|
1
|
+
# qemu-toolkit-overview(7) -- architecture and philosophy of qemu-toolkit
|
2
|
+
|
3
|
+
## OVERVIEW
|
4
|
+
|
5
|
+
This is a toolkit for running qemu on OmniOS/Illumos. Features:
|
6
|
+
|
7
|
+
* VMs based on local zvols
|
8
|
+
* VMs based on iSCSI targets
|
9
|
+
* Full access to QEMUs options (through a nifty Ruby DSL)
|
10
|
+
* Automatic vnic creation, supports VLAN tags
|
11
|
+
* Secure VNC channel through unix socket
|
12
|
+
* Access to VM monitor and serial console
|
13
|
+
|
14
|
+
|
15
|
+
Here's a sample configuration file:
|
16
|
+
|
17
|
+
virtual_machine "vm_name" do
|
18
|
+
# Network configuration: vnic via igb1
|
19
|
+
nic 'eth0', macaddr: '2:8:20:52:a6:7e', via: 'igb1'
|
20
|
+
|
21
|
+
# Disks: via iSCSI iqn
|
22
|
+
iscsi_target 'iqn.2010-01.com.qemu-toolkit:vm_name', "10.0.30.1"
|
23
|
+
|
24
|
+
# 4 SMP CPUs.
|
25
|
+
cpus 4
|
26
|
+
end
|
27
|
+
|
28
|
+
On-disk layout is as follows:
|
29
|
+
|
30
|
+
foo base zfs dataset
|
31
|
+
foo/disk1 first disk, zvol block device
|
32
|
+
foo/disk2 second disk, zvol block device
|
33
|
+
|
34
|
+
## DEPLOYMENT OPTIONS
|
35
|
+
|
36
|
+
Using this toolkit, you can deploy your virtual machines in one of two ways:
|
37
|
+
|
38
|
+
* All-local, using zvols
|
39
|
+
* SAN-style, using iSCSI based block devices mapping to zvols
|
40
|
+
|
41
|
+
### Local ZVOLs
|
42
|
+
|
43
|
+
In this architectural style, you use both tools (storadm(1) and vmadm(1)) on
|
44
|
+
the same machine. To create a virtual machine from scratch, you would use the
|
45
|
+
following sequence of commands:
|
46
|
+
|
47
|
+
$ storadm create pool1/foo 10G
|
48
|
+
$ vmadm create foo
|
49
|
+
$ vmadm start foo --bootiso=installation-disk.iso
|
50
|
+
|
51
|
+
This would create a base dataset pool1/foo with one 10G block device as root
|
52
|
+
disk. It then creates a file `foo.rb` below `/etc/qemu-toolkit/` that defines
|
53
|
+
base attributes for the virtual machine. Finally, starting the machine using
|
54
|
+
the `--bootiso` parameter would allow you to install a base system to the virtual
|
55
|
+
machine.
|
56
|
+
|
57
|
+
### SAN-style
|
58
|
+
|
59
|
+
Here you use two machines, one as storage host and one as VM host. The virtual
|
60
|
+
machines run on host A, but all storage is provided for by host B. Here's a
|
61
|
+
typical sequence of commands to create a virtual machine from scratch in this
|
62
|
+
scenario:
|
63
|
+
|
64
|
+
Machine B:
|
65
|
+
$ storadm create pool1/foo 10G
|
66
|
+
$ storadm export pool1/foo
|
67
|
+
|
68
|
+
Machine A
|
69
|
+
$ vmadm create foo
|
70
|
+
# Edit foo.rb at this point to include a valid iqn + IP pair for host B
|
71
|
+
$ vmadm start foo --bootiso=installation-disk.iso
|
72
|
+
|
73
|
+
This assumes that you've got iSCSI set up on both machines. (initiator on A,
|
74
|
+
target on B) While this configuration is certainly more complex than the
|
75
|
+
all-local one above, it is also more flexible to administer.
|
76
|
+
|
77
|
+
## SEE ALSO
|
78
|
+
|
79
|
+
qemu-toolkit-overview(7), qemu-toolkit-install(7),
|
80
|
+
qemu-toolkit-configuration(7), storadm(1), vmadm(1), README(7)
|
81
|
+
|
82
|
+
|
data/doc/storadm.1
ADDED
@@ -0,0 +1,142 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "STORADM" "1" "November 2012" "" "qemu-toolkit"
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBstoradm\fR \- manages virtual machine storage
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
\fBstoradm\fR [\-h]
|
11
|
+
.
|
12
|
+
.br
|
13
|
+
\fBstoradm list\fR
|
14
|
+
.
|
15
|
+
.br
|
16
|
+
\fBstoradm create\fR [\-v] \fIname\fR
|
17
|
+
.
|
18
|
+
.br
|
19
|
+
\fBstoradm clone\fR [\-v] \fIname\fR \fItemplate\fR \fIversion\fR
|
20
|
+
.
|
21
|
+
.br
|
22
|
+
\fBstoradm export\fR [\-v] \fIname\fR
|
23
|
+
.
|
24
|
+
.br
|
25
|
+
\fBstoradm hide\fR [\-v] \fIname\fR
|
26
|
+
.
|
27
|
+
.br
|
28
|
+
.
|
29
|
+
.SH "DESCRIPTION"
|
30
|
+
The \fBstoradm\fR command allows you to manage virtual machine storage all in one place\. It creates, clones and destroys storage spaces\. And if you want to separate storage machines from the hosts that run virtual machines (a SAN style setup), you can \- \fBstoradm\fR provides two subcommands for this setup\.
|
31
|
+
.
|
32
|
+
.P
|
33
|
+
Virtual machine storage is based on ZFS and uses the following dataset layout:
|
34
|
+
.
|
35
|
+
.IP "" 4
|
36
|
+
.
|
37
|
+
.nf
|
38
|
+
|
39
|
+
vm_name # base dataset
|
40
|
+
vm_name/disk1 # first block device (zvol)
|
41
|
+
.
|
42
|
+
.fi
|
43
|
+
.
|
44
|
+
.IP "" 0
|
45
|
+
.
|
46
|
+
.P
|
47
|
+
These subcommands are defined:
|
48
|
+
.
|
49
|
+
.TP
|
50
|
+
\fBstoradm list\fR
|
51
|
+
Lists all virtual machine storage spaces on this machine\. For all storage spaces that have an iSCSI export, it lists the corresponding IQN\.
|
52
|
+
.
|
53
|
+
.TP
|
54
|
+
\fBstoradm create\fR [\-v] \fIname\fR
|
55
|
+
Creates a new storage space\. \fIname\fR should be a full zfs path to where you want to create the storage space, something like \fBpool1/foo\fR\.
|
56
|
+
.
|
57
|
+
.TP
|
58
|
+
\fB\-v\fR
|
59
|
+
Prints all commands as they are executed\.
|
60
|
+
|
61
|
+
.
|
62
|
+
.TP
|
63
|
+
\fBstoradm clone\fR [\-v] \fIname\fR \fItemplate\fR \fIversion\fR
|
64
|
+
Clones a new storage space from a template\. \fItemplate\fR refers to a storage space that has a recursive snapshot called \fIversion\fR\.
|
65
|
+
.
|
66
|
+
.TP
|
67
|
+
\fB\-v\fR
|
68
|
+
Prints all commands as they are executed\.
|
69
|
+
|
70
|
+
.
|
71
|
+
.TP
|
72
|
+
\fBstoradm export\fR [\-v] \fIname\fR
|
73
|
+
Creates an iSCSI export for the storage space\. All disks of the storage space are mapped to LUNs in the iSCSI target\.
|
74
|
+
.
|
75
|
+
.TP
|
76
|
+
\fB\-v\fR
|
77
|
+
Prints all commands as they are executed\.
|
78
|
+
|
79
|
+
.
|
80
|
+
.TP
|
81
|
+
\fBstoradm hide\fR [\-v] \fIname\fR
|
82
|
+
Hides a storage space by removing the previously created iSCSI export from the system\.
|
83
|
+
.
|
84
|
+
.TP
|
85
|
+
\fB\-v\fR
|
86
|
+
Prints all commands as they are executed\.
|
87
|
+
|
88
|
+
.
|
89
|
+
.SH "EXAMPLES"
|
90
|
+
.
|
91
|
+
.SS "Example 1 Creating a storage space"
|
92
|
+
The following command creates an empty virtual machine storage space with one disk drive of 10GB\.
|
93
|
+
.
|
94
|
+
.IP "" 4
|
95
|
+
.
|
96
|
+
.nf
|
97
|
+
|
98
|
+
# storadm create pool1/foo 10G
|
99
|
+
.
|
100
|
+
.fi
|
101
|
+
.
|
102
|
+
.IP "" 0
|
103
|
+
.
|
104
|
+
.SS "Example 2 Listing all available storage spaces"
|
105
|
+
The following command lists all available storage spaces\.
|
106
|
+
.
|
107
|
+
.IP "" 4
|
108
|
+
.
|
109
|
+
.nf
|
110
|
+
|
111
|
+
# storadm list
|
112
|
+
pool1/foo
|
113
|
+
.
|
114
|
+
.fi
|
115
|
+
.
|
116
|
+
.IP "" 0
|
117
|
+
.
|
118
|
+
.SS "Example 3 Creating a base version and cloning it"
|
119
|
+
The following commands snapshot an existing storage space called \fBpool1/template\fR with the version tag \fB0\.1\.0\fR\. A clone is then created based on that version of \fBpool1/template\fR\.
|
120
|
+
.
|
121
|
+
.IP "" 4
|
122
|
+
.
|
123
|
+
.nf
|
124
|
+
|
125
|
+
# zfs snapshot \-r pool1/template@0\.1\.0
|
126
|
+
# storadm clone my_vm pool1/template 0\.1\.0
|
127
|
+
.
|
128
|
+
.fi
|
129
|
+
.
|
130
|
+
.IP "" 0
|
131
|
+
.
|
132
|
+
.SH "BUGS"
|
133
|
+
Only the unknown\.
|
134
|
+
.
|
135
|
+
.SH "SEE ALSO"
|
136
|
+
qemu\-toolkit\-overview(7), qemu\-toolkit\-install(7), qemu\-toolkit\-configuration(7), storadm(1), vmadm(1), README(7)
|
137
|
+
.
|
138
|
+
.SH "AUTHORS"
|
139
|
+
Copyright (c) 2012 Kaspar Schiess\.
|
140
|
+
.
|
141
|
+
.SH "COPYRIGHT"
|
142
|
+
This tool is under a MIT license\. Please see the LICENSE file in the original source\.
|
data/doc/storadm.1.ronn
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
|
2
|
+
# storadm(1) -- manages virtual machine storage
|
3
|
+
|
4
|
+
## SYNOPSIS
|
5
|
+
|
6
|
+
`storadm` [-h]<br>
|
7
|
+
`storadm list`<br>
|
8
|
+
`storadm create` [-v] <name><br>
|
9
|
+
`storadm clone` [-v] <name> <template> <version><br>
|
10
|
+
`storadm export` [-v] <name><br>
|
11
|
+
`storadm hide` [-v] <name><br>
|
12
|
+
|
13
|
+
## DESCRIPTION
|
14
|
+
|
15
|
+
The `storadm` command allows you to manage virtual machine storage all in
|
16
|
+
one place. It creates, clones and destroys storage spaces. And if you want
|
17
|
+
to separate storage machines from the hosts that run virtual machines (a SAN
|
18
|
+
style setup), you can - `storadm` provides two subcommands for this setup.
|
19
|
+
|
20
|
+
Virtual machine storage is based on ZFS and uses the following dataset
|
21
|
+
layout:
|
22
|
+
|
23
|
+
vm_name # base dataset
|
24
|
+
vm_name/disk1 # first block device (zvol)
|
25
|
+
|
26
|
+
These subcommands are defined:
|
27
|
+
|
28
|
+
* `storadm list`:
|
29
|
+
Lists all virtual machine storage spaces on this machine. For all
|
30
|
+
storage spaces that have an iSCSI export, it lists the corresponding
|
31
|
+
IQN.
|
32
|
+
|
33
|
+
* `storadm create` [-v] <name>:
|
34
|
+
Creates a new storage space. <name> should be a full zfs path to where
|
35
|
+
you want to create the storage space, something like `pool1/foo`.
|
36
|
+
|
37
|
+
* `-v`:
|
38
|
+
Prints all commands as they are executed.
|
39
|
+
|
40
|
+
* `storadm clone` [-v] <name> <template> <version>:
|
41
|
+
Clones a new storage space from a template. <template> refers to a
|
42
|
+
storage space that has a recursive snapshot called <version>.
|
43
|
+
|
44
|
+
* `-v`:
|
45
|
+
Prints all commands as they are executed.
|
46
|
+
|
47
|
+
* `storadm export` [-v] <name>:
|
48
|
+
Creates an iSCSI export for the storage space. All disks of the storage
|
49
|
+
space are mapped to LUNs in the iSCSI target.
|
50
|
+
|
51
|
+
* `-v`:
|
52
|
+
Prints all commands as they are executed.
|
53
|
+
|
54
|
+
* `storadm hide` [-v] <name>:
|
55
|
+
Hides a storage space by removing the previously created iSCSI export
|
56
|
+
from the system.
|
57
|
+
|
58
|
+
* `-v`:
|
59
|
+
Prints all commands as they are executed.
|
60
|
+
|
61
|
+
## EXAMPLES
|
62
|
+
|
63
|
+
### Example 1 Creating a storage space
|
64
|
+
The following command creates an empty virtual machine storage space with one
|
65
|
+
disk drive of 10GB.
|
66
|
+
|
67
|
+
# storadm create pool1/foo 10G
|
68
|
+
|
69
|
+
### Example 2 Listing all available storage spaces
|
70
|
+
|
71
|
+
The following command lists all available storage spaces.
|
72
|
+
|
73
|
+
# storadm list
|
74
|
+
pool1/foo
|
75
|
+
|
76
|
+
### Example 3 Creating a base version and cloning it
|
77
|
+
|
78
|
+
The following commands snapshot an existing storage space called
|
79
|
+
`pool1/template` with the version tag `0.1.0`. A clone is then created based
|
80
|
+
on that version of `pool1/template`.
|
81
|
+
|
82
|
+
# zfs snapshot -r pool1/template@0.1.0
|
83
|
+
# storadm clone my_vm pool1/template 0.1.0
|
84
|
+
|
85
|
+
## BUGS
|
86
|
+
|
87
|
+
Only the unknown.
|
88
|
+
|
89
|
+
## SEE ALSO
|
90
|
+
|
91
|
+
qemu-toolkit-overview(7), qemu-toolkit-install(7),
|
92
|
+
qemu-toolkit-configuration(7), storadm(1), vmadm(1), README(7)
|
93
|
+
|
94
|
+
## AUTHORS
|
95
|
+
|
96
|
+
Copyright (c) 2012 Kaspar Schiess.
|
97
|
+
|
98
|
+
## COPYRIGHT
|
99
|
+
|
100
|
+
This tool is under a MIT license. Please see the LICENSE file in the original
|
101
|
+
source.
|
data/doc/vmadm.1
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
.\" generated with Ronn/v0.7.3
|
2
|
+
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
+
.
|
4
|
+
.TH "VMADM" "1" "November 2012" "" "qemu-toolkit"
|
5
|
+
.
|
6
|
+
.SH "NAME"
|
7
|
+
\fBvmadm\fR \- manages qemu\-toolkit virtual machines
|
8
|
+
.
|
9
|
+
.SH "SYNOPSIS"
|
10
|
+
\fBvmadm\fR [\-h]
|
11
|
+
.
|
12
|
+
.br
|
13
|
+
\fBvmadm list\fR
|
14
|
+
.
|
15
|
+
.br
|
16
|
+
\fBvmadm create\fR \fIname\fR
|
17
|
+
.
|
18
|
+
.br
|
19
|
+
\fBvmadm start\fR [\-\-bootiso \fIiso_file\fR]\fIname\fR
|
20
|
+
.
|
21
|
+
.br
|
22
|
+
\fBvmadm shutdown\fR \fIname\fR
|
23
|
+
.
|
24
|
+
.br
|
25
|
+
\fBvmadm kill\fR \fIname\fR
|
26
|
+
.
|
27
|
+
.br
|
28
|
+
\fBvmadm monitor\fR \fIname\fR
|
29
|
+
.
|
30
|
+
.br
|
31
|
+
\fBvmadm vnc\fR \fIname\fR
|
32
|
+
.
|
33
|
+
.br
|
34
|
+
\fBvmadm console\fR \fIname\fR
|
35
|
+
.
|
36
|
+
.br
|
37
|
+
.
|
38
|
+
.SH "DESCRIPTION"
|
39
|
+
The \fBvmadm\fR command manages virtual machines\. A virtual machine is defined by using the \fBvirtual_machine\fR syntax in a file below \fB/etc/qemu\-toolkit\fR\. (see qemu\-toolkit\-configuration(7))
|
40
|
+
.
|
41
|
+
.TP
|
42
|
+
\fBvmadm list\fR
|
43
|
+
Lists all virtual machines that are defined on this system\.
|
44
|
+
.
|
45
|
+
.TP
|
46
|
+
\fBvmadm create\fR \fIname\fR
|
47
|
+
Creates a new virtual machine definition and fills it with sensible default values\.
|
48
|
+
.
|
49
|
+
.TP
|
50
|
+
\fBvmadm start\fR \fIname\fR
|
51
|
+
Starts a virtual machine using QEMU/KVM\.
|
52
|
+
.
|
53
|
+
.TP
|
54
|
+
\fB\-\-bootiso\fR \fIiso_file\fR
|
55
|
+
Boots the virtual machine once from virtual cdrom backed by the iso file given\. Upon reboot, the machine will use its first disk to boot\.
|
56
|
+
|
57
|
+
.
|
58
|
+
.TP
|
59
|
+
\fBvmadm shutdown\fR \fIname\fR
|
60
|
+
Sends the virtual machine a system/powerdown event\.
|
61
|
+
.
|
62
|
+
.TP
|
63
|
+
\fBvmadm kill\fR \fIname\fR
|
64
|
+
Immediately kills the virtual machine\.
|
65
|
+
.
|
66
|
+
.TP
|
67
|
+
\fBvmadm monitor\fR \fIname\fR
|
68
|
+
Enters an interactive monitor mode that controls the virtual machine\. The machine must be running for this to work\. Use Control+D to exit\.
|
69
|
+
.
|
70
|
+
.TP
|
71
|
+
\fBvmadm vnc\fR \fIname\fR
|
72
|
+
Connect the terminal to a VNC server that displays the console of the virtual machine\.
|
73
|
+
.
|
74
|
+
.TP
|
75
|
+
\fBvmadm console\fR \fIname\fR
|
76
|
+
Connects the terminal to the serial console of the virtual machine\. Note that this must be specially configured for most guest OSes\.
|
77
|
+
.
|
78
|
+
.SH "EXAMPLES"
|
79
|
+
.
|
80
|
+
.SS "Example 1 Boot a virtual machine"
|
81
|
+
The following command starts the virtual machine and boots it from its first disk\.
|
82
|
+
.
|
83
|
+
.IP "" 4
|
84
|
+
.
|
85
|
+
.nf
|
86
|
+
|
87
|
+
# vmadm start my_vm
|
88
|
+
.
|
89
|
+
.fi
|
90
|
+
.
|
91
|
+
.IP "" 0
|
92
|
+
.
|
93
|
+
.SS "Example 2 Install a virtual machine from ISO"
|
94
|
+
The following command boots the virtual machine from a virtual cdrom\. The cdrom is backed by an ISO file called ubuntu\.iso\.
|
95
|
+
.
|
96
|
+
.IP "" 4
|
97
|
+
.
|
98
|
+
.nf
|
99
|
+
|
100
|
+
# vmadm start my_vm \-\-bootiso ubuntu\.iso
|
101
|
+
.
|
102
|
+
.fi
|
103
|
+
.
|
104
|
+
.IP "" 0
|
105
|
+
.
|
106
|
+
.SH "BUGS"
|
107
|
+
When using iscsi targets, you have to relaunch the vm twice to get it to start up\. We have code in place to work around this, but it is not effective\. Work to fix this is underway\.
|
108
|
+
.
|
109
|
+
.SH "SEE ALSO"
|
110
|
+
qemu\-toolkit\-overview(7), qemu\-toolkit\-install(7), qemu\-toolkit\-configuration(7), storadm(1), vmadm(1), README(7)
|
111
|
+
.
|
112
|
+
.SH "AUTHORS"
|
113
|
+
Copyright (c) 2012 Kaspar Schiess\.
|
114
|
+
.
|
115
|
+
.SH "COPYRIGHT"
|
116
|
+
This tool is under a MIT license\. Please see the LICENSE file in the original source\.
|