.\" Automatically generated by Podwrapper::Man 1.40.2 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "virt-p2v-make-kickstart 1" .TH virt-p2v-make-kickstart 1 "2019-02-07" "libguestfs-1.40.2" "Virtualization Support" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" virt\-p2v\-make\-kickstart \- Build the virt\-p2v kickstart .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& virt\-p2v\-make\-kickstart [\-o p2v.ks] [\-\-proxy=http://...] repo [repo...] .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBvirt\-p2v\fR\|(1) converts a physical machine to run virtualized on \s-1KVM,\s0 managed by libvirt, OpenStack, oVirt, Red Hat Enterprise Virtualisation (\s-1RHEV\s0), or one of the other targets supported by \&\fBvirt\-v2v\fR\|(1). .PP Kickstart is a format used by Red Hat-derived distributions (such as Fedora, Red Hat Enterprise Linux, CentOS, Scientific Linux, and others) to describe how to make live CDs, install the distro, make \&\*(L"Spins\*(R" and so on. It is driven by a kickstart file. .PP virt\-p2v\-make\-kickstart builds a kickstart file which can be used to build a bootable P2V \s-1ISO,\s0 live \s-1CD, USB\s0 key, or \s-1PXE\s0 image. This tool only builds the kickstart file, but this manual page describes some of the ways you can use the kickstart file. .SH "BUILDING THE KICKSTART FILE" .IX Header "BUILDING THE KICKSTART FILE" Using virt\-p2v\-make\-kickstart is very simple: .PP .Vb 1 \& virt\-p2v\-make\-kickstart fedora .Ve .PP will build a kickstart file for Fedora. The kickstart file will be called \fIp2v.ks\fR and located in the current directory. .PP The parameters are a list of one or more repositories. Some built-in repositories are available: \f(CW\*(C`fedora\*(C'\fR, \f(CW\*(C`rawhide\*(C'\fR, \f(CW\*(C`koji\*(C'\fR or \&\f(CW\*(C`rhel\-VERSION\*(C'\fR (eg. \f(CW\*(C`rhel\-7.1\*(C'\fR). You can also use a \s-1URL\s0 as a parameter to point to a repository, for example: .PP .Vb 1 \& virt\-p2v\-make\-kickstart https://dl.fedoraproject.org/pub/fedora/linux/releases/21/Everything/x86_64/os/ .Ve .PP To control the name of the output file, use the \fI\-o\fR parameter. To tell kickstart to use a proxy server or web cache to download files, use the \fI\-\-proxy\fR parameter. .SH "BUILDING A LIVE CD / ISO" .IX Header "BUILDING A LIVE CD / ISO" Once you have the kickstart file, you can use \fBlivecd\-creator\fR\|(8) to make a live \s-1CD:\s0 .PP .Vb 1 \& sudo livecd\-creator p2v.ks .Ve .PP Before running this note that you should probably run \&\f(CW\*(C`livecd\-creator\*(C'\fR in a disposable virtual machine for these reasons: .IP "\(bu" 4 You have to disable SELinux when running the tool. .IP "\(bu" 4 This tool has to be run as root, and has some nasty failure modes. .IP "\(bu" 4 You can only create the exact same Live \s-1CD\s0 distro as the host distro. Cross-builds will fail in strange ways (eg. RHBZ#1092327). .SH "BUILDING A FEDORA SPIN USING KOJI" .IX Header "BUILDING A FEDORA SPIN USING KOJI" This requires \f(CW\*(C`spin\-livecd\*(C'\fR permissions on Koji, which are not given out usually, even to Fedora packagers. However assuming you have been given these permissions (or have your own Koji instance, I guess), then you can do: .PP .Vb 1 \& koji spin\-livecd [\-\-scratch] virt\-p2v 1.XX.YY rawhide x86_64 p2v.ks .Ve .IP "\(bu" 4 Add the \f(CW\*(C`\-\-scratch\*(C'\fR option to do a scratch build (recommended for testing). .IP "\(bu" 4 \&\f(CW\*(C`1.XX.YY\*(C'\fR should match the libguestfs version .IP "\(bu" 4 Instead of \f(CW\*(C`rawhide\*(C'\fR you can use any Koji target. .SH "BUILDING A BOOTABLE USB KEY" .IX Header "BUILDING A BOOTABLE USB KEY" Use the \fBlivecd\-iso\-to\-disk\fR\|(8) program to convert the \s-1ISO\s0 created above to a \s-1USB\s0 key: .PP .Vb 1 \& sudo livecd\-iso\-to\-disk livecd\-p2v.iso /dev/sdX .Ve .SH "BUILDING A PXE BOOT IMAGE" .IX Header "BUILDING A PXE BOOT IMAGE" Use the \f(CW\*(C`livecd\-iso\-to\-pxeboot\*(C'\fR program to convert the \s-1ISO\s0 created above to a \s-1PXE\s0 boot image. .PP .Vb 1 \& sudo livecd\-iso\-to\-pxeboot livecd\-p2v.iso .Ve .PP This creates a \f(CW\*(C`tftpboot\*(C'\fR subdirectory under the current directory containing the files required to \s-1PXE\s0 boot virt\-p2v: .PP .Vb 6 \& $ ls \-1R tftpboot/ \& tftpboot/: \& initrd0.img \& pxelinux.0 \& pxelinux.cfg/ \& vmlinuz0 \& \& tftpboot/pxelinux.cfg: \& default .Ve .SH "32 OR 64 BIT VIRT\-P2V?" .IX Header "32 OR 64 BIT VIRT-P2V?" Virt\-p2v can convert any 32 or 64 bit guest, regardless of whether virt\-p2v itself is built as a 32 or 64 bit binary. The only restriction is that 64 bit virt\-p2v cannot run on 32 bit hardware. .PP Old virt\-p2v 0.9 was always built as a 32 bit (i686) \s-1ISO.\s0 This meant that the \s-1CD\s0 could be booted on any 32\- or 64\-bit i686 or x86\-64 hardware, and could convert any guest. The old virt\-p2v \s-1ISO\s0 shipped by Red Hat was based on Red Hat Enterprise Linux (\s-1RHEL\s0) 6. .PP Since \s-1RHEL 7\s0 dropped support for 32 bit machines, current virt\-p2v on \&\s-1RHEL\s0 can only be built for 64 bit. It cannot run on old 32 bit only hardware. .PP Fedora virt\-p2v ISOs are generally built for 32 bit, so like the old \&\s-1RHEL\s0 6\-based virt\-p2v 0.9 they can boot on any hardware. .SH "TESTING VIRT\-P2V USING QEMU" .IX Header "TESTING VIRT-P2V USING QEMU" .SS "\s-1TESTING THE P2V ISO USING QEMU\s0" .IX Subsection "TESTING THE P2V ISO USING QEMU" You can use qemu to test-boot the P2V \s-1ISO:\s0 .PP .Vb 1 \& qemu\-kvm \-m 1024 \-hda /tmp/guest.img \-cdrom /tmp/livecd\-p2v.iso \-boot d .Ve .PP Note that \f(CW\*(C`\-hda\*(C'\fR is the (virtual) system that you want to convert (for test purposes). It could be any guest type supported by \&\fBvirt\-v2v\fR\|(1), including Windows or Red Hat Enterprise Linux. .SS "\s-1TESTING PXE SUPPORT USING QEMU\s0" .IX Subsection "TESTING PXE SUPPORT USING QEMU" .IP "\(bu" 4 Unpack the tftpboot directory into \fI/tmp\fR (so it appears as \&\fI/tmp/tftpboot\fR). .IP "\(bu" 4 Copy \fIpxelinux.0\fR and \fIldlinux.c32\fR from syslinux (usually from \&\fI/usr/share/syslinux\fR) into \fI/tmp/tftpboot\fR. .IP "\(bu" 4 Adjust the \f(CW\*(C`APPEND\*(C'\fR line in \fI/tmp/tftpboot/pxelinux.cfg/default\fR if required. See \*(L"\s-1KERNEL COMMAND LINE CONFIGURATION\*(R"\s0 in \fBvirt\-p2v\fR\|(1). .IP "\(bu" 4 Run qemu like this so that it acts as a \s-1TFTP\s0 and \s-1BOOTP\s0 server, emulating a netboot: .Sp .Vb 6 \& qemu\-kvm \e \& \-m 4096 \-hda /tmp/guest.img \e \& \-boot n \e \& \-netdev user,id=unet,tftp=/tmp/tftpboot,bootfile=/pxelinux.0 \e \& \-device virtio\-net\-pci,netdev=unet \e \& \-serial stdio .Ve .Sp Note that this requires considerably more memory because the \s-1PXE\s0 image is loaded into memory. Also that qemu’s \s-1TFTP\s0 server is very slow and the virt\-p2v \s-1PXE\s0 image is very large, so it can appear to \*(L"hang\*(R" after pxelinux starts up. .SH "ADDING EXTRA PACKAGES" .IX Header "ADDING EXTRA PACKAGES" You can install extra packages using the \fI\-\-install\fR 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: .PP .Vb 1 \& virt\-p2v\-make\-kickstart [...] \-\-install tcpdump,traceroute .Ve .SH "ADDING AN SSH IDENTITY" .IX Header "ADDING AN SSH IDENTITY" You can inject an \s-1SSH\s0 identity (private key) file to the kickstart and hence into the \s-1ISO\s0 using the \fI\-\-inject\-ssh\-identity\fR option. Note that you \fIcannot\fR inject a key once the \s-1ISO\s0 has been built. .PP First create a key pair. It must have an empty passphrase: .PP .Vb 1 \& ssh\-keygen \-t rsa \-N \*(Aq\*(Aq \-f id_rsa .Ve .PP This creates a private key (\f(CW\*(C`id_rsa\*(C'\fR) and a public key (\f(CW\*(C`id_rsa.pub\*(C'\fR) pair. The public key should be appended to the \&\f(CW\*(C`authorized_keys\*(C'\fR file on the virt\-v2v conversion server (usually to \&\f(CW\*(C`/root/.ssh/authorized_keys\*(C'\fR). .PP The private key should be added to the kickstart file and then discarded: .PP .Vb 2 \& virt\-p2v\-make\-kickstart [...] \-\-inject\-ssh\-identity id_rsa \& rm id_rsa .Ve .PP The \s-1ISO\s0 can then be built from the kickstart in the usual way (see above), and it will contain the embedded \s-1SSH\s0 identity (\fI/var/tmp/id_rsa\fR). .PP When booting virt\-p2v, specify the \s-1URL\s0 of the injected file like this: .PP .Vb 5 \& │ User name: [root_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_] │ \& │ │ \& │ Password: [ ] │ \& │ │ \& │ SSH Identity URL: [file:///var/tmp/id_rsa_\|_\|_\|_\|_\|_\|_\|_\|_\|_\|_] │ .Ve .PP or if using the kernel command line, add: .PP .Vb 1 \& p2v.identity=file:///var/tmp/id_rsa .Ve .PP For more information, see \*(L"\s-1SSH IDENTITIES\*(R"\s0 in \fBvirt\-p2v\fR\|(1). .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-\-help\fR" 4 .IX Item "--help" Display help. .IP "\fB\-\-inject\-ssh\-identity\fR id_rsa" 4 .IX Item "--inject-ssh-identity id_rsa" Add an \s-1SSH\s0 identity (private key) file into the kickstart. See \*(L"\s-1ADDING AN SSH IDENTITY\*(R"\s0 above. .IP "\fB\-\-install\fR pkg,pkg,..." 4 .IX Item "--install pkg,pkg,..." Add extra packages to the kickstart \f(CW%packages\fR section. See \*(L"\s-1ADDING EXTRA PACKAGES\*(R"\s0 above. .IP "\fB\-o\fR \s-1OUTPUT\s0" 4 .IX Item "-o OUTPUT" .PD 0 .IP "\fB\-\-output\fR \s-1OUTPUT\s0" 4 .IX Item "--output OUTPUT" .PD Write kickstart to \f(CW\*(C`OUTPUT\*(C'\fR. If not specified, the default is \&\fIp2v.ks\fR in the current directory. .IP "\fB\-\-proxy\fR \s-1URL\s0" 4 .IX Item "--proxy URL" Tell the kickstart to use a proxy server or web cache for downloads. .IP "\fB\-v\fR" 4 .IX Item "-v" .PD 0 .IP "\fB\-\-verbose\fR" 4 .IX Item "--verbose" .PD Enable verbose output. Use this if you need to debug problems with the script or if you are filing a bug. .IP "\fB\-V\fR" 4 .IX Item "-V" .PD 0 .IP "\fB\-\-version\fR" 4 .IX Item "--version" .PD Display version number and exit. .SH "FILES" .IX Header "FILES" .IP "\fI\f(CI$libdir\fI/virt\-p2v/virt\-p2v.xz\fR" 4 .IX Item "$libdir/virt-p2v/virt-p2v.xz" The \fBvirt\-p2v\fR\|(1) binary which is copied into the kickstart file. .Sp The location of the binary can be changed by setting the \&\f(CW\*(C`VIRT_P2V_DATA_DIR\*(C'\fR environment variable. .IP "\fI\f(CI$datadir\fI/virt\-p2v/issue\fR" 4 .IX Item "$datadir/virt-p2v/issue" .PD 0 .IP "\fI\f(CI$datadir\fI/virt\-p2v/launch\-virt\-p2v.in\fR" 4 .IX Item "$datadir/virt-p2v/launch-virt-p2v.in" .IP "\fI\f(CI$datadir\fI/virt\-p2v/p2v.ks.in\fR" 4 .IX Item "$datadir/virt-p2v/p2v.ks.in" .IP "\fI\f(CI$datadir\fI/virt\-p2v/p2v.service\fR" 4 .IX Item "$datadir/virt-p2v/p2v.service" .PD Various data files that are used to make the kickstart. .Sp The location of these files can be changed by setting the \&\f(CW\*(C`VIRT_P2V_DATA_DIR\*(C'\fR environment variable. .SH "ENVIRONMENT VARIABLES" .IX Header "ENVIRONMENT VARIABLES" .ie n .IP """VIRT_P2V_DATA_DIR""" 4 .el .IP "\f(CWVIRT_P2V_DATA_DIR\fR" 4 .IX Item "VIRT_P2V_DATA_DIR" The directory where virt\-p2v\-make\-kickstart looks for data files and the virt\-p2v binary (see \*(L"\s-1FILES\*(R"\s0 above). If not set, a compiled-in location is used. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBvirt\-p2v\fR\|(1), \&\fBvirt\-p2v\-make\-disk\fR\|(1), \&\fBvirt\-v2v\fR\|(1), \&\fBlivecd\-creator\fR\|(8), \&\fBlivecd\-iso\-to\-disk\fR\|(8), http://libguestfs.org/. .SH "AUTHORS" .IX Header "AUTHORS" Richard W.M. Jones http://people.redhat.com/~rjones/ .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2009\-2019 Red Hat Inc. .SH "LICENSE" .IX Header "LICENSE" This program is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. .PP This program is distributed in the hope that it will be useful, but \&\s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \&\s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE.\s0 See the \s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, \s-1MA 02110\-1301 USA.\s0 .SH "BUGS" .IX Header "BUGS" To get a list of bugs against libguestfs, use this link: https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools .PP To report a new bug against libguestfs, use this link: https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools .PP When reporting a bug, please supply: .IP "\(bu" 4 The version of libguestfs. .IP "\(bu" 4 Where you got libguestfs (eg. which Linux distro, compiled from source, etc) .IP "\(bu" 4 Describe the bug accurately and give a way to reproduce it. .IP "\(bu" 4 Run \fBlibguestfs\-test\-tool\fR\|(1) and paste the \fBcomplete, unedited\fR output into the bug report.