I will discuss here step by step how to configure a Virtual Machine with Linux OS using VM VirtualBox Manager.
- Virtual Machine Setup
- Install Linux OS on VM
- Oracle GI and Database Installation Prerequisites
- Configure Shareable Disk for ASM (for RAC setup)
- Clone VM and prepare another VM for Clusterware Node
Configure Server on VM:
Click ‘New’ on toolbar and provide the Name and select appropriate OS type and version.
Set memory values here. If you have more memory on you computer, and based on your requirement you can set memory. 2-4 GB memory is good amount for practicing.. Click Next…
Select Hard disk type. Select ‘Create a Virtual hard disk now’ option and Click Next…
Select Hard disk file type. Here I chosen VDI option.
Always good to select ‘Dynamically allocated’ option as it will get used space from your local hard disk. Let say if you create 80GB HD but used only 10GB, it will allocate 10GB only from your HD and later will increase based on your used.
Select File Location and Size and Click Next…
Right Click on created host/server then Select Settings..
Select necessary Hardware from System. Optical and Hard Disk can be selected. All other leave as default. Click Next…
For DVD drive, you can select the OS iso from your harddisk. then it will start booting to install the OS. Click Next…
Choose Next work adapter. Select ‘Host-only Adapter’ option from drop-down for Adapter 1.
NOTE:::For RAC environment, Required two network Adapters. One is for public and another for private.
And Select Adapter 2 (Applicable for RAC)
Install Linux OS on VM: Installation
Network Setup:
From OS GUI, Select System -> Administrator -> Network
Configure Ethernet Device (eth0). Select Network Device and Click Edit (highlighted). Set Static IP and Click OK..
Select Network Device and Click Edit. Set Static IP (choose different subnet mask as it will be use as private IP for RAC) and Click OK..
Activate the device. Select Device and Click Activate from tool bar.
Create Shareable Disk for RAC: Using command
For Oracle RAC (Real Application Cluster), We will create shareable disk which will use for ASM. In real life, company will use either SAN or NAS storage for RAC environment. For this parctice we will create 8 disks (3 for OCR, 3 for DATA, and 2 for FRA)
Create Disk on VM
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" createhd --filename "C:\VM\RACDR1\asmdisk05.vdi" --size 3072 --format VDI --variant Fixed "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" createhd --filename "C:\VM\RACDR1\asmdisk06.vdi" --size 5120 --format VDI --variant Fixed "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" createhd --filename "C:\VM\RACDR1\asmdisk07.vdi" --size 5120 --format VDI --variant Fixed "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" createhd --filename "C:\VM\RACDR1\asmdisk08.vdi" --size 5120 --format VDI --variant Fixed
Connect them (disks) to Virtual Machine (Created host name racdr1)
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RACDR1 --storagectl "SATA" --port 5 --device 0 --type hdd --medium "C:\VM\RACDR1\asmdisk05.vdi" --mtype shareable "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RACDR1 --storagectl "SATA" --port 6 --device 0 --type hdd --medium "C:\VM\RACDR1\asmdisk06.vdi" --mtype shareable "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RACDR1 --storagectl "SATA" --port 7 --device 0 --type hdd --medium "C:\VM\RACDR1\asmdisk07.vdi" --mtype shareable "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RACDR1 --storagectl "SATA" --port 8 --device 0 --type hdd --medium "C:\VM\RACDR1\asmdisk08.vdi" --mtype shareable
Disk created as Normal Type but need to convert to Shareable for ASM.
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd "C:\VM\RACDR1\asmdisk05.vdi" --type shareable "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd "C:\VM\RACDR1\asmdisk06.vdi" --type shareable "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd "C:\VM\RACDR1\asmdisk07.vdi" --type shareable "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd "C:\VM\RACDR1\asmdisk08.vdi" --type shareable
Create Shareable Disk for RAC: Using GUI
From Setting -> Select Storage -> Controller : SATA -> Click ‘Adds Hard disk’ icon -> from popup window, Click ‘Create new disk’.
You may select VDI from on this step.. Click Next…
Select ‘Fixed size’ option and click Next…
Set the location and file name and size. 4 GB for OCR or Voting Disk. Click Create…
Storage has been created with Normal (VDI) format. But we need to change it to shareable. Click OK.
We can make change hard disk type from Normal to Shareable two ways (GUI Or Command). I will show both in below..
Steps to change format using GUI.
Click File on VM menu and select ‘Virtual Media Manger…‘ option or Press Ctrl + D.
Select the Disk you want to change type. Then from Attributes section Change type Shareable from drop-down list. Click Apply..
Validate the disk type and it should now Shareable now like below highlighted.
Clone VM and prepare another VM for Clusterware 2nd Node
NOTE:::If you complete all steps mentioned above, then you don’t need to repeat same steps on Node2.
Shutdown VM (racdr).
Right Click on VM and Choose Clone Option.
Enter new VM name and select the check box. Click Next..
Select ‘Full clone’ and Click Clone
It will take time to complete the cloning process based on disks size.
Changes on new (cloned) VM
Set network IP on new VM:
To change network IP for new VM please follow the same process what has been done for first VM
Change Host name for new VM:
From VM -> Select System -> Administrator -> Network. Below Window will popup then Select DNS and enter Hostname.
Configure shareable disks for Node2:
As we have cloned the VM so its also copied all shareable disks for new VM. But same shareable disks will connect from both Nodes. So we will delete all created shareable disks from new VM and connect these disk from Node 1 location.
Remove all shareable disks from Node 2:
From Settings on Node 2 -> Select Storage -> Select disk (one be one) and Click Removes selected button highlighted in below.
After removed all shareable disk from node 2, it will be link below.
Add Shareable Disks on Node 2 using command.
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RACDR2 --storagectl "SATA" --port 3 --device 0 --type hdd --medium "C:\VM\RACDR1\asmdisk03.vdi" --mtype shareable "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RACDR2 --storagectl "SATA" --port 4 --device 0 --type hdd --medium "C:\VM\RACDR1\asmdisk04.vdi" --mtype shareable "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RACDR2 --storagectl "SATA" --port 5 --device 0 --type hdd --medium "C:\VM\RACDR1\asmdisk05.vdi" --mtype shareable "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RACDR2 --storagectl "SATA" --port 6 --device 0 --type hdd --medium "C:\VM\RACDR1\asmdisk06.vdi" --mtype shareable "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RACDR2 --storagectl "SATA" --port 7 --device 0 --type hdd --medium "C:\VM\RACDR1\asmdisk07.vdi" --mtype shareable "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" storageattach RACDR2 --storagectl "SATA" --port 8 --device 0 --type hdd --medium "C:\VM\RACDR1\asmdisk08.vdi" --mtype shareable
Add Shareable Disks on Node 2 using GUI.
Add Shareable disk from Node 1 Location. Select ‘Adds hard disk’ icon and it will popup another window for selecting file. Choose the disk from Node 1 location.
It will look like below. Add all disks one by one and Click OK.
Finally it will show attached to for both nodes (highlighted).
1 pings
[…] 1. Configure VM for 2 Nodes RAC. Create VM […]