FATMIN

OpenStack / Cloud / Virtualization / Linux

Skip to content
  • Home
  • About
  • Git
  • Resources
Search

defaults

RHEL6 – How to Manually Logout of an Iscsi Disk

August 27, 2012November 28, 2014 / Christopher Paquin / Leave a comment

Little_cartoon_spider_in_front_of_full_moon_sticker-p217682891349294915envb3_400One of the issues that I have run into in the past when working with iscsi disks occurs when a host (initiator) is unable to logout gracefully from an iscsi disk when attempting to shutdown or reboot a host.

Note that this is a known issue and is documented here and here. I have not read completely through the RHEL 6 Bugzilla to see if the issue has been resolved, however I can tell you that I have seen this issue in RHEL 6.2.

Anyway as a quick work around to save yourself a painfully slow reboot you can logout of the disk before you shutdown to save time, for example, if you were taking some sort of linux test.

First think I do is verify that I actually currently am logged into an iscsi session

# iscsiadm -m session
tcp: [1] 10.1.224.34:3260,1 iqn.2012-08.my.new.iscsi

Next I umount the mounted filesystem that was on the iscsi disk. In my case I mounted it to /iscsi_disk

UUID="4f3f136d-1f90-4e1b-95b6-d3496d54da99"             /iscsi_disk             ext4    defaults,_netdev 0 0

Above is the line in my /etc/fstab that mounts the iscsi disk, note that you should always use the _netdev option to mount a remote disk (nfs, san, iscsi — does not matter)

So after unmounting the disk I manually log out from the iscsi disk/s

iscsiadm -m node –logout all

The output of the command above shows me that the logout was successful.

Logging out of session [sid: 1, target: iqn.2012-08.my.new.iscsi, portal: 10.1.224.34,3260]
Logout of [sid: 1, target: iqn.2012-08.my.new.iscsi, portal: 10.1.224.34,3260] successful.

I can then check my current connected sessions again and see that I have no active sessions.

# iscsiadm -m session
iscsiadm: No active sessions.

Now you should be able to reboot without issue.

As a side note I was actually wondering how the initiator knew to log back into the iscsi disk at boot time. Well if you look in /var/lib/iscsi/nodes/ you will see a directory for each iscsi disk that you logged into using iscsiadm.

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Reddit (Opens in new window)

Like this:

Like Loading...

Member of The Internet Defense League

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 156 other subscribers

Categories

  • AIX
  • Android
  • Applications
  • Asus
  • centos
  • Ceph
  • cinder
  • Cisco
  • Cisco UCS
  • collectd
  • Compliance
  • Containers
  • Dell
  • Devops
  • Docker
  • DPDK
  • foreman
  • Git
  • glance
  • Google
  • Hardware
  • Heat
  • Home Automation
  • Homelab
  • horizon
  • HPUX
  • ironic
  • kubernetes
  • KVM
  • libvirt
  • Linux
  • LSI
  • Mac
  • Misc
  • Monitoring
  • mysql
  • NAS
  • Networking
  • neutron
  • NFV
  • nova
  • Open Solaris
  • OpenShift
  • OpenStack
  • Performance Tuning
  • puppet
  • Redhat
  • rhel7
  • RHEL8
  • RHEV
  • Salt
  • SAN
  • Satellite
  • Security
  • Shell Scripting
  • Solaris 10
  • Solaris 8
  • Storage
  • tripleO
  • Ubuntu
  • Uncategorized
  • vcli
  • VCP Exam
  • Veritas
  • virtualization
  • Vmware
  • Windows
  • Xenserver
  • ZFS
 

Loading Comments...
 

    %d bloggers like this: