Sun Microsystems, Inc.  Oracle System Handbook - ISO 7.0 May 2018 Internal/Partner Edition
   Home | Current Systems | Former STK Products | EOL Systems | Components | General Info | Search | Feedback

Asset ID: 1-71-1608367.1
Update Date:2018-05-14
Keywords:

Solution Type  Technical Instruction Sure

Solution  1608367.1 :   ODAVP: Migrating systems to ODA Virtualized Platform (ODA VP)  


Related Items
  • Oracle Database Appliance
  •  
  • Oracle Database Appliance Software
  •  
Related Categories
  • PLA-Support>Eng Systems>Exadata/ODA/SSC>Oracle Database Appliance>DB: ODA_EST
  •  




In this Document
Goal
Solution
 Covered scenarios
 I. Physical System and VM to ODA VP
 1. Create a virtual machine image of a computer:
 2. Download the physical system image
 3. Build the ODA VP valid template
 4. Import the template into ODA VP
 5. Once the template has been registered you can clone the new Guest as following (from oda_base)
 II. VMWare or VBox or Hyper-V to ODA VP
 1. Pre export steps
 2. Export the VM from VMWare or VBox as OVA format
 3. Import the OVA VM template on ODA VP
 4. Once the template has been registered review the vm configuration file 'vm.cfg' (from dom0)
 5. Once the template has been registered you can clone the new Guest as following (from oda_base)
 III. How to Manually Convert a VMWare Guest Image for use with Oracle Database Appliance Virtualized Platform
 1. Choose the appropriate VMware guest to convert
 2. Pre export steps
 3. Convert VMware image to a single disk
 4. Convert VMware single disk to raw image using qemu-img
 5. Copy raw VMware disk to Oracle Database Appliance VM Server
 6. Create the Virtual Machine configuration file
 7. Register the new Guest VM as OVM Template 
References


Applies to:

Oracle Database Appliance - Version All Versions and later
Oracle Database Appliance Software - Version 2.5.0.0 and later
Information in this document applies to any platform.

Goal

The aim of this article is to show how to migrate a systems, running on physical HW, VMware, VBox, KVM to use with Oracle Database Appliance Virtualized Platform (ODA VP)

Solution

Covered scenarios

There are a growing number of people asking the question: how do you move a physical, VMware/VBox virtual machine to ODA VP. In the following article we will cover different scenarios to accomplish this objective.

scenarios2
 

 

I. Physical System and VM to ODA VP

You can convert the operating system (Linux and Microsoft Windows™) and application software on a computer to an Oracle VM hardware virtualized guest image using the Physical to Virtual (P2V) conversion utility. The P2V utility is included on the Oracle VM Server CD. To perform a P2V conversion, the host computer must have a CPU that supports PAE (Physical Address Extension).

The P2V conversion process creates a virtual machine configuration file (vm.cfg), allows you to make some modifications in terms of sizing of the virtual machine hardware, and then replicates the physical image and transfers it over the network. The image on your physical computer is not changed in any way.

The hardware virtualized guest created by the P2V utility must have it's own network configuration. If you use the same network configuration as the original computer, a network clash may occur as two computers on the network may have the same IP and MAC address. When the guest is started, make sure the network device is detected and a new network device is configured.

You can run the P2V utility interactively, or as an automated process using a kickstart configuration file. When you use the P2V utility with a kickstart file, no user intervention is required (see Oracle VM User Guide for details)

Requirements:

When you use the P2V utility, you are prompted for all required information.

1. Create a virtual machine image of a computer:

a. Insert the Oracle VM Server CDROM into the CDROM drive of the computer you want to image.

Note: This procedure is for 64-bit computers. If you want to convert a 32-bit host computer to a virtual machine template, you must use the Oracle VM 2.x CD.
 

b. Start the computer with the Oracle VM Server CDROM.

c. The Oracle VM Server screen is displayed.

Oracle VM Server Installation Screen

At the boot: prompt, enter:

p2v

Press Enter.

d. The CD Found screen is displayed.

 p2v02

If you want to make sure the CDROM is error free, you can have the installer test it for errors. To test the CDROM, select OK and press Enter. The CDROM is tested and any errors are reported.

To skip media testing and continue with the installation, select Skip and press Enter.

e. The P2V Network Configuration screen is displayed.

P2V Network Configuration Screen

Select your Ethernet driver from the list displayed.

If your computer uses DHCP to assign its IP address, select Automatically obtain via DHCP.

If your computer uses a static IP address, select Manually configure, and enter the IP address and netmask, gateway, domain and name server for your computer.

Select OK and press Enter.

f. The disk selection screen is displayed.

Disk Selection Screen

Select the disk partition(s) on the computer to include in the guest image. Select OK and press Enter.

g. The Other parameters for VM screen is displayed.

Other Parameters for VM Screen

Enter information about the guest image for:

  • VM (guest) name

  • VM (guest) memory

  • Number of virtual CPUs

  • Console password. This is no longer required, but you must enter a value.

Select OK and press Enter.

h. A secure web server (HTTPS) is started. The IP address of the computer, and port number the web server is available on is displayed.

Web Server Screen

Open a web browser on another computer and enter the URL created using the information displayed on the computer running the P2V utility, for example

https://192.168.1.100/

You do not need to enter the port number as this is the default port number for HTTPs connections. A directory listing is displayed which contains the files created by the P2V utility. Take a note of the URLs for the vm.cfg and *.img files as you use them in the next step.

List of P2V files

2. Download the physical system image

You can download the physical system image directly on ODA dom0 under /OVS/staging issuing

mkdir -p /OVS/staging/<MigratedSystemName>
curl -k https://192.168.1.100/vm.cfg
curl -o /OVS/staging/<MigratedSystemName> -k https://192.168.1.100/System-sda.img

3. Build the ODA VP valid template

In order to build a valid ODA VP template issue the following command:

tar cvfz /OVS/staging/<MigratedSystemName>.tgz -C /OVS/staging/<MigratedSystemName> .

ie:
tar cvfz /OVS/staging/OL6U4.tgz -C /OVS/staging/OL6U4 .

4. Import the template into ODA VP

You can now import the created template from ODA_BASE issuing the following command

oakcli import vmtemplate <vmtemplatename> -files <image files> -repo <repo_name> [ -node <0|1> ]


example:
# oakcli import vmtemplate ol6u4 -files /OVS/staging/ol6u4.tgz -repo odarepo1

Note:
see ODA documentation  on how to Manage Virtual Machines on Oracle Database Appliance
 

Note:

if you build the ODA VP valid template on another system you can provide the availabiltty to ODA VP thought and HTTP server importing it with the following command:

oakcli import vmtemplate <vmtemplatename> -files <http://templatename> -repo <repo_name> [ -node <0|1> ]

example:
# oakcli import vmtemplate ol6u4 -files http://192.168.1.200:8000/ol6u4.tgz -repo odarepo1

TIP: If you have no proper http/server setup in the environment, the following single python command will start an HTTP server which will serve all files from the current directory and all subdirectories:


$ python -m SimpleHTTPServer 8000

  

5. Once the template has been registered you can clone the new Guest as following (from oda_base)

oakcli clone vm <vm_name> -vm template-repo
# oakcli clone vm ol6u4 -vmtemplate ol6u4 -repo odarepo1

Cloned VM : ol6u4

Now you can manage/configure the new Guest VM from dom1 using oakcli (configure, show, start/stop)

# oakcli show vm ol6u4
....     
# oakcli start vm ol6u4

Started VM : ol6u4
 

II. VMWare or VBox or Hyper-V to ODA VP

The aim of this chapter is to show how to convert a VMWare or VBox guest image for use with Oracle Database Appliance Virtualized Platform (ODA VP) using assembly template file.

1. Pre export steps

If in your MS Windows VM you are using scsi devices: apply fix for kb31408 see also Note 754071.1
Uninstall VMWare/VBox tools


Removing VMware Tools, this is easy enough (on linux guest):

vmware-uninstall-tools.pl

Removing VMware Tools (on linux guest):

/opt/[VboxAddonsFolder]/uninstall.sh 

 

2. Export the VM from VMWare or VBox as OVA format

An emerging standard for encapsulating information to allow vm's to be transported more easily are:

  • Open Virtualization Format (OVF) is an open standard for packaging and distributing virtual appliances or more generally software to be run in virtual machines.
  • Open Virtualization Format Archive (OVA) is a tar archive containing the OVF package files

Note as OVF is not supported on ODA yet.

So in theory you should be able to Export this vm from VMware Workstation/VirtualBox. Sadly, the VMware conversion wizard (File...Import or Export...) doesn't support Oracle Enterprise Linux as a guest, but there is a command line ovftool that can be downloaded from VMware's site.

On VBox, you can export a VM as OVF if you choose 'ovf' as file estension or as OVA if you choose 'ova' as file estension.

In any case, You can create an OVA file format from an OVF, building a tar file where the configuration file (.ovf) must be the first

