RHEV 3.0 and earlier requires a clan LUN to create a new storage domain. This is done intentionally so you do not overwrite existing data. However if you want to force RHEV to use a LUN with existing data you can wipe out the first 512 bytes of the lun to fool RHEV in to thinking the LUN is empty.
basically there are two steps………
1. Find the path to the LUN
Run the command “multipath -ll” on a host to see whether it “sees” the SAN luns or not, the output will look something like this if it “sees” the LUN:
mpath1 (3600d0230003228bc000339414edb8101) [size=100 GB][features=”0″][hwhandler=”0″]
\_ round-robin 0 [prio=1][active]
\_ 2:0:0:6 sdb 8:16 [active][ready]
\_ round-robin 0 [prio=1][enabled]
\_ 3:0:0:6 sdc 8:64 [active][ready]
If you do not see the LUN in the multipath output it means that the host can not access the LUN, ie its not presented correctly to the host. Check you SAN ACLS. If you are using ISCSI make sure you are logged in. see my post on ISCSI notes for more info.
2. “Clean” the LUN. The LUN must be empty to add to the RHEV-M. You can use “dd” to wipe out the first 512 bytes of the lun to fool RHEV in to thinking the LUN is empty.
dd if=/dev/zero of=/dev/path/to/LUN bs=1024k count=10
# iscsiadm -m discovery -t sendtargets -p 192.168.1.100
# iscsiadm -m node -T iqn.1991-05.com.microsoft:winserver-win -server-iscsi-target-target -p 192.168.1.100 –login
# ll /dev/disk/by-path/ -> /sdb
# fdisk /dev/sdb
# mkfs.ext3 /dev/sdb1
mke2fs 1.39 (29-May-2006)
/dev/sdb1 is apparently in use by the system; will not make a filesystem here!
# iscsiadm -m node -T iqn.1991-05.com.microsoft:winserver-win
-server-iscsi-target-target -p 192.168.1.100 –logout
Define an iSCSI target name:
# tgtadm –lld iscsi –op new –mode target –tid=1 –targetname iqn.2010-10.local.rhev:target1
To view the currect configuration:
# tgtadm –lld iscsi –op show –mode target
Add it as a logical unit to the target:
# tgtadm –lld iscsi –op new –mode logicalunit –tid 1 –lun 1 -b /dev/sdb
tgtadm –lld iscsi –op bind –mode=target –tid=1 –initiator-address=192.168.1.102