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

Shabir Abdul Samadh 96 Reputation points
2020-02-20T18:40:32.98+00:00

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
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,086 questions
0 comments No comments
{count} votes

1 additional answer

Sort by: Most helpful
  1. 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