VMs and REST
-
mardi 28 août 2012 17:51
Hello,
I'm attempting to use the REST API in order to manage virtual machines. After a LOT of work, I was able to get REST to work with pretty much every other thing I needed to do except this core functionality.
I've now spent a few days straight trying to get this "Create Virtual Machine Deployment" API to work, to no avail. I've stripped my request body to the following:
<Deployment xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <Name>myascitestdeployment</Name> <DeploymentSlot>Production</DeploymentSlot> <Label><!--from c#:-->Base64String(System.Text.Encoding.UTF8.GetBytes("myascitestdeployment_label"))</Label> <RoleList> <Role> <RoleName>bdzeveltestvm</RoleName> <RoleType>PersistentVMRole</RoleType> <ConfigurationSets> <ConfigurationSet> <ConfigurationSetType>LinuxProvisioningConfiguration</ConfigurationSetType> <HostName>bdzevelhostname</HostName> <UserName>administrator</UserName> <UserPassword>Mypassword2#</UserPassword> <DisableSshPasswordAuthentication>false</DisableSshPasswordAuthentication> </ConfigurationSet> </ConfigurationSets> <OSVirtualHardDisk> <MediaLink>https://bdzevelstorageaccount.blob.core.windows.net/mycontainer/diskimage.vhd</MediaLink> <SourceImageName>CANONICAL__Canonical-Ubuntu-12-04-amd64-server-20120528.1.3-en-us-30GB.vhd</SourceImageName> </OSVirtualHardDisk> <RoleSize>ExtraSmall</RoleSize> </Role> </RoleList> <VirtualNetworkName>MyVirtualNetwork</VirtualNetworkName> </Deployment>This request succeeds, but when I get the operation status, I see...
<Operation xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <ID>50cbd06d-f85f-45ee-acfb-bc7bb36876bb</ID> <Status>Failed</Status> <HttpStatusCode>500</HttpStatusCode> <Error> <Code>InternalError</Code> <Message>The server encountered an internal error. Please retry the request.</Message> </Error> </Operation>So, it fails... and I don't get why. I read and re-read these docs (namely, http://msdn.microsoft.com/en-us/library/windowsazure/jj157194) and it seems that I've stripped this down to the bare-minimum in terms of requirements. I have all the "Required" fields and they all seem to be in the correct format. What am I doing wrong?
As a secondary question, when I go to the preview portal, I see "Hosted Services" (which is what this REST API manages) and I also see "Virtual Machines." Is there a way, via REST, to start a VM in THAT environment, instead of the "Hosted Services" environment (Production / Staging)? It would seem that the "Create VM Deployment," "Add Role," "Update Role," etc APIs deal SPECIFICALLY with "Hosted Services," NOT with the "basic" virtual machine environment I see above that in the portal.
Thanks!
Toutes les réponses
-
mardi 28 août 2012 22:36
Hi,
This REST API reference http://msdn.microsoft.com/en-us/library/windowsazure/jj157206 refers to the Windows Azure Virtual Machines offer.
Best Regards,
Carlos Sardo- Modifié Carlos Sardo mardi 28 août 2012 22:38
-
mercredi 29 août 2012 06:50Modérateur
Hi,
You know, 500 error always means internal server errors, if you can make sure the code is fine and Reques URI and Request body format is OK, try to connect Azure support to get more info:
https://support.microsoft.com/oas/default.aspx?gprid=14928&st=1&wfxredirect=1&sd=gn
Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework
- Marqué comme réponse Arwind - MSFTModerator lundi 3 septembre 2012 07:33
-
mercredi 29 août 2012 14:37I suppose that is what I will do, thanks.
-
vendredi 14 septembre 2012 04:30
Hi Arwind,
Even I am also facing the same issue and i have contacted the Support team also. But i got the following answer. which states we have to take help from Forum. Plesae let us know whom we have to contact reagarding this.
"Hello Gourav,
As we discussed, below is the link for forums :
Link : http://social.msdn.microsoft.com/Forums/en-US/category/windowsazureplatformctp
Regards,
Mahesh Bhoop
Azure Support Engineer
Microsoft Azure Support
Working Hours : 6.00 am to 2:30pm UTC (Monday to Friday)
Email : v-mshank@microsoft.com
Escalation Email : faslead@microsoft.com
Manager Email : v-anupti@microsoft.com v-panjha@microsoft.com
-
vendredi 14 septembre 2012 20:57
I am also facing the same problem. The CreateVMDeployment REST API is returning 500 with no details. Any luck anyone?
Shashwat

