OVM: How to import a template from Oracle into a Repository
You can download the template from Oracle support web “Oracle VM Templates for Oracle Database – Single Instance, Oracle Restart (SIHA) and Oracle RAC (Doc ID 1185244.1)”
In our case, we want to download the “Single Instance & Oracle Real Application Clusters (RAC) 18c (64-bit) on Oracle Linux 7.5 (w/OVMAPI Support)” that it contains 4 zip files, the first file is the operating system image, and the rest of them (you will need to join them later) are the Oracle software:
sergio@sergio-pc:~/Descargas$ ls -lrt |grep p1888 -rw-rw-r-- 1 sergio sergio 969607288 nov 27 19:20 p18888888_10_Linux-x86-64_1of4.zip → OS Disk -rw-rw-r-- 1 sergio sergio 4167812975 nov 28 09:53 p18888888_10_Linux-x86-64_4of4.zip → Oracle Disk -rw-rw-r-- 1 sergio sergio 4167764970 nov 28 09:54 p18888888_10_Linux-x86-64_3of4.zip → Oracle Disk -rw-rw-r-- 1 sergio sergio 4163837255 nov 28 09:54 p18888888_10_Linux-x86-64_2of4.zip → Oracle Disk
Unzip OS Disk:
sergio@sergio-pc:~/Descargas$ unzip p18888888_10_Linux-x86-64_1of4.zip Archive: p18888888_10_Linux-x86-64_1of4.zip inflating: OVM_OL7U5_X86_64_18400DBRAC_PVHVM-1of2.tar.gz inflating: DBRACOVM18400181016-MYSUPPORT-READMEv1.0.txt
Unzip Oracle Disk:
sergio@sergio-pc:~/Descargas$ unzip p18888888_10_Linux-x86-64_2of4.zip Archive: p18888888_10_Linux-x86-64_2of4.zip inflating: OVM_OL7U5_X86_64_18400DBRAC_PVHVM-2of2-partA.tar.gz inflating: DBRAC18400181016-OVM2-template-Configuration.pdf sergio@sergio-pc:~/Descargas$ unzip p18888888_10_Linux-x86-64_3of4.zip Archive: p18888888_10_Linux-x86-64_3of4.zip inflating: OVM_OL7U5_X86_64_18400DBRAC_PVHVM-2of2-partB.tar.gz sergio@sergio-pc:~/Descargas$ unzip p18888888_10_Linux-x86-64_4of4.zip Archive: p18888888_10_Linux-x86-64_4of4.zip inflating: OVM_OL7U5_X86_64_18400DBRAC_PVHVM-2of2-partC.tar.gz
Join the Oracle disks in one:
sergio@sergio-pc:~/Descargas$ cat OVM_OL7U5_X86_64_18400DBRAC_PVHVM-2of2-partA.tar.gz OVM_OL7U5_X86_64_18400DBRAC_PVHVM-2of2-partB.tar.gz OVM_OL7U5_X86_64_18400DBRAC_PVHVM-2of2-partC.tar.gz >OVM_OL7U5_X86_64_18400DBRAC_PVHVM-2of2.tar.gz
Copy both of them (OS Disk and Oracle Disk) to one of the ovm servers:
[root@ovmmanager1 repos]# pwd /var/www/repos [root@ovmmanager1 repos]# ls -l total 13221836 -rw-r--r--. 1 root root 986272382 Dec 4 12:12 OVM_OL7U5_X86_64_18400DBRAC_PVHVM-1of2.tar.gz -rw-r--r--. 1 root root 12552880679 Dec 4 11:58 OVM_OL7U5_X86_64_18400DBRAC_PVHVM-2of2.tar.gz [root@ovmmanager1 repos]# ssh root@ovmsrv01 mkdir -p /var/www/repos/ [root@ovmmanager1 repos]# scp *.tar.gz root@nodo1:/var/www/repos/ OVM_OL7U5_X86_64_18400DBRAC_PVHVM-1of2.tar.gz 100% 941MB 50.3MB/s 00:18 OVM_OL7U5_X86_64_18400DBRAC_PVHVM-2of2.tar.gz 100% 12GB 47.9MB/s 04:10
Unzip the files:
1) El del SO: [root@ovmsrv01 repos]# tar xzvf OVM_OL7U5_X86_64_18400DBRAC_PVHVM-1of2.tar.gz OVM_OL7U5_X86_64_18400DBRAC_PVHVM/System.img OVM_OL7U5_X86_64_18400DBRAC_PVHVM/README.txt OVM_OL7U5_X86_64_18400DBRAC_PVHVM/vm.cfg 2) El del RDBMS: [root@ovmsrv01 repos]# tar xzvf OVM_OL7U5_X86_64_18400DBRAC_PVHVM-2of2.tar.gz OVM_OL7U5_X86_64_18400DBRAC_PVHVM/lsinventory-sample.db-64bit OVM_OL7U5_X86_64_18400DBRAC_PVHVM/lsinventory-sample.grid-64bit OVM_OL7U5_X86_64_18400DBRAC_PVHVM/DBRAC18400181016-OVM2-template-Configuration.pdf OVM_OL7U5_X86_64_18400DBRAC_PVHVM/utils/ OVM_OL7U5_X86_64_18400DBRAC_PVHVM/utils/netconfig.txt OVM_OL7U5_X86_64_18400DBRAC_PVHVM/utils/README.txt OVM_OL7U5_X86_64_18400DBRAC_PVHVM/utils/common.sh OVM_OL7U5_X86_64_18400DBRAC_PVHVM/utils/netconfig.sh OVM_OL7U5_X86_64_18400DBRAC_PVHVM/utils/netconfig-sample64.ini OVM_OL7U5_X86_64_18400DBRAC_PVHVM/utils/netconfig-sample-si.ini OVM_OL7U5_X86_64_18400DBRAC_PVHVM/utils/params.ini [root@ovmsrv01 repos]# ls -lrth OVM_OL7U5_X86_64_18400DBRAC_PVHVM total 26G drwxr-xr-x 2 root root 4.0K Jul 29 2016 utils -rw------- 1 root root 515 Oct 1 22:17 vm.cfg -rw-r--r-- 1 root root 13K Oct 21 13:50 lsinventory-sample.grid-64bit -rw-r--r-- 1 root root 11K Oct 21 15:04 lsinventory-sample.db-64bit -rw-r--r-- 1 root root 2.4M Oct 24 16:58 DBRAC18400181016-OVM2-template-Configuration.pdf -rw-r--r-- 1 root root 60G Oct 25 09:18 Oracle18400DBRAC_x86_64-xvdb.img -rw-r--r-- 1 root root 1.5K Oct 25 09:19 README.txt -rw-r--r-- 1 root root 15G Oct 25 14:05 System.img
* The process of joining the Oracle Disks and tar them, it is possible to do it in only one command if you want:
# cat /tmp/OVM_OL7U5_X86_64_18400DBRAC_PVHVM-2of2-partA.tar.gz /tmp/OVM_OL7U5_X86_64_18400DBRAC_PVHVM-2of2-partB.tar.gz /tmp/OVM_OL7U5_X86_64_18400DBRAC_PVHVM-2of2-partCtar.gz | tar xz &
Start the http server into the ovm server where the templates are copied:
[root@ovmsrv01 ~]# cd /var/www/repos [root@ovmsrv01 repos]# python -m SimpleHTTPServer 80 Serving HTTP on 0.0.0.0 port 80 ...
Import the templates from the ovm manager:
OVM> importtemplate repository name='repolocal-ovmsrv01' url="http:////ovmsrv01//OVM_OL7U5_X86_64_18400DBRAC_PVHVM//vm.cfg,http:////ovmsrv01//OVM_OL7U5_X86_64_18400DBRAC_PVHVM//System.img,http:////ovmsrv01//OVM_OL7U5_X86_64_18400DBRAC_PVHVM//Oracle18400DBRAC_x86_64-xvdb.img" Command: importtemplate repository name='repolocal-ovmsrv01' url="http:////ovmsrv01//OVM_OL7U5_X86_64_18400DBRAC_PVHVM//vm.cfg,http:////ovmsrv01//OVM_OL7U5_X86_64_18400DBRAC_PVHVM//System.img,http:////ovmsrv01//OVM_OL7U5_X86_64_18400DBRAC_PVHVM//Oracle18400DBRAC_x86_64-xvdb.img" Status: Success Time: 2018-12-16 08:51:48,076 CET JobId: 1544946374048 Data: id:0004fb0000140000799466daa5b94a9a name:vm.cfg
And you are ready to use the new template!
Adding value with Arumel!!