Example:
Exporting as OVF from VBox a Ms Windows VM with one virtual disk, three files are created:

  • MsWin2008.ovf               - VM configuration file
  • MsWin2008-disk1.vmdk    - VM virtual disk
  • MsWin2008.mf               - VM manifest file

If you need to build the corrisponding OVA file you need to make a tar file where the VM configuration (.ovf) file is the first:

tar cvf MsWin2008.ova MsWin2008.ovf MsWin2008-disk1.vmdk MsWin2008.mf

3. Import the OVA VM template on ODA VP

You can now import the OVA created template from ODA_BASE issuing the following command

oakcli import vmtemplate <vmtemplatename> -assembly <image files> -repo <repo_name> [ -node <0|1> ]

example:
# oakcli import vmtemplate MsWin2008 -assembly /OVS/staging/MsWin2008.ova -repo odarepo1
# oakcli import vmtemplate MsWin2008 -assembly http://192.168.1.200:8000/MsWin2008.ova -repo odarepo1
 
Note:
see ODA documentation how Managing Virtual Machines on Oracle Database Appliance


TIP: If you have no proper http/server setup in the environment, the following single python command will start an HTTP server which will serve all files from the current directory and all subdirectories:
$ python -m SimpleHTTPServer 8000

4. Once the template has been registered review the vm configuration file 'vm.cfg' (from dom0)

The VM configuration file (vm.cfg) is stored under

/OVS/Repositories/<repo name>/Templates/otml_<VM template name>/vm.cfg

ie:
/OVS/Repositories/odarepo1/Templates/otml_MsWin2008/vm.cfg

 

# cat vm.cfg
vif = ['']
name = 'otml_MsWin2008'
builder = 'hvm'
vcpus = 2
memory = 4096
serial = 'pty'
disk = [u'file:/OVS/Repositories/odarepo1/Templates/otml_MsWin2008/6ee6ea13b3264f7a8e36ff5dfbd95015.img,xvda,w']
uuid = 'd001944ceebd42399a37a6bc140c309b'


- The option

vif = [''] should be changed to vif = [ 'type=ioemu,bridge=net1']

- You should add the entry

vfb = [ 'type=vnc,vnclisten=0.0.0.0,vncunused=1' ]


The backend listens on IP 127.0.0.1 port 5900+N by default where N would be the domain ID. You can override both address and N (IP address 0.0.0.0 means dom0 IP)

vfb = [ 'type=vnc,vnclisten=0.0.0.0,vncdisplay=10' ]

or bind the first unused port above 5900 (on dom0 ip address):

vfb = [ 'type=vnc,vnclisten=0.0.0.0,vncunused=1' ]

or override the password

vfb = [ 'type=vnc,vnclisten=0.0.0.0,vncpassword='MyPassword',vncunused=1' ]

It could be also needed to add the following entries:

kernel = '/usr/lib/xen/boot/hvmloader'
device_model = '/usr/lib/xen/bin/qemu-dm'
acpi = 0
apic = 0
pae = 0 

where

kernel
    Path to the kernel image
device_model
    Path to device model program
acpi
    Disable or enable ACPI of HVM domain. Default: 1
apic
    Disable or enable APIC mode. Default: 1    
pae
    Disable or enable PAE. Default: 1

  

5. Once the template has been registered you can clone the new Guest as following (from oda_base)

oakcli clone vm <vm_name> -vm template-repo
# oakcli clone vm MsWin2008 -vmtemplate MsWin2008 -repo odarepo1

Cloned VM : MsWin2008

Now you can manage/configure the new Guest VM from dom1 using oakcli (configure, show, start/stop)

# oakcli show vm MsWin2008
....     
# oakcli start vm MsWin2008

Started VM : MsWin2008

Note:

If the VMWare image you are using is a Windows OS and you got boot issue, this can likely be solved by disabling ACPI and the APIC in the guest.

acpi = 0
apic = 0

 

 

III. How to Manually Convert a VMWare Guest Image for use with Oracle Database Appliance Virtualized Platform

The aim of this chapter is to show how to convert a VMWare  guest image for use with Oracle Database Appliance Virtualized Platform (ODA VP)

Requirements:

  • VMware guest image files (.vmdk)
  • VMware: vmware-vdiskmanager utility
  • QEMU: qemu-img utility
  • Oracle Database Appliance VM Server

1. Choose the appropriate VMware guest to convert

Select an appropriate xen-capable VMware guest image to convert, such as Enterprise Linux, Ubuntu, Ms Windows

