SCSI reservecoc登陆失败 稍后重试后会重试么

评测导购 >
存储SCSI锁解读:Windows Cluster篇
EMC中文支持论坛&&佚名丨 11:02 &&&
SCSI锁的作用:
在一个共享存储的环境下,多台前端主机可能会同时访问同一台存储设备,如果此时多台主机在同一时点上对一个LUN进行写操作,那么可想而知这个LUN将不知道哪个数据先写,哪个数据后写。为了防止这种情况发生而导致的数据损坏,所以就有了SCSI锁的概念。通过SCSI Reservation机制来进行SCSI锁的操作,目前绝大多数的磁盘都支持‘SCSI reservvation命令‘。。如果有其他的主机给已经被锁定的磁盘发送读写请求,则会收到‘reservation conflict’报错信息。如果保留SCSI锁的主机崩溃,或者其他主机给磁盘发送‘break reservation或者reset target命令,用来解除SCSI锁。然后,第二个主机发送I/O请求之前需要重新发送SCSI Reservation命令给磁盘。
SCSI锁的分类:
SCSI锁有两种类型:SCSI-2 Reservation和SCSI-3 Reservation。一个LUN上只能存在一种类型的SCSI锁。
SCSI-2 Reservation只允许设备被发出SCSI锁的Initiator访问,也就是主机的HBA。比如主机1上的HBA1对访问的LUN加上SCSI-2锁,此时即使主机1的HBA2也无法访问这个LUN。所以SCSI-2 Reservation也被称为Single Path Reservation。
SCSI-3 Reservation(Persistent Reservation)是使用PR Key来对磁盘进行加锁。通常一台Host会有唯一的PR Key,不同的主机对应的PR Key也不同。所以一般SCSI-3 Reservation通常被应用在多通路的共享环境下面。。
Windows Cluster中的SCSI锁:
Windows 2003集群中使用SCSI-2 reserve/release命令。作为非持久的reservation,所以集群中的一台节点会持有SCSI-2 Reservation的锁,然后每过3秒会重新刷新一次。如果故障转移发生,则切换节点主机会在相应的磁盘上放置SCSI-2 Reservation然后维护SCSI锁。如果所有节点主机上的集群服务都会关闭,Reservation也不会保留。
。如果磁盘从主机上没有正确移除,集群使用的磁盘(Cluster Disk)会保留着这些Reservation。锁对应的SCSI锁会一直存在于相应的磁盘之上,即使集群服务被关闭或者磁盘对于主机取消掩饰(unmasked)。所以,有些时候需要强行移除磁盘上的Reservation。
在Windows环境中,移除Reservation移除的命令是(disknumber可以在Windows的Disk Management中找到)
【编辑推荐】
戴尔透露闪存服务器细节 虚拟SAN上日程 摩擦渐消 EMC将ScaleIO纳入VMware内核 解析:iSCSI、FCoE和FC的性能比较 光纤通道――SSD存储之王 华为存储OceanStor V3引领传统企业IT变革 什么是富士通“Data Center-focused”的ICT产品? 百万用户规模的系统如何扩展 如何给Win7系统下的硬盘分区 大海捞针 数据中心存储系统应如何使用 硕讯联盟(ERAS GROUP)推出万兆IP统一存储系统
今日微信独家
《华尔街日报》报道日前援引知情人士的消息称,由于被美国政府以国家安全问题为由进行调查,联想斥资23亿美元收购IBM低端服务器业务的交易陷入了停滞状态。
关注新浪官博
订阅微信订阅号
订阅焦点周刊
论坛与活动
看DELL微视频,赢大奖!
51CTO旗下网站《Linux那些事儿之我是USB》我是U盘(31)SCSI命令之我型我秀
usb_stor_control_thread()基本讲完了,但是其中下面这几行,正是高潮中的高潮。所谓的批量传输,所谓的Bulk-Only协议。正是在这里体现出来的。
371&&&&&&&&&& /* we've got a command, let's do it! */
372&&&&&&&&&& else {
373&&&&&&&&&&&&&& US_DEBUG(usb_stor_show_command(us-&srb));
374&&&&&&&&&&&&&& us-&proto_handler(us-&srb,us);
375&&&&&&&&&& }
所谓的US_DEBUG,我们前面已经讲过,无非就是打印条是信息的。而眼下这句话就是执行usb_stor_show_command(us-&srb)这个函数,鉴于这个函数是我们自己写的,而且有意义,所以也就列出来。这个函数定义于drivers/usb/storage/debug.c中:
&56 voidusb_stor_show_command(struct scsi_cmnd *srb)
&58&&&&& char*what = NULL;
&61&&&&&& switch(srb-&cmnd[0]) {
&62&&&&&& caseTEST_UNIT_READY: what = &TEST_UNIT_READY&;
&63&&&&&& caseREZERO_UNIT: what = &REZERO_UNIT&;
&64&&&&&& caseREQUEST_SENSE: what = &REQUEST_SENSE&;
&65&&&&&& caseFORMAT_UNIT: what = &FORMAT_UNIT&;
&66&&&&&& caseREAD_BLOCK_LIMITS: what = &READ_BLOCK_LIMITS&;
&67&&&&&& caseREASSIGN_BLOCKS: what = &REASSIGN_BLOCKS&;
&68&&&&&& caseREAD_6: what = &READ_6&;
&69&&&&& caseWRITE_6: what = &WRITE_6&;
&70&&&&&& caseSEEK_6: what = &SEEK_6&;
&71&&&&& caseREAD_REVERSE: what = &READ_REVERSE&;
&72&&&&&& caseWRITE_FILEMARKS: what = &WRITE_FILEMARKS&;
&73&&&&& caseSPACE: what = &SPACE&;
&74&&&&&& caseINQUIRY: what = &INQUIRY&;
&75&&&&&& caseRECOVER_BUFFERED_DATA: what =&RECOVER_BUFFERED_DATA&;
&76&&&&&& caseMODE_SELECT: what = &MODE_SELECT&;
&77&&&&&& caseRESERVE: what = &RESERVE&;
&78&&&&&& caseRELEASE: what = &RELEASE&;
&79&&&&&& caseCOPY: what = &COPY&;
&80&&&&&& caseERASE: what = &ERASE&;
&81&&&&&& caseMODE_SENSE: what = &MODE_SENSE&;
&82&&&&&& caseSTART_STOP: what = &START_STOP&;
&83&&&&&& caseRECEIVE_DIAGNOSTIC: what = &RECEIVE_DIAGNOSTIC&;
&84&&&&& case SEND_DIAGNOSTIC: what =&SEND_DIAGNOSTIC&;
&85&&&&& caseALLOW_MEDIUM_REMOVAL: what = &ALLOW_MEDIUM_REMOVAL&;
&86&&&&&& caseSET_WINDOW: what = &SET_WINDOW&;
&87&&&&& caseREAD_CAPACITY: what = &READ_CAPACITY&;
&88&&&&& caseREAD_10: what = &READ_10&;
&89&&&&&& caseWRITE_10: what = &WRITE_10&;
&90&&&&&& caseSEEK_10: what = &SEEK_10&;
&91&&&&& caseWRITE_VERIFY: what = &WRITE_VERIFY&;
&92&&&&&& caseVERIFY: what = &VERIFY&;
&93&&&&&& caseSEARCH_HIGH: what = &SEARCH_HIGH&;
&94&&&&& caseSEARCH_EQUAL: what = &SEARCH_EQUAL&;
&95&&&&&& caseSEARCH_LOW: what = &SEARCH_LOW&;
&96&&&&& caseSET_LIMITS: what = &SET_LIMITS&;
&97&&&&&& caseREAD_POSITION: what = &READ_POSITION&;
&98&&&&& case SYNCHRONIZE_CACHE: what =&SYNCHRONIZE_CACHE&;
&99&&&&& case LOCK_UNLOCK_CACHE: what =&LOCK_UNLOCK_CACHE&;
100&&&&& case READ_DEFECT_DATA: what =&READ_DEFECT_DATA&;
101&&&&& case MEDIUM_SCAN: what =&MEDIUM_SCAN&;
102&&&&& case COMPARE: what = &COMPARE&;
103&&&& case COPY_VERIFY: what =&COPY_VERIFY&;
104&&&&& case WRITE_BUFFER: what =&WRITE_BUFFER&;
105&&&&& case READ_BUFFER: what =&READ_BUFFER&;
106&&&& case UPDATE_BLOCK: what =&UPDATE_BLOCK&;
107&&&&& case READ_LONG: what = &READ_LONG&;
108&&&&& case WRITE_LONG: what =&WRITE_LONG&;
109&&&&& case CHANGE_DEFINITION: what =&CHANGE_DEFINITION&;
110&&&&& case WRITE_SAME: what =&WRITE_SAME&;
111&&&&& case GPCMD_READ_SUBCHANNEL: what = &READSUBCHANNEL&;
112&&&&& case READ_TOC: what = &READ_TOC&;
113&&&&& case GPCMD_READ_HEADER: what = &READHEADER&;
114&&&&& case GPCMD_PLAY_AUDIO_10: what = &PLAYAUDIO (10)&;
115&&&&& case GPCMD_PLAY_AUDIO_MSF: what = &PLAYAUDIO MSF&;
116&&&& &case GPCMD_GET_EVENT_STATUS_NOTIFICATION:
117&&&&&&&&&& what = &GET EVENT/STATUSNOTIFICATION&;
118&&&&& case GPCMD_PAUSE_RESUME: what =&PAUSE/RESUME&;
119&&&&& case LOG_SELECT: what =&LOG_SELECT&;
120&&&&& case LOG_SENSE: what = &LOG_SENSE&;
121&&&&& case GPCMD_STOP_PLAY_SCAN: what = &STOPPLAY/SCAN&;
122&&&&& case GPCMD_READ_DISC_INFO: what = &READDISC INFORMATION&;
123&&&&& case GPCMD_READ_TRACK_RZONE_INFO:
124&&&&&&&&&& what = &READ TRACK INFORMATION&;
125&&&&& case GPCMD_RESERVE_RZONE_TRACK: what =&RESERVE TRACK&;
126&&&&& case GPCMD_SEND_OPC: what = &SENDOPC&;
127&&&&& case MODE_SELECT_10: what =&MODE_SELECT_10&;
128&&&&& case GPCMD_REPAIR_RZONE_TRACK: what =&REPAIR TRACK&;
129&&&&& case 0x59: what = &READ MASTER CUE&;
130&&&&& case MODE_SENSE_10: what =&MODE_SENSE_10&;
131&&&&& case GPCMD_CLOSE_TRACK: what = &CLOSETRACK/SESSION&;
132&&&&& case 0x5C: what = &READ BUFFER CAPACITY&;
133&&&&& case 0x5D: what = &SEND CUESHEET&;
134&&&&& case GPCMD_BLANK: what = &BLANK&;
135&&&&& case REPORT_LUNS: what = &REPORTLUNS&;
136&&&&& case MOVE_MEDIUM: what = &MOVE_MEDIUM orPLAY AUDIO (12)&;
137&&&&& case READ_12: what = &READ_12&;
138&&&&& case WRITE_12: what = &WRITE_12&;
139&&&&& case WRITE_VERIFY_12: what =&WRITE_VERIFY_12&;
140&&&&& case SEARCH_HIGH_12: what =&SEARCH_HIGH_12&;
141&&&&& case SEARCH_EQUAL_12: what =&SEARCH_EQUAL_12&;
142&&&&& case SEARCH_LOW_12: what =&SEARCH_LOW_12&;
143&&&&& case SEND_VOLUME_TAG: what =&SEND_VOLUME_TAG&;
144&&&&& case READ_ELEMENT_STATUS: what =&READ_ELEMENT_STATUS&;
145&&&&& case GPCMD_READ_CD_MSF: what = &READ CDMSF&;
146&&&&& case GPCMD_SCAN: what = &SCAN&;
147&&&&& case GPCMD_SET_SPEED: what = &SET CDSPEED&;
148&&&&& case GPCMD_MECHANISM_STATUS: what =&MECHANISM STATUS&;
149&&&&& case GPCMD_READ_CD: what = &READCD&;
150&&&&& case 0xE1: what = &WRITE CONTINUE&;
151&&&&& case WRITE_LONG_2: what =&WRITE_LONG_2&;
152&&&& default: what = &(unknown command)&;
153&&&&& }
154&&&&& US_DEBUGP(&Command %s (%d Bytes)\n&,what, srb-&cmd_len);
155&&&&& US_DEBUGP(&&);
156&&&&& for (i = 0; i & srb-&cmd_len &&i & 16; i++)
157&&&&& US_DEBUGPX(& %02x&, srb-&cmnd[i]);
158&&&&& US_DEBUGPX(&\n&);
这个函数,很简单,就是把要执行的SCSI命令打印出来。列出这个函数没别的意思,让不熟悉SCSI的读者知道基本上会遇到一些什么命令。显然,刚才说的那个INQUIRY也包含在其中。
不过别看这个函数很简单,你要是不熟悉SCSI协议的话,你还真的解释不了这个函数。比如你说srb-&cmnd[]这个数组到底是什么内容?有什么格式?为什么函数一开始只判断cmnd[0]?实不相瞒,这里边还真有学问。首先,在SCSI的规范里边定义了一些命令,每个命令都有一定的格式,命令的字节数也有好几种,有的命令是6个字节的,有的命令是10个字节的,有的命令是12个字节的。如图4.33.1、图4.33.2和图4.33.3所示,SCSI命令就该是这个样子。
人们把这样几个字节的命令称之为CDB(Command DescriptorBlock,命令描述符块)。而我们为CDB准备了一个字符数组,结构体struct scsi_cmnd中的unsigned char cmnd[16],最大就12个字节,为什么不申请一个12个字节的数组?
既然这个CDB有16个字节,那么为什么我们每次都判断cmnd[0]就够了?仔细看这三幅图,注意到Operation code了吗?没错,三幅图中的第1个字节都被称为Operationcode,换而言之,不管是什么样子的命令,都必须在第1个字节里签上自己的名字,向世人说明你是谁。于是在include/scsi/scsi.h中,定义了好多宏,比如#define INQUIRY 0x12,#define READ_6 0x08,#define FORMAT_UNIT 0x04,实际上操作码就相当于SCSI命令的序列号,SCSI命令总共也就那么多,8位的操作码已经足够表示了,因此,我们只要用一个字节就可以判断出这是哪个命令了。
好了,命令说完了,开始进入真正处理命令的部分了。ESXi5+VM+RHCS环境构筑时遇到的问题及解决方法_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
ESXi5+VM+RHCS环境构筑时遇到的问题及解决方法
||文档简介
总评分4.2|
浏览量2365
&&环​境​:​
​
​V​M​w​a​r​e​ ​E​S​X​i.
​
​R​e​d​H​a​t​ .
​
​用​虚​拟​机​搭​建​双​机​环​境
阅读已结束,如果下载本文需要使用
想免费下载本文?
下载文档到电脑,查找使用更方便
还剩30页未读,继续阅读
你可能喜欢Categories
I'm working on some changes, please stand by.
March 1, 2010
Filed under: , ,
admin @ 2:50 pm
I’ve recently started working extensively with iSCSI based SAN storage, having previously only had a background in Fibre Channel based storage.
One unexpected benefit from using iSCSI based storage is the ease of capturing SCSI traffic for analysis.
ISCSI, making use of the TCP/IP stack and Ethernet for the physical layer makes traffic capturing as trivial as installing .
On the other hand, capturing Fibre Channel traffic for analysis typically requires a Fiber tap and expensive pieces of hardware.
I have had experience with SCSI-3 Persistent Reservations in the past, but while recently troubleshooting a SCSI-3 PR issue, I decided to capture sample SCSI-3 Persistent Reservation traffic with Wireshark for reference analysis.
I built a CentOS 5u3 virtual machine, installed and configured the iscsi_initiator_utils package, and then installed the
sg3_utils consists of a number of extremely useful tools which allow you to directly manipulate devices via SCSI commands.
The tool I wanted to use is called sg_persist and is used to send PROUT and PRIN commands (more on that in a moment).
Before we go any further, a little background is required…
The SCSI protocol standards, maintained by the
of the International Committee for Information Technology Standards (INCITS), is split into a large number of specifications covering various aspects of SCSI.
The over-arching standard is known as the SCSI Architecture Model, or SAM, now in its 5th generation (SAM-5).
The SAM ties together all of the SCSI standards and provides the requirements which the myriad SCSI specifications and standards must meet.
Of primary concern to us now is the SPC, or SCSI Primary Commands standard, which defines SCSI commands common to all classes of SCSI devices.
A given SCSI device will conform, in the least, to the SPC and a standard specific to that class of device.
For example, a basic disk drive will conform to the SPC and the SBC (SCSI Block Commands) specifications.
Device reservations are handled in one of two ways–the older RESERVE/RELEASE method specified in the SCSI-2 specs and the newer persistent reservation method of SCSI-3.
Reservations allow a SCSI device (typically a SAN-based storage array) to maintain a list of initiators which can and cannot issue commands to a particular device.
Reservations, whether the older method or PR, are what allows more than one server to access to a shared set of storage without stepping on one another.
SCSI-3 Persistent Reservations offer some advantages over the older RESERVE/RELEASE method–primarily by allowing the reservation data to be preserved across server reboots, initiator failures, etc.
The reservation will be held by the array for the LUN until it is released or preempted.
One important thing to keep in mind is that the function of persistent reservations are to prevent a node from writing to a disk when it does not hold the reservation.
The reservation system will not prevent another node from preempting the existing reservation and then writing to the disk.
It is the responsibility of the server-side application making use of the persistent reservations to ensure that cluster nodes act appropriately when dealing with reservations.
In part II we will look at the two SPC commands dealing with persistent reservations–PRIN (Persistent Reserve In) and PROUT (Persistent Reserve Out) and their associated service actions.
Website Design & Maintenance by

我要回帖

更多关于 coc登陆失败 稍后重试 的文章

 

随机推荐