Skip to content

Instantly share code, notes, and snippets.

@olivierlambert
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olivierlambert/ccfa341d4b4f2897a2ea to your computer and use it in GitHub Desktop.
Save olivierlambert/ccfa341d4b4f2897a2ea to your computer and use it in GitHub Desktop.
iSCSI process in XAPI

The iSCSI process for XAPI

Step 1: find the iSCSI IQN on a target

# xe sr-probe type=lvmoiscsi device-config:target=192.168.0.100

It returns an error:

Error code: SR_BACKEND_FAILURE_96
Error parameters: , The request is missing or has an incorrect target IQN parameter

And also the XML with this data:

<?xml version="1.0" ?>
<iscsi-target-iqns>
	<TGT>
		<Index>
			0
		</Index>
		<IPAddress>
			192.168.0.100
		</IPAddress>
		<TargetIQN>
			iqn.1986-03.com.sun:02:ba2ab54c-2d14-eb74-d6f9-ef7c4f28ff1e
		</TargetIQN>
	</TGT>
	<TGT>
		<Index>
			1
		</Index>
		<IPAddress>
			192.168.1.10
		</IPAddress>
		<TargetIQN>
			iqn.1986-03.com.sun:02:ba2ab54c-2d14-eb74-d6f9-ef7c4f28ff1e
		</TargetIQN>
	</TGT>
	<TGT>
		<Index>
			2
		</Index>
		<IPAddress>
			192.168.0.100
		</IPAddress>
		<TargetIQN>
			*
		</TargetIQN>
	</TGT>
</iscsi-target-iqns>

Step 2: find the iSCSI Id and LUNs with a given IQN

# xe sr-probe type=lvmoiscsi device-config:target=192.168.0.100 device-config:targetIQN=iqn.1986-03.com.sun:02:ba2ab54c-2d14-eb74-d6f9-ef7c4f28ff1e

It returns:

Error code: SR_BACKEND_FAILURE_107
Error parameters: , The SCSIid parameter is missing or incorrect

And the XML:

<?xml version="1.0" ?>
<iscsi-target>
	<LUN>
		<vendor>
			NEXENTA
		</vendor>
		<serial>
			A83BCKLAF
		</serial>
		<LUNid>
			0
		</LUNid>
		<size>
			2199023255552
		</size>
		<SCSIid>
			3600144f0d43d7eb7a10c523192cf0001
		</SCSIid>
	</LUN>
</iscsi-target>

Step 3: find all connected SR to a SCSI Id

# xe sr-probe type=lvmoiscsi device-config:target=192.168.0.100 device-config:targetIQN=iqn.1986-03.com.sun:02:ba2ab54c-2d14-eb74-d6f9-ef7c4f28ff1e device-config:SCSIid=3600144f0d43d7eb7a10c523192cf0001

WARNING: if the XML returns a connected SR, it means you are ALREADY connected with an existing SR. Do NOT connect twice, it will WIPE all the disk content.

<?xml version="1.0" ?>
<SRlist>
	<SR>
		<UUID>
			b09ffdf4-ac78-89bb-1300-1c7fcef141ba
		</UUID>
		<Devlist>
			/dev/disk/by-id/scsi-3600144f0d43d7eb7a10c523192cf0001
		</Devlist>
		<size>
			2199010672640
		</size>
	</SR>
</SRlist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment