Novell is now a part of Micro Focus

Creating shared storage on SUSE Linux Enterprise Server 10 using Xen and OCFS2

Novell Cool Solutions: Feature
By Arun Singh

Digg This - Slashdot This

Updated: 17 Aug 2007


This paper describes the process of creating shared storage on a standalone system using SUSE Linux Enterprise Server 10 (SLES10) i.e. OCFS2 and Xen Virtualization. The cool part is there is no real expensive shared storage used. The information provided here works with real shared storage as well.


  1. Disk Partition Layout

    Creating partition for shared storage is important. Please plan ahead to avoid re-install of SLES10. Here is sample disk layout from my server, to create shared storage i.e. /dev/sda3.

  2. Install SLES10 with Xen

    Follow the standard SUSE Linux Enterprise Server install. Select "Xen Virtual Machine Host Server" pattern. Also search and select "ocfs2-tools & ocfs2console" to install OCFS2 packages. Here is sample screen, showing package selection.

  3. Boot SLES10 Server with XEN kernel

    Once SLES10 with Xen is installed successfully, reboot the server and select XEN boot option.

    Verify that server is booted with xen kernel.

  4. Upgrade XEN tools on SLES10 Server (Optional)

    This is an optional step but an important one to upgrade xen tools to newer available version. Visit Novell support web site ( to download newer version of xen tools. You will find installing xen guest very slow without these updated xen tools. Here is screen shot showing upgrade procedure.

  5. Install Xen Guests OS

    Installing a xen guest OS is very easy in SLES10. There are many documents available explaining installation procedure, but here are some quick steps.

    1. Start YaST xen console i.e. /sbin/yast2 xen

    2. Click "Add" to add new virtual machine.

    3. Change Settings, especially Network and Operating System Installation.

    4. Here vnc based installation is selected. You may get different screen for text based install.

    5. Follow the install instruction presented i.e. open vncviewer and continue installation.

    6. Here on-ward it's standard install.

    7. Select default package selection. You can search and select additional ocfs2 packages.

      Installation continues ...

      Now the guest OS Installation is complete. Change any boot settings as needed.

      Once virtual guest OS is installed, you can stop/start from same YaST console. If you like, you can use command line options i.e. xm.

  6. Configure OCFS2 on Xen Host Server
    1. Run ocfs2console tool to add Xen Host Server node entry to cluster configuration (/etc/ocfs2/cluster.conf).

    Here is sample cluster.conf file after adding first node.

    1. Run o2cb command to configure and enable cluster.

  7. Format shared volume partition

    In order to use partition as OCFS2 cluster, you need to format partition using ocfs2 tool i.e. mkfs.ocfs2. This tool is added to your system when ocfs2-tools package is installed. Alternatively, you can use ocfs2console, GUI application to format partition. Here is a screen shot showing the formatting of partition /dev/sda3.

      First check that the o2cb cluster is online.

      Then either use ocfs2console or mkfs.ocfs2 to format the partition.

      Here is the ocfs2console view after formatting.

  8. Configure OCFS2 Cluster on Xen Guest OS's

    You need to configure OCFS2 on each participating xen guest to allow it to mount shared storage. Install ocfs2-tools and ocfs2console, If you haven't done during xen guest OS installation. Here is screen shot of OCFS2 configuration of Xen Guest OS.

  9. Add OCFS2 nodes to cluster

    Once all xen guest are ocfs2 configured and enabled, you need to populate cluster with node information. You can use ocfs2console utility to add new node cluster information and propagate to all other nodes in the cluster. Make sure all nodes in the cluster have same /etc/ocfs2/cluster.conf information.

    Here is /etc/ocfs2/cluster.conf file. Note Static IP address of cluster nodes.

    You can copy /etc/ocfs2/cluster.conf manually to all nodes or use Propagate Cluster Configuration feature of ocfs2console GUI tool.

  10. Add shared partition to Xen Guest OS

    Add shared partition /dev/sda3 detail to xen guest OS setting in /etc/xen/vm/. Here is screen shot showing the detail. Reboot xen guest OS to take change into effect.

  11. Mount shared partition

    Now you are ready to mount and use the newly created shared partition (/dev/sda3) in Xen guest OS. Here is screen shot showing how to add physical partition on xen guest OS.

    ocfs2console showing mounted /shared volume on node1.

    Here is screen shot showing /shared mounted on Xen host SLES10 and Xen guest node1.


This paper is to help you to understand the steps involved in creating shared storage without using expensive shared storage. Using this information you can create shared storage used by all xen guest OS and Host, avoiding copying of files between guest OS's. Hope you will find this paper useful.

Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions.

© Copyright Micro Focus or one of its affiliates