romi
Contributor
Contributor

Help please

Hi,

I am using esx 3.0. i am very curious to know how esx server put scsi reservation . i have read some documents and came to know that esx server put scsi reserveration on whole lun. just wondering about cluster in box configuration . suppose one lun is shared between two vmguests and they are residing on one host (cluster in box configuration) . so how esxserver will put scsi reservation corresponding to particular vmguest?

Thanks in advance.

0 Kudos
8 Replies
romi
Contributor
Contributor

Please help me ....

Thanks in advance.

0 Kudos
Dave_Mishchenko
Immortal
Immortal

You're correct that a SCSI reservation will lock the entire LUN and no ESX host or VM will be able to write to the LUN besides the host with the reservation. These reservations however are very short in duration and generally wouldn't be a problem. VM hosts in a cluster would only experience a brief pause in I/O. Here's a good thread on the topic.

http://www.vmware.com/community/thread.jspa?messageID=605246&#605246

romi
Contributor
Contributor

Thanks dev,

Suppose there are two vmguest on one esx server machine. Both are using same hba adapter and sharing one physical disk. Esx server will put scsi reserveration for each vmguest when that vmguest will issue some I/O command . i just want to know how Esx server distinguish between guests , How it will put scsi reservation for vmguest1 or vmguest2 . As HBA and disk are common for both guest . i believe ESX server must pass some id specific to the guest to put scsi reservation. do u have any idea about this specific guest id?

0 Kudos
Dave_Mishchenko
Immortal
Immortal

ESX won't use a SCSI reservation when writing to the VM's VMDK files. In that case, the ESX host will maintain file locks to prevent another host from using the files.

SCSI reservations are only used for certain operations like creating new VMDK files, expanding a VMDK file, and powering on a VM.

So in the case of your example, ESX won't be using SCSI reservations at all. Disk I/O will be shared on the same HBA, but the VM's won't have any understanding of the underlying disk hardware. ESX masks that from the VM and schedules access to resources like disk, CPU and memory based on available resources, reservations and share settings.

0 Kudos
romi
Contributor
Contributor

I am getting bit confused . The link u sent in ur previous reply state that

"a very few SCSI reservations are used when vmkernel-based disk I/O operations are make on a VMFS filesystem"

now you r saying that ESX dont use scsi reservation while writing to the vm's vmdk files. could you please explain this.

If ESX put file licks in case of disk writing then i guess it should be also of short duration (till a write operation is being executed )isn't it?

now one novice question what is difference between file lock and scsi reserve. scsi reserve is also a kind of lock isn't it?

0 Kudos
Dave_Mishchenko
Immortal
Immortal

"a very few SCSI reservations are used when

vmkernel-based disk I/O operations are make on a VMFS

filesystem"

This would refer to operations that the vmkernal makes on the filesystem like creating, deleting and modifying files. It does not include changes made by the VM itself to the contents of the VMDK files themselves.

now you r saying that ESX dont use scsi reservation

while writing to the vm's vmdk files. could you

please explain this.

If ESX put file licks in case of disk writing then i

guess it should be also of short duration (till a

write operation is being executed )isn't it?

Yes, a SCSI reservation is not used to allow a VM to write to it's VMDK files. THe ESX host that powers on the VM will use file locks instead to ensure that no other hosts can write to the VMDKs. The file locks are relaxed if the VMDK file is shared between VMs (i.e. like if the VMs are running Microsoft clustering) to allow multiple VMs write access to the VMDK at the same time.

now one novice question what is difference between

file lock and scsi reserve. scsi reserve is also a

kind of lock isn't it?

They are both locks, but with SCSI reservation the entire LUN is locked and no other host or VM can write to the LUN while a host has a SCSI reservation. SCSI reservations are not needed for local storage on ESX host.

One last link for you:

http://pubs.vmware.com/esx254/admin/wwhelp/wwhimpl/common/html/wwhelp.htm?context=admin&file=esx25ad...

romi
Contributor
Contributor

Thanks a lot Dev for detailed explaination ,

Now back to my privious question, The situation i was mentioning in which two vmguests are residing on single esx host.

How vmware H.A will do scsi reserve for one vmguest in case of vmguest failover. the command vmkfstools will put a scsi reserve on entire lun , this command dosen't ask for which vmguest i want to put scsi reserve.

vmkfstools -L reserve vmhba0:1:0:0

if i will execute above command from esx host it will put scsi reserve on entire lun, cant we put scsi reserve for a specific vmguest?? As both vmguests are residing on same esx host and sharing same HBA and same lun.

0 Kudos
Texiwill
Leadership
Leadership

Hello,

SCSI reservations are issues anytime the VMFS metadata is modified. So in your example:

Boot of VM:

Single Reservation request for opening each file associated with the VM (.vmx, vmware.log, .nvram, .vmsd, .vmxf, .vmdk, -flat.vmdk)

Single Reservation request for updating access time each file associated with the VM (.vmx, vmware.log, .nvram, .vmsd, .vmxf, .vmdk, -flat.vmdk)

General

Single Reservation request every time a file grows in 15MB increments

vMotion:

Reservation requests for opening the proper files on the target host

Reservation requests for closing the files on the original host

Shutdown a VM

Reservation requests for closing the files for the VM

Reservation requests to change modification time for files modified for the VM.

Create a VM:

Reservation requests for when files are created associated with a VM.

Reservation requests when files are grown in increments of 15MBs

VMware HA:

Reservation request for the BOOT of the VMs on the redundant host

Since the 'original host' has died, there are no reservations associated with the original host

Using vmkfstools will put a reservation on the entire LUN not a specific guest. But the entire LUN.

Reservation requests are made at the LUN level, not the file level. For each change to the metadata of the VMFS there is a reservation request made for the LUN upon which the VMFS resides. Metadata of the VMFS is the equivalent of the directory and file information stored in NTFS or ext3.

Since requests are made at the LUN level, a VMFS must span entire LUN, using a partition is not a good idea (unless it is local SCSI).

Best regards,

Edward

--
Edward L. Haletky
vExpert XIII: 2009-2021,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos