1virt-v2v-output-openstack(1)Virtualization Supportvirt-v2v-output-openstack(1)
2
3
4
6 virt-v2v-output-openstack - Using virt-v2v to convert guests to
7 OpenStack
8
10 virt-v2v [-i* options] -o openstack
11 -oo server-id=SERVER
12 [-oo guest-id=GUEST]
13 [-oo verify-server-certificate=false]
14 [-oo os-username=admin] [-oo os-*=*]
15
16 virt-v2v [-i* options] -o glance
17
19 This page documents how to use virt-v2v(1) to convert guests to run on
20 OpenStack. There are two output modes you can select, but only -o
21 openstack should be used normally.
22
23 -o openstack -oo server-id=SERVER [...]
24 Full description: "OUTPUT TO OPENSTACK"
25
26 This is the modern method for uploading to OpenStack via the REST
27 API. Guests can be directly converted into Cinder volumes.
28
29 -o glance
30 Full description: "OUTPUT TO GLANCE"
31
32 This is the old method for uploading to Glance. Unfortunately
33 Glance is not well suited to storing converted guests (since
34 virt-v2v deals with "pets" not templated "cattle"), so this method
35 is not recommended unless you really know what you are doing.
36
38 To output to OpenStack, use the -o openstack option.
39
40 OpenStack: Setting up a conversion appliance
41 When virt-v2v is converting to OpenStack, it is unusual in that
42 virt-v2v must be running inside a virtual machine running on top of the
43 OpenStack overcloud. This virtual machine is called the "conversion
44 appliance". Note this virtual machine is unrelated to the guest which
45 is being converted.
46
47 The reason for this is because to create Cinder volumes that will
48 contain the guest data (for the converted guest) we must attach those
49 Cinder volumes to an OpenStack virtual machine.
50
51 The "openstack" command must be installed in the appliance. We use it
52 for communicating with OpenStack.
53
54 When virt-v2v is running in the conversion appliance, you must supply
55 the name or UUID of the conversion appliance to virt-v2v, eg:
56
57 $ openstack server list
58 +--------------------------------------+-----------+--------+
59 | ID | Name | Status |
60 +--------------------------------------+-----------+--------+
61 | bbb0147a-44b9-4d19-9a9d-10ca9a984744 | test1 | ACTIVE |
62 +--------------------------------------+-----------+--------+
63
64 # virt-v2v [...] \
65 -o openstack -oo server-id=bbb0147a-44b9-4d19-9a9d-10ca9a984744
66
67 or:
68
69 # virt-v2v [...] -o openstack -oo server-id=test1
70
71 You can run many parallel conversions inside a single conversion
72 appliance if you want, subject to having enough resources available.
73 However OpenStack itself imposes a limit that you should be aware of:
74 OpenStack cannot attach more than around 25 disks [the exact number
75 varies with configuration] to a single appliance, and that limits the
76 number of guests which can be converted in parallel, because each
77 guest's disk must be attached to the appliance while being copied.
78
79 OpenStack: Authentication
80 Converting to OpenStack requires access to the tenant (non-admin) API
81 endpoints. You will need to either set up your "$OS_*" environment
82 variables or use output options on the virt-v2v command line to
83 authenticate with OpenStack.
84
85 Normally there is a file called "overcloudrc" or "keystonerc_admin"
86 which you can simply "source" to set everything up.
87
88 For example:
89
90 export OS_USERNAME=admin
91
92 or:
93
94 virt-v2v [...] -o openstack -oo os-username=admin
95
96 are equivalent, and have the same effect as using --os-username on the
97 command line of OpenStack tools.
98
99 OpenStack: Running as root
100 Because virt-v2v must access Cinder volumes which are presented as /dev
101 devices to the conversion appliance, virt-v2v must usually run as root
102 in -o openstack mode.
103
104 If you use "sudo" to start virt-v2v and you are using environment
105 variables for authentication, remember to use the "sudo -E" option to
106 preserve the environment.
107
108 OpenStack: Guest ID
109 virt-v2v [...] -o openstack -oo guest-id=123-456-7890
110
111 You may optionally specify -oo guest-id=... on the command line. The
112 ID (which can be any string) is saved on each Cinder volume in the
113 "virt_v2v_guest_id" volume property.
114
115 This can be used to find disks associated with a guest, or to associate
116 which disks are related to which guests when converting many guests.
117
118 OpenStack: Ignore server certificate
119 Using -oo verify-server-certificate=false you can tell the openstack
120 client to ignore the server certificate when connecting to the
121 OpenStack API endpoints. This has the same effect as passing the
122 --insecure option to the "openstack" command.
123
124 OpenStack: Converting a guest
125 The final command to convert the guest, running as root, will be:
126
127 # virt-v2v [-i options ...] \
128 -o openstack -oo server-id=NAME|UUID [-oo guest-id=ID]
129
130 If you include authentication options on the command line then:
131
132 # virt-v2v [-i options ...] \
133 -o openstack -oo server-id=NAME|UUID -oo os-username=admin [etc]
134
135 OpenStack: Booting the guest
136 Guests are converted as Cinder volume(s) (one volume per disk in the
137 original guest). To boot them use the "openstack server create
138 --volume" option:
139
140 $ openstack volume list
141 +--------------------------------------+---------------+-----------+
142 | ID | Name | Status |
143 +--------------------------------------+---------------+-----------+
144 | c4d06d15-22ef-462e-9eff-ab54ab285a1f | fedora-27-sda | available |
145 +--------------------------------------+---------------+-----------+
146 $ openstack server create \
147 --flavor x1.small \
148 --volume c4d06d15-22ef-462e-9eff-ab54ab285a1f \
149 myguest
150 $ openstack console url show myguest
151
152 OpenStack: Other conversion options
153 To specify the Cinder volume type, use -os. If not specified then no
154 Cinder volume type is used.
155
156 The following options are not supported with OpenStack: -oa, -of.
157
159 Note this is a legacy option. In most cases you should use "OUTPUT TO
160 OPENSTACK" instead.
161
162 To output to OpenStack Glance, use the -o glance option.
163
164 This runs the glance(1) CLI program which must be installed on the
165 virt-v2v conversion host. For authentication to work, you will need to
166 set "OS_*" environment variables.
167
168 Normally there is a file called "overcloudrc" or "keystonerc_admin"
169 which you can simply "source" to set everything up.
170
171 Virt-v2v adds metadata for the guest to Glance, describing such things
172 as the guest operating system and what drivers it requires. The
173 command "glance image-show" will display the metadata as "Property"
174 fields such as "os_type" and "hw_disk_bus".
175
176 Glance and sparseness
177 Glance image upload doesn't appear to correctly handle sparseness. For
178 this reason, using qcow2 will be faster and use less space on the
179 Glance server. Use the virt-v2v -of qcow2 option.
180
181 Glance and multiple disks
182 If the guest has a single disk, then the name of the disk in Glance
183 will be the name of the guest. You can control this using the -on
184 option.
185
186 Glance doesn't have a concept of associating multiple disks with a
187 single guest, and Nova doesn't allow you to boot a guest from multiple
188 Glance disks either. If the guest has multiple disks, then the first
189 (assumed to be the system disk) will have the name of the guest, and
190 the second and subsequent data disks will be called "guestname-disk2",
191 "guestname-disk3" etc. It may be best to leave the system disk in
192 Glance, and import the data disks to Cinder.
193
195 virt-v2v(1),
196 https://docs.openstack.org/python-openstackclient/latest/cli/man/openstack.html,
197 glance(1).
198
200 Richard W.M. Jones
201
203 Copyright (C) 2009-2020 Red Hat Inc.
204
206 This program is free software; you can redistribute it and/or modify it
207 under the terms of the GNU General Public License as published by the
208 Free Software Foundation; either version 2 of the License, or (at your
209 option) any later version.
210
211 This program is distributed in the hope that it will be useful, but
212 WITHOUT ANY WARRANTY; without even the implied warranty of
213 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
214 General Public License for more details.
215
216 You should have received a copy of the GNU General Public License along
217 with this program; if not, write to the Free Software Foundation, Inc.,
218 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
219
221 To get a list of bugs against libguestfs, use this link:
222 https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools
223
224 To report a new bug against libguestfs, use this link:
225 https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools
226
227 When reporting a bug, please supply:
228
229 • The version of libguestfs.
230
231 • Where you got libguestfs (eg. which Linux distro, compiled from
232 source, etc)
233
234 • Describe the bug accurately and give a way to reproduce it.
235
236 • Run libguestfs-test-tool(1) and paste the complete, unedited output
237 into the bug report.
238
239
240
241virt-v2v-2.2.0 2023-01-10 virt-v2v-output-openstack(1)