You can use a kickstart file to automate the creation of a guest image of a physical computer using the P2V utility. When you use the P2V utility with a kickstart file, no user intervention is required. If there are any missing parameters in the kickstart file, you are prompted to enter them.
To use a P2V kickstart file, you must create a file with the P2V configuration options and parameters and place it on a kickstart server. The kickstart server can be made available using NFS, FTP, or HTTP. The kickstart server is set up in the same way as a standard Oracle Linux or Red Hat kickstart server and is beyond the scope of this book.
The following example P2V kickstart file starts sends the guest image to an instance of Oracle VM Manager via network device eth0, which obtained an IP address via DHCP:
p2v cdrom lang en_US.UTF-8 keyboard us target --ovmmanager network --device eth0 --bootproto dhcp diskimage --device /dev/sda --type IDE vm_options --name myGuest --mem 1024 --vcpus 1 --consolepasswd mypassword
See Appendix A, P2V Parameters for detailed information on the P2V kickstart file options and parameters.
To create an Oracle VM virtual machine image of a computer using the P2V utility with a kickstart file:
Create a P2V kickstart file and copy it to your kickstart server.
Insert the Oracle VM Server CDROM into your CDROM drive of the computer you want to image.
Restart the computer with the Oracle VM Server CDROM.
The Oracle VM Server screen is
displayed. At the boot:
prompt, enter
p2v
and the protocol and location for the
kickstart file. For example, to use a kickstart file called
ks.cfg on an HTTP server named
http://example.com, enter:
p2v ks=http://example.com/mypath/ks.cfg
Press Enter.
If there are any missing parameters in the kickstart file, you are prompted to enter them.
If the kickstart file includes the directive to import the guest image to Oracle VM Manager, a secure web server (HTTPS) is started. A screen is displayed giving the IP address of the computer, and port number the web server is available on. Log in to Oracle VM Manager and import the guest using the import template feature as described in Section 8.1.1, “Using the P2V Utility”.
When the virtual machine template is added to the repository, you should terminate the P2V utility on the host computer. Press Control+C to terminate the P2V utility on the computer. Remove the Oracle VM Server CDROM from your CDROM drive. Restart the computer.
The guest image is created and available in the repository as a hardware virtualized virtual machine template.