none
VMs and REST RRS feed

  • Question

  • 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!

    Tuesday, August 28, 2012 5:51 PM

Answers

All replies