VMware Fusion on MAC — Shared Storage for Oracle RAC
Mar 25, 2009 / By Alex Gorbachev
This topic has been raised again and again and quite a few people have asked me how to configure RAC on VMware Fusions on Mac. This warrants a blog post, especially, that Mac is definitely the way to go for an Oracle DBA — a Unix desktop OS that just works. What can be better? Sorry, I digress without even starting!
Before I go any further, I should say that this is not a complete guide on the Oracle RAC install with VMware Fusion but just the hints on setting up shared storage for Oracle RAC using Mac as host for VMWare Fusion virtual machines (VM’s). The reader is assumed to understand how to setup Oracle RAC and has general understanding of VMware itself. There are plenty of guides on the Internet on how to setup Oracle RAC including VMware but they usually refer to VMware Server on Linux or Windows. Please note that I’m writing it largely by memory so if you hit any issue — please leave a comment.
Disclaimers are over — moving on!
The root of the problem is that VMware Fusion doesn’t support shared disks unlike VMware Server on Windows and Linux. If you try to update the .vmx file manually to enable shared disk, you get the error message “Clustering is not supported for VMware Fusion – this setting will be ignored”. Fear not — you are running the best desktop OS anyway! ;-)
Other than shared disks from the host OS, there are couple other options you can investigate for shared storage — NFS filesystem and iSCSI. iSCSI is good when you want to play with ASM but as you will see, there is no problem to use NFS for ASM (well, as a playground). Actually, I’ll save it for another post.
One solution is to run Open Filer setup in another VM and it can present storage as iSCSI targets and as NFS exports. iSCSI setup is not very easy (well, definitely not for me) and I avoid it as a plague. Accessing NFS mounts from Open Filer requires configuring LDAP on your Oracle RAC VM’s and even though it’s not too difficult (I’ve done it few times), it’s still some additional complexity and we don’t want any of that on our playground.
Finally, running yet another VM adds some overhead of memory and CPU as well as makes IO slower. That’s my experience. YMMV.
Back to out host machine — don’t forget it’s full blown Unix OS — Mac OSX is based on FreeBSD — and it naturally includes NFS server.
Desktop Mac OSX doesn’t have NFS server daemon running by default but enabling it is a piece of cake:
macbook:~ gorby$ sudo nfsd enable macbook:~ gorby$ sudo nfsd status nfsd service is enabled nfsd is running (pid 87970, 8 threads) macbook:~ gorby$ ps -p 87970 PID TT STAT TIME COMMAND 87970 ?? Ss 0:00.01 /sbin/nfsd
Update: 13-Apr-09 before starting NFS daemon
/etc/exports file must exist so run
sudo touch /etc/exports or just start
nfsd after you created a proper
/etc/exports as explained below (thanks to juergen for the hint).
You will want to check your VMware Fusion network configuration. Be default, VMware Fusion creates two virtual NIC’s:
- vmnet1 — host-only network
- vmnet8 — NAT network
When I setup Oracle RAC on VMware, I usually configure public interface on the NAT network (this way I have internet access from VM’s if I need to download something directly) and private interface on the host-only network but private sub-net can be completely different as it doesn’t need to be routed anywhere.
If you follow this advise, you want to limit your NFS exports to NAT sub-net. Check network configuration:
macbook:~ gorby$ ifconfig vmnet1 vmnet1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 inet 172.16.59.1 netmask 0xffffff00 broadcast 172.16.59.255 ether 00:50:56:c0:00:01 macbook:~ gorby$ ifconfig vmnet8 vmnet8: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 inet 192.168.94.1 netmask 0xffffff00 broadcast 192.168.94.255 ether 00:50:56:c0:00:08
My NAT network is 192.168.94.0/24.
At this point, you need to create a directory that you want to export from your host OSX and share in your Oracle RAC VM’s. Let’s say I want to share /exports/nfs1, /exports/nfs2 and /exports/nfs3. Next, edit /etc/exports adding a line:
/exports/nfs1 /exports/nfs2 /exports/nfs3 -maproot=root -network 192.168.94 -mask 255.255.255.0
-maproot=root is a convenience to have full root access on these exports as root from a VM. Now you just need to bounce nfsd —
sudo nfsd restart.
In the early releases of OSX 10.5, nfsd daemon caused hangs from time to time under high load but then it isn’t supposed to be used in the desktop OSX and generally required OSX Server. However, it’s been quite stable on the latest 10.5.x patchsets.
I should say that I’ve been using this setup for more than a year and I’ve done many demos during my presentations. I always have my test RAC cluster with me on my laptop — super handy if you drop by a geeky Oracle group. ;-)
Want to see how it works in real life — drop by the first Sydney Oracle Meetup next week.