question

ShabirAbdulSamadh-3741 avatar image
ShabirAbdulSamadh-3741 asked ·

Creating a managed disk with IOPS and Throughout using the Azure Java-SDK

Hi,

I am trying to connect to Azure and create a managed disk with custom IOPS and Throughput (for Ultra Disks) using the Azure Java SDK. I am on the following SDK version: 1.31.0


I am able to create a managed disk of different types with custom sizes. However, I am unable to find how I can specify an IOPS or Throughput on the Disk. The piece of code I am using is:


     Azure az = factory.userClient(ctx);
     // some stuff
 
     Disk.DefinitionStages.Blank dd = az.disks().define(myDIskModel.getName());
     Disk.DefinitionStages.WithGroup ddGroup = dd.withRegion(myDIskModel.getRegion());
     Disk.DefinitionStages.WithDiskSource ddSource = ddGroup.withExistingResourceGroup(resourceGroup);
     Disk.DefinitionStages.WithDataDiskSource ddData = ddSource.withData();
     Disk.DefinitionStages.WithCreate ddCreate = ddData
             .withSizeInGB(Integer.parseInt(myDIskModel.getSizeGb()))
             .withSku(DiskSkuTypes.fromStorageAccountType(DiskStorageAccountTypes.fromString(myDIskModel.getType())))
             .withTag(AzureTags.X, XX)
             .withTag(AzureTags.Y, YY)
             .withTag(AzureTags.Z, ZZ);

     Observable<Indexable> asynCreate = ddCreate.createAsync();
     Checker checker = new Checker(callerContext, asynCreate, Disk.class);

I have no way of finding how to set IOPS and Throughput on my call to create a disk. Is it something that only supported via REST API client and not the SDK?

Any guidance would be helpful.

I have raised the question in the Azure-Java-SDK github repo as well: https://github.com/Azure/azure-sdk-for-java/issues/8348

Best
Shabir AS

azure-virtual-machines
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ShabirAbdulSamadh-3741 avatar image
ShabirAbdulSamadh-3741 answered ·

The answer to this question was provided in the Azure-Java-SDK repo: https://github.com/Azure/azure-sdk-for-java/issues/8348

Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

HelgeRutz-8366 avatar image
HelgeRutz-8366 answered ·

The Class definition of disk contains

withDiskIOPSReadWrite(Long diskIOPSReadWrite)
withDiskMBpsReadWrite(Integer diskMBpsReadWrite)

have you already tried this?

Helge

1 comment Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I don't see it in the SDK version I am using: 1.31.0.


These are the ones I see:
3133-screen-shot-2020-02-20-at-42117-pm.png


0 Votes 0 · ·