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:

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!).

  1. Environment
    I’ll assume that we’re in a Windows host, with 

    d:\node1	-- node1 virtual machine, 192.168.2.51
    d:\node2	-- node2 virtual machine, 192.168.2.52
    d:\shared	-- all shared stuff.
  2. 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.

  3. Adding a Shared SCSI disk
    With the VMWare Server 2.0 UI you can add a new disk to node1, and setup these parameters: 

    1. create it into the “shared” folder (read “1. Environment”)
    2. independent & persistent
    3. adapter SCSI:0, device 0
    4. (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”

  4. Install and configure OCFS2 stuff
    1. Install OCFS2 packages
      In Debian / Ubuntu is pretty easy: 

      apt-get install ocfs2console ocfs2-tools

    2. 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.

    3. 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: OK

      root@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

    4. 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

  5. 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.
  6. Reboot both nodes & enjoy.

One Response to “Shared SCSI Storage with VMWare Server 2.0 and OCFS”

  1. No fount backup with ghettovcb…..

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

%d bloggers like this: