Using the VM Depot
Yesterday, Microsoft Open Technologies announced a complementary service to Windows Azure VMs - the VM Depot. The depot is a community-driven catalog of open source VM images. This lets you create and share VMs with custom configurations or specific software stacks installed.
Doug Mahugh also posted a getting started article that gives the basics of using the service.
I spent some time working with the depot last night, and here are the things I learned.
Requirements
You can probably guess that you'll need a Windows Azure subscription, but there's a few more things you'll need to do.
Make sure the VM preview feature is enabled for your service. You can do this by signing into your subscription and going to https://account.windowsazure.com/PreviewFeatures. Once here, sign up for the Virtual Machines & Virtual Networks option if it is not already active.
Make sure you have the latest version of the Windows Azure Command-line tools, as the depot produces a deployment script that uses a newish parameter (-o). You can update the command line tools by doing one of the following:
- Using the npm install azure-cli -g command to install the latest Azure command-line bits.
OR
- Installing the SDK download for your platform from https://www.windowsazure.com/en-us/develop/downloads/.
You'll also need to import your account settings if you haven't already. You can find the steps for this in the How to download and import publish settings section of this article.
Using a community image
If you want to create a new VM using a community image, the process is pretty simple:
Open https://vmdepot.msopentech.com/List/Index in your browser.
Find an image you want from the list. You can either scroll through the list or use the search bar at the top. The following image illustrates using the search field to find a VM that has Riak.
At this point you can either click the Deployment Script link to the far right of the VM entry you want to use or the Deployment Script icon at the top to retrieve a deployment script. You'll need to agree to the terms of use and select a region, and then you'll be given a command similar to the following:
azure vm create DNS_PREFIX -o vmdepot-66-2-2 -l "East US" USER_NAME [PASSWORD] [--ssh] [other_options]
You will need to replace the fields such as USER_NAME with actual values. Here's what each should go in each of these fields:
DNS_PREFIX should be replaced with whatever you want this machine to be called. I'm going to use myawesomevm.
USER_NAME should be replaced with the user name you want to login to the machine as.
[PASSWORD] should be the password you want to use for this user (don't include the [] characters around the password).
[--ssh] should be changed to just --ssh if you want to enable SSH (and you probably do, otherwise how are you connecting to the machine?)
[other_options] should be replaced with any other options available for the azure vm create command. For example, --vm-size small.
A final command line should look something like:
azure vm create larryriak -o vmdepot-66-2-2 -l "East US" larry secretpassword --ssh
Run this command from a command-line. It will copy the disk image from the VM Depot to storage in your subscription, and then provision a VM that uses this disk image.
At this point, the new VM should show up in the Windows Azure portal.
After the VM status changes to running, you should be able to use SSH to connect to the VM and use it as you normally would.
Publishing a VM
Doug Mahugh's article provides information on publishing an image to the VM Depot. I didn't go through the entire process of publishing a VM because I didn't want to clutter up the VM Depot with "Larry's great generic Linux VM for testing purposes". The steps seem relatively straight forward though.
Create a custom VM and publish a VHD to the VM Deopot
Create a VM. You can find a walk through of this process in the Create a virtual machine running Linux tutorial.
Once it's been created, SSH to the VM and install things people might find useful.
Capture an image of the VM to a VHD. You can find these steps in the How to capture an image of a virtual machine running Linux article.
Set the storage container that contains the .VHD to public. You can do this in the Windows Azure Portal by:
Publishing the VHD to the VM Depot
You'll need to create an account on the VM Depot for this step. It allows you to use a Windows LiveID, Google ID, or Yahoo! ID. To create an account, just click on the Sign In link in the upper right to set this up.
After you've created an account and signed in, perform the following steps to share your VM with the community:
Click the Publish icon at the top of the page.
Enter information about the VM image: name, description, what packages are installed, legal terms, etc.
The URL of the VHD to publish is the full URL to the VHD in your public container. You can get this by performing the following steps:
Go to the Windows Azure Portal.
Go to the storage account that contains this VHD.
Select Containers, and then select the container.
A list of the objects in the container, along with the full URL to each item, will be displayed. Just note the URL and use it in the URL of the VHD to publish field in the VM Depot.
Once you've specified the VHD path and filled out all the information, agree to the terms and click the publish button.
Final Thoughts
The VM Depot is a great addition to the Windows Azure VM story. Previously you had to select a raw OS image and manually install your software stack on it. With the Depot, you can now pick an image that already has the stack you need, as well as share your custom stack with the community. And since it's based on the Windows Azure command-line tools, it allows you to create the command-line once in the portal and then use it in your automation scripts, or hand it out to co-workers who need to create their own VMs.
There's already a lot of VMs in the Depot for both specific OS releases (Debian Wheezy and Mageia) and specific software and software stacks (LAMP, Ruby, JRuby, WordPress, Joomla, Drupal). It will be interesting to see what new VMs show up now that this is open to the community.
Any thoughts on specific OS or software stacks that you'd like to see in the VM Depot?
- Larry