iSCSI
iscsi allows one to share and mount block devices using the scsi protocol over a network. Fedora currently connects to a netapp that has an iscsi export.
Contact Information
- Owner
-
Fedora Infrastructure Team
- Contact
-
#admin, sysadmin-main
- Servers
-
bvmhost-p10-01/02, bvmhost-x86-05/06
- Purpose
-
Provides iscsi connectivity to our netapp.
Typical Uses
We use iscsi volumes for builders, where speed and lack of local storage needs call for it.
iscsi Basics
iscsi’s basic login / logout procedure is
-
Notify your client that a new target is available (similar to editing /etc/fstab for a new nfs mount)
-
Login to the iscsi target (similar to running "mount /my/nfs"
-
Logout from the iscsi target (similar to running "umount /my/nfs"
-
Delete the target from the client (similar to removing the nfs mount from /etc/fstab)
Logging in
Most mounts are covered by ansible so this should be automatic. In the event that something goes wrong though, the best way to fix this is:
-
Notify the client of the target:
iscsiadm --mode node --targetname iqn.1992-08.com.netapp:sn.118047036 --portal 10.5.88.21:3260 -o new
-
Log in to the new target:
iscsiadm --mode node --targetname iqn.1992-08.com.netapp:sn.118047036 --portal 10.5.88.21:3260 --login
-
Scan and activate lvm:
pvscan vgscan vgchange -ay <guestvolume>
Once this is done, one should be able to run "lvs" to see the logical volumes
Logging out
Logging out isn’t normally needed, for example rebooting a machine automatically logs the initiator out. Should a problem arise though here are the steps:
-
Disable the logical volume:
vgchange -an <guestvolume>
-
log out:
iscsiadm --mode node --targetname iqn.1992-08.com.netapp:sn.118047036 --portal 10.5.88.21:3260 --logout
|
If the vgchange command fails with an error about not being able to deactivate the volume group, this means that one of the logical volumes is still in use. By running "lvs" you can get a list of volume groups. Look in the Attr column. There are 6 attrs listed. The 5th column usually has a - or an a. a means its active, - means it is not. To the right of that (the last column) you will see an - or an o. If you see an o that means that logical volume is still mounted and in use. |
Want to help? Learn how to contribute to Fedora Docs ›