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

VirtualMachineDiskOperationsImpl.updateDataDisk fail #693

Closed
open-ruic opened this issue May 10, 2016 · 3 comments
Closed

VirtualMachineDiskOperationsImpl.updateDataDisk fail #693

open-ruic opened this issue May 10, 2016 · 3 comments

Comments

@open-ruic
Copy link

open-ruic commented May 10, 2016

I met a issue when using VirtualMachineDiskOperationsImpl.updateDataDisk , I think It's maybe a bug. I use Service Manage API in Azure SDK 0.9.3

It always show me an error!

[Fatal Error] :1:1: Premature end of file.
com.microsoft.windowsazure.exception.ServiceException: 
    at com.microsoft.windowsazure.exception.ServiceException.createFromXml(ServiceException.java:216)
    at com.microsoft.windowsazure.management.compute.VirtualMachineDiskOperationsImpl.updateDataDisk(VirtualMachineDiskOperationsImpl.java:2219)
    at com.vianet.cie.vmdemo.CloudServiceAPITest.updateDataDisk(CloudServiceAPITest.java:83)
    at com.vianet.cie.vmdemo.CloudServiceAPITest.main(CloudServiceAPITest.java:53)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

It's my code below:

VirtualMachineDiskGetResponse response = computeManagementClient.getVirtualMachineDisksOperations().getDisk("kevinvm-kevinvm-1-201605090139510196");
VirtualMachineDataDiskUpdateParameters updateParameters = new VirtualMachineDataDiskUpdateParameters();
updateParameters.setName("kevinvm-kevinvm-1-201605090139510196");
updateParameters.setLabel("kevinvm-data-1");
updateParameters.setMediaLinkUri(response.getMediaLinkUri());
updateParameters.setHostCaching(VirtualHardDiskHostCaching.READWRITE);
computeManagementClient.getVirtualMachineDisksOperations().updateDataDisk("kevinvm", "kevinvm", "kevinvm", 0, updateParameters);

I debuged it in my eclipse. and found this rest api return 202 status code. Then I checked it with the rest api document and found it return 202 code by design
aa

You could found this rest api in this link : https://msdn.microsoft.com/library/azure/jj157190.aspx
bb

jianghaolu added a commit to jianghaolu/azure-sdk-for-java that referenced this issue May 10, 2016
@jianghaolu
Copy link
Contributor

Yes it's a bug. Please take a look at the fix.

@open-ruic
Copy link
Author

Thanks, Cloud you tell me when do you merge your patch to azure-sdk-for-java and when do you to publish a new version with this fix patch?

jianghaolu added a commit that referenced this issue May 23, 2016
[Fixes #693] Fix for VM Datadisk status code
@jianghaolu
Copy link
Contributor

This should be fixed in 0.9.5.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants