locked
Problems with CreateVolume VDS API RRS feed

  • Question

  • Hi to all,

    I've developed a windows service in order to format all unitialized drives on my platform, Virtual Disk (vds) is correctly added in the dependencies of this service. The disks I'm using for my test are unformatted drives reported as UnInitialized from disk management utility and I query them with QueryUnallocatedDisks function.

    Sometimes it happens that the async operation on CreateVolume function fails with cause VDS_E_TIMEOUT after 3 minutes, and the volume is not correctly created. The strange thing is once I got this problem every subsequent call to CreateVolume API, with different disks as target, fails for the same reason.

    Is there any particular operation that I need to do after this API timeout?

    Moreover this problem appears much more frequently (about 95% of times) if my service is started by another service that lists it in its dependencies.

    Basically the code I used it is like this:

    volCreated = (pIVdsPack->CreateVolume(VDS_VT_SIMPLE,&diskInput, 1, 0, &pIVolAsync));
    if (SUCCEEDED(volCreated))
    {
          HRESULT hVolResult = -1;
          VDS_ASYNC_OUTPUT asyncOutput;

          if (SUCCEEDED(pIVolAsync->Wait(&hVolResult, &asyncOutput) && SUCCEEDED(hVolResult)))
          {

    ...

     

    I also tryed to use QueryStatus instead of Wait but it does not solve the problem and the reported status of the asynchronous operation is always 0%.          

    Friday, March 18, 2011 2:31 PM

All replies

  • Just adding a quick update.

    I thought it was not working sometimes when the service was started thru depency by another service but I was wrong, in this case the CreateVolume ALWAYS fails due to timeout, it seems somehow deadlocked till I set the status of the service to started.

    Tuesday, April 12, 2011 1:51 PM