1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
|
=head1 NAME
virt-p2v-make-disk - Build the virt-p2v disk using virt-builder
=head1 SYNOPSIS
virt-p2v-make-disk -o /dev/sdX [os-version]
=head1 DESCRIPTION
L<virt-p2v(1)> converts a physical machine to run virtualized on KVM,
managed by libvirt, OpenStack, oVirt, Red Hat Enterprise
Virtualisation (RHEV), or one of the other targets supported by
L<virt-v2v(1)>.
virt-p2v-make-disk is a script which creates a bootable disk image or
USB key containing virt-p2v. It uses L<virt-builder(1)> to do this,
and is just a small shell script around virt-builder.
The required I<-o> parameter specifies where the output should go, for
example to a USB key (eg. C<-o /dev/sdX>) or to a file. If you pass a
device name, then B<the existing contents of the device will be erased>.
The root user on the disk image uses C<p2v> as its initial password.
=head2 C<os-version> parameter
The optional C<os-version> parameter is the base Linux distro to use
for the operating system on the ISO. If you don't set this parameter,
the script tries to choose a suitable default for you. Most users
should I<not> use the C<os-version> parameter.
The base OS selected for virt-p2v is not related in any way to the OS
of the physical machine that you are trying to convert.
To list possible C<os-version> combinations, do:
virt-builder -l
=head1 EXAMPLES
Write a virt-p2v bootable USB key on F</dev/sdX> (any existing content
on F</dev/sdX> is erased):
virt-p2v-make-disk -o /dev/sdX
Write a virt-p2v bootable virtual disk image, and boot it under qemu:
virt-p2v-make-disk -o /var/tmp/p2v.img
qemu-kvm -m 1024 -boot c \
-drive file=/var/tmp/p2v.img,if=virtio,index=0 \
-drive file=/var/tmp/guest.img,if=virtio,index=1
where F</var/tmp/guest.img> would be the disk image of some guest that
you want to convert (for testing only).
=head1 ADDING EXTRA PACKAGES
You can install extra packages using the I<--install> option. This
can be useful for making a more fully-featured virt-p2v disk with
extra tools for debugging and troubleshooting. Give a list of
packages, separated by commas. For example:
virt-p2v-make-disk -o /var/tmp/p2v.img --install tcpdump,traceroute
=head1 ADDING AN SSH IDENTITY
You can inject an SSH identity (private key) file to the image using
the I<--inject-ssh-identity> option.
First create a key pair. It must have an empty passphrase:
ssh-keygen -t rsa -N '' -f id_rsa
This creates a private key (C<id_rsa>) and a public key
(C<id_rsa.pub>) pair. The public key should be appended to the
C<authorized_keys> file on the virt-v2v conversion server (usually to
C</root/.ssh/authorized_keys>).
The private key should be injected into the disk image and then
discarded:
virt-p2v-make-disk [...] --inject-ssh-identity id_rsa
rm id_rsa
When booting virt-p2v, specify the URL of the injected file like this:
│ User name: [root_____________________________] │
│ │
│ Password: [ <leave this field blank> ] │
│ │
│ SSH Identity URL: [file:///var/tmp/id_rsa___________] │
or if using the kernel command line, add:
p2v.identity=file:///var/tmp/id_rsa
For more information, see L<virt-p2v(1)/SSH IDENTITIES>.
=head1 32 BIT VIRT-P2V
For improved compatibility with older hardware, virt-p2v-make-disk has
an I<--arch> option. The most useful setting (on x86-64 hosts) is
I<--arch i686>, which builds a 32 bit virt-p2v environment that will
work on older hardware. 32 bit virt-p2v can convert 64 bit physical
machines and can interoperate with 64 bit virt-v2v and 64 bit
hypervisors.
This option requires that you have built F<virt-p2v.$arch> (ie.
usually F<virt-p2v.i686>) by some means, and that you install it next
to the ordinary F<virt-p2v> binary (eg. in F<$libdir/virt-p2v/> or
C<$VIRT_V2V_DATA_DIR>). This is outside the scope of this manual
page, but you can find some tips in
L<p2v-building(1)/BUILDING i686 32 BIT VIRT-P2V>.
=head1 OPTIONS
=over 4
=item B<--help>
Display help.
=item B<--arch> ARCH
Set the architecture of the virt-p2v ISO. See L</32 BIT VIRT-P2V> above.
If this option is not supplied, then the default is to use the same
architecture as the host that is running virt-p2v-make-disk.
=item B<--inject-ssh-identity> id_rsa
Add an SSH identity (private key) file into the image.
See L</ADDING AN SSH IDENTITY> above.
=item B<--install> pkg,pkg,...
Add extra packages to the image.
See L</ADDING EXTRA PACKAGES> above.
=item B<--no-warn-if-partition>
Normally you should not write to a partition on a USB drive (ie. don’t
use S<C<-o /dev/sdX1>>, use S<C<-o /dev/sdX>> to make a bootable USB
drive). If you do this, virt-builder prints a warning. This option
suppresses that warning.
=item B<-o> OUTPUT
=item B<--output> OUTPUT
Write output to C<OUTPUT>, which can be a local file or block device.
B<The existing contents of the device will be erased>.
=item B<-v>
=item B<--verbose>
Enable verbose output. Use this if you need to debug problems with
the script or if you are filing a bug.
=item B<-V>
=item B<--version>
Display version number and exit.
=back
=head1 FILES
=over 4
=item F<$libdir/virt-p2v/virt-p2v.xz>
The L<virt-p2v(1)> binary which is copied into the bootable disk
image.
The location of the binary can be changed by setting the
C<VIRT_P2V_DATA_DIR> environment variable.
=item F<$datadir/virt-p2v/issue>
=item F<$datadir/virt-p2v/launch-virt-p2v.in>
=item F<$datadir/virt-p2v/p2v.service>
Various data files that are copied into the bootable disk image.
The location of these files can be changed by setting the
C<VIRT_P2V_DATA_DIR> environment variable.
=back
=head1 ENVIRONMENT VARIABLES
=over 4
=item C<VIRT_P2V_DATA_DIR>
The directory where virt-p2v-make-disk looks for data files (see
L</FILES> above). If not set, a compiled-in location is used.
=back
=head1 SEE ALSO
L<virt-p2v(1)>,
L<virt-p2v-make-kickstart(1)>,
L<virt-p2v-make-kiwi(1)>,
L<virt-v2v(1)>,
L<http://libguestfs.org/>.
=head1 AUTHORS
Richard W.M. Jones L<http://people.redhat.com/~rjones/>
=head1 COPYRIGHT
Copyright (C) 2009-2019 Red Hat Inc.
|