atom feed3 messages in com.redhat.linux-cluster[Linux-cluster] CLVM, iSCSI and namin...
FromSent OnAttachments
Pierre-Alain RIVIEREOct 24, 2007 3:09 am 
Graham WoodOct 24, 2007 3:24 am 
Pierre-Alain RIVIEREOct 24, 2007 4:57 am 
Subject:[Linux-cluster] CLVM, iSCSI and naming rules
From:Pierre-Alain RIVIERE (pari@ippon.fr)
Date:Oct 24, 2007 3:09:04 am
List:com.redhat.linux-cluster

Hello,

I'm working on a Xen solution where Xen's DomU are stored on iSCSI volumes (a LV on Dom0 is a partition on DomU) to allow live migration between hosts and to make DomU's partitions resizing easier.

iSCSI volumes -> LVM on Dom0 -> LV on Dom0 -> partition on DomU

As far as I know, I need CLVM in order to propagate automatically LVM changes between host. So I've installed Ubuntu Gutsy on my server and configured CMAN, CLVM and Open-ISCSI. Things seems to work fine. I've also added some udev custom rules to have the same device name on each box

----------------- udev rule KERNEL=="sd*", BUS=="scsi", PROGRAM="iscsidev %b",SYMLINK+="iscsi/%c{1}/lun%c{2}/part%n"

------------------

------------------ iscsidev #!/bin/sh

BUS=${1} HOST=${BUS%%:*}

# This was the first thing I thought of, I'm sure it can be done better: LUN=`echo ${BUS} | cut -d":" -f4`

[ -e /sys/class/iscsi_host ] || exit 1

file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/targetname"

#target_name=$(cat ${file}) target_name=`cut -d":" -f2 ${file}`

# This is not an open-scsi drive if [ -z "${target_name}" ]; then exit 1 fi

echo "${target_name} ${LUN}"

--------------------------------------

Using these scripts my iSCSI devices have a symlink under /dev/iscsi/, /dev/iscsi/IpponData.xen01/lun0/part is an example.

Next step, LVM initialization.

# pvcreate /dev/iscsi/IpponData.xen02/lun0/part # pvdisplay /dev/iscsi/IpponData.xen02/lun0/part

--- NEW Physical volume --- PV Name /dev/sdj VG Name PV Size 10.00 GB Allocatable NO PE Size (KByte) 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID ecfUIs-4mnP-sKhq-mK8s-mICm-rUvt-2o8E8g

As you can see pvdisplay doesn't care about /dev/iscsi/IpponData.xen02/lun0/part symlink and instead use the target device.

This is a normal behavior? And when I will deploy CMAN, CLVM and iSCSI on another box what will be LVM behaviours? I can't guarantee that /dev/sdj will be accessible on the other box, only the symlink will be the same.