In the following example, VMware image files pertain to an Enterprise Linux 6.2 (x86-64) guest created using VMware Workstation 9.0.1 running under Ubuntu 12.10 (x86-64)

$ ls -l VMWare/OEL6_64-bit/
total 656545
-rw------- 1 rcitton oda      8684 Jan 31 16:09 OEL6_64-bit.nvram
-rw------- 1 rcitton oda 374734848 Jan 31 16:14 OEL6_64-bit-s001.vmdk
-rw------- 1 rcitton oda 224329728 Jan 31 16:14 OEL6_64-bit-s002.vmdk
-rw------- 1 rcitton oda  72679424 Jan 31 16:14 OEL6_64-bit-s003.vmdk
-rw------- 1 rcitton oda    393216 Jan 31 16:13 OEL6_64-bit-s004.vmdk
-rw------- 1 rcitton oda    327680 Jan 31 16:09 OEL6_64-bit-s005.vmdk
-rw------- 1 rcitton oda     65536 Jan 31 16:09 OEL6_64-bit-s006.vmdk
-rw------- 1 rcitton oda       697 Jan 31 16:13 OEL6_64-bit.vmdk
-rw------- 1 rcitton oda         0 Jan 31 15:53 OEL6_64-bit.vmsd
-rw------- 1 rcitton oda      2552 Jan 31 16:09 OEL6_64-bit.vmx
-rw------- 1 rcitton oda       266 Jan 31 15:53 OEL6_64-bit.vmxf
-rw------- 1 rcitton oda    587785 Jan 31 16:14 vmware.log

Note: as the VMware guest image files were created as multiple (split), 2Gb files, rather than a single contiguous file.

 

2. Pre export steps

If in your MS Windows VM you are using scsi devices: apply fix for kb31408 see also Note 754071.1

Uninstall vmware tools

Stop the VM

Make sure there are no snapshots on the vm

 

3. Convert VMware image to a single disk

Run the VMware /usr/bin/vmware-vdiskmanager utility to convert multiple VMware disk images into a single, growable virtual disk (type 0)

vmware-vdiskmanager -r <source-disk> -t <disk-type> <disk-name> 

  Disk types:
      0                   : single growable virtual disk
      1                   : growable virtual disk split in 2GB files
      2                   : preallocated virtual disk
      3                   : preallocated virtual disk split in 2GB files
      4                   : preallocated ESX-type virtual disk
      5                   : compressed disk optimized for streaming

$ vmware-vdiskmanager -r OEL6_64-bit.vmdk -t 0 OEL6_64-bit-xen.vmdk
Creating disk 'OEL6_64-bit-xen.vmdk'
  Convert: 100% done.
Virtual disk conversion successful.
$ ls -l *xen.vmdk
-rw------- 1 rcitton oda 830341120 Jan 31 16:23 OEL6_64-bit-xen.vmdk

 

4. Convert VMware single disk to raw image using qemu-img

The QEMU /usr/sbin/qemu-img utility is required to convert VMware disks into raw image form for use by Oracle VM. The qemu-img utility is provided by the xen-tools package but on ODA VM the qemu-img is not available. There is the qemu-img-xen but unfortunately it's not working properly with recent vmdk files.

Due to differences between QEMU mainline and xen-tools' QEMU, do not install QEMU on top of an Oracle Database Appliance VM. For converting VMware images on systems other than Oracle VM Servers, qemu-img (from QEMU mainline) is available externally e.g.:

http://wiki.qemu.org/Download (source)

http://dag.wieers.com/rpm/packages/qemu/ (rpm packages)

You should download and install it on a separate linux box.


Convert the single VMware disk image file from vmdk format to a raw image. In the following example, VMware disk file OEL6_64-bit-xen.vmdk is converted to OEL6_64-bit-xen.img:

$ qemu-img convert -f vmdk  OEL6_64-bit-xen.vmdk -O raw OEL6_64-bit-xen.img

$ ls -l *.img
-rw------- 1 rcitton oda 10737418240 Jan 31 16:37 OEL6_64-bit-xen.img

 

5. Copy raw VMware disk to Oracle Database Appliance VM Server

Copy the raw VMWare disk image created above on ODA VM Server under the folder /OVS/stage/vm_temp/<vm_name>, ie:

scp OEL6_64-bit-xen.img <hostname>:/OVS/stage/vm_temp/OEL6_64

 

6. Create the Virtual Machine configuration file

Under the above folder  '/OVS/stage/vm_temp/<vm_name>' create the VM configuration file vm.cfg, example

name = 'OEL6_64'
kernel = '/usr/lib/xen/boot/hvmloader'
device_model = '/usr/lib/xen/bin/qemu-dm'
builder = 'hvm'
memory = '2048'
vcpus = 2
acpi = 1
apic = 1
pae = 1
disk = [u'file:/OVS/stage/vm_temp/OEL6_64/OEL6_64-bit-xen.img,xvda,w']
on_reboot = 'restart'
on_crash = 'restart'
on_poweroff = 'restart'
keymap = 'it'
vif = [ 'type=ioemu, bridge=net1']
vfb = [ 'type=vnc,vnclisten=0.0.0.0,vncpasswd='',vncunused=1']

 

7. Register the new Guest VM as OVM Template 

0. Be sure your VM is switched off

# xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0  2039    24     r----- 354313.3
oakDom1                                      2 65536    16     -b---- 376598.0

1. Create the tgz (tar gz compress) file, be sure that your VM is switched off

cd /OVS/staging/vm_temp/<virtual_machine_name>/
tar cvfz <virtual_machine_name>.tgz *.*
ie:

# tar cvfz OEL6_64.tgz *.*
OEL6_64-bit-xen.img
vm.cfg

 2. from oda_base issuing the following commands

oakcli import vmtemplate <vm_template_name> -files '/OVS/stage/vm_temp//.tgz' -repo
# oakcli import vmtemplate OEL6_64 -files /OVS/stage/vm_temp/OEL6_64/OEL6_64.tgz -repo odarepo1

Imported VM Template
 
Note:

see ODA documentation how Managing Virtual Machines on Oracle Database Appliance 

 

Note:
due to bug 16238078 the vmtemplate import with sparse file is not working efficiently.
The imported template will  take more space

[This section is not visible to customers.]

 

3. You can now remove the "temporary" new guest virtual machine from dom0:

rm -fr /OVS/stage/vm_temp/<virtual_machine_name>
# rm -fr /OVS/stage/vm_temp/OEL6_64/

 

4. Once the template has been registered you can clone the new Guest as following (from dom1)

oakcli clone vm <vm_name> -vm template-repo
# oakcli clone vm OEL6_64 -vmtemplate OEL6_64 -repo odarepo1

Cloned VM : OEL6_64-xen

Now you can manage the new Guest VM from dom1 using oakcli (configure, show, start/stop)

# oakcli show vm OEL6_64
Resource: OEL6_64
    AutoStart       :    restore        
    CPUPriority     :    100            
    Disks           :    |file:/OVS/Repositories/odarepo2/Vi
                         rtualMachines/OEL6_64-xen/OEL6_64-bit-
                         xen.img,xvda,w|
    Domain          :    XEN_PVM        
    ExpectedState   :    offline        
    Keyboard        :    it             
    MaxMemory       :    2048           
    MaxVcpu         :    2              
    Memory          :    2048           
    Mouse           :    OS_DEFAULT     
    Name            :    OEL6_64-xen   
    Networks        :    |type=ioemu, bridge=net1|
    NodeNum         :    1              
    OS              :    OL_5           
    PrivateIP       :    None           
    ProcessorCap    :    100            
    RepoName        :    odarepo2       
    State           :    Offline        
    TemplateName    :    otml_OEL6_64
    Vcpu            :    2              
    cpupool         :    default-unpinned-pool
    vncport         :    0            
# oakcli start vm OEL6_64

Started VM : OEL6_64

Note:

If the VMWare image you are using is a Windows OS and you got boot issue, this can likely be solved by disabling ACPI and the APIC in the guest.

acpi = 0
apic = 0

 

References

http://docs.oracle.com/cd/E22693_01/doc.21/e22692/odaadmin.htm#autoId0
http://docs.oracle.com/cd/E35328_01/E35332/html/vmusg-ptov-conversion.html#vmusg-ptov-kickstart-options
<NOTE:1524138.1> - ODAVP: How To Create a Fully-Virtualized Guests (HVM) from an OS ISO image
<NOTE:1525105.1> - ODAVP: How to Manually Convert a VMware Guest Image for use with Oracle Database Appliance VP
<BUG:16786774> - LNX64-112-CMT: P2V SUPPORT
<NOTE:754071.1> - Blue Screen on Boot after Migrating VMware Windows Guest Which is Installed on SCSI Disk to Oracle VM (V2V)

Attachments
This solution has no attachment
  Copyright © 2018 Oracle, Inc.  All rights reserved.
 Feedback