The answer to this question was provided in the Azure-Java-SDK repo: https://github.com/Azure/azure-sdk-for-java/issues/8348
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
1 additional answer
Sort by: Most helpful
-
Helge Rutz 1 Reputation point
2020-02-20T20:48:08.557+00:00 The Class definition of disk contains
withDiskIOPSReadWrite(Long diskIOPSReadWrite)
withDiskMBpsReadWrite(Integer diskMBpsReadWrite)have you already tried this?
Helge