Oracle RAC 12cR1 on OEL 7.2 VBox – Part 3: Cloning the Node two a 2-Node-RAC

In my previous article Adding ASM Disks and Configuration of OS I described to add some ASM Disks and to configure the Oracle Enterprise Linux (OEL) 7.2 to be ready for Oracle RAC 12c. In this article I will describe you a short script to clone   the previous create VM to have to identical VMs. This is the third of

  1. Installation of OEL 7.2
  2. Add sharable ASM Disk Groups and Configuration of OEL 7.2 to be ready for Oracle Installation
  3. Cloning the Node two a 2-Node-RAC
  4. Install the GI software only
  5. Patch and Configure GI
  6. Installation of CDB with two PDB
  7. Summary

Below you will find a small script to clone the files of the previous created VM in order to create a new VM. The main steps of the script are:

  1. Power-Off and unregister the new VM by deleting all files – if the new VM already exists
  2. Cloning the two files of the previous created VM
  3. Create a new VM
  4. Setting some properties of the VM
  5. Configure the network of the new VM
  6. Add one IDE
    1. Add an empty DVD to IDE controller
  7. Add one SATA controller
    1. Add the two cloned files to the SATA Controller
    2. add all sharable ASM Disks to the SATA Controller
  8. Start the created VM

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
REM Script to Clone the previous created virtual machine (VM)
REM 2016-05-18/R.Hartwig: created
REM 
REM 1. Power-Off and removing existing new VM
REM 2. Cloning two files of previous created VM
REM 3. Create new VM, set some properties
REM 4. Configure Network of new VM
REM 5. Add Disks to new VM
REM
REM You only have to adjust the four variables below this remark
REM (lines 13 to 16 of this script)
REM
set VBM="C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"
set BDIR=C:\VMS
set VM=OEL72Rac12cN01
set VM2=OEL72Rac12cN02
 
set VMDIR=%BDIR%\%VM%
set N1=%VMDIR%\OEL72Rac12cN01
set N2=%VMDIR%\OEL72Rac12cN02
set ASM=%VMDIR%\asm
set CRT=%VBM% createvm --name "%VM2%"
set MOD=%VBM% modifyvm        "%VM2%"
set CTL=%VBM% storagectl      "%VM2%"
set DVD=%VBM% storageattach   "%VM2%" --storagectl "IDE"  --type dvddrive --device 0
set ADD=%VBM% storageattach   "%VM2%" --storagectl "SATA" --type hdd      --device 0
 
cd /D %BDIR%
 
echo *** Power-Off - if running ...
%VBM% controlvm "%VM2%" poweroff       
 
echo *** Delete VM including all files ...
%VBM% unregistervm "%VM2%" --delete    
 
echo *** Cloning files ...
del /F "%N2%-root.vdi"
del /F "%N2%-u01.vdi"
%VBM% clonehd "%N1%-root.vdi" "%N2%-root.vdi" 
%VBM% clonehd "%N1%-u01.vdi"  "%N2%-u01.vdi"  
 
echo *** Create new VM ...
%CRT% --ostype "Oracle_64" --register --basefolder "%VMDIR%"  
 
echo *** set VM Properties ...
%MOD% --groups "/" --memory 4096 --vram 12 --acpi on --ioapic on --pae on --cpus 2 
%MOD% --longmode on --hpet off --paravirtprovider default 
%MOD% --nestedpaging on --largepages on --vtxvpid on --vtxux on
%MOD% --accelerate3d off --accelerate2dvideo off --chipset piix3 
%MOD% --clipboard bidirectional --draganddrop bidirectional 
%MOD% --biosbootmenu messageandmenu --biospxedebug off --firmware bios
%MOD% --rtcuseutc on --biossystemtimeoffset 0 --monitorcount 1
%MOD% --uart1 off --uart2 off --uart3 off --uart4 off --audio none 
%MOD% --lptmode1 off --lptmode2 off
%MOD% --usb off --usbehci off --usbxhci off --videocap off --vrde off 
%MOD% --tracing-enabled off --teleporter off 
%MOD% --boot1 disk --boot2 dvd --boot3 none --boot4 none
 
echo *** Config Network of VM ...
%MOD% --nictrace1 off      --nictrace2 off      --nictrace3 off      --nictrace4 off
%MOD% --nicpromisc1 deny   --nicpromisc2 deny   --nicpromisc3 deny   --nicpromisc4 deny 
%MOD% --nictrace5 off      --nictrace6 off      --nictrace7 off      --nictrace8 off
%MOD% --nicpromisc5 deny   --nicpromisc6 deny   --nicpromisc7 deny   --nicpromisc8 deny 
%MOD% --cableconnected1 on --cableconnected2 on --cableconnected3 on --cableconnected4 on
%MOD% --macaddress2 auto   --macaddress3 auto   --macaddress3 auto   --macaddress4 auto
%MOD% --nictype1 82540EM   --nictype2 82540EM   --nictype3 82540EM   --nictype4 82540EM
%MOD% --nic1 nat  
%MOD% --nic2 hostonly --hostonlyadapter2 "VirtualBox Host-Only Ethernet Adapter"
%MOD% --nic3 intnet   --intnet3 "priv1"
%MOD% --nic4 intnet   --intnet4 "priv2"
 
echo *** Add Storage to VM ...
%CTL% --add ide  --controller PIIX4     --portcount 2  --name "IDE"
%DVD% --port 0   --medium emptydrive
%CTL% --add sata --controller IntelAHCI --portcount 30 --name "SATA"
%ADD% --port 0   --medium "%N2%-root.vdi"
%ADD% --port 1   --medium "%N2%-u01.vdi"
%ADD% --port 2   --medium "%ASM%01.vdi"  --mtype shareable
%ADD% --port 3   --medium "%ASM%02.vdi"  --mtype shareable
%ADD% --port 4   --medium "%ASM%03.vdi"  --mtype shareable
%ADD% --port 5   --medium "%ASM%04.vdi"  --mtype shareable
%ADD% --port 6   --medium "%ASM%05.vdi"  --mtype shareable
%ADD% --port 7   --medium "%ASM%06.vdi"  --mtype shareable
%ADD% --port 8   --medium "%ASM%07.vdi"  --mtype shareable
%ADD% --port 9   --medium "%ASM%08.vdi"  --mtype shareable
 
echo VM created.
%VBM% controlvm "%VM2%"

 

Have fun –

Rainer

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.