Reattach iSCSI Storage

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Re-attach the Iscsi storage

Here are the steps you should implement when you do a detach of an ISCSI Storage Repository and
you want to add it back.

Confirm you are able to see the ISCSI device locally

[root@xenserver-jamesc log]# fdisk -l

Disk /dev/sda: 160.0 GB, 160000000000 bytes


255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System


/dev/sda1 * 1 499 4008186 83 Linux
/dev/sda2 500 998 4008217+ 83 Linux
/dev/sda3 999 19452 148231755 83 Linux

If not, do not proceed until you do. In this example I restarted the open-iscsi service which logged
into the ISCSI LUN

[root@xenserver-jamesc log]# service open-iscsi restart


Stopping iSCSI initiator service: iscsid (pid 32231 32230) is running...
[ OK ]
Starting iSCSI initiator service: [ OK ]
Setting up iSCSI targets: Login session [iface: default, target: iqn.2006-
01.com.openfiler:volume.jamesc, portal: 10.217.130.5,3260]
[ OK ]
[root@xenserver-jamesc log]# fdisk -l

Disk /dev/sda: 160.0 GB, 160000000000 bytes


255 heads, 63 sectors/track, 19452 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System


/dev/sda1 * 1 499 4008186 83 Linux
/dev/sda2 500 998 4008217+ 83 Linux
/dev/sda3 999 19452 148231755 83 Linux

Disk /dev/sdb: 83.8 GB, 83886080000 bytes


255 heads, 63 sectors/track, 10198 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Identify the UUID of the VG_XenStorage ISCSI LUN

[root@xenserver-jamesc log]# vgs


VG #PV #LV #SN Attr VSize VFree
VG_XenStorage-1382fed0-f4cd-be9d-6691-d640a3a2c495 1 4 0 wz--n- 78.11G 57.61G
VG_XenStorage-3fa0f04a-147e-0da4-b486-80e1aadedf29 1 2 0 wz--n- 141.35G 123.35G

Introduce the Storage Repository using the UUID of the correct Volume Group from the vgs
command

[root@xenserver-jamesc log]# xe sr-introduce


content-type= name-label= shared= type= uuid=
[root@xenserver-jamesc log]# xe sr-introduce content-type=user name-label=jamesiscsi
type=lvmoiscsi uuid=1382fed0-f4cd-be9d-6691-d640a3a2c495
1382fed0-f4cd-be9d-6691-d640a3a2c495

Confirm the Storage Repository now shows up

[root@xenserver-jamesc log]# xe sr-list uuid=1382fed0-f4cd-be9d-6691-d640a3a2c495


uuid ( RO) : 1382fed0-f4cd-be9d-6691-d640a3a2c495
name-label ( RW): jamesiscsi
name-description ( RW):
host ( RO): <not in database>
type ( RO): lvmoiscsi
content-type ( RO): user

Create the Physical Block Device (PBD)

[root@xenserver-jamesc log]# xe pbd-create


device-config- host-uuid= sr-uuid=

[root@xenserver-jamesc log]# xe pbd-create host-uuid=797f6d55-3e0e-4aa7-9830-bfb64208feed sr-


uuid=1382fed0-f4cd-be9d-6691-d640a3a2c495 device-config:target=10.217.130.5 type=lvmoiscsi
device-config:targetIQN=iqn.2006-01.com.openfiler:volume.jamesc device-config:LUNid=0
a550f692-4b2b-2cf5-1aa5-fa7a425345ee

Now plugin the Physical Block Device (PBD)


[root@xenserver-jamesc log]# xe pbd-plug uuid=a550f692-4b2b-2cf5-1aa5-fa7a425345ee

Your ISCSI Storage Repository should now be online. 

The final task will be to reattach the Virtual Disk Images (VDI) to the corresponding Virtual Machines
(VM)

Select the VM in the XenCenter console and choose the Storage tab - select the Attach at the
bottom and choose the corresponding VDI's for the VM

You might also like