10.3 Converting Hosts Silently with a Kickstart File

To convert physical hosts to a guest image silently, you use a kickstart file to pass parameters to the P2V utility.

The following steps provide a high-level overview of how to convert hosts silently:

  1. Create a P2V kickstart file and copy it to your kickstart server.

  2. Insert the Oracle VM Server installation media into the optical disc drive of the computer you want to image.

  3. Change the boot order to start from the optical disc drive in the BIOS or UEFI settings.

  4. Boot the computer with the Oracle VM Server installation media.

    The Oracle VM Server boot screen displays.

  5. At the boot prompt, enter the following:

    # mboot.c32 xen.mb.efi --- vmlinuz p2v ksdevice=9C:B6:54:82:15:AC 
    ks=http://example.com/mypath/ks.cfg --- initrd.img

    Where:

    • ksdevice specifies the network interface to use.

    • ks is the path to the P2V kickstart file.

The P2V utility begins the conversion process. If there are any missing parameters in the kickstart file, you are prompted to enter them.

When the conversion process completes, you can import the hardware virtualized guest into Oracle VM Manager as a virtual machine template. See Section 10.4, “Importing Guests as Virtual Machine Templates to Oracle VM Manager”.

Considerations for Using a Kickstart File

Before you attempt to convert hosts with a kickstart file, you should consider the following:

  • The P2V utility converts disks on the computer to virtual disk images. The virtual disk images are created as IDE disks (hda, hdb, hdc, hdd, and so on) on the guest, using the original disk names. When you use a P2V kickstart file, up to four disks are automatically deployed in the guest. Any extra disks are converted and added to the guest configuration file (vm.cfg) but are not deployed in the guest.

    To deploy the additional disks in the guest, edit the guest configuration file to remove the comments from the disk entries and map the additional disks to SCSI device names; for example, sda, sdb, and sdc. The boot disk must always be mapped to device hda. Any files on the guest that contain references to these devices must also be changed; for example, the /etc/fstab file might contain references to /dev/hda1, /dev/sda1, and so on.

  • At least one network interface must use DHCP so that the computer on which the P2V utility is running can read the kickstart file over the network.

  • If you want the P2V utility web server to listen using a network interface other than the one that initiates the kickstart session, specify the network configuration for that network interface in the kickstart file.

P2V Kickstart Parameters

To converting hosts with a kickstart file, you must specify parameters at the boot prompt and in a P2V kickstart file.

At the boot prompt, you must specify parameters as follows:

# mboot.c32 xen.mb.efi --- vmlinuz p2v ksdevice=device ks=ksfile --- initrd.img

Boot Parameters

Option

Description

p2v

Loads the P2V conversion utility.

ks=ksfile

Specifies the name and location of a P2V kickstart file.

ksdevice=value

Specifies the network interface to use. You can set one of the following values:

  • The device name of the interface, for example: eth0

  • The MAC address of the interface, for example: 9C:B6:54:82:15:AC

  • The keyword link, which uses the first active network interface found on the system.

  • The keyword bootif, which uses the interface that the system used to boot from a PXE server.

  • The keyword ibft, which uses the MAC address of the interface specified by the iSCSI Boot Firmware Table (iBFT) in the system BIOS or firmware.

Kickstart File Options

Option

Description

p2v

Indicates the kickstart file is intended to automate a P2V conversion. It accepts no parameters.

target --ovmmanager

Sets the end destination for the guest image. Sets the P2V utility to operate in HTTPS server mode to transfer the guest image to a running instance of Oracle VM Manager.

diskimage option ...

Denotes a disk to be included in the guest image. The P2V utility uses device mapper-based snapshotting to copy the disk as a system-*.img file on the target computer. There may be multiple diskimage directives in a P2V kickstart file, each resulting in a disk image in the guest image. The --device parameter must always be used with the diskimage directive to indicate which device should be imaged.

The option parameter is one or more of the following:

--device path

The device to image. path must be the full path to the device. For example:

diskimage --device /dev/sda

--type { IDE | SCSI | LVM | MDRAID }

Sets the type of disk. Must be one of IDE, SCSI, LVM, or MDRAID. Devices /dev/hda, /dev/hdb, /dev/hdc, and /dev/hdd should be IDE. Devices /dev/sd[a-zz] should be SCSI. A logical volume should be LVM. Devices /dev/md[a-zz] should be MDRAID. For example:

diskimage --device /dev/hda --type IDE

network option ...

Configures network information for the computer.

The option parameter is one or more of the following:

--bootproto { dhcp | bootp | static }

Sets the method by which the network configuration is determined. Must be dhcp, bootp, or static. The default is dhcp. bootp and dhcp are treated as the same.

dhcp uses a DHCP server to obtain the networking configuration, for example:

network --bootproto dhcp

static requires all the necessary networking information. As the name implies, this information is static and is used during and after the installation. The entry for static networking is more complex, as you must include all network configuration information on one line. You must specify the IP address, netmask, gateway, and nameserver, for example:

network --bootproto static --ip 10.0.2.15 
  --netmask 255.255.255.0 --gateway 10.0.2.254 
  --nameserver 10.0.2.1

The static method has the following restrictions:

  • All static networking configuration information must be specified on one line; you cannot wrap lines using a backslash.

  • You can only specify one nameserver.

--ip ipaddress

The IP address for the computer.

--gateway ipaddress

The IP address for the default gateway.

--nameserver ipaddress

The IP address for the primary nameserver.

--netmask netmask

The netmask for the computer.

vm_options option ...

Sets the configuration options for the guest.

The option parameter is one or more of the following:

--name name

The name of the guest.

--mem size

The memory allocation for the guest in Mb.

--vcpus number

The number of VCPUs for the guest.

--consolepasswd password

The console password for the guest. This option is ignored by Oracle VM Manager when the guest is imported.

For example:

vm_options --name MyVM --mem 2048 --vcpus 2 
  --consolepasswd mypassword

P2V Kickstart File Example

The following provides an example of a P2V kickstart file:

p2v
target --ovmmanager
network --device eth0 --bootproto dhcp
diskimage --device /dev/sda --type IDE
vm_options --name myVM --mem 2048 --vcpus 2 --consolepasswd password