Oracle 11gR2 11.2.0.3 2-node RAC on Windows 2008 on VMware Workstation 9 – Part VII

Time Required: 30 minutes

Class Materials:

  • 5GB of disk space
  • an ASCII text editor

Next we are going to add a shared disk to our two Windows VMs.

VMware Workstation makes the allocation of shared disk to VMs very simple. Shared disk has been the biggest obstacle to create Oracle RAC clusters at home, but VMware gives us a reliable and portable solution that does not require fire-wire hacks, your own NFS server or a SCSI disk array.

Make sure both VMs are shut down. If you want to make a clone of your progress then now is your last chance to do so without the complication of shared external disk.

We will add a new disk to Rodolfo first, and then add the same disk into Mimi.

Using the VMware Workstation menu, right click on Rodolfo and select Settings.

This will bring up the Virtual Machine Settings menu. Click on the Add button.

Add Virtual Disk

At the Add Hardware Wizard menu, select Hard Disk and click Next.

Select Create a new virtual disk and click Next.

Add Virtual Disk

When the Select a Disk Type menu appears, select SCSI (Recommended) and for mode check Indepenent and the radio button Persistent.

Add Virtual Disk

When the Specify Disk Capacity menu appear, set the new disk size at 5GB. This should be just enough to support our demo RAC database. If you have an abundance of disk space then by all means set the disk size much larger.

Check the All all disk space now. button and Store virtual disk as a single file

Add Virtual Disk

NOTE: These last two options are very important for our RAC. Trying to create a shared disk with VMware Workstation using thin-provisioning will result in disk corruption.

Next VMware Workstation will ask where you want to store your new disk and what you want to call it. By default it will want to place the virtual disk in the same directory as the rest of the Rodolfo VM. However this new disk is to be shared, so I prefer to place it in a separate directory.

VMware Workstation stores its VMs by default in the user’s Documents directory under a sub-directory called Virtual Machines. In this directory you will find sub-directories for both our VMs Rodolfo and Mimi. I suggest creating a new sub-directory here called Shared Disk and storing our new virtual disk in the Shared Disk directory with the name asm disk 1.vmdk.

Add Virtual Disk

VMware will ask you confirm your selection. Press Finish to confirm.

Add Virtual Disk

Now we need to move our new disk to a different virtual SCSI device within the VM. In order to avoid all manner of cluster disk issues, we need to place the shared disks on a different SCSI controller to the local disks.

Highlight the Rodolfo VM in the VMware Workstation menu and select Settings. When the Virtual Machine Settings menu appears, highlight Hard Disk 2 and select the Advanced button on the right hand side.

The Hard Disk Advanced Settings menu allows to modify the Virtual device node. By default this will be set to SCSI 0:1, but we need to change this to SCSI 1:0. This will move our new disk to SCSI controller 1, device 0.

Add Virtual Disk

Repeat these steps on the Mimi VM, but instead of creating a new virtual disk, select “Use an existing virtual disk”, and select the same VMDK file you created for the new disk for Rodolfo.

Add Virtual Disk

NOTE: On Mimi make sure you also set the disk to SCSI 1:0.

Next we will have to resort to a little hacking to make our shared disk really sharable. We are now leveraging VM functionality that is not really supported in VMware Workstation 9, but does appear to work, at least for demo purposes.

Navigate to the directory where the Rodolfo VM files are stored, in most cases this will be Documents/Virtual Machines/Rodolfo. In there you will find a file called Rodolfo.vmx

The VMX file contains the hardware profile of the VMs we have created. Before we do anything else, make a copy of it so we have something to go back to if we make a mess.

Open the VMX file with an ASCII editor and add the following entries:

disk.locking = "FALSE"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0" 
diskLib.dataCacheMinReadAheadSize = "0" 
diskLib.dataCachePageSize = "4096" 
diskLib.maxUnsyncedWrites = "0" 
scsi1.sharedBus = "virtual"

 
These changes force the VMs to not try to buffer reads and writes to the disk, which would result in block corruption to the shared database. The new directives can be added anywhere in the VMX file, although I tend to add them immediately above the SCSI settings.

Repeat these steps for the Mimi.VMX file.

Now start up Rodolfo. As you do so, you might notice a small warning in the bottom right hand corner of the VMware window that states:

Clustering is not supported for WMware Workstation – this setting will be ignored

Don’t worry about this. This is expected behavior.

When Windows has booted up, log in as either Administrator or oracle, and open a command prompt. Then enter DISKPART.

The Disk Partition utility is used to partition new disks.

Use the LIST DISK command to see what disks are available. For my VM I have two, the 40GB boot disk I created originally, and the new 5GB disk I just added.

C:\>diskpart

Microsoft DiskPart version 6.1.7601
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: RODOLFO

DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online           40 GB      0 B
  Disk 1    Offline        5120 MB  5120 MB

 
Disk 1 is shown as being offline, so first let’s bring it online:

DISKPART> select disk 1

Disk 1 is now the selected disk.

DISKPART> online disk

DiskPart successfully onlined the selected disk.

 
New disks default to being readonly, so we need to set the new disk to read-write:

DISKPART> attributes disk clear readonly

Disk attributes cleared successfully.

 
Next we are going to create a partition on the disk. With Windows Server 2008, Windows now automatically offsets the partition to 1MB.

DISKPART> create partition extended

DiskPart succeeded in creating the specified partition.

DISKPART> create partition logical

DiskPart succeeded in creating the specified partition.

DISKPART> list partition

  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 0    Extended          5118 MB  1024 KB
* Partition 1    Logical           5117 MB  2048 KB

 
Now start up Mimi.

When Mimi starts, log in to Windows as Administrator or oracle. Then open a command prompt and type DISKPART.

Repeat the steps used on Rodolfo to list the disks, select disk 1, online the shared disk and clear the read-only attributes.

Microsoft DiskPart version 6.1.7601
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: MIMI

DISKPART> list disk

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online           40 GB      0 B
  Disk 1    Offline        5120 MB  1024 KB

DISKPART> select disk 1

Disk 1 is now the selected disk.

DISKPART> online disk

DiskPart successfully onlined the selected disk.

DISKPART> attributes disk clear readonly

Disk attributes cleared successfully.

 
If we now check the partition table, we can see that the partitions created on Rodolfo are visible on the shared disk:

DISKPART> list partition

  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 0    Extended          5118 MB  1024 KB
  Partition 1    Logical           5117 MB  2048 KB

DISKPART>

 
Somtimes, when the disk is onlined, Windows will automatically assign a drive letter to it, and prompt you to format the disk.

If this happens, ignore the dialog box and use DISKPART to remove the drive letter assignment:

DISKPART> list volume

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     D                       DVD-ROM         0 B  No Media
  Volume 1     C                NTFS   Partition     39 GB  Healthy    System
  Volume 2     E                RAW    Partition   5117 MB  Healthy

DISKPART> select volume 2

Volume 2 is the selected volume.

DISKPART> remove letter=e

DiskPart successfully removed the drive letter or mount point.

 
We now have shared disk on both Rodolfo and Mimi.

Article Quick Navigation
Previous Step Main Index Next Step
Advertisements

One thought on “Oracle 11gR2 11.2.0.3 2-node RAC on Windows 2008 on VMware Workstation 9 – Part VII

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s