Share via


Deploying VM Roles to both private and public clouds

 

Applies To: Windows Azure Pack

Windows Azure Pack (WAP) and System Center 2012 R2 introduced the Virtual Machine Role (VM Role). The VM Role gallery is comprised of one or more virtual machines that can enable users to deploy and configure workloads such as SQL Server, SharePoint or a LAMP stack.

Using consistent resource extensions increases efficiency

Developers can add VM Roles to more easily scale-out and configure their applications. You can use the VM Role Authoring Tool and the Microsoft Enterprise Application Extension Handler to procure and deploy VM Role resource extensions to either Windows Azure Pack or Microsoft Azure. The ability to deploy to both the public Azure cloud and the on-premises Windows Azure Pack gallery can help you to effectively deploy VM Role resource extensions across the private, hosted, and public parts of your Microsoft Cloud.

Contents

The following sections describe how to deploy VM Role resource extensions to a private or public cloud.

  • Speed-Up development and testing of VM Roles

  • Build VM Role consistency across private, hosted, and public clouds

  • VM Role Walk-Through

  • Prerequisites

  • Procedure

  • Updating your resource extension

  • Updating and testing your VM Role content in Microsoft Azure

  • Updating a VM Role Gallery Item with Windows Azure Pack and System Center

Speed-Up development and testing of VM Roles

If you are already building VM Roles for your private VM Roles gallery with Windows Azure Pack (WAP), you may at times become hindered by the limited capacity or involved administrative processes of your on-premises testing environment. In these cases, you may be able to speed-up the completion of your project by first deploying a VM Role resource extension to an IaaS virtual machine in Microsoft Azure. In Azure, you can take advantage of the greater efficiencies to test and increment your application. After your project is complete and tested you can import the resource extension back on-premises. You can then deploy your final content into the VM Role gallery of your private cloud using Windows Azure Pack and System Center.

Build VM Role consistency across private, hosted, and public clouds

If you already use VM Role resource extensions in your on-premises cloud, you expect to gain functionality and reduce development time by deploying VM Role content consistently across your private, hosted, and public clouds. You may use Microsoft Enterprise Application Extension Handler to programmatically deploy a VM Role resource extension to either Microsoft Azure or your on-premises VM Role gallery in Windows Azure Pack.

VM Role Walk-Through

The following walk-through shows how you can start with a resource extension artifact, such as you would use when deploying to an on-premises VM Role gallery with Windows Azure Pack and System Center, and then deploy the resource extension to a virtual machine running in Microsoft Azure. The walk-through uses the VM Role Authoring Tool.

Prerequisites

You’ll need the following to deploy your resource extension to the public and private clouds.

  • You’ll need access to a Microsoft Azure subscription where you intend to deploy the resource extension and have a management certificate associated with this subscription.

  • If you intend to deploy a resource extension which specifies application payload you will also need at least one storage account in your subscription. This storage account must have a storage container to host the application payload

  • You’ll need an IaaS virtual machine already in the subscription to receive the resource extension deployment. This VM must have the Windows Azure Guest Agent already installed. When you create this VM you may also want to enable HTTP access during the VM creation experience in the Azure Portal in order to easily test the deployment results.

  • Install the certificate and associated private key in the My certificate store of the computer from which you intend to initiate your deployment. You will also need the thumbprint for this certificate.

  • You need to have a version of the VM Role Authoring Tool with the deploy-to-Azure option.

Be sure to write down the values of your subscription ID and the thumbprint of the management certificate. You will need to provide these values to the tool’s GUI during the deployment. To save time, you can paste these values into the tool configuration file. After you have downloaded the VM Role Authoring Tool, open the VMroleAuthor.exe.config file and paste your values there as follows.

<add key="SubscriptionId" value="<enter the subscription id>" />
<add key="MgtCertThumbprint" value="<enter the management certificate thumbprint>" />

Procedure

The following walk-through uses the SharePoint Foundation 2010 – Basic Gallery Resource sample which you can download from the Service Models Web Platform Installer Gallery.

  1. Download the SharePoint Foundation 2010 – Basic Gallery Resource sample as demonstrated in this video: Using the Service Models Web Platform Installer Feed. Alternatively you can create a new resource extension using the VM Authoring Tool and as demonstrated in these How to Videos for the VM Role Authoring Tool.

    Screenshot of Web Platform Installer

  2. Use the Web Platform Installer to add the SharePoint Foundation 2010 – Basic Gallery Resource sample to your computer. After adding the sample, you can find the resource extension package, named SharePointFoundation2010.resextpkg, inside the SharePoint_FoundationBasic_VMRole_Pkg folder.

  3. Start the VM Role Authoring Tool. Go to File and Open the SharePointFoundation2010.resextpkg file. Selecting Resource Extension in the navigation tree on the left displays the resource extension Name, Version, and Publisher and enables the Deploy button. You can change the Name, Version, and Publisher here. You need to have the version of the VM Role Authoring Tool with the deploy-to-Azure option. Check the drop-down menu here to verify that it is the version that includes the deploy-to-Azure option.

    Screen Shot of VM Role Authoring Tool

  4. Select Parameters in the navigation tree on the left to view the parameters defined by this resource extension. You will add values for these resource parameters in a later step.

    VM Role Authoring Tool

  5. Select Resource Extension in the navigation tree to enable the Deploy option and click on the Deploy button. Prior to initiating the deployment, the tool automatically validates the resource extension and displays an error message if it encounters any errors. Click the OK button to close the error message. You must correct all validation errors before you can deploy the resource extension.

    VM Role Authoring Tool

  6. Because the SharePoint Foundation 2010 – Basic Gallery Resource example specifies an application payload, the resource extension package does not pass validation until the payload exists in the expected location. Open the readme file you downloaded with the sample and you will note the following requirement.

    Readme file excerpt

  7. Download the SharePoint Foundation 2012 SP2 package from the specified location. After downloading the SharePoint_SP2_en-us.exe file and creating the specified folder structure, the SharePointFoundation2010.resextpkg should be in the SharePoint_FoundationBasic_VMRole_Pkg folder and the SharePoint_SP2_en-us.exe should be in the SharePointPayload folder. You should have a folder structure like the following.

    Payload Directory Structure

  8. Click on the Validate icon displayed at the top of the VM Role Authoring Tool window. This time the resource extension package should validate with 0 errors and 0 warnings.

  9. After correcting all validation errors, select Resource Extension in the navigation tree and click on the Deploy button again to display the Deployment Configuration window. Note the window contains the resource extension’s Name, Version, and Publisher and the default gallery item icon

    VM Authoring Tool

  10. Provide the following information in the Deployment Configuration window:

    SUBSCRIPTIONID - the value for the Microsoft Azure subscription where you intend to deploy the resource extension. You must enter a valid thumbprint for the deployment to proceed. If you already added this information into the VMroleAuthor.exe.config file, then your value is appears here.

    MANAGEMENT CERTIFICATE THUMBPRINT - the value for the Azure management certificate thumbprint. The tool displays an error message if it can find no certificate corresponding to the thumbprint value. You must enter a valid thumbprint for the deployment to proceed. If you already added this information in the VMroleAuthor.exe.config file, then your value is appears here.

    CLOUD SERVICE - select a cloud service from the drop-down list.

    VIRTUAL MACHINE (DEPLOYMENT) – select a virtual machine from the drop-down list. You should select the target VM that you want to receive the resource extension deployment. The tool displays an error message if the Windows Azure Guest Agent is not already installed on this VM. The Windows Azure Guest Agent is required.

    STORAGE ACCOUNT – select the storage account where the deployment can upload the Resource Extension Payload.

    STORAGE ACCOUNT CONTAINER – select a storage account container where the deployment can upload the Resource Extension Payload.

  11. Check the first box in this window only if you have already uploaded the required resources of the Resource Extension as an external payload. The tool displays a message if the required payload does not already exist in the storage account and storage container you have specified. The deployment then cannot proceed until this is corrected or you uncheck this box to specify that the payload should be uploaded as part of the deployment process. The external payload is typically placed in the same location and structure that would be required to import the resource extension to VMM. Leave this box unchecked for this example.

  12. Check the second box in this window to specify that the payload should be deleted from storage accounts after deployment. You can leave this box unchecked for this example.

  13. Use the arrow in the bottom-left corner to step to the next windows. Under APPLICATION SETTINGS, enter the resource parameter values. The tool masks the values of secure Resource Extension Parameters such as passwords and secure resource strings.

    VM Authoring Tool

  14. After you have entered all the required parameter values, the View Settings icon and the View PowerShell Script icon appear in the upper right corner of the window and are enabled. Click on the View Settings icon to view and save the settings the VM Role Authoring Tool passes to the Microsoft Enterprise Application Extension Handler. Click on the View PowerShell Script icon to view and save a Windows Azure PowerShell script that you could use to automate the deployment your resource extension. However, the next steps in this walk-through demonstrate how to finish the deployment from the VM Role Authoring Tool.

  15. Click on the checkmark in the last window to start the deployment. Do not close this window until the deployment is complete.

  16. When the deployment of the resource extension has completed, the Deployment Results window displays whether the deployment has completed successfully, completed with warnings, or has completed with errors.

    VM Authoring Tool

  17. To verify the resource extension, you could connect to your VM. However for this example, you can also use your browser to navigate to the Cloud Service VM and log in using the admin user account you specified when you created the VM.

Updating your resource extension

You may find it is more efficient to increment and test your resource extension in the public cloud, even if you primarily plan to use it on-premises in your private cloud. Once you are satisfied with your application, you can take the finished version of your resource extension artifact and deploy to a IaaS VM you intend to provide to public cloud users, or you can bind the resource extension artifact to a resource definition to create a resource definition that you can deploy to the VM Role Gallery using Windows Azure Pack.

Updating and testing your VM Role content in Microsoft Azure

You can use the VM Authoring Tool and the same method as shown here to update your extension or application that has been deployed to the public Microsoft Azure cloud. In Azure, you can take advantage of the greater efficiencies to test and increment your application.

After your project is complete and tested you can import the resource extension back into your on-premises private cloud with Windows Azure Pack and System Center. You can use the VM Authoring Tool to save the resource extension package such that it can be imported into System Center 2012 R2 – Virtual Machine Manager. This process is explained in the video: Updating a Virtual Machine Role Gallery Item.

See Also

VM Role Authoring Tool
Microsoft Enterprise Application Extension Handler
Service Models Web Platform Installer Gallery
How to Videos for the VM Role Authoring Tool
Updating a Virtual Machine Role Gallery Item