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

Shabir Abdul Samadh 96 Reputation points


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  
            .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:

Shabir AS

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
5,234 questions
0 comments No comments
{count} votes

1 additional answer

Sort by: Most helpful
  1. Helge Rutz 1 Reputation point

    The Class definition of disk contains

    withDiskIOPSReadWrite(Long diskIOPSReadWrite)
    withDiskMBpsReadWrite(Integer diskMBpsReadWrite)

    have you already tried this?