Shared SCSI Storage with VMWare Server 2.0 and OCFS
(An update over the same trick with VMWare Server 1.X)
VMWare Server was declared End Of Availability on Jan/2010, while VMWare is pushing to use Player, ESX(i), vCenter, vSphere and all the “formerly known as” product names. I think that VMWare Server series are a great software, but v2.0 was sentenced to death since:
- Adding the web UI lead to many browser-related issues: [1,2,3]
- Bloated with tomcat, java .. and so on.
- Lastests releases didn’t included a VI Client.
- Why none of VMWare Server shown the “shared scsi controller” in their UI?
The King is dead. Long live the King.
Well, let’s see a recipe for configuring a shared SCSI bus + OCFS2 with VMWare Server 2.0.
I will use a turnkey Linux appliance in this test, because it has a very simple startup menu for configuring IP address and it’s debian based (apt-get!).
- Environment
I’ll assume that we’re in a Windows host, withd:\node1 -- node1 virtual machine, 192.168.2.51 d:\node2 -- node2 virtual machine, 192.168.2.52 d:\shared -- all shared stuff.
- Preparing Virtual Machine
Download, save & import your favourite testing appliance into VMWare Server 2.0, and change the following:/etc/hosts:127.0.0.1 node1 localhost 192.168.2.51 node1 192.168.2.52 node2
/etc/hostname:
node1
Reboot the VM, and verify if all changes persisted with ifconfig and hostname utils.
- Adding a Shared SCSI disk
With the VMWare Server 2.0 UI you can add a new disk to node1, and setup these parameters:- create it into the “shared” folder (read “1. Environment”)
- independent & persistent
- adapter SCSI:0, device 0
- (optional: 1Gb, don’t allocate immediately)
Save config and edit the .vmx file and ensure that the following properties are set:
node1.vmx:
scsi0.sharedBus = “virtual” # was “none”
disk.locking = “false”
scsi0.virtualDev = “lsilogic”
scsi0:0.redo = “”
scsi0:0.deviceType = “disk” - Install and configure OCFS2 stuff
- Install OCFS2 packages
In Debian / Ubuntu is pretty easy:apt-get install ocfs2console ocfs2-tools
- Configure OCFS2
If you try to execute:
./o2cb startYou can get errors like:Loading module “configfs”: OK
Mounting configfs filesystem at /sys/kernel/config: OK
Loading module “ocfs2_nodemanager”: OK
Loading module “ocfs2_dlm”: OK
Loading module “ocfs2_dlmfs”: OK
Creating directory ‘/dlm’: OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK
Checking O2CB cluster configuration : Failed
invoke-rc.d: initscript o2cb, action “start” failed.To fix this, run “dpkg-reconfigure ocfs2-tools” and create the file /etc/ocfs2/cluster.conf:
cluster: node_count = 2 name = ocfs2 node: ip_port = 7777 ip_address = 192.168.2.51 number = 1 name = node1 cluster = ocfs2 node: ip_port = 7777 ip_address = 192.168.2.52 number = 2 name = node2 cluster = ocfs2
Ensure that name & cluster attributes (value: “ocfs2″ in the example) matches your response when ran “dpkg-reconfigure ocfs2-tools”. This file should use TABs instead whitespaces.
- Test OCFS2
root@node1:/etc/init.d# ./o2cb start
Loading module “configfs”: OK
Mounting configfs filesystem at /sys/kernel/config: OK
Loading module “ocfs2_nodemanager”: OK
Loading module “ocfs2_dlm”: OK
Loading module “ocfs2_dlmfs”: OK
Mounting ocfs2_dlmfs filesystem at /dlm: OK
Starting O2CB cluster ocfs2: OKroot@node1:/etc/init.d# ./o2cb status
Module “configfs”: Loaded
Filesystem “configfs”: Mounted
Module “ocfs2_nodemanager”: Loaded
Module “ocfs2_dlm”: Loaded
Module “ocfs2_dlmfs”: Loaded
Filesystem “ocfs2_dlmfs”: Mounted
Checking O2CB cluster ocfs2: Online
Heartbeat dead threshold = 7
Network idle timeout: 10000
Network keepalive delay: 5000
Network reconnect delay: 2000
Checking O2CB heartbeat: Not active - Make a OCFS2 partition
Create a new partition with fdisk and the mkfs it with:mkfs.ocfs /dev/sdX1
Mount it:
mount -t ocfs2 /dev/sdX1 /mnt/shared
And define it in fstab:
/dev/sdX1 /mnt/shared ocfs2 _netdev 0 0
- Install OCFS2 packages
- Cloning the first node
Shutdown node1 and copy it in node2 folder (see “1 – Environment”). Node2 is exactly configured as node1, but IP address
and hostname should be changed. All references to shared disk vdmk remain valid as the disk is in a separate folder. Repeat “2 – Preparing Virtual Machine” for Node2. - Reboot both nodes & enjoy.
27/December/2011 at 11:07 am
No fount backup with ghettovcb…..