How to change VM size with the Windows Azure PHP Command-line Tools

April 21, 2011

Newer Note: The Interoperability Team at Microsoft has annouced a new version of the Windows Azure SDK for PHP which contains a set of shiny new command line tools and has deprecated the Windows Azure PHP Command-line Tools project. This post is not valid for the SDK, however a config file of the same name will be edited with the new tools. See http://azurephp.interoperabilitybridges.com for documentation on the new SDK tools

 

Note: Upcoming versions of the Windows Azure PHP Command-line tools will probably have functionality to change this at build time. Please check the documentation at the following sites to see if your version has the option.

The Windows Azure PHP Command-line Tools does not currently have a way to change the role size for any given instance; however there is a way to do this, by “hacking” the command line tool. If you have not already read my post on Hacking the Windows Azure PHP Command-line Tools you should do so now to get an understanding of what is going on behind the scenes.

The size of you VM instance is controlled in the .csdef file as a parameter to your role tag. Open the .csdef file in your command line tools install and locate the role you want to change (Probably <WebRole…). Add the “vmsize” attribute and set it to the size role you want. Save the changes and rebuild your app.

Example with a medium instance:
<WebRole name=”WebRole” vmsize=”Medium”>

As of the time of this writing you can choose from the following VM sizes:

  • ExtraSmall
  • Small
  • Medium
  • Large
  • ExtraLarge

For more information on role sizes see: http://msdn.microsoft.com/en-us/library/ee814754.aspx

Learn more about running PHP on Windows Azure at http://azurephp.interopbridges.com