none
Storage Management Provider Development RELEASE: (4/3/2014) RRS feed

  • Question

  • With the reference of the msdn web page
    SMP development

    I generated a skeletal code for my SMP provider using the 3 mandatory classes: StorageProvider, StorageSubSystem and VirtualDisk.
    I copied all the methods for all 3 classes from the MOF's of MSFT_StorageProvider, MSFT_StorageSubSystem and MSFT_VirtualDisk, and also wrote some of my own methods. Registered the provider into the registry and I can see my provider in

    HKLM\SOFTWARE\Microsoft\Wbem\CIMOM\SecuredHostProviders with a value as root\Microsoft\Windows\Storage\Providers_v2:__Win32Provider.Name="SMP_PROVIDER"

    I tried to test the provider by writing CIM cmdlets as below:
    $c = Get-CimClass -Namespace root\Microsoft\Windows\Storage\Providers_v2 -ClassName My_StorageProvider
    $Arguments = @{
       
        ComputerName = 'localhost';
       
        Credential = 'Password';
    };
    Invoke-CimMethod -Verbose -CimClass $c -MethodName RegisterSubsystem -Arguments $Arguments

    However, I am persistently getting a Invalid method parameter(s) error or Provider load failure while executing any of the methods. Debugging the same with VS2012/Wbemtest/EventViewer seems to show no specific causes of error. I tried to attach the smp provider to the host process(WmiPrvSE.exe) but it exits without getting a breakpoint hit and there seems to be no way to debug it.
    I have not yet written any business logic, all methods are empty and I have just done a MI_Context_PostResult(context, MI_RESULT_OK); at end of each method.

    Also, when I have my smp provider ready, how will I test it?

    Are there any specific cmdlets or utilities to test the provider (VDS had disk manager but smp has only Powershell/WMI/Disk raid) as per this msdn page VDS transitioning to SMP
    Is the cmdlets  list here to be used while testing? For example, Get-StorageProvider should display my registered provider or something similar to that.
    I didn't find any documentation which explains the method to test the SMP providers. Any help or redirection to the appropriate resource(s) would be really appreciated.

    P.S. I am using WMIv2 for writing the SMP provider and Windows SDK 8.1 on Windows Server 2012 R2

    Thanks

    prathamesh



    Tuesday, May 20, 2014 5:38 AM

Answers

  • Hey Prathamesh,

    The model should follow the first scenario. All calls from the Subsystem, StoragePool, PhysicalDisk, VirtualDisk should actually occur.  Once a Disk object is exposed (if you can see it from Get-Disk), Windows can operate on these objects with the usage of the Disk, Partition, and Volume objects.

    I hope this is clear!

    Thanks,

    Alex 

    Wednesday, June 25, 2014 9:12 PM

All replies

  • Hey Prathamesh,

    Can you explain what you mean by registering your provider into registry?  Does that you mean that you used the Register-CimProvider.exe command to register?  From the MSDN article you referenced on SMP development:

    Register-CimProvider.exe –Namespace root\Microsoft\Windows\Storage\Providers_v2 -ProviderName <name of your provider> –Path <path to your provider’s dll file>

    In terms of the question on validation, the cmdlets are a good way to validate that your provider is working properly.  A call to Get-StorageProvider should display your StorageProvider object.  Note that you would first need to post your StorageProvider instance before calling MI_Context_PostResult.

    Hope this help!

    Thanks,

    Alex

    Monday, June 23, 2014 7:53 PM
  • Thanks Alex !!

    Yes, we used the Register-CimProvider.exe command to register. We was able to find the root cause of the issue. Actually, the path to my provider DLL was very long and thus was getting a Buffer overflow in Event Procmon utility. Copied the DLL to C:\ and everything worked like a charm :)

    Was able to see Get-StorageProvider Get-StorageSubsytem and other cmdlets output. I have one query though: Do the storage cmdlets need to gain full control on the vendor subsystem? Please confirm which scenario is expected:

    1) A Get-PhysicalDisk, New-StoragePool(from Get-PhysicalDisk), New-VirtualDisk(from New-StoragePool) and finally a New-Volume(from New-VirtualDisk) must reflect similar concurrent changes on your subsystem array? I mean when I say Get-PhysicalDisk, must I see all the disks (raw) of the vendor subsystem on Windows?

    2) Or, do you need to expose the LUNs from your subsystem to Windows first and then Windows takes over from there from Get-PhysicalDisk upto New-Volume creation?

    Please let me know if I am making sense to you. This is somewhat confusing to explain in words. Hope I am clear!!

    Thanks for help Alex!

    Appreciated,

    prathamesh

    Tuesday, June 24, 2014 6:13 AM
  • Hey Prathamesh,

    The model should follow the first scenario. All calls from the Subsystem, StoragePool, PhysicalDisk, VirtualDisk should actually occur.  Once a Disk object is exposed (if you can see it from Get-Disk), Windows can operate on these objects with the usage of the Disk, Partition, and Volume objects.

    I hope this is clear!

    Thanks,

    Alex 

    Wednesday, June 25, 2014 9:12 PM
  • Hi Alex,

     Yes, you are clear. We were also thinking the same; you made our understanding about SMP more strong :)

    Thanks,

    prathamesh

    Thursday, June 26, 2014 5:10 AM