Creating shared storage on SUSE Linux Enterprise Server 10 using Xen and OCFS2
Novell Cool Solutions: Feature
By Arun Singh
Digg 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.
- Disk Partition Layout
- Install SLES10 with Xen
- Boot SLES10 Server with XEN kernel
- Upgrade XEN tools on SLES10 Server (Optional)
- Install Xen Guests OS
- Start YaST xen console i.e. /sbin/yast2 xen
- Click "Add" to add new virtual machine.
- Change Settings, especially Network and Operating System Installation.
- Here vnc based installation is selected. You may get different screen for text based install.
- Follow the install instruction presented i.e. open vncviewer and continue installation.
- Here on-ward it's standard install.
- 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.
- Configure OCFS2 on Xen Host Server
- Run ocfs2console tool to add Xen Host Server node entry to cluster configuration (/etc/ocfs2/cluster.conf).
- Run o2cb command to configure and enable cluster.
- Format shared volume partition
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.
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.
Once SLES10 with Xen is installed successfully, reboot the server and select XEN boot option.
Verify that server is booted with xen kernel.
This is an optional step but an important one to upgrade xen tools to newer available version. Visit Novell support web site (http://support.novell.com/linux/psdb/) 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.
Installing a xen guest OS is very easy in SLES10. There are many documents available explaining installation procedure, but here are some quick steps.
Here is sample cluster.conf file after adding first node.
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.
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.
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.
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.
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. www.webwiseone.com