Concerning VHDs. Is this even valid?

I have a customer who wants to create a expandable VHD on a local drive
on a host OS (WS08R2, WS12, etc) and then open and do raw IO to the
\.\PhysicalDriveX device which was create on the host. NOTE: there is
*NO* VM involved here. He is simply doing raw access to the VHD on the
host OS. He says when he does this, his program hangs and the system
can only be manually powered down. To me this is totally bogus, but he
insists that it should work.

Please advise.

((&->

QuasiCodo wrote:

I have a customer who wants to create a expandable VHD on a local drive
on a host OS (WS08R2, WS12, etc) and then open and do raw IO to the
\.\PhysicalDriveX device which was create on the host. NOTE: there is
*NO* VM involved here. He is simply doing raw access to the VHD on the
host OS. He says when he does this, his program hangs and the system
can only be manually powered down. To me this is totally bogus, but he
insists that it should work.

Windows 7 and beyond can certainly mount a VHD so that it can be
accessed as a virtual disk. I do not know whether that drive is
accessible through \.\PhysicalDriveX, however.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

> Windows 7 and beyond can certainly mount a VHD so that it can be

accessed as a virtual disk. I do not know whether that drive is
accessible through \.\PhysicalDriveX, however.

It is.

VHD mounter is a virtual StorPort miniport, so, mounted VHD is a full physical disk.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

On 7/31/2013 1:54 PM, Maxim S. Shatskih wrote:

> Windows 7 and beyond can certainly mount a VHD so that it can be
> accessed as a virtual disk. I do not know whether that drive is
> accessible through \.\PhysicalDriveX, however.

It is.

VHD mounter is a virtual StorPort miniport, so, mounted VHD is a full physical disk.

Here is more info to whet your appetite:

When the number of outstanding IOs (i.e. IO queue depth) is small,
everything is fine. The IOs complete and everybody is happy. The hang
only occurs when the queue depth is something like 100.

It seems like the queue to handle async IOs is stuck and the IOs cannot
be canceled.

In the test program, you can set the IO queue depth. When I run the
test program from a guest OS (i.e. within a VM), raw IO with a large
queue depth works fine on a VHD which has been mounted to the VM.
However, if you run the program from the host OS, raw IO with a large
queue depth will hang the IO queue within a few minutes.

Any thoughts (not that I really want to fix a Microsoft bug)?

((&->

This is very likely Windows bug.

On what kind of the host disk is it? If you run IOMETER to the simple file on the same host disk, would it get stuck with large number of I/O?

On 7/31/2013 2:54 PM, xxxxx@broadcom.com wrote:

This is very likely Windows bug.

On what kind of the host disk is it? If you run IOMETER to the simple file on the same host disk, would it get stuck with large number of I/O?

The problem has been seen on SATA drives, SAS drives and on SSDs.

((&->

On 7/31/2013 1:06 PM, QuasiCodo wrote:

I have a customer who wants to create a expandable VHD on a local drive
on a host OS (WS08R2, WS12, etc) and then open and do raw IO to the
\.\PhysicalDriveX device which was create on the host. NOTE: there is
*NO* VM involved here. He is simply doing raw access to the VHD on the
host OS. He says when he does this, his program hangs and the system
can only be manually powered down. To me this is totally bogus, but he
insists that it should work.

Please advise.

((&->

This may also be related to the thread “Can multiple concurrent SCSI
Pass Through (Direct) cause system lockup?”

Like that issue, my test program is writing large block IO (8MB) to the
VHD device.

((&->

On 7/31/2013 3:10 PM, QuasiCodo wrote:

On 7/31/2013 2:54 PM, xxxxx@broadcom.com wrote:
> This is very likely Windows bug.
>
> On what kind of the host disk is it? If you run IOMETER to the simple
> file on the same host disk, would it get stuck with large number of I/O?
>

The problem has been seen on SATA drives, SAS drives and on SSDs.

((&->

Also, IoMeter run against a simple file on the same host works fine
also. It is only when it is a dynamically expandable VHD that there is
a problem.

((&->

That issue was open by me, however, it was an issue with my driver. Once I fixed it, I do not see the system hang any longer.

Sorry for not updating the thread with the resolution.

Update -

Just in case you are interested. I did more tests and found that the dynamically expanding VHD hangs only on WS08r2 in these circumstances. On WS12 and WS12r2 everything works great. Or if you use fixed sized VHDs on WS08r2, then everything works.

I submitted the problem to MS Premier Support and they said they would not fix WS08r2 and the solution is the either update to WS12/WS12r2 or use fixed size VHDs on WS08r2. I felt a little jipped that MS Premier Support would just regurgitate the cases I myself had listed where the problem does not happen as the “solution”. They didn’t even bother to try to reproduce and debug it. Ah, another support ticket “solved” and closed. Why did I even waste my time?

((&->