Special thanks to Srimathi Santhanam, Thomas Yip, and Filippo Seracini (a.k.a. The Doctor) for putting together and testing the examples in this post.
Following the release of System Center 2012 R2 and Windows Azure Pack in fall of 2013, we have been getting an increasing number of inquiries from people wanting help on how to think about support for VMM
s in our IaaS APIs. To be completely clear: Service Provider Foundation has included support for managing and using VMM service templates since its inception.
The most likely reason for people asking questions is the very strong emphasis on Azure consistency which permeates all our efforts in pursuit of the Cloud OS vision. To help people truly realize the long-term benefits of the Cloud OS (one experience, one toolset, one API) we began some time ago to encourage customers and partners to focus on
Windows Azure Pack’s Service Management API
as the entry point for programming against IaaS capabilities in the part of the Cloud OS powered by Windows Server & System Center. From this perspective, Service Provider Foundation is merely the conduit between Windows Azure Pack’s Service Management API and System Center, not the primary IaaS API itself.
However, also because of the emphasis on Azure consistency, the Service Management API in Windows Azure Pack does not include support for VMM service templates. And while it does include support for the Azure-consistent
VM Role artifact
, which is a similar concept, this newer artifact is currently lacking some capabilities of VMM service templates (e.g. multiple tiers in a single definition).
So, while we wait on VM Role evolution to close the gaps, what should people do? The answer is to take a hybrid approach: continue to focus on Windows Azure Pack’s Service Management API for your IaaS programming efforts, but also use Service Provider Foundation for VMM service templates if you want programmatic access to those capabilities. Done correctly, you can retain the Windows Azure Pack plan/subscription context and also make use of VMM service templates if you need to.
To provide support for service templates, you first have to add a service template to the tenant subscription, and then execute the desired operations on the service (create, delete, scale out, etc.).
The following information describes how to do this, with generalized examples (i.e. you will need to edit these examples for them to function properly in your deployed environment).
To add a Service Template to a Tenant Subscription via Service Management Automation (SMA) Runbook
The Admin provides tenants (subscribed through
WAP Tenant API
) with access to a
through an SMA runbook that gets triggered by SPF when the tenant creates a subscription:
Open Admin console in the WAP portal, access the “Automation” section (left nav pane) and create a new runbook
Paste the script you see below into the new runbook
Replace the variables with your environment-specific values
Publish the runbook, and make sure to enter the tag value of “SPF” into the runbook configuration (just those three letters, no quotes, this is critical else you won’t see the runbook in the next step), click save
Access the “VM Clouds” section, “Automation” tab, and create a new event-to-runbook mapping: object = “subscription”; action = create; runbook = the one you just created, whatever you named it
#only perform action when it is subscription create
if (($name -ne "Subscription") -or ($operation -ne "Create"))
throw "Mismatch operation. Finishing runbook"
$subscriptionName = <your subscriptionName>
if ($resourceObject.SubscriptionName -eq $subscriptionName)
$UserRoleId = $resourceObject.SubscriptionId
#define variable for service template we are going to use