The following forum(s) have migrated to Microsoft Q&A (Preview): Azure Virtual Machines!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
Create Basic Tier VM using REST API RRS feed

  • Question

  • Hi,

    How can we create a basic virtual machine deployment using the REST API?, Which value we have to put in the "RoleSize" tag?

    Thanks!

    Saturday, April 19, 2014 10:40 AM

Answers

All replies

  • The role sizes are Basic_A0 through Basic_A4


    You can call https://management.core.windows.net/<SubscriptionID/rolesizes
     
    To obtain the complete list.

    Sunday, April 20, 2014 11:58 PM
  • You can read this sample:

    http://www.codeproject.com/Articles/601419/How-to-manage-Azure-IaaS-Programmatically

    Create a Virtual Machine have many configurations.

    If you use .net framework,  I suggest you use management libraries:

    http://code.msdn.microsoft.com/Programmatically-d30e148a/view/Discussions

    Also you can set a break point in method.

    QuickCreateVM() 
      client.VirtualMachines.CreateDeployment(vmName, createDeploymentParams); 

    When the app run to this line

    You can open the fiddler catch the REST Call.

    Then use this xml in your REST Call.


    My Blog
    Please use Make as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

    Monday, April 21, 2014 1:49 AM
  • Thanks!, this is what i was looking for,

    regards,

    Marc.

    Monday, April 21, 2014 8:26 AM
  • Hi Yuan,

    How can we change the Tier to Basic while creating from a CLI or PowerShell?

    Kinldy suggest

    Thanks,

    Anish

    Thursday, April 24, 2014 3:32 PM
  • You're probably better starting a new topic for this, as it helps people who are looking for that specific question.

    I will dig out the bit of script I have got to do that.

    Thursday, April 24, 2014 6:33 PM
  • http://msdn.microsoft.com/en-us/library/jj835085.aspx#bk_Quick

    Azure PowerShell Commands are very powerful when it comes to creating Azure VMs (see above link)


    R. Matt Sampson

    Thursday, April 24, 2014 6:36 PM
  • Hi Yuan,

    1. Create new Basic VM:

      New-AzureQuickVM -Windows -ServiceName CLMay7WS12R2A -Name CLMay7WS12R2A -ImageName (Get-AzureVMImage | Where{$_.ImageFamily -match "Windows Server 2012"})[-1].ImageName -Password $password -Location 'West US' -AdminUsername craig -InstanceSize Basic_A0
       
    2. View VM size

      Get-AzureVM CLMay7WS12R2A | select InstanceSize

      InstanceSize                : Basic_A0
       
    3. Change to Standard VM

      Get-AzureVM CLMay7WS12R2A | Set-AzureVMSize -InstanceSize Small | Update-AzureVM
       
    4. Verify the change:

      Get-AzureVM CLMay7WS12R2A | Select instancesize
       
      InstanceSize                : Small
       
    5. Change back to Basic:

      Get-AzureVM CLMay7WS12R2A | Set-AzureVMSize -InstanceSize Basic_A0 | Update-AzureVM
       
    6. List all possible InstanceSize values:

      Get-AzureRoleSize | Select InstanceSize

      InstanceSize
      ------------
      A5
      A6
      A7
      A8
      A9
      Basic_A0
      Basic_A1
      Basic_A2
      Basic_A3
      Basic_A4

      ExtraLarge
      ExtraSmall
      Large
      Medium
      Small

    Thursday, May 8, 2014 12:21 AM