VDI for SQL sample problem

  • Hello,

    I am using the sample code for the VDI for SQL server downloaded from:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/samples/samples_1lf7.asp

    My problem is that the sample code fails when using a valid SQL instance name other than an empty server name.

    The documentation describes the command line for the sample as:

    usage: snapshot {B|R} <databaseName> [<instanceName>]

    If I execute the sample without the instance name and work on the local server it is OK,

    everything is done correctly.

    However, if the instance name is not NULL or empty, I get an Error.

    Using debugger I realized that it failed to create the Virtual Device set .

    Following is the piece of code from the example :

    rc = MultiByteToWideChar (CP_ACP, 0,

    pInstanceName, strlen (pInstanceName),

    wInstanceName, 127);

    wInstanceName [rc] = 0;

    hr = vds->CreateEx (wInstanceName, wVdsName, &config);

    if (!SUCCEEDED (hr))

    {

    printf ("VDS::Create fails: x%X", hr);

    goto exit;

    }

    pInstanceName holds the server name provided by the user in the command line for the instance name.

    The error code that I receive is 0x80770007 which according to the vdierror header file is:

    // Failed to recognize the SQL Server instance name

    //

    #define VD_E_INSTANCE_NAME VD_ERROR( 7 ) /* 0x80770007 */

    My question is:

    What do you expect to get as parameters to the sample?

    I attached a screenshot of mine SQL server manager.

    At mine server I execute your sample as followed:

    >snapshot.exe B testDB DROR_SPM_CLIENT

    Thanks in advance;

  • Can't really try it and not sure of the issue, but the reality is that example code from MSDN is notoriously buggy and incomplete. I wouldn't be surprised if there is a typo in there. I'd query the "sedn feedback" link at the top of the page.

    Steve Jones

    sjones@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/sjones

    The Best of SQL Server Central.com 2002 - http://www.sqlservercentral.com/bestof/

    http://www.dkranch.net

  • Agreed with Steve, Why don't ask your hardware vendor?

  • quote:


    Agreed with Steve, Why don't ask your hardware vendor?


    I actually already used the feedback link;

    and also complete the incomplete sample :)))

    (it is indeed incomplete) .

    However, my question is more about the following:

    The VDI API function:

    createEX used to open the virtual device set,

    it's first parameter should get the server instance name, if NULL is delivered it assumes it is the local server.

    with NULL everything works fine, but with other instance name it failed to create the set.

    The question is how to deliver the server instance name.

    maybe I delivered wrong name.

    anyone have ever tried this API?

  • Did you try "server\instance"?

    Steve Jones

    sjones@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/sjones

    The Best of SQL Server Central.com 2002 - http://www.sqlservercentral.com/bestof/

    http://www.dkranch.net

  • quote:


    Did you try "server\instance"?

    Steve Jones

    sjones@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/sjones

    The Best of SQL Server Central.com 2002 - http://www.sqlservercentral.com/bestof/

    http://www.dkranch.net


    1)Yes, I have already tried it.

    BTW: my instance name and my serverName are the same (Is there is any problem with it?)

    2)at the documentation of that function in VDI SDK (can be download from: http://www.microsoft.com/sql/downloads/virtualbackup.asp), it is said that no need for the "<computer name>\" prefix

  • Instance name same as server shouldn't be an issue, but you never know.

    As far as the lack of servername, it might work from the local server, but I'd be wary of that. Doesn't seem like a good design decision if it does.

    Steve Jones

    sjones@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/sjones

    The Best of SQL Server Central.com 2002 - http://www.sqlservercentral.com/bestof/

    http://www.dkranch.net

  • I think I will open an MSDN call about rhis and let you know the "Formal" answer when I'll have one.

  • Here is the formal answer:

    As for running it for a named instance on a remote machine, the following remark appears in the API help

    for IClientVirtualDeviceSet2:CreateEx:

    " The instance name must identify the instance to which the T-SQL is issued.

    NULL identifies the default instance. No "machineName\" prefix is accepted"

    Mean: CreateEx can not take a remote machine's named instance as a parameter.

    The client application using the createEx API must be running on the same computer as SQL Server

    For the local default instance server you must use 'Null' parameter.

    so here is the summarry:

    1. You can not use the VDI API for remote server.

    2.For the local default instance the createEx get NULL parameter.

    3. For named instance it gets only the instance name without the the server name prefix.

    Regards;

    Dror

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply