The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Azure Virtual Machines!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
VMImage "not found" error when adding second role RRS feed

  • Question

  • When I trying to add a second role to a deployment with the REST API, I am getting the error:

    <Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Code>ResourceNotFound</Code><Message>VMImage vnscubed3502-ul-x8664-azure-5QgR not found.</Message></Error>

    When I use the api to get the list of images, the output in includes:

    <OSImage>
        <Category>User</Category>
        <Label>vnscubed3502-ul-x8664-azure-5QgR</Label>
        <Location>East US</Location>
        <LogicalSizeInGB>10</LogicalSizeInGB>
        <MediaLink>http://cohesiveft.blob.core.windows.net/vhds/vnscubed3502-ul-x8664-azure-5QgR</MediaLink>
        <Name>vnscubed3502-ul-x8664-azure-5QgR</Name>
        <OS>Linux</OS>
        <IsPremium>false</IsPremium>
        <OSState>Generalized</OSState>
    </OSImage>

    My XML for the add role includes:

         <VMImageName>vnscubed3502-ul-x8664-azure-5QgR</VMImageName>
         <MediaLocation>http://cohesiveft.blob.core.windows.net/vhds</MediaLocation>

      I have also used "East US" in place of the above value for MediaLocation with the same result.

    Are <VMImageName> or <MediaLocation> incorrect or is there some other field related to the image that is also required ?  Any help would be greatly appreciated.

        Thanks,

    Monday, August 4, 2014 6:37 PM

Answers

All replies

  • Monday, August 4, 2014 8:06 PM
    Moderator
  • The XML on http://msdn.microsoft.com/en-us/library/azure/jj157194.aspx was used as a template for the XML to the "Add Role"  REST API call.  That page lists the elements "VMImageName" and "MediaLocation" who's values I took from the output of the "List VM Images" REST API call, they are set as follows:

    • VMImageName, is set to the value from <OSImage><Name>
    • MediaLocation, is set to the value from <OSImage><MediaLink>

    If the values for "VMImageName" and/or "MediaLocation" are not being set correctly or if there is some other element that must be set to identify the image, then please let me know what elements need to be set to identify the VM Image and how to determine their values.

        Thanks,

      
    Monday, August 4, 2014 11:47 PM
  • Hi,

    The MediaLocation is required if the Virtual Machine is being created from a published VM Image. Specifies the location of the VHD file that is created when VMImageName specifies a published VM Image.

    For more and detail information, please refer to he following MS document:

    http://msdn.microsoft.com/en-us/library/azure/jj157186.aspx

    Regards.


    Vivian Wang

    Tuesday, August 5, 2014 6:55 AM
  • Neither of the previous pages I was pointed to help, they both describe the element "VMImageName" like this: "Optional. Specifies the name of the VM Image that is to be used to create the Virtual Machine."

    From the console I am able to create multiple VMs by selecting this image name "vnscubed3502-ul-x8664-azure-5QgR".

    Output from the REST API operation "List VM Images" includes the following element:
    <OSImage>
        <Category>User</Category>
        <Label>vnscubed3502-ul-x8664-azure-5QgR</Label>
        <Location>East US</Location>
        <LogicalSizeInGB>10</LogicalSizeInGB>
        <MediaLink>http://cohesiveft.blob.core.windows.net/vhds/vnscubed3502-ul-x8664-azure-5QgR</MediaLink>
        <Name>vnscubed3502-ul-x8664-azure-5QgR</Name>
        <OS>Linux</OS>
        <IsPremium>false</IsPremium>
        <OSState>Generalized</OSState>
    </OSImage>

    The image name selected on the console to create a VM matches exactly the <Name> element in <OSImage> seen above in the ouput fron the REST API operation "List VM Images".  When I try to create a VM using this same name with the REST API opertation "Add Role", the following result is returned:

    <Error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Code>ResourceNotFound</Code><Message>VMImage vnscubed3502-ul-x8664-azure-5QgR not found.</Message></Error>


    The XML to the REST API operation "Add Role" contains the element <VMImageName>vnscubed3502-ul-x8664-azure-5QgR</VMImageName>.

    My questions are:

    1) Should the value of the element <VMImageName> be set to the value in the <Name> element obtained from REST API operation "List VM Images" ? If not, then how do I determine what it should be set to ?

    2) is there some other element that also must be set to identify the image ?

    Tuesday, August 5, 2014 12:47 PM