locked
How to get the Windows 2016 Preview OS in CreatePool() RRS feed

  • Question

  • To followup on my previous post, is there any way to get CreatePool() to use a Windows 2016 Preview instance or image?  I know that works for me because I've tried it, and the VM I used with 2016 had .NET 4.6.1 - which is what I need.

    Thanks.

    Monday, May 23, 2016 3:03 AM

Answers

  • I was able to get it working on my machine. Make sure you set the vmSize from "small" to "STANDARD_A1".

    Here's my code to get it to work:

            var pool = batchClient.PoolOperations.CreatePool(
              poolId: poolId,
              targetDedicated: 1,              
              virtualMachineSize: "STANDARD_A1",
              //virtualMachineSize: "small",
              virtualMachineConfiguration: new VirtualMachineConfiguration(
                imageReference: new ImageReference(publisher: "MicrosoftWindowsServer", 
                offer: "WindowsServer", 
                skuId: "Windows-Server-Technical-Preview", 
                version: "latest"), 
              nodeAgentSkuId: "batch.node.windows amd64"));// single-core, 1.75 GB memory, 225 GB disk
    I did notice, however, that Application Packages are not supported when using the virtualMachineConfiguration.

    Wednesday, May 25, 2016 1:02 PM

All replies

  • Hi Srikant,

    This is the ImageReference information you need to specify to get OS2016 via CreatePool (using a VirutalMachineConfiguration).

    “publisher”: “MicrosoftWindowsServer”

    “offer”: “WindowsServer”

    “sku”: “Windows-Server-Technical-Preview

    “version”: “latest”

    “nodeAgentSKUId”: “batch.node.windows amd64”


    Monday, May 23, 2016 7:51 PM
  • Hi Matthew,

    I've tried that before - but I get a BadRequst Error.  The following is the code and log:

    Code:
    var p = bc.PoolOperations.CreatePool(poolId: pid, targetDedicated: 1, virtualMachineSize: "small", virtualMachineConfiguration: new VirtualMachineConfiguration(imageReference: new ImageReference(publisher: "MicrosoftWindowsServer", offer: "WindowsServer", skuId: "Windows-Server-Technical-Preview", version: "latest"), nodeAgentSkuId: "batch.node.windows amd64"));
    ...
    p.CommitAsync();


    Log:
    [5/23/2016 4:32:40 PM ERROR] Operation returned an invalid status code 'BadRequest' =>    at Microsoft.Azure.Batch.Protocol.BatchRequestBase`2.<ExecuteRequestAsync>d__40.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.Azure.Batch.ProtocolLayer.<ProcessAndExecuteBatchRequest>d__82`1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.Azure.Batch.CloudPool.<CommitAsync>d__2.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
       at Dolphin.Azure.<CreatePoolAsync>d__4.MoveNext() in C:\Code\Fastshout\Exec\Dolphin\Azure.cs:line 204
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
       at Dolphin.Azure.<AzureBatchAsync>d__0.MoveNext() in C:\Code\Fastshout\Exec\Dolphin\Azure.cs:line 53
    [5/23/2016 4:32:40 PM ERROR] batch error code: InvalidPropertyValue, batch error value: The value provided for one of the property in the request body is invalid.

    Monday, May 23, 2016 8:36 PM
  • I was able to get it working on my machine. Make sure you set the vmSize from "small" to "STANDARD_A1".

    Here's my code to get it to work:

            var pool = batchClient.PoolOperations.CreatePool(
              poolId: poolId,
              targetDedicated: 1,              
              virtualMachineSize: "STANDARD_A1",
              //virtualMachineSize: "small",
              virtualMachineConfiguration: new VirtualMachineConfiguration(
                imageReference: new ImageReference(publisher: "MicrosoftWindowsServer", 
                offer: "WindowsServer", 
                skuId: "Windows-Server-Technical-Preview", 
                version: "latest"), 
              nodeAgentSkuId: "batch.node.windows amd64"));// single-core, 1.75 GB memory, 225 GB disk
    I did notice, however, that Application Packages are not supported when using the virtualMachineConfiguration.

    Wednesday, May 25, 2016 1:02 PM
  • That's right, it works now - thanks.
    Wednesday, May 25, 2016 1:52 PM