4.4 P2V Parameters

This section contains information about the Physical to Virtual (P2V) conversion utility and details the usage, syntax and parameters on the command line and in a kickstart file.

The P2V conversion utility enables you to convert a computer's operating system (Linux and Microsoft Windows™) and applications to an Oracle VM hardware virtualized guest image. The P2V utility is included on the Oracle VM Server CD. You can access the P2V utility by restarting a computer with the Oracle VM Server CD. The Oracle VM Server start-up screen is displayed. At the boot: prompt, enter p2v, for example:

boot: p2v

You can use a P2V kickstart file to automate creation of hardware virtualized guest images from physical computers. This section discusses the options and parameters of the P2V kickstart file.

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), although they are not deployed. To deploy the additional disks in the guest, edit the guest configuration file, 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 which contain references to these devices must also be changed, for example, the /etc/fstab file may contain references to /dev/hda1, /dev/sda1, and so on.

When you use a P2V kickstart file, at least one network interface must use DHCP. This is required for the computer running the P2V utility to read the kickstart file over the network. The network configuration for this network interface cannot be modified from the kickstart file.

If you want the P2V utility's web server to listen using a network interface other than the one used to initiate the kickstart session, the network configuration (DHCP or static IP address) for that network interface can be specified in the kickstart file.

A number of screens may be displayed prior to the P2V utility starting with a kickstart file. You can suppress these screens to fully automate the P2V utility. Prior to the P2V utility starting, you may see up to four screens:

  • P2V Network Configuration screen.

  • Language selection screen.

  • Keyboard selection screen.

  • Installation source screen.


p2v [ ks=ksfile ] [ ksdevice=device ]


The following table shows the options for this command. These options can also be used in a kickstart file.




The name and location of a P2V kickstart file. This should be used on the command line, not in a kickstart file.


Suppresses the P2V Network Configuration screen. The device parameter is the name of an Ethernet device, for example eth0. This should be used on the command line, not in a kickstart file.


Indicates the kickstart file is intended to automate a P2V conversion. This parameter is required in order to perform an automated P2V conversion and should be supplied at the Oracle VM Server boot: prompt instead of install, update, or rescue. It accepts no parameters.

lang language

Suppresses the P2V Language selection screen. The language parameter is the name of the operating system language, for example, en_US.UTF-8.

keyboard keyboard

Suppresses the P2V Keyboard selection screen. The keyboard parameter is the name of the keyboard type, for example, us.


Suppress the Installation source screen.

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 
  --netmask --gateway 

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


Example 4.1 P2V Kickstart File

An example P2V kickstart file follows:

lang en_US.UTF-8
keyboard us
target --ovmmanager
network --device eth0 --bootproto dhcp
diskimage --device /dev/sda --type IDE
vm_options --name myVM --mem 2048 --vcpus 2 --consolepasswd password

Example 4.2 Suppressing the P2V Network Configuration Screen

To suppress the P2V Network Configuration screen, supply the Ethernet device on the command line, for example:

boot: p2v ks=http://example.com/ks.cfg ksdevice=eth0

Example 4.3 Suppressing the Language Selection Screen

To suppress the Language selection screen, supply the language parameter in the kickstart file, for example:

lang en_US.UTF-8

Example 4.4 Suppressing the Keyboard Selection Screen

To suppress the Keyboard selection screen, supply the keyboard parameter in the kickstart file, for example:

keyboard us

Example 4.5 Suppressing the Installation Source Screen

To suppress the Installation source screen, supply the source parameter in the kickstart file, for example: