Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set custom IOPS and Throughput on a new Azure Disk create #8348

Closed
2 tasks done
Shabirmean opened this issue Feb 20, 2020 · 3 comments
Closed
2 tasks done

Set custom IOPS and Throughput on a new Azure Disk create #8348

Shabirmean opened this issue Feb 20, 2020 · 3 comments
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files)

Comments

@Shabirmean
Copy link

Shabirmean commented Feb 20, 2020

Query/Question

  • I want to create a managed disk using the Azure SDK.
  • And I am able to do it.
  • However, I can't find any method or interface via which I can set IOPS and Throughput on the disks I create (I know they are only supported for Ultra disks).
  • Is it something only possible via the REST API and not supported from the Java SDK for Azure?
  • I have asked the question here as well.

Current definition stages I see are:

image

// what I have as of now
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);

Why is this not a Bug or a feature Request?

  • Because I think it is something I can't figure out and maybe not necessarily something that's broken.

Setup (please complete the following information if applicable):

  • OS: Mac
  • IDE : IntelliJ
  • Version of the Library used: 1.31.0

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Query Added
  • Setup information Added
@joshfree joshfree added customer-reported Issues that are reported by GitHub users external to the Azure organization. Management question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files) labels Feb 20, 2020
@joshfree
Copy link
Member

Thanks for posting the question on the Java Storage Management SDK @Shabirmean. @yaohaizh @ChenTanyi can you please assist?

/cc @rickle-msft @gapra-msft

@ChenTanyi
Copy link
Contributor

@Shabirmean The whole Rest API is innerObject, when you see an option doesn't appear in fluent API, you could use inner api as a workaround.

In this situation, code is like:

Disk disk = azure.disks().define()....create();
disk.inner().withDiskIOPSReadWrite(1L);
disk.update().apply();

// Or if the options can only be set in creation
Disk.DefinitionStages.WithCreate diskCreate = azure.disks().define()...
    // .create();
((Disk) diskCreate).inner().withDiskIOPSReadWrite(1L);
diskCreate.create();

@Shabirmean
Copy link
Author

@ChenTanyi - This works. Thank you very much! 🎉

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

3 participants