<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
>
<channel>
<title>Building Clouds</title>
<atom:link href="https://blogs.technet.microsoft.com/privatecloud/feed/" rel="self" type="application/rss+xml" />
<link>https://blogs.technet.microsoft.com/privatecloud</link>
<description>...building hybrid clouds that can support any device from anywhere</description>
<lastBuildDate>Wed, 07 Dec 2016 15:22:01 +0000</lastBuildDate>
<language>en-US</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<item>
<title>Post notifications to Microsoft Teams using PowerShell</title>
<link>https://blogs.technet.microsoft.com/privatecloud/2016/11/02/post-notifications-to-microsoft-teams-using-powershell/</link>
<comments>https://blogs.technet.microsoft.com/privatecloud/2016/11/02/post-notifications-to-microsoft-teams-using-powershell/#respond</comments>
<pubDate>Wed, 02 Nov 2016 23:00:02 +0000</pubDate>
<dc:creator><![CDATA[Michael Greene]]></dc:creator>
<category><![CDATA[Uncategorized]]></category>
<category><![CDATA[Automation]]></category>
<category><![CDATA[Powershell]]></category>
<guid isPermaLink="false">https://blogs.technet.microsoft.com/privatecloud/?p=9775</guid>
<description><![CDATA[Microsoft Teams, announced earlier today, is a new platform for chat based communication. I was very happy to see the Connectors available including many popular CI/CD related tools. The Connector configurations allow for an easily pluggable extension for Microsoft Teams to integrate notifications in to discussions. This creates an opportunity to integrate datacenter and cloud... <a href="https://blogs.technet.microsoft.com/privatecloud/2016/11/02/post-notifications-to-microsoft-teams-using-powershell/" class="read-more">Read more</a>]]></description>
<content:encoded><'
$fact2 = '[1 test failed](http://URLtoReport)'
$body = ConvertTo-Json -Depth 4 @{
title = 'New Build Notification'
text = "A build completed with status $status"
sections = @(
@{
activityTitle = 'Build'
activitySubtitle = 'automated test platform'
activityText = 'A change was evaluated and new results are available.'
activityImage = 'http://URL' # this value would be a path to a nice image you would like to display in notifications
},
@{
title = 'Details'
facts = @(
@{
name = 'Unit Tests'
value = $fact1
},
@{
name = 'Integration Tests'
value = $fact2
}
)
}
)
potentialAction = @(@{
'@context' = 'http://schema.org'
'@type' = 'ViewAction'
name = 'Click here to visit PowerShell.org'
target = @('http://powershell.org')
})
}
Invoke-RestMethod -uri $uri -Method Post -body $body -ContentType 'application/json'
</code></pre>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/11/button.jpg" alt="button" width="884" height="318" class="alignnone size-full wp-image-9785" /></p>
<h3 id="troubleshooting">Troubleshooting</h3>
<p>In testing this, all of the errors I encountered were a result of not correctly formatting the JSON document. Reference the examples given in the API and compare your results as returned by the <em>ConvertTo-Json</em> cmdlet. To see this text, highlight just the section of the script that generates $body and run it in PowerShell ISE using the “Run Selection” button or by pressing F8. Then type $body in the terminal window and review the output. Remember that when you see square brackets in the JSON document, that indicates an array, and arrays might contain only a single value.</p>
<p>Thank you!<br />
Michael Greene<br />
Principal Program Manager<br />
Enterprise Cloud Group CAT Team</p>
]]></content:encoded>
<wfw:commentRss>https://blogs.technet.microsoft.com/privatecloud/2016/11/02/post-notifications-to-microsoft-teams-using-powershell/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>Monitoring your home IP security cameras with OMS Log Analytics</title>
<link>https://blogs.technet.microsoft.com/privatecloud/2016/10/23/monitoring-your-home-ip-security-cameras-with-oms-log-analytics/</link>
<comments>https://blogs.technet.microsoft.com/privatecloud/2016/10/23/monitoring-your-home-ip-security-cameras-with-oms-log-analytics/#respond</comments>
<pubDate>Sun, 23 Oct 2016 13:50:00 +0000</pubDate>
<dc:creator><![CDATA[Tiander Turpijn [MSFT]]]></dc:creator>
<category><![CDATA[Operations Management Suite]]></category>
<category><![CDATA[Log Analytics]]></category>
<category><![CDATA[OMS]]></category>
<category><![CDATA[Powershell]]></category>
<category><![CDATA[Syslog]]></category>
<guid isPermaLink="false">https://blogs.technet.microsoft.com/privatecloud/?p=9365</guid>
<description><![CDATA[Summary: Monitor devices, like home IP security cameras, with OMS Log Analytics without installing an agent! Hi folks, In this blog post I would like to share with you how you can monitor devices with Log Analytics without the need to install the OMS (MMA) agent. We’ve recently announced the Log Analytics HTTP Data Collector... <a href="https://blogs.technet.microsoft.com/privatecloud/2016/10/23/monitoring-your-home-ip-security-cameras-with-oms-log-analytics/" class="read-more">Read more</a>]]></description>
<content:encoded><![CDATA[<p><strong>Summary</strong>: Monitor devices, like home IP security cameras, with OMS Log Analytics without installing an agent!</p>
<p>Hi folks, In this blog post I would like to share with you how you can monitor devices with Log Analytics without the need to install the OMS (MMA) agent.</p>
<p>We’ve recently announced the <a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-data-collector-api/">Log Analytics HTTP Data Collector API</a>. This enables a number of scenarios for which you may not have considered OMS Log Analytics previously. Especially in an environment where you cannot install the OMS agent or when the device does not run a supported OS version or distro like Windows or Linux. Well, let me show you the following.</p>
<p>A solution typically starts with a problem, so let’s dive into my problem first.</p>
<p>I have a home security system and part of that system are a couple of <strong>Foscam IP security camera’s</strong> and a Foscam NVR (<strong>Network Video Recorder</strong>) which records the camera feeds. The outdoor camera’s are at my <strong>front door</strong> and my <strong>carport</strong>, which leads to my backdoor. The camera’s are connected to the NVR and are configured in such a way that upon motion detection, they start a recording and optionally I can configure alert actions which typically would result in sending an email with a snapshot taken from the camera feed.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image805.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb633.png" width="562" height="253"></a></p>
<p>All goodness at this point. The problem or challenge if you will, is that I want to know if someone is doing some reconnaissance around my house in such a way that a person is detected by my front door camera <em><strong>AND</strong></em> by my carport camera <em><strong>WITHIN</strong></em> a specific interval of minutes, let’s say 5 minutes. I can visually see this correlation in my NVR when I play recorded streams, like this:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image790.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb618.png" width="538" height="86"></a></p>
<p> </p>
<p>These systems (cameras and NVR) were never designed though to be able to perform any form of correlation and certainly not to do any data analytics. Did I say analytics? Yes I did. So whenever I hear analytics, OMS Log Analytics obviously comes to mind. But to use Log Analytics in this scenario, I need to have the data available in Log Analytics first. Now with the ingestion API you can! Let’s break this project up for a second.</p>
<h3>Step 1 – Does my camera log events and puts it in some kind of log file?</h3>
<p>Well it does, but it’s mainly focused at the web UI and there’s no export capability to be found in the UI <img class="wlEmoticon wlEmoticon-sadsmile" style="border-top-style: none;border-left-style: none;border-bottom-style: none;border-right-style: none" alt="Sad smile" src="https://msdnshared.blob.core.windows.net/media/2016/08/wlEmoticon-sadsmile2.png"> , but hey, I have logged events! <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none;border-left-style: none;border-bottom-style: none;border-right-style: none" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/2016/08/wlEmoticon-smile12.png"></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image787.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb615.png" width="443" height="295"></a></p>
<h3>Step 2 – Is there any form of automation possible to retrieve the logs?</h3>
<p>After thorough research (through Bing that is) I’ve discovered that there’s a limited SDK available which supports CGI requests in the form of POST and GET commands. Well that’s a start. It turned out that I can get the logs, but they are limited in the number of rows returned (10 max) and they come in this format:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image788.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb616.png" width="441" height="252"></a></p>
<p><em>Fast forward in time and more coffee</em>….it appears that the datetime field and source IP address are notated in UNIX time and in decimal notation. Nothing that PowerShell can’t handle <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none;border-left-style: none;border-bottom-style: none;border-right-style: none" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/2016/08/wlEmoticon-smile12.png"> , let’s move on to step 3.</p>
<h3>Step 3 – Create PowerShell automation scripts – am I hearing Azure Automation here?</h3>
<p>So the fun part begins:</p>
<p>1. Creating PowerShell snippets to get the logs through CGI requests, using <strong>Invoke-WebRequest</strong>, and put the result in an array – <em>done</em></p>
<p>2. Utilize existing PowerShell functions to convert Unix time and the IP address – <em>done</em></p>
<p>3. Update the array so I end up with <strong>DateTime</strong>, <strong>UserName</strong>, <strong>Source IP address</strong> and <strong>Camera EventType</strong> – <em>done</em></p>
<p>4. Create a table with custom log field names, based on the array from step 1, and send it to the Log Analytics ingestion API – <em>done</em></p>
<p>5. Test-drive the ingestion process – <em>done</em></p>
<h3> </h3>
<h3>Step 4 – Using Log Search to query my camera data</h3>
<p>Now that I have the log data from my outdoor camera’s sent to OMS Log Analytics, we can explore the data through Log Search:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image789.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb617.png" width="469" height="524"></a></p>
<p>Nice!</p>
<h3>Step 5 – Correlating the camera log data</h3>
<p>Time to take an outside walk to get some sun and wave at my two outdoors cameras. The cameras have done their job, they’ve detected me and have streamed the video feed to my NVR which has recorded my movements. Let’s see if I can correlate this in Log Search:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image791.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb619.png" width="535" height="343"></a></p>
<p>Great! Let’s turn that into an alert with a schedule:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image792.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb620.png" width="260" height="383"></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image796.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb624.png" width="266" height="193"></a></p>
<p> </p>
<p>And while we’re there, let’s add an Azure Automation (webhook enabled) runbook which will send a text message (leveraging the Twilio text service):</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image794.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb622.png" width="276" height="487"></a></p>
<p>Let’s test the webhook…. Ok, that works:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image797.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb625.png" width="266" height="499"></a></p>
<p>And we’re done!</p>
<p>Let’s test drive the solution. Again getting some sun, waving at my camera’s, sending the data to Log Analytics and….here we go:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image798.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb626.png" width="643" height="382"></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image799.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb627.png" width="614" height="370"></a></p>
<p>Awesome! Peace of mind accomplished.</p>
<p>Now I can add my PowerShell script to Azure Automation, assign variables through assets, add it to a schedule and execute it on a Hybrid Runbook Worker, which has connectivity to my camera’s on my internal network.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image806.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb634.png" width="594" height="351"></a></p>
<h3> </h3>
<h3>So what’s next?</h3>
<p>Besides creating visualization with the View Designer… </p>
<p>For the next project <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none;border-left-style: none;border-bottom-style: none;border-right-style: none" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/2016/08/wlEmoticon-smile12.png"> I’ve noticed that in some rare occasion I did not have the complete camera recording, what is going on with that? Exploring the logs of the NVR I saw this:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image800.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb628.png" width="504" height="308"></a></p>
<p>That sounds like a good use case to send the NVR logs to Log Analytics too for analyzing and correlating the data. I can leverage the approach followed previously which allows me to search through the NVR data as well:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image801.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb629.png" width="527" height="333"></a></p>
<p>Since the camera’s, but also the NVR are IP based, I wanted to be able to troubleshoot if there are some kind of connectivity issues going on between my camera’s, NVR and my home router. So I’ve decided to leverage and enable <strong>Syslog</strong> forwarding on my router. That was easy, since on my Asus Router I luckily have this:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image802.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb630.png" width="490" height="158"></a></p>
<p>The <strong>Remote Log Server</strong> destination IP address is an Azure VM running Ubuntu, which has an OMS agent running, which forwards the data to Log Analytics:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image803.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb631.png" width="507" height="138"></a></p>
<p> </p>
<p>With the router data in Log Analytics as well, I can now go ahead and start troubleshooting and correlating my “video lost” errors and hopefully find the root cause by searching for keywords like <strong>NVR</strong> or <strong>drop</strong> (for potentially dropped packets, etc.):</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/08/image804.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb632.png" width="521" height="310"></a></p>
<h3> <a href="https://msdnshared.blob.core.windows.net/media/2016/08/image807.png"><img title="image" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/08/image_thumb635.png" width="502" height="328"></a></h3>
<p>If you want to explore Syslog forwarding, you can go here: <a href="https://github.com/Microsoft/OMS-Agent-for-Linux/blob/master/docs/OMS-Agent-for-Linux.md#configuring-syslog-collection-from-the-oms-portal">Configuring syslog collection from the OMS portal</a></p>
<p>I hope that you’ve enjoyed this blog post and have seen the power and possibilities of the <a href="https://azure.microsoft.com/en-us/documentation/articles/log-analytics-data-collector-api/">Log Analytics HTTP Data Collector API</a>.</p>
<p>Thanks,</p>
<p>Tiander.</p>
]]></content:encoded>
<wfw:commentRss>https://blogs.technet.microsoft.com/privatecloud/2016/10/23/monitoring-your-home-ip-security-cameras-with-oms-log-analytics/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>Taking backup of encrypted Azure VMs with ADE (Azure Disk Encryption) using Azure Backup in OMS</title>
<link>https://blogs.technet.microsoft.com/privatecloud/2016/09/15/taking-backup-of-encrypted-azure-vms-with-ade-azure-disk-encryption-using-azure-backup-in-oms/</link>
<comments>https://blogs.technet.microsoft.com/privatecloud/2016/09/15/taking-backup-of-encrypted-azure-vms-with-ade-azure-disk-encryption-using-azure-backup-in-oms/#respond</comments>
<pubDate>Fri, 16 Sep 2016 04:09:04 +0000</pubDate>
<dc:creator><![CDATA[Kandavel KR]]></dc:creator>
<category><![CDATA[Operations Management Suite]]></category>
<category><![CDATA[Uncategorized]]></category>
<category><![CDATA[Azure Backup]]></category>
<category><![CDATA[Azure Virtual Machines]]></category>
<category><![CDATA[Disk Encryption]]></category>
<guid isPermaLink="false">https://blogs.technet.microsoft.com/privatecloud/?p=9295</guid>
<description><![CDATA[We see customers migrating or deploying workloads on Azure have started encrypting their virtual machines using ADE (Azure Disk Encryption) and looking for a backup solution that supports protecting those encrypted VMs in a simple and cost effctive manner. We also heard, loud and clear, that Azure Backup (ABU) is the one which customers prefer... <a href="https://blogs.technet.microsoft.com/privatecloud/2016/09/15/taking-backup-of-encrypted-azure-vms-with-ade-azure-disk-encryption-using-azure-backup-in-oms/" class="read-more">Read more</a>]]></description>
<content:encoded><![CDATA[<p align="left">We see customers migrating or deploying workloads on Azure have started encrypting their virtual machines using ADE (Azure Disk Encryption) and looking for a backup solution that supports protecting those encrypted VMs in a simple and cost effctive manner. We also heard, loud and clear, that Azure Backup (ABU) is the one which customers prefer in maintaining the encrypted VMs backup in their Azure deployment. Here, in this blog post, we show you how you can use the latest Azure Recovery Services Backup PowerShell cmdlets to take backup of your ADE (Azure Disk Encryption) encrypted VMs on Azure.</p>
<p>In short, here is the list of high-level steps covered in the blog post:</p>
<ol>
<li>Prepare your Azure AD application’s client ID & client Secret</li>
<li>Prepare Azure Key Vault account & set policies for Azure AD application to store & manage encryption keys & secrets</li>
<li>Enable Disk Encryption on Azure VM using AAD application & Key Vault</li>
<li>Prepare Azure Recovery Services Vault settings and perform backup of encrypted VM</li>
<li>Trigger initial backup of encrypted VM</li>
<li>Restore encrypted VM into a storage account for recovering VM</li>
</ol>
<p><strong><u>Prerequisites:</u></strong></p>
<p>To get you started, here are the steps you need to prepare before proceeding further:</p>
<p>1. <u>Azure subscription</u>: A valid Azure subscription is needed to use Azure services.</p>
<p>2. <u>Azure PowerShell</u>: Please use the latest Azure PowerShell version <a target="_blank" href="https://github.com/Azure/azure-powershell/releases">1.6.0</a> or later</p>
<p>3. <u>Azure Key Vault</u>: Please refer to the <a target="_blank" href="http://blogs.technet.com/b/kv/archive/2015/06/02/azure-key-vault-step-by-step.aspx">Azure Key Vault – Step by Step</a> blog post for more details on how to setup a Key Vault in Azure. Please create and use a Key Vault that is in the same region as the VM to be encrypted. For Azure Backup you need to use the key encryption key feature which you can create in the Key Vault by following instructions on this <a target="_blank" href="https://azure.microsoft.com/en-us/documentation/articles/key-vault-get-started/">page</a>. This key will be used as the key encryption key to wrap the encryption secrets.</p>
<p>4. <u>Azure Active Directory Client ID and Secret</u>: In order to write encryption secrets to a specified Key Vault, Azure Disk Encryption needs the Client ID and the Client Secret of the Azure Active Directory application that has permissions to write secrets to the specified Key Vault. Please refer to the <a target="_blank" href="http://blogs.technet.com/b/kv/archive/2015/06/02/azure-key-vault-step-by-step.aspx">Azure Key Vault – Step by Step</a> blog post for more detail on how to get the Azure Active Directory Client ID and Client Secret using the Azure portal.</p>
<p>5. <u>IaaS V2 VM in Azure</u>: Azure Disk Encryption works only on IaaS V2 VMs (virtual machines created using the Azure Resource Management Model) in Azure. Please refer to <a target="_blank" href="https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-choices-create-vm/">Different ways to create a Windows virtual machine with Resource Manager</a> for information on how to create IaaS V2 virtual machines in Azure.</p>
<p>6. <u>Azure Recovery Services Vault</u>: Please refer to the <a target="_blank" href="https://azure.microsoft.com/en-us/documentation/articles/backup-azure-vms-first-look-arm/">First look: Protect Azure VMs with a recovery services vault</a> document “Step 1” for more details on how to create an Azure Recovery Services Vault.</p>
<p><strong>Note</strong>:<br />
The key encryption key (KEK) must have been created in the same key vault where the disk encryption secrets are placed. Please refer to the article <a target="_blank" href="https://azure.microsoft.com/en-us/documentation/articles/key-vault-get-started/">Getting Started with Azure Key Vault</a> to learn how to create keys in Key Vault.</p>
<p> </p>
<p>########################################################################################################<br />
# <strong><u>Section1</u></strong>: Log-in to Azure and select appropriate subscription.<br />
########################################################################################################</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>Login-AzureRmAccount -ErrorAction “Stop” 1> $null; </strong></p>
<p><strong>Get-AzureRmSubscription -SubscriptionName <your-subscription-name> | Select-AzureRmSubscription</strong></td>
</tr>
</tbody>
</table>
<p> </p>
<p>########################################################################################################<br />
# <strong><u>Section2</u></strong>: Define the variables required Log-in to Azure and select appropriate subscription.<br />
########################################################################################################</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>$rgName = ‘MySecureRg’;</strong></p>
<p><strong>$aadAppName = <your-aad-app-name>;</strong></p>
<p><strong>$aadClientSecret = <your-aad-client-secret>;</strong></p>
<p><strong>$keyVaultName = ‘MySecureVault’;</strong></p>
<p><strong>$keyEncryptionKeyName = ‘MyKeyEncryptionKey’;</strong></p>
<p><strong>$backupVMName = ‘ExtraSecureVM’;</strong></p>
<p><strong>$recoveryServicesVaultName = <your-recovery-services-vault-name>;</strong></p>
<p><strong>$recoveryServicesAADServicePrincipalName = ‘262044b1-e2ce-469f-a196-69ab7ada62d3’;</strong></td>
</tr>
</tbody>
</table>
<p> </p>
<p>########################################################################################################<br />
# <strong><u>Section3</u></strong>: Create your Azure AD application & Key Vault for using in ADE & ABU<br />
########################################################################################################</p>
<p># Create a new AD application if not created before</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>$identifierUri = [string]::Format(“</strong><a href="http://localhost:8080/{0}",[Guid]::NewGuid().ToString("N"));">http://localhost:8080/{0}”,[Guid]::NewGuid().ToString(“N”));</a><br />
<strong>$defaultHomePage = ‘</strong><a href="http://contoso.com';">http://contoso.com’;</a><br />
<strong>$now = [System.DateTime]::Now;<br />
$oneYearFromNow = $now.AddYears(1);<br />
$aadClientSecret = [Guid]::NewGuid(); </strong><strong>$ADApp = New-AzureRmADApplication -DisplayName $aadAppName -HomePage $defaultHomePage -IdentifierUris $identifierUri -StartDate $now -EndDate $oneYearFromNow -Password $aadClientSecret;<br />
$servicePrincipal = New-AzureRmADServicePrincipal -ApplicationId $ADApp.ApplicationId; </strong></td>
</tr>
</tbody>
</table>
<p> </p>
<p># Get Resource Group object to crease Key Vault</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>$resGroup = Get-AzureRmResourceGroup -Name $rgName<br />
$location = $resGroup.Location</strong></td>
</tr>
</tbody>
</table>
<p> </p>
<p># Create a new vault if vault doesn’t exist</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>$keyVault = New-AzureRmKeyVault -VaultName $keyVaultName -ResourceGroupName $rgName -Sku Standard -Location $location;</strong></td>
</tr>
</tbody>
</table>
<p># Add a new Key to Key Vault for using in Disk Encryption for VMs</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>$key = Add-AzureKeyVaultKey -VaultName $keyVaultName -Name $keyEncryptionKeyName -Destination ‘Software’</strong></td>
</tr>
</tbody>
</table>
<p> </p>
<p>########################################################################################################<br />
# <strong><u>Section4</u></strong>: Get your Azure AD application’s client ID<br />
########################################################################################################</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>$aadAppSvcPrincipals = (Get-AzureRmADServicePrincipal -SearchString $aadAppName);<br />
$aadClientID = $aadAppSvcPrincipals[0].ApplicationId;</strong></td>
</tr>
</tbody>
</table>
<p> </p>
<p>########################################################################################################<br />
# <strong><u>Section5</u></strong>: Get Azure Key Vault account & set policies for Azure AD application to store & manage encryption keys & secrets<br />
########################################################################################################</p>
<p># Get Key Vault account’s Encryption Key, Resource ID and Key Encryption Key URL which are needed for encrypting Azure VM:</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>$keyVault = Get-AzureRmKeyVault -VaultName $keyVaultName -ResourceGroupName $rgname;</strong></p>
<p><strong>$diskEncryptionKeyVaultUrl = $keyVault.VaultUri;</strong></p>
<p><strong>$keyVaultResourceId = $keyVault.ResourceId;</strong></p>
<p><strong>$keyEncryptionKeyUrl = (Get-AzureKeyVaultKey -VaultName $keyVaultName -Name $keyEncryptionKeyName).Key.kid;</strong></td>
</tr>
</tbody>
</table>
<p> </p>
<p># Specify full privileges to the key vault for the AAD application</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>Set-AzureRmKeyVaultAccessPolicy -VaultName $keyVaultName -ServicePrincipalName $aadClientID -PermissionsToKeys all -PermissionsToSecrets all; </strong></td>
</tr>
</tbody>
</table>
<p> </p>
<p># Enable disk encryption policy in key vault for using ADE</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>Set-AzureRmKeyVaultAccessPolicy -VaultName $keyVaultName -EnabledForDiskEncryption;</strong></td>
</tr>
</tbody>
</table>
<p> </p>
<p># Specify privileges for Azure Backup Service to access keys and secrets in key vault for VM Backup. Please note the Service Principal name to set which is unique to Azure Backup service</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>Set-AzureRmKeyVaultAccessPolicy -VaultName $keyVaultName -ResourceGroupName $rgName -PermissionsToKeys backup,get,list -PermissionsToSecrets get,list –ServicePrincipalName $recoveryServicesAADServicePrincipalName</strong></td>
</tr>
</tbody>
</table>
<p> </p>
<p>########################################################################################################<br />
# <strong><u>Section6</u></strong>: Enable Disk Encryption on Azure VM using AAD application & Key Vault<br />
########################################################################################################</p>
<p># Use VM disk encryption extension to enable encryption (Bit Locker for Windows, for Linux)</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>Set-AzureRmVMDiskEncryptionExtension -ResourceGroupName $rgName -VMName $backupVMName -AadClientID $aadClientID -AadClientSecret $aadClientSecret -DiskEncryptionKeyVaultUrl $diskEncryptionKeyVaultUrl -DiskEncryptionKeyVaultId $keyVaultResourceId -KeyEncryptionKeyUrl $keyEncryptionKeyUrl -KeyEncryptionKeyVaultId $keyVaultResourceId;</strong></td>
</tr>
</tbody>
</table>
<p><strong></strong></p>
<p>########################################################################################################<br />
# <strong><u>Section7</u></strong>: Trigger Initial Backup of encrypted VM<br />
########################################################################################################</p>
<p># Set Azure Recovery Services Vault context for backup operations</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>$recoveryServicesVault = Get-AzureRmRecoveryServicesVault -ResourceGroupName $rgName -Name $recoveryServicesVaultName </strong></p>
<p><strong>Set-AzureRmRecoveryServicesVaultContext –Vault $recoveryServicesVault</strong></td>
</tr>
</tbody>
</table>
<p><strong></strong></p>
<p># Get protection policy to be used for enabling encrypted VM backup. Here the default protection policy is used which you can replace with your custom created one.</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>$backupPolicy = Get-AzureRmRecoveryServicesBackupProtectionPolicy DefaultPolicy</strong></td>
</tr>
</tbody>
</table>
<p><strong></strong></p>
<p># Enable encrypted VM backup using the selected protection policy</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>Enable-AzureRmRecoveryServicesBackupProtection -Policy $backupPolicy -Name $backupVMName -ResourceGroupName $rgName</strong></td>
</tr>
</tbody>
</table>
<h6></h6>
<p>######################################################################################################## # <strong>Section8</strong>: Trigger initial backup on demand to create initial copy of VM<br />
########################################################################################################</p>
<p># Trigger Initial Backup of VM</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>$backupContainer = Get-AzureRmRecoveryServicesBackupContainer -ContainerType AzureVM -Name $backupVMName</strong></p>
<p><strong>$backupItem = Get-AzureRmRecoveryServicesBackupItem -Container $backupContainer -WorkloadType AzureVM -Name $backupVMName</strong></p>
<p><strong>$backupItem | Backup-AzureRmRecoveryServicesBackupItem</strong></td>
</tr>
</tbody>
</table>
<p> </p>
<p>########################################################################################################<br />
# <strong><u>Section9</u></strong>: Restore encrypted VM from a specific recovery point object to a storage account for new VM creation<br />
######################################################################################################### Get Recovery Points of encrypted VM backup</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>$recoveryKeyFileLocation = <path-to-key-file-location></strong></p>
<p><strong>$recoveryPointID=Get-AzureRmRecoveryServicesBackupRecoveryPoint -Item $backupItem</strong><br />
<strong>$recoveryPoint = Get-AzureRmRecoveryServicesBackupRecoveryPoint -RecoveryPointId $recoveryPointID[0] -Item $backupItem -KeyFileDownloadLocation $recoveryKeyFileLocation</strong></td>
</tr>
</tbody>
</table>
<p># Restore encrypted VM to a storage account for creating new VM</p>
<table width="999" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td width="997" valign="top"><strong>$recoveryStorageAccount = <your-recovery-storage-account></strong></p>
<p><strong>$recoveryResourceGroup = <your-resource-group-for-recovery></strong></p>
<p><strong>Restore-AzureRMRecoveryServicesBackupItem -RecoveryPoint $recoveryPointID[0] -StorageAccountName $recoveryStorageAccount -StorageAccountResourceGroupName $recoveryResourceGroup</strong></td>
</tr>
</tbody>
</table>
<p> </p>
<p><strong><u>Summary:</u></strong></p>
<p>Now that you have protected your encrypted VM using Azure Backup and recovered it successfully to a storage account, if you want to create a new VM using that recovered image then please follow the steps <a target="_blank" href="https://azure.microsoft.com/en-us/documentation/articles/backup-azure-vms-automation/">here</a> under section “Create a VM from restored disks” in the Azure Backup documentation.</p>
<p><strong><u></u></strong></p>
<p><strong><u>References:</u></strong></p>
<p><a target="_blank" href="https://azure.microsoft.com/en-us/documentation/articles/key-vault-get-started/">Getting Started with Azure Key Vault</a></p>
<p><a target="_blank" href="https://azure.microsoft.com/en-us/documentation/articles/azure-security-disk-encryption/">Azure Disk Encryption for Windows and Linux IaaS VMs</a></p>
<p><a target="_blank" href="https://azure.microsoft.com/en-us/documentation/articles/backup-azure-vms-automation/">Deploy and manage backups for Resource Manager-deployed VMs using PowerShell</a></p>
]]></content:encoded>
<wfw:commentRss>https://blogs.technet.microsoft.com/privatecloud/2016/09/15/taking-backup-of-encrypted-azure-vms-with-ade-azure-disk-encryption-using-azure-backup-in-oms/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>ARM concepts in Azure Stack for the WAP Administrator – Troubleshooting IaaS in Azure Stack</title>
<link>https://blogs.technet.microsoft.com/privatecloud/2016/08/09/arm-concepts-in-azure-stack-for-the-wap-administrator-troubleshooting-iaas-in-azure-stack/</link>
<comments>https://blogs.technet.microsoft.com/privatecloud/2016/08/09/arm-concepts-in-azure-stack-for-the-wap-administrator-troubleshooting-iaas-in-azure-stack/#respond</comments>
<pubDate>Tue, 09 Aug 2016 16:08:15 +0000</pubDate>
<dc:creator><![CDATA[Victor Arzate [MSFT]]]></dc:creator>
<category><![CDATA[Microsoft Azure Stack]]></category>
<category><![CDATA[ARM]]></category>
<category><![CDATA[Azure Resource Manager]]></category>
<category><![CDATA[Azure Stack]]></category>
<category><![CDATA[AzureStack]]></category>
<category><![CDATA[Bruno Saille]]></category>
<category><![CDATA[Building Clouds]]></category>
<category><![CDATA[building clouds blog]]></category>
<category><![CDATA[Hybrid Cloud]]></category>
<category><![CDATA[Microsoft Azure]]></category>
<category><![CDATA[PowerShell DSC]]></category>
<category><![CDATA[Private Cloud]]></category>
<category><![CDATA[Tiander Turpijn]]></category>
<category><![CDATA[Troubleshooting]]></category>
<category><![CDATA[Victor Arzate]]></category>
<category><![CDATA[WAP]]></category>
<category><![CDATA[WAPack]]></category>
<category><![CDATA[Windows Azure Pack]]></category>
<guid isPermaLink="false">https://blogs.technet.microsoft.com/privatecloud/?p=9255</guid>
<description><![CDATA[Hello Readers! This blog is part 8 (and the last) of the series “ARM concepts in Azure Stack for the WAP Administrator.” In this post we’ll discuss and share troubleshooting techniques and resources that we have learned when working with customers and partners that are actively validating Microsoft Azure Stack Technical Preview 1. Note Some information relates to... <a href="https://blogs.technet.microsoft.com/privatecloud/2016/08/09/arm-concepts-in-azure-stack-for-the-wap-administrator-troubleshooting-iaas-in-azure-stack/" class="read-more">Read more</a>]]></description>
<content:encoded><![CDATA[<p>Hello Readers! This blog is part 8 (and the last) of the series “ARM concepts in Azure Stack for the WAP Administrator.” In this post we’ll discuss and share troubleshooting techniques and resources that we have learned when working with customers and partners that are actively validating Microsoft Azure Stack Technical Preview 1.</p>
<p style="margin-left: 18pt"><span style="font-size: 12pt"><strong>Note</strong><br />
</span><em>Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.</em></p>
<p>I’m including the table of contents for this series of post so that you’ll find it easier to navigate across the series:</p>
<p><strong>Table of contents<br />
</strong></p>
<ol>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/02/08/arm-concepts-in-azure-stack-for-the-wap-administratorintroduction-post/">Introductory post</a>, and some first information on the <a href="https://azure.microsoft.com/en-us/documentation/articles/azure-stack-poc/">Azure Stack POC</a> architecture and ARM’s role</li>
<li><a target="_blank" href="https://blogs.technet.microsoft.com/privatecloud/2016/02/15/arm-concepts-in-azure-stack-for-the-wap-administrator-cloud-service-delivery/">Cloud Service Delivery</a></li>
<li><a target="_blank" href="https://blogs.technet.microsoft.com/privatecloud/2016/02/24/arm-concepts-in-azure-stack-for-the-wap-administrator-offers-plans-and-subscriptions-2/">Plans, offers, and subscriptions</a></li>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/03/18/arm-concepts-in-azure-stack-for-the-wap-administrator-resource-deployment/">Resource Deployment</a></li>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/04/01/arm-concepts-in-azure-stack-for-the-wap-administrator-packaging-and-publishing-templates-on-azure-stack/">Packaging and publishing templates on Azure Stack</a></li>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/04/29/arm-concepts-in-azure-stack-for-the-wap-administrator-multi-tier-applications/">Multi-tier applications</a></li>
<li><a target="_blank" href="https://blogs.technet.microsoft.com/privatecloud/2016/06/29/arm-concepts-in-azure-stack-for-the-wap-administrator-in-guest-configuration-with-arm-and-technologies-such-as-virtual-machines-extensions-including-powershell-desired-state-configuration-d/">In-guest configuration with ARM, and technologies such as Virtual Machines Extensions, including PowerShell Desired State Configuration (DSC)</a></li>
<li>Troubleshooting IaaS deployments in Azure Stack —<strong>this post</strong></li>
</ol>
<p>With no more delay, let’s get started!</p>
<hr />
<h1>WAP Troubleshooting</h1>
<p>While we’ve already discussed the WAP architecture for IaaS in previous posts from this series, let’s summarize the components required – a fabric based on Windows Server 2012 R2, a fabric management infrastructure based on System Center 2012 R2 and Windows Azure Pack for offering cloud services to tenants as depicted in the picture below:</p>
<p><img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/08/080916_0843_ARMconcepts1.png" /></p>
<p>And specifically, for enabling the Virtual Machine Clouds (a.k.a. VM Clouds or simply IaaS) service in WAP, the System Center 2012 R2 components required are:</p>
<ul>
<li>Virtual Machine Manager (VMM)</li>
<li>Service Provider Foundation (SPF)</li>
<li>(Optional) Operations Manager (OpsMgr) – for usage</li>
<li>(Optional) Service Management Automation (SMA) – for executing automation runbooks</li>
</ul>
<p>This is depicted in the picture below:</p>
<p><img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/08/080916_0843_ARMconcepts2.gif" /></p>
<p>As you can see, there are several moving parts involved just for the VM Clouds service in WAP (meaning tenants can deploy VMs and VM networks via a self-service portal). So, when something goes wrong (like a tenant VM deployment failing), the root cause could be in WAP, SPF, VMM, at the storage level, or event in Hyper-V!</p>
<p>To help with this potential challenge, back when WAP was released, the Building Clouds blog team (aka.ms/buildingclouds) and the community had been very active providing guidance and troubleshooting for the initial scenarios.</p>
<p>At the same time, the official WAP documentation was growing to cover the different areas (hence, not only IaaS, but PaaS too, such as Web Sites and SQL). The WAP troubleshooting article in TechNet covers the different components and scenarios in great detail:</p>
<ul>
<li><a href="https://technet.microsoft.com/en-us/library/dn554311.aspx">Windows Azure Pack troubleshooting</a></li>
</ul>
<p>And, finally, WAP administrators have a plethora of troubleshooting information for <a href="https://technet.microsoft.com/en-us/library/hh801901(v=ws.11).aspx">Windows Server 2012 R2</a>, <a href="https://technet.microsoft.com/en-US/library/mt169373(v=ws.11).aspx">Hyper-V</a>, and <a href="https://technet.microsoft.com/en-us/library/hh546785(v=sc.12).aspx">System Center 2012 R2</a> (<a href="https://technet.microsoft.com/library/gg610610.aspx">VMM</a>, <a href="https://technet.microsoft.com/en-us/library/jj642895(v=sc.12).aspx">SPF</a>, <a href="https://technet.microsoft.com/library/hh205987.aspx">Operations Manager</a>, and so on).</p>
<p>Now, let’s see what resources we’ve available for troubleshooting Azure Stack TP1.</p>
<hr />
<h1>Azure Stack Troubleshooting</h1>
<p>At the time of this writing, the Azure Stack version we have available is Azure Stack Technical Preview 1. This means that we’re working with a very early version of the product and which is deployed on a one-node configuration for evaluation purposes. Hence, the guidance and links provided on this blog apply to Azure Stack TP1 only.</p>
<p>First, let’s start with a quick overview of the Azure Stack TP1 architecture, which is described on <a href="https://azure.microsoft.com/en-us/documentation/articles/azure-stack-architecture/">this</a> article:</p>
<p><img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/08/080916_0843_ARMconcepts3.png" /></p>
<p>The same article explains the roles of each of the components, and also, if you read the comments, you’ll see that this diagram is missing the BGP VM, which acts as a router between different VMs in the TP1 single-node deployment.</p>
<p>As you can see in the picture above, the architecture and components on Azure Stack TP1 are very different from what you were used in WAP. New technologies from Windows Server 2016 Technical Preview 4 (such as Storage Spaces Direct) and from Microsoft Azure (such as Service Fabric) are used. With so many new components, let’s take a look at the resources available for you to troubleshoot Azure Stack TP1.</p>
<hr />
<h1>Azure Stack Troubleshooting – Where to go and how to contribute</h1>
<p>In case you haven’t noticed, there is a very comprehensive list of known issues, workarounds and troubleshooting guidance in the Azure Stack documentation (direct link <a href="https://azure.microsoft.com/en-us/documentation/articles/azure-stack-troubleshooting/">here</a>). I’d suggest that you refer to this site for troubleshooting topics on Azure Stack as it’s been updated regularly. The articles are organized by categories, so that it’s easier to navigate and find answers depending on a specific area (such as Platform Image Repository, templates or TP1 deployment itself).</p>
<p>With that said, we will not start writing additional or new troubleshooting guidance for Azure Stack on this blog post, because the Azure Stack documentation is available in azure.microsoft.com and every one of us can contribute to it! You only need to have a GitHub account (if you don’t have one, you can get one <a href="https://github.com/join">here</a>), go to the specific document, and click on the Edit on GitHub link as depicted in the picture below:</p>
<p><img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/08/080916_0843_ARMconcepts4.png" /></p>
<p>This will bring you to the article on the Azure GitHub repository, and from here you can easily contribute by clicking on the edit button as highlighted in yellow in the picture below:</p>
<p><img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/08/080916_0843_ARMconcepts5.png" /></p>
<p>Make the edits in your fork of this project, propose a file change and then submit a pull request. Pull requests are reviewed by the Azure Stack team, and if everything looks good, they’d merge the request into their repository, and everybody will see your contribution:</p>
<p><img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/08/080916_0843_ARMconcepts6.png" /></p>
<hr />
<h1>Azure Stack Troubleshooting – Most common issues</h1>
<p>Alright, the list of known issues provided in the link above is quite comprehensive, but which are the most common issues faced when working with IaaS in Azure Stack? At the time of this writing, these were some of the most common issues we’ve seen when working with customers:</p>
<div>
<table style="border-collapse: collapse;background: #bfbfbf" border="0">
<colgroup>
<col style="width: 1247px" /></colgroup>
<tbody valign="top">
<tr>
<td style="padding-left: 14px;padding-right: 14px"><strong>Disclaimer</strong> – These common issues only apply to Azure Stack TP1 POC and were taken from the Azure Stack troubleshooting <a href="https://azure.microsoft.com/en-us/documentation/articles/azure-stack-troubleshooting/">article</a>. You could expect these issues to be fixed in future Azure Stack releases.</td>
</tr>
</tbody>
</table>
</div>
<div>
<table style="border-collapse: collapse" border="0">
<colgroup>
<col style="width: 1247px" /></colgroup>
<tbody valign="top">
<tr>
<td style="padding-left: 14px;padding-right: 14px;border: solid 0.5pt"><strong>“Gateway Timeout” error message when working with virtual machines<br />
</strong>In Azure PowerShell, the error message may be:</p>
<p style="margin-left: 36pt"><em>Gateway Timeout: The gateway did not receive a response from ‘Microsoft.Compute’ within the specified time period.<br />
</em></p>
<p>This is a known issue, and should be fixed in a future release. As a workaround, restarting the Compute Resource Provider (CRP) services on the xRPVM, or restarting this VM, should solve the issue.</td>
</tr>
</tbody>
</table>
</div>
<div>
<table style="border-collapse: collapse" border="0">
<colgroup>
<col style="width: 1247px" /></colgroup>
<tbody valign="top">
<tr>
<td style="padding-left: 14px;padding-right: 14px;border: solid 0.5pt"><strong>Performance issues when deploying or deleting tenant virtual machines<br />
</strong>Some improvements on deployment and deletion times have been implemented in the <a href="https://azure.microsoft.com/en-us/blog/announcing-incremental-release-for-azure-stack-technical-preview-1/">incremental release for Azure Stack TP1</a> (April 2016). In case you still see issues, here are some steps that may help with poor performance during VM management tasks:</p>
<ol>
<li>Restart the WinRM service on the Hyper-V Host</li>
<li>If that doesn’t work, restart the CRP service on the xRPVM</li>
<li>If that doesn’t work, restart the xRPVM</li>
</ol>
</td>
</tr>
</tbody>
</table>
</div>
<div>
<table style="border-collapse: collapse" border="0">
<colgroup>
<col style="width: 1247px" /></colgroup>
<tbody valign="top">
<tr>
<td style="padding-left: 14px;padding-right: 14px;border: solid 0.5pt"><strong>A new image added to the Platform Image Repository (PIR) may not show up in the portal<br />
</strong>When <a href="https://azure.microsoft.com/en-us/documentation/articles/azure-stack-add-image-pir/">Adding an image to the Platform Image Repository (PIR) in Azure Stack</a>, it can take some time (5 to 10 minutes) for the image to show up in the Azure Stack portal, after running “CopyImageToPlatformImageRepository.ps1”.Also, if the value for -Offer and/or -SKU contains a space, the manifest will be invalid and a gallery item will not be created. This is a known issue, and the current workaround is to ensure you don’t use space, for example changing the SKU from “Windows Server 2012 R2 Standard” to either “WindowsServer-2012-R2-Standard” or “WindowsServer2012R2Standard”.Finally, we’ve seen reports where increasing the number of virtual processors (to 4 or 8) and memory (to 8 GB) for the xRPVM would solve this situation.</td>
</tr>
</tbody>
</table>
</div>
<div>
<table style="border-collapse: collapse" border="0">
<colgroup>
<col style="width: 1247px" /></colgroup>
<tbody valign="top">
<tr>
<td style="padding-left: 14px;padding-right: 14px;border: solid 0.5pt"><strong>Network security groups cannot be created using default tags<br />
</strong>In Azure Stack TP1, it is possible to deploy security rules with a sourceAddressPrefix of “*” or “10.0.0.0/24”, but using a tag like “Internet” or “VirtualNetwork” fails. This is because default tags are not supported in TP1. This is a known issue that should be fixed in a future release.</td>
</tr>
</tbody>
</table>
</div>
<div>
<table style="border-collapse: collapse" border="0">
<colgroup>
<col style="width: 1247px" /></colgroup>
<tbody valign="top">
<tr>
<td style="padding-left: 14px;padding-right: 14px;border: solid 0.5pt"><strong>Network resolution issues from tenant virtual machines<br />
</strong>With this release, virtual machines should be able to connect to the internet, for example for some of the virtual machine extensions.If you are having internet connectivity issues from within the virtual machines, it is likely due to the fact that we do not have the iDNS feature yet in this Technical Preview 1 release, meaning that a shared DNS feature from Azure is not configured by default.You can confirm this by looking at the “DNS servers” settings for the associated virtual network:</p>
<p style="text-align: center"><img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/08/080916_0843_ARMconcepts7.png" /></p>
<p>In the portal, this can be changed to 192.168.100.2 and another public DNS value for the second one that is required. This can also be controlled when deploying via a template, by using this setting in the “dhcpOptions” for the virtual network</p>
<p style="margin-left: 36pt">“dnsServers”: [“192.168.100.2”]</p>
<p>This setting can also be used when deploying a virtual machine via a template that also includes a virtual network.</p>
<p style="text-align: center"><img alt="" src="https://msdnshared.blob.core.windows.net/media/2016/08/080916_0843_ARMconcepts8.png" /></p>
<p>If you need to change this for an existing virtual network, virtual machines that are already deployed will need to be stopped and restarted. When logging into the restarted VM, you should confirm it has picked up the new settings from the Network Controller, via DHCP. Doing changes directly in the VM may work, but would be a change “out of band” for the Network Controller, so is not desired. Disabling/enabling the virtual NIC within the VM would also be a possibility at this stage (since you have access to both tenant and service admin sides in the POC).</td>
</tr>
</tbody>
</table>
</div>
<div>
<table style="border-collapse: collapse" border="0">
<colgroup>
<col style="width: 1247px" /></colgroup>
<tbody valign="top">
<tr>
<td style="padding-left: 14px;padding-right: 14px;border: solid 0.5pt"><strong>Error “Operation could not be completed within the specified time” when running the New-StorageContainer cmdlet<br />
</strong>This is a known issue that should be fixed in a future release.Workaround:You can stop the WAC (WacServer.exe) process inside the ACS VM, using task manager. Service fabric should automatically restart it</td>
</tr>
</tbody>
</table>
</div>
<h1></h1>
<hr />
<h1>Azure Stack Troubleshooting – Tools available</h1>
<p>Now, let’s review some of the tools available to help you troubleshoot Azure Stack TP1:</p>
<p><a href="https://blogs.technet.microsoft.com/privatecloud/2016/02/26/tool-arm-template-checker-for-microsoft-azure-stack/">Tool: ARM Template Checker for Microsoft Azure Stack</a></p>
<p>Let’s imagine this situation: you have a JSON template that you’ve been using to deploy resources in your Azure subscription (for example, a virtual network, VMs and NSGs). When you deploy the template in your Azure subscription it works like a charm, but it fails to deploy on your Azure Stack subscription.</p>
<p>For scenarios like this, you can use the ARM template checker tool that as the name implies, it’ll help you to check your template, and it will indicate if it detects incompatibilities on your template that would prevent the successful deployment on Azure Stack. For example, your template might reference an Azure region (such as West Europe) that does not exist on Azure Stack (the only region on Azure Stack TP1 is local). Also, your template, might make references to resource providers or APIs available in Azure, but not available in Azure Stack yet.</p>
<p><a href="https://github.com/victorar/ARM-Deployment-Troubleshooter">ARM-Deployment-Troubleshooter</a></p>
<p>Think about this scenario: you take one of the templates from the <a href="https://github.com/Azure/AzureStack-QuickStart-Templates">Azure Stack Quick Start GitHub repository</a> (or any template you may have written), deploy it to a resource group in your Azure Stack subscription, and for some reason, the deployment fails and maybe you get just a generic error in the Azure Stack portal or in PowerShell. It’s difficult to know where the deployment failed, isn’t it? (and this is even more complex when you’ve nested templates such as <a href="https://github.com/Azure/AzureStack-QuickStart-Templates/tree/master/sharepoint-2013-non-ha">SharePoint</a>).</p>
<p>This script can help you to troubleshoot ARM deployments on Azure Stack TP1. Basically, you pass the Resource Group as parameter to this script, and then, the script will contact ARM and will get you all the information and logs from the deployments available on the resource group, and it will save all that information in a log file, hence, you’ve in a single place all the logs and deployment details. Among the details collected from the deployments on the resource group, the script gets you:</p>
<ul>
<li>The template used during the deployment</li>
<li>The deployment parameters</li>
<li>
<div>Details of the deployment operations</div>
<ul>
<li>Here you can see which specific action failed (if any)</li>
</ul>
</li>
<li>Resources in the resource group</li>
<li>
<div>Details about the virtual machines,</div>
<ul>
<li>VM status</li>
<li>VM Agent Status</li>
<li>Installed VM extensions on the VM</li>
</ul>
</li>
</ul>
<p>For example, one of my colleagues was troubleshooting a complex deployment, and using this script, he got the logs and noticed the following error on the Custom Script VM Extension:</p>
<div>
<table style="border-collapse: collapse" border="0">
<colgroup>
<col style="width: 1247px" /></colgroup>
<tbody valign="top">
<tr>
<td style="padding-left: 14px;padding-right: 14px;border: solid 0.5pt"><span style="color: black;font-family: Consolas;font-size: 9pt;background-color: white"> {<br />
</span><span style="color: black;font-family: Consolas;font-size: 9pt;background-color: white"> <span style="color: #2e75b6">“name”<span style="color: black">: <span style="color: #a31515">“PowerShellExec”<span style="color: black">,<br />
</span></span></span></span></span><span style="color: black;font-family: Consolas;font-size: 9pt;background-color: white"> <span style="color: #2e75b6">“type”<span style="color: black">: <span style="color: #a31515">“Microsoft.Compute.CustomScriptExtension”<span style="color: black">,<br />
</span></span></span></span></span><span style="color: black;font-family: Consolas;font-size: 9pt;background-color: white"> <span style="color: #2e75b6">“typeHandlerVersion”<span style="color: black">: <span style="color: #a31515">“1.7.0.0”<span style="color: black">,<br />
</span></span></span></span></span></p>
<p><span style="color: black;font-family: Consolas;font-size: 9pt;background-color: white"> <span style="color: #2e75b6">“substatuses”<span style="color: black">: <span style="color: blue">null<span style="color: black">,<br />
</span></span></span></span></span></p>
<p><span style="color: black;font-family: Consolas;font-size: 9pt;background-color: white"> <span style="color: #2e75b6">“statuses”<span style="color: black">: [<br />
</span></span></span></p>
<p><span style="color: black;font-family: Consolas;font-size: 9pt;background-color: white"> {<br />
</span></p>
<p><span style="color: black;font-family: Consolas;font-size: 9pt;background-color: white"> <span style="color: #2e75b6">“code”<span style="color: black">: <span style="color: #a31515">“ProvisioningState/failed/3”<span style="color: black">,<br />
</span></span></span></span></span></p>
<p><span style="color: black;font-family: Consolas;font-size: 9pt;background-color: white"> <span style="color: #2e75b6">“level”<span style="color: black">: <span style="color: #a31515">“Error”<span style="color: black">,<br />
</span></span></span></span></span></p>
<p><span style="color: black;font-family: Consolas;font-size: 9pt;background-color: white"> <span style="color: #2e75b6">“displayStatus”<span style="color: black">: <span style="color: #a31515">“Provisioning failed”<span style="color: black">,<br />
</span></span></span></span></span></p>
<p><span style="color: black;font-family: Consolas;font-size: 9pt;background-color: white"> <span style="color: #2e75b6">“message”<span style="color: black">: <span style="color: #a31515">“Failed to download all specified files. Exiting. Error Message: The remote server returned an error: (404) Not Found.”<span style="color: black">,<br />
</span></span></span></span></span></p>
<p><span style="color: black;font-family: Consolas;font-size: 9pt;background-color: white"> <span style="color: #2e75b6">“time”<span style="color: black">: <span style="color: #a31515">“0001-01-02T00:00:00Z”<span style="color: black"><br />
</span></span></span></span></span></p>
<p><span style="color: black;font-family: Consolas;font-size: 9pt;background-color: white"> }<br />
</span></p>
<p><span style="color: black;font-family: Consolas;font-size: 9pt;background-color: white"> ]<br />
</span></p>
<p><span style="color: black;font-family: Consolas;font-size: 9pt;background-color: white"> }</span></td>
</tr>
</tbody>
</table>
</div>
<p>As you can see on the snippet above, the Custom Script Extension is in failed state, and the error message clearly indicates that it couldn’t download the required files, as it received a 404 error code (not found). In this particular case, the environment required a proxy to connect to the internet, and additional configuration was required to allow this particular VM to access the internet to download the required files.</p>
<p><a href="https://gallery.technet.microsoft.com/Deployment-Checker-for-76d824e1">Deployment Checker for Azure Stack Technical Preview 1</a></p>
<p>Let’s imagine this scenario: you are eager to test Azure Stack TP1 and you got one server for installing and testing it, but after reading the <a href="https://azure.microsoft.com/en-us/documentation/azure-stack/">online documentation</a> for <a href="https://azure.microsoft.com/en-us/documentation/articles/azure-stack-deploy/">hardware requirements</a>, you’re still not sure if your server meets the requirements to deploy Azure Stack TP1, and you’d like to know if it would be possible to run Azure Stack on your hardware before you download the Azure Stack TP1 installation files.</p>
<p>This script will help you to check if your hardware meets the requirements / prerequisites for deploying Azure Stack TP1. The script goes through the prerequisite checks done by the Azure Stack TP1 installer and it will indicate if your server meets the requirements beforehand.</p>
<hr />
<h1>Azure Stack Troubleshooting – Additional resources</h1>
<p>Now, let’s review additional documents / links available for Azure Stack troubleshooting:</p>
<ul>
<li>
<div><a href="https://azure.microsoft.com/en-us/documentation/articles/azure-stack-troubleshooting/">Microsoft Azure Stack troubleshooting</a></div>
<p>Official article from the Azure Stack team with detailed troubleshooting guidance. Expect this list to grow over time!</li>
<li>
<div><a href="https://azure.microsoft.com/en-us/documentation/articles/azure-stack-faq/">Frequently asked questions for Azure Stack</a></div>
<p>Also an official article from the Azure Stack team, which is frequently updated (last update was a couple of weeks ago!) with common asks and topics being answered directly by the Azure Stack team.</li>
<li>
<div><a href="https://social.msdn.microsoft.com/Forums/azure/en-US/b7946e8d-c9fa-41c3-b407-98c6d1aa475e/azure-stack-known-issues-and-workarounds-tips-and-pitfalls-and-faqs-posted?forum=AzureStack">FAQ, known issues and workarounds</a></div>
<p>Collection of known issues and workarounds provided and maintained in the Azure Stack Forum.</li>
<li>
<div><a href="https://social.msdn.microsoft.com/Forums/en-US/home?forum=AzureStack">Azure Stack Forum</a></div>
<p>MSDN forum dedicated for Azure Stack. Great place to learns from others, but also, this is the right place to place your questions when you face problems with your Azure Stack environment.</li>
<li>
<div><a href="https://social.msdn.microsoft.com/Forums/en-US/ea3207a5-9895-4c5a-b834-91b53e677ea1/azure-stack-logs?forum=AzureStack">Azure Stack Logs</a></div>
<p>Entry in the Azure Stack forum with a comprehensive list of logs for different Azure Stack components, as well as instructions on how to gather logs manually and automatically.</li>
<li>
<div><a href="https://channel9.msdn.com/Blogs/azurestack">The Azure Stack Channel</a></div>
<p>Channel 9 channel dedicated for Azure Stack resources (deployment, best practices, and more).</li>
</ul>
<hr />
<h1>Conclusion</h1>
<p>The resources provided on this blog should help you to troubleshoot the most common and known issues with Azure Stack TP1, specifically for IaaS (the focus of this series).</p>
<p>Also, with this blog post, we conclude this series that had as an original goal to map the IaaS concepts that WAP administrators are familiar with to the new Azure Stack TP1. We covered this series from a wide variety of angles, to help you understand more how cloud services are delivered on Azure Stack, and how the consistency with Azure via Azure Resource Manager is a key differentiator to bring the power of Azure to your datacenter.</p>
<p>Thanks and until next time!</p>
<p>Victor, Tiander and Bruno</p>
]]></content:encoded>
<wfw:commentRss>https://blogs.technet.microsoft.com/privatecloud/2016/08/09/arm-concepts-in-azure-stack-for-the-wap-administrator-troubleshooting-iaas-in-azure-stack/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>Azure Stack API’s – Working directly with the Resource Manager API Layer (Technical Preview 1)</title>
<link>https://blogs.technet.microsoft.com/privatecloud/2016/08/01/azure-stack-apis-working-directly-with-the-resource-manager-api-layer-technical-preview-1/</link>
<comments>https://blogs.technet.microsoft.com/privatecloud/2016/08/01/azure-stack-apis-working-directly-with-the-resource-manager-api-layer-technical-preview-1/#respond</comments>
<pubDate>Mon, 01 Aug 2016 21:37:18 +0000</pubDate>
<dc:creator><![CDATA[Shawn Gibbs [MSFT]]]></dc:creator>
<category><![CDATA[Microsoft Azure Stack]]></category>
<category><![CDATA[API]]></category>
<category><![CDATA[Azure Stack]]></category>
<category><![CDATA[MAS]]></category>
<category><![CDATA[Shawn Gibbs]]></category>
<guid isPermaLink="false">https://blogs.technet.microsoft.com/privatecloud/?p=9165</guid>
<description><![CDATA[Introduction To work with the Azure’s Resource Manager, you have a number of options. For example, you have these SDK’s to simplify development: Azure .NET SDK’s https://azure.microsoft.com/en-us/documentation/api/ Azure Resource Manager SDK’s – JAVA, Python, and Ruby https://azure.microsoft.com/en-us/blog/azure-resource-manager-preview-sdks/ Azure Resource Manager PowerShell Cmdlets https://msdn.microsoft.com/en-us/library/azure/mt125356.aspx Note: I can’t stress enough that this is simply a model I... <a href="https://blogs.technet.microsoft.com/privatecloud/2016/08/01/azure-stack-apis-working-directly-with-the-resource-manager-api-layer-technical-preview-1/" class="read-more">Read more</a>]]></description>
<content:encoded><![CDATA[<h2>Introduction</h2>
<p>To work with the Azure’s Resource Manager, you have a number of options. For example, you have these SDK’s to simplify development:</p>
<ul>
<li>Azure .NET SDK’s <a href="https://azure.microsoft.com/en-us/documentation/api/">https://azure.microsoft.com/en-us/documentation/api/</a></li>
<li>Azure Resource Manager SDK’s – JAVA, Python, and Ruby <a href="https://azure.microsoft.com/en-us/blog/azure-resource-manager-preview-sdks/">https://azure.microsoft.com/en-us/blog/azure-resource-manager-preview-sdks/</a></li>
<li>Azure Resource Manager PowerShell Cmdlets <a href="https://msdn.microsoft.com/en-us/library/azure/mt125356.aspx">https://msdn.microsoft.com/en-us/library/azure/mt125356.aspx</a></li>
</ul>
<p><em>Note: I can’t stress enough that this is simply a model I use, mostly for validation and there certainly are other choices depending on project and requirements. Again this is for MAS TP1 which uses Azure AD so this may also be different moving forward for you. </em></p>
<p>The beauty of cloud consistency means that these tools and patterns are also the method in which you can develop against Azure Stack’s Resource Manager. Keeping in mind Azure Stack is in Technical Preview and not all API’s are available. This blog post offers another way, one that takes away the complexity for SDK’s and PowerShell modules and allows for the ability to understand and learn the API’s as a Restful service in their most foundational form.</p>
<h2>Why work directly with APIs?</h2>
<p>Besides the ability to learn what’s happening underneath the covers, so to speak, debugging and translation to other languages can be easier. In PowerShell the obvious and easiest option is to utilize the Azure PowerShell cmdlets like Get-AzureRmSubscription or Get-AzureRmVM but this is hard to translate into other scripting or coding languages and if trouble exists it’s a little more complicated to debug. This should not be considered a recommendation on best practice as the note above highlights but for the purposes of testing it should suffice.</p>
<h2>To Begin</h2>
<p>No matter the method in which you choose to develop, either SDK’s, PowerShell, CLI or directly with APIs there are some basic requirements for a project that need to be met, some of which are managed by the PowerShell or CLI: These are:</p>
<ul>
<li>Authentication and authorization – Click <a href="https://azure.microsoft.com/en-us/documentation/articles/resource-group-authenticate-service-principal/">Here</a> for information on authenticating a service principal with ARM.</li>
<li>The application needs to be registered with Azure Active Directory and given permission – Click <a href="https://azure.microsoft.com/en-us/documentation/articles/resource-group-create-service-principal-portal/">Here</a> for more details.</li>
<li>Restful requests can then be made to the API’s correct URI’s with the above information used to create a bearer token – Click <a href="https://azure.microsoft.com/en-us/documentation/articles/resource-manager-supported-services/">Here</a> for Azure’s documentation for ARM API’s. (<em>Note: This is for Azure public cloud so the API versions and available resources will differ from Azure Stacks API’s but this is a great place to start in a cloud consistent world)</em></li>
</ul>
<p>In the Technical Preview of Azure Stack – which uses Azure Active Directory -, the first step is to create an application in the Azure Portal. Next, give that application delegated permission to the Azure Stack API application which was created during the install of the technical preview.</p>
<h3>Step 1</h3>
<p>Create an application in the Classic Azure Portal <a href="https://manage.windowsazure.com/">https://manage.windowsazure.com</a> within the Active Directory you used to install Azure Stack.</p>
<p>Add application:</p>
<ol>
<li>Within the directory used for Azure Stack select Applications tab and then select Add+ in the bottom menu to add an application.</li>
<li>When asked ‘What do you want to do?’ select the “Add an application my organization is developing” option.</li>
<li>Under the ‘Tell us about your application’ screen enter a name for your application and select the ‘Web application’ type.</li>
<li>Then enter a sign in URL, here you can enter <a href="http://localhost/">http://localhost</a></li>
<li>Under APP ID URI enter a unique App URI, for example <a href="https://localhost/appname/">https://localhost/appname/</a></li>
</ol>
<h3>Step 2</h3>
<p>Configure the applications authorization to Azure Stack’s API’s.</p>
<p>Configure Application:</p>
<ol>
<li>Select the configure tab and take note of the Client ID GUID (you’ll need this later)</li>
<li>Under Keys, select the drop down called ‘select duration’ and pick 1 year.</li>
<li>Click save and go back to the keys section and copy the newly created key (<strong>this is the only chance to get it!</strong>)</li>
<li>Under the permissions section click add application and in the dialog box drop down the show menu and select all apps. Click the check button.</li>
<li>In the list of applications find the AzureStack.local-Api application and select it, then click the plus sign now in the name column. Then click the check.</li>
<li>It’s now added to the permissions list so drop down the delegated permissions and select the Access AzureStack.local-Api app and then click save again.</li>
<li>As a last piece of required data, select the ‘VIEW ENDPOINTS’ and in the new dialog box you’ll see several choices. The important piece here is GUID you can see in each dialog box for each of the endpoints listed. This is an easy way to get your Tenant ID in GUID format.</li>
</ol>
<p> </p>
<h2>Act on Azure Stacks API’s</h2>
<p>This next steps requires their own sections. I’ll show some examples in PowerShell and Python but essentially all we are doing is sending a correctly formed HTTPS request to the Azure Stack API to perform the action we wish to perform. The request can be a GET request just like when you request a web page from a site but in API terms this is a request for information. Or it can be other types like a DELETE request or a PUT request which will delete a resource or create a resource. All requests made to a service, even web sites require a header but for ARM API’s they require some specific information.</p>
<h3>Getting Tenants Authorization Token</h3>
<p>To retrieve the AAD Token for the tenant’s authorization to access Azure Stacks API’s we’ll make a POST request to the OAUTH token endpoint <a href="https://login.microsoftonline.com/%7b0%7d/oauth2/token">https://login.microsoftonline.com/{0}/oauth2/token</a> where {0} is your tenant ID from the earlier steps in creating and authorizing applications. We also need to set the grant type and scope.</p>
<p><em><strong>Using PowerShell, let’s set some parameters:</strong> </em></p>
<pre style="margin-left: 3em">$ClientID = "<Enter you Client ID>" $ClientKey = "<Enter your client secret>"
$TenantID = "<Enter Tenant ID GUID from Endpoints>"
$User = <"Enter the tenant user name, for example:Tenant1@shawngibbs.onmicrosoft.com"
$Password = "<Enter your Tenant password>"
$AppIdUri = "https://azurestack.local-api/" $AADURI = "https://login.microsoftonline.com/{0}/oauth2/token" -f $TenantID
</pre>
<p> </p>
<p><em><strong>In Python, setting parameters looks like this:</strong> </em></p>
<pre style="margin-left: 3em">CLIENT_ID = ""<Enter you Client ID>"
CLIENT_SECRET =""<Enter your client secret>"
CLIENT_TENANTID = "<Enter Tenant ID GUID from Endpoints>"
CLIENT_USERNAME = "Tenant1@shawngibbs.onmicrosoft.com"
CLIENT_PASSWORD = "<Enter your Tenant password>" CLIENT_RESOURCE = "https://azurestack.local-api/" CLIENT_LOGIN_URL= "https://login.microsoftonline.com/" URL = CLIENT_LOGIN_URL + CLIENT_TENANTID + "/oauth2/token"
</pre>
<p> </p>
<p>Making the request for token. Since PowerShell and Python differ in how they deal with the object model and this in turn changes the returned data, we’ll handle it in a way that is easy to deal with, although there may certainly be better ways to do the next step. For Python, we’ll set the acceptable response type to JSON with a request header: headers = {“Accept”:”application/json”. For PowerShell, this can be set to content type in the command parameters. The request will require a body of content that represents the grant request information and type.</p>
<p><em><strong>For PowerShell, the request body:</strong> </em></p>
<pre style="margin-left: 3em">$GrantBody = "grant_type=password&scope=openid&resource={0}&client_id={1}&client_secret={2}&username={3}&password={4}" -f $AppIdUri, $ClientID, $ClientKey, $User, $Password
</pre>
<p> </p>
<p><em><strong>For Python, the request body:</strong> </em></p>
<pre style="margin-left: 3em">params = {"grant_type": "password",
"scope": "openid",
"resource": CLIENT_RESOURCE,
"client_id": parameters.CLIENT_ID,
"client_secret": parameters.CLIENT_SECRET,
"username": CLIENT_USERNAME,
"password": parameters.CLIENT_PASSWORD}
</pre>
<p> </p>
<p>Now let’s make the calls to the authorization API and parse out the token we will use to make additional request to the resource managers API.</p>
<p><em><strong>For PowerShell:</strong> </em></p>
<pre style="margin-left: 3em">$AADTokenResponse = Invoke-RestMethod -Uri $AADURI -ContentType "application/x-www-form-urlencoded" -Body $GrantBody -Method Post -Verbose
$AADtoken = $AADTokenResponse.access_token
</pre>
<p><em><strong>For Python:</strong> </em></p>
<pre style="margin-left: 3em">response = requests.post(URL, data = params, headers=headers)
response_json = response.json()
token = response_json['access_token']
</pre>
<p>The end result is that we have the JWT (‘JSON Web Token’) now saved as a variable in PowerShell and Python. This now gets attached to future requests as the ‘Authorization’ part of the requests header. We’ll also set some other header variables just set language and response type.</p>
<p><em><strong>In PowerShell:</strong> </em></p>
<pre style="margin-left: 3em">$Headers = @{Authorization = "Bearer $AADtoken "
"Accept" = "application/json"
"x-ms-effective-locale" = "en.en-us"
}
</pre>
<p><em><strong>In Python:</strong> </em></p>
<pre style="margin-left: 3em">headers = {"Authorization": "Bearer "+ token, "Accept": "application/json", "x-ms-effective-locale":"en.en-us"}
</pre>
<p>At this point, we set the URI of the specific resources API we wish to get or set and make additional calls with the above headers that include the authorization token. For brevity, we’ll simply request subscriptions for the specific tenant, parse the response and since multiple subscriptions may exist, we’ll walk through each.</p>
<p><em><strong>In PowerShell:</strong> </em></p>
<pre style="margin-left: 3em">$GetSubscriptionsURI = "https://api.azurestack.local/subscriptions?api-version=1.0&includeDetails=true"
$Subscriptions = (Invoke-RestMethod -Uri $GetSubscriptionsURI -ContentType "application/json" -Headers $Headers -Method Get -Debug -Verbose).value
$Subscriptions
</pre>
<p><em><strong>In Python:</strong> </em></p>
<pre style="margin-left: 3em">SUBURL = "https://api.azurestack.local/subscriptions?api-version=1.0&includeDetails=true"
response = requests.get(SUBURL, headers=headers, verify=False)
response_json = json.loads(response.text)
response_value = response_json['value']
for sub in response_value:
print("My subscription ID is: " + sub['subscriptionId'])</pre>
<p> </p>
<h2>Result</h2>
<p>At this point, you have the basics needed to communicate directly with the Azure Stack Resource Management API’s. Even if this is not the model you choose to do your development moving forward, it should at least enlighten you to what is happening. These API’s are everything you need when you want to perform exactly the same tasks that you do via the portal, PowerShell or CLI.</p>
]]></content:encoded>
<wfw:commentRss>https://blogs.technet.microsoft.com/privatecloud/2016/08/01/azure-stack-apis-working-directly-with-the-resource-manager-api-layer-technical-preview-1/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>ARM concepts in Azure Stack for the WAP Administrator – In-guest configuration with ARM, and technologies such as Virtual Machines Extensions, including PowerShell Desired State Configuration (DSC)</title>
<link>https://blogs.technet.microsoft.com/privatecloud/2016/06/29/arm-concepts-in-azure-stack-for-the-wap-administrator-in-guest-configuration-with-arm-and-technologies-such-as-virtual-machines-extensions-including-powershell-desired-state-configuration-d/</link>
<comments>https://blogs.technet.microsoft.com/privatecloud/2016/06/29/arm-concepts-in-azure-stack-for-the-wap-administrator-in-guest-configuration-with-arm-and-technologies-such-as-virtual-machines-extensions-including-powershell-desired-state-configuration-d/#respond</comments>
<pubDate>Wed, 29 Jun 2016 21:25:00 +0000</pubDate>
<dc:creator><![CDATA[Tiander Turpijn [MSFT]]]></dc:creator>
<category><![CDATA[Uncategorized]]></category>
<category><![CDATA[ARM]]></category>
<category><![CDATA[Azure Automation]]></category>
<category><![CDATA[Azure Resource Manager]]></category>
<category><![CDATA[Azure Stack]]></category>
<category><![CDATA[AzureStack]]></category>
<category><![CDATA[Building Clouds]]></category>
<category><![CDATA[building clouds blog]]></category>
<category><![CDATA[Hybrid Cloud]]></category>
<category><![CDATA[Microsoft Azure]]></category>
<category><![CDATA[PowerShell DSC]]></category>
<category><![CDATA[WAP]]></category>
<category><![CDATA[Windows Azure Pack]]></category>
<guid isPermaLink="false">https://blogs.technet.microsoft.com/privatecloud/?p=8765</guid>
<description><![CDATA[Hello Readers! This is part 7 of the blog post series “ARM concepts in Azure Stack for the WAP Administrator.” In this post we’ll focus on the VM configuration itself, leveraging Azure Resource Manager (ARM), VM Extensions and PowerShell DSC. Note Some information relates to pre-released product which may be substantially modified before it’s commercially... <a href="https://blogs.technet.microsoft.com/privatecloud/2016/06/29/arm-concepts-in-azure-stack-for-the-wap-administrator-in-guest-configuration-with-arm-and-technologies-such-as-virtual-machines-extensions-including-powershell-desired-state-configuration-d/" class="read-more">Read more</a>]]></description>
<content:encoded><![CDATA[<p>Hello Readers! This is part 7 of the blog post series “ARM concepts in Azure Stack for the WAP Administrator.” In this post we’ll focus on the VM configuration itself, leveraging Azure Resource Manager (ARM), VM Extensions and PowerShell DSC.</p>
<p><strong>Note</strong><br />
<em>Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.</em></p>
<p>Here is the table of contents for the series of post so that you’ll find it easier to navigate across the series:</p>
<p><strong>Table of contents<br />
</strong></p>
<ol>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/02/08/arm-concepts-in-azure-stack-for-the-wap-administratorintroduction-post/">Introductory post</a>, and some first information on the <a href="https://azure.microsoft.com/en-us/documentation/articles/azure-stack-poc/">Azure Stack POC</a> architecture and ARM’s role</li>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/02/15/arm-concepts-in-azure-stack-for-the-wap-administrator-cloud-service-delivery/">Cloud Service Delivery</a></li>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/02/24/arm-concepts-in-azure-stack-for-the-wap-administrator-offers-plans-and-subscriptions-2/">Plans, offers, and subscriptions</a></li>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/04/29/arm-concepts-in-azure-stack-for-the-wap-administrator-multi-tier-applications/">Resource Deployment</a></li>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/04/01/arm-concepts-in-azure-stack-for-the-wap-administrator-packaging-and-publishing-templates-on-azure-stack/">Packaging and publishing templates on Azure Stack</a></li>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/04/29/arm-concepts-in-azure-stack-for-the-wap-administrator-multi-tier-applications/">Multi-tier applications with ARM</a></li>
<li>In-guest configuration with ARM, and technologies such as Virtual Machines Extensions, including PowerShell Desired State Configuration (DSC) – <strong>this post</strong></li>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/08/09/arm-concepts-in-azure-stack-for-the-wap-administrator-troubleshooting-iaas-in-azure-stack/">Troubleshooting IaaS deployments in Azure Stack—this maps to an understanding of how the different Resource Providers (RPs) work together in an Azure Stack installation</a></li>
</ol>
<hr />
<h2>Introduction</h2>
<p>Victor Arzate has done a great job in laying down the foundation for this blog post by describing how to <a target="_blank" href="https://blogs.technet.microsoft.com/privatecloud/2016/03/18/arm-concepts-in-azure-stack-for-the-wap-administrator-resource-deployment/">deploy resources</a> and <a target="_blank" href="https://blogs.technet.microsoft.com/privatecloud/2016/04/29/arm-concepts-in-azure-stack-for-the-wap-administrator-multi-tier-applications/">multi-tier applications</a>. In this blog post we will dive deeper in how to configure a VM, also known as in-guest configuration. We will briefly revisit the options you have in Windows Azure Pack (WAP), look at Azure Stack and discover the similarities between the two.</p>
<hr />
<h2>VM deployment and configuration in Windows Azure Pack</h2>
<p>Let’s revisit the options in WAP to deploy a VM:</p>
<ul>
<li>VM Standalone – mapped to a VM template in System Center Virtual Machine Manager (SCVMM)</li>
<li>VM Role – allows integration of application installation during deployment</li>
</ul>
<blockquote><p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/image128.png"><img width="216" height="175" title="image" style="padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px;border-width: 0px" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/06/image_thumb118.png" border="0" /></a></p></blockquote>
<p>And as mentioned in the previous posts, Service Management Automation (SMA) can be used to automate and orchestrate a VM deployment and configuration (and much more) in WAP.</p>
<p>Desired State Configuration (DSC) can be used to declare the end state of your deployment which can be applied during or after a deployment. With stand-alone virtual machines, you usually deploy a VM with only the operating system installed, but what about if you need more than this? Let’s say, for example, you want to deploy a VM with SQL server? Then you need a technology that allows you to configure the VM itself, once it has been deployed with an OS. VM Roles allow you to perform this as it will deploy the VM with the OS desired and second, it will allow you to perform in-guest configuration via PowerShell DSC. For our example with SQL Server, PowerShell DSC allows you to install the required OS features (for example, .Net Framework) and also it allows you to install the application and configure it as required (in this case, SQL Server). How to create VM roles and use PowerShell DSC is out of scope of this blog, but this has been extensively documented. Two great blog posts which talk about VM role deployment and DSC are:</p>
<ul>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2014/02/28/automationthe-new-world-of-tenant-provisioning-with-windows-azure-pack-part-1-introduction-and-table-of-contents/">WAP Tenant provisioning by Charles Joy</a></li>
<li><a href="http://www.hyper-v.nu/archives/bgelens/2015/02/integrating-vm-role-with-desired-state-configuration-part-1-introduction-and-scenario/">VM Role and DSC integration by Ben Gelens</a></li>
</ul>
<p>If you are looking for a DSC jump start, then please check out <a target="_blank" href="https://channel9.msdn.com/Series/Getting-Started-with-PowerShell-Desired-State-Configuration-DSC/01">this great video</a> and if you are wondering where you can find DSC resources, please check the <a target="_blank" href="http://www.powershellgallery.com/items?q=dsc&x=0&y=0">PowerShell Gallery</a>.</p>
<p>Let’s now look at Azure Stack.</p>
<hr />
<h2>VM deployment and configuration in Azure Stack</h2>
<p>One of the biggest differences between WAP and Azure Stack is <strong>Azure Resource Manager</strong> (ARM). If you are looking for a primer on ARM I would encourage you to check out <a target="_blank" href="https://channel9.msdn.com/Events/Build/2015/2-659">Ryan Jones’ presentation on ARM</a>.</p>
<p>Since ARM is the consistent management layer between Azure and Azure Stack and consumes JSON based templates for VM deployment and configuration, it’s the first obvious step to explore. As pointed out a couple of times already during the blog post series, please do check out and try the available Azure Stack templates <a target="_blank" href="https://github.com/Azure/AzureStack-QuickStart-Templates">here</a>. Notice the green button in the picture below; in a couple of clicks you can download a zip file and explore all sample templates on your local machine or test them in your Azure Stack environment:</p>
<blockquote><p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/image221.png"><img width="885" height="225" title="image" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/06/image_thumb139.png" border="0" /></a></p></blockquote>
<p>So with an ARM template you can deploy and configure your VM’s, right? Correct! Let’s look at the options:</p>
<p><strong>For <em>new</em> VM’s deploy an ARM template leveraging the:</strong></p>
<p>a) Custom Script extension, see <a target="_blank" href="https://github.com/Azure/AzureStack-QuickStart-Templates/tree/master/101-vm-ext-win-cs-scriptfile">this</a> template as an example</p>
<p>b) DSC extension, see <a target="_blank" href="https://github.com/Azure/AzureStack-QuickStart-Templates/tree/6a82de37650656be5fd48549df65bb9d96698a28/ad-non-ha">this</a> template as an example</p>
<p>c) DSC extension and Azure Automation DSC for pull server functionality, see <a target="_blank" href="https://github.com/Azure/azure-quickstart-templates/tree/master/201-vmss-automation-dsc">this</a> template as an example</p>
<p><strong></strong></p>
<p><strong>For <em>existing</em> VM’s:</strong></p>
<p>d) Push a DSC configuration using PowerShell Remoting</p>
<p>e) Enable the DSC VM extension and assign a configuration</p>
<p>f) Enable the DSC VM extension<em> </em>and assign a DSC configuration, leveraging Azure Automation for pull server functionality</p>
<ol><!--EndFragment--></ol>
<p> </p>
<p>In this blog post will focus on options d and f.</p>
<p><em>Note: Before we move on, it is good to emphasize that DSC investments you have made – or are going to make – in WAP, Azure or Azure Stack – can be reused in all these areas. Write once, run everywhere!</em></p>
<p> </p>
<p>Let’s look at the relevant VM extensions in an ARM template.</p>
<p><strong>VM extension skeleton. </strong>Please note the highlighted section in red, these are different in each VM extension as depicted below.</p>
<pre> {
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "MyExtension",
"apiVersion": "2015-05-01-preview",
"location": "[parameters('location')]",
"dependsOn": ["[concat('Microsoft.Compute/virtualMachines/',parameters('vmName'))]"],
"properties":
{
<span style="color: #ff0000">"publisher": "Publisher Namespace",
"type": "extension Name",
"typeHandlerVersion": "extension version",
"autoUpgradeMinorVersion":true,
"settings": {
// <strong>Extension specific configuration goes in here</strong>.</span>
}
}
}</pre>
<p><strong></strong></p>
<p><strong>Custom Script Extension:</strong></p>
<pre> {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.7",
"settings": {
"fileUris": [
"http: //Yourstorageaccount.blob.core.windows.net/customscriptfiles/<strong>YourScriptGoesHere.ps1</strong>"
],
"commandToExecute": "powershell.exe-ExecutionPolicyUnrestricted -<strong>YourScriptGoesHere.ps1</strong>"
},
"protectedSettings": {
"commandToExecute": "powershell.exe-ExecutionPolicyUnrestricted -<strong>YourScriptGoesHere.ps1</strong>",
"storageAccountName": "yourStorageAccountName",
"storageAccountKey": "yourStorageAccountKey"
}
}</pre>
<p><strong><em>You can refer to </em></strong><a target="_blank" href="https://github.com/Azure/AzureStack-QuickStart-Templates/tree/master/101-vm-ext-win-cs-scriptfile"><strong><em>this</em></strong></a><strong><em> sample from the </em></strong><a target="_blank" href="https://github.com/Azure/AzureStack-QuickStart-Templates"><strong><em>Azure Stack Quick Start GitHub repository</em></strong></a><strong><em> for a complete template using the custom script extension.</em></strong></p>
<p><strong></strong>The Custom Script Extension can be used to invoke a script after deployment to do some post configuration work. For example, we could invoke an Azure Automation runbook leveraging this extension, like a <a target="_blank" href="https://azure.microsoft.com/en-us/documentation/articles/automation-webhooks/">webhook</a> enabled runbook.</p>
<p> </p>
<p><strong>DSC Extension:</strong></p>
<pre> {
"publisher": "Microsoft.Powershell",
"type": "DSC",
"typeHandlerVersion": "2.1",
"settings": {
"ModulesUrl": "https://UrlToZipContainingConfigurationScript.ps1.zip",
"SasToken": "Optional : SAS Token if ModulesUrl points to Azure Blob Storage",
"ConfigurationFunction": "ConfigurationScript.ps1\\ConfigurationFunction",
"Properties": {
"ParameterToConfigurationFunction1": "Value1",
"ParameterToConfigurationFunction2": "Value2",
"ParameterOfTypePSCredential1": {
"UserName": "UsernameValue1",
"Password": "PrivateSettingsRef:Key1(Value is a reference to a member of the Items object in the protected settings)"
},
"ParameterOfTypePSCredential2": {
"UserName": "UsernameValue2",
"Password": "PrivateSettingsRef:Key2"
}
}
},
"protectedSettings": {
"Items": {
"Key1": "PasswordValue1",
"Key2": "PasswordValue2"
},
"DataBlobUri": "optional : https: //UrlToConfigurationData.psd1"
}
}</pre>
<h1></h1>
<p><em></em></p>
<p><em>If you want to make sure that you are using the latest version of the Windows Management Framework (WMF) you can add <strong>“wmfVersion”: “latest”</strong> , see the </em><a target="_blank" href="https://blogs.msdn.microsoft.com/powershell/2016/02/26/arm-dsc-extension-settings/"><em>ARM DSC Extension Settings</em></a><em> for more information.</em></p>
<p><em>If you want to use the latest DSC extension version, you can add <strong>“autoUpgradeMinorVersion”: true </strong>right under the line <strong>“typeHandlerVersion”: “2.1”,</strong> see </em><a target="_blank" href="https://blogs.msdn.microsoft.com/powershell/2015/10/02/how-to-use-wmf-4-with-azure-dsc-extension-in-azure-resource-manager-arm/"><em>this link</em></a> for an example. <em>Note: <strong>autoUpgradeMinorVersion </strong></em>works<em> for any VM extension.</em></p>
<p> </p>
<p><strong>Note</strong>: it is in the Azure Automation backlog to support invoking an Azure Automation runbook based on a <strong>webhook</strong> in an ARM template. If you want to provide feedback on this specific topic then please navigate to <a target="_blank" href="https://feedback.azure.com/forums/246290-automation/suggestions/13227531-webhooks-arm-template">this link</a>.</p>
<p>Examples of Azure Stack templates which use the DSC extension can be found <a target="_blank" href="https://github.com/Azure/AzureStack-QuickStart-Templates/tree/master/ad-non-ha">here</a>.</p>
<hr />
<h2>Creating and deploying your own DSC Configuration</h2>
<p>In the previous posts we showed you how to deploy a new VM leveraging an ARM template which included the DSC extension to complete the in-guest configuration, so we already have covered that.</p>
<p>You can leverage DSC in two different ways: in <strong>Push</strong> or <strong>Pull</strong> mode. As you can guess based on the names, in push mode we push the DSC configuration to a node whereas in a pull mode, the node pulls the configuration from a so called <strong>DSC Pull Server</strong>. Luckily for us, there’s a DSC Pull Server up in the cloud called Azure Automation DSC which takes a way a lot of complexity in setting up a local pull server. A local pull server is a very valid option in a fully disconnected environment, but out of scope for this blog post. Go <a target="_blank" href="https://msdn.microsoft.com/en-us/powershell/dsc/pullserver">here</a> if you want to read up how to install a pull server. Using the Azure Automation DSC Pull Server assumes that your nodes have Internet access, but this is by far the easiest way to manage DSC configurations because your configurations are located and managed in a central place.</p>
<p>Let’s look at the following for this blog post:</p>
<ul>
<li>Create your own DSC configuration</li>
<li>Push the configuration to a node and apply</li>
<li>Upload your DSC configuration to Azure Automation and compile
<ul>
<li>This will generate a MOF file which will get consumed by the DSC Local Configuration Manager (LCM) – the DSC engine if you will</li>
</ul>
</li>
<li>Assign the DSC configuration to an existing VM</li>
<li>Look at the compliancy state in Azure Automation</li>
</ul>
<hr />
<h2>Create your own DSC configuration</h2>
<p>A DSC configuration is like a function in PowerShell and we will use it to declare our end state.</p>
<p>Perform the following steps on a machine which has Internet access since we will upload the DSC configuration to Azure Automation.</p>
<p>1. Open PowerShell ISE and let’s create this simple website configuration:</p>
<div style="overflow: auto;border-top: black 1px solid;;border-right: black 1px solid;width: 650px;border-bottom: black 1px solid;border-left: black 1px solid;padding: 5px">
<table border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td valign="top">
<div style="background: #cecece;padding: 5px"><span style="font-family: Consolas"><span style="font-size: 10pt">001<br />
002<br />
003<br />
004<br />
005<br />
006<br />
007<br />
008<br />
009<br />
010<br />
011<br />
012<br />
013<br />
014<br />
015<br />
016<br />
017<br />
018<br />
019<br />
020<br />
021<br />
022<br />
023<br />
024<br />
025<br />
026</span></span></div>
</td>
<td nowrap="nowrap" valign="top">
<div style="background: #fcfcfc;padding: 5px"><span style="font-family: Consolas"><span><span style="color: #00008b"><span style="font-size: 10pt">Configuration</span></span></span><span style="font-size: 10pt"><span> </span><span><span style="color: #8a2be2">MyCorpWebsite</span></span><span> </span><span>{</span><br />
<span> </span><span><span style="color: #00008b">param</span></span><span> </span><span>(</span><br />
<span> </span><span><span style="color: #ff4500">$NodeName</span></span><br />
<span> </span><span>)</span><br />
<span> </span><span><span style="color: #00008b">Node</span></span><span> </span><span><span style="color: #ff4500">$NodeName</span></span><span> </span><span>{</span><br />
<span> </span><span><span style="color: #00008b">WindowsFeature</span></span><span> </span><span><span style="color: #8a2be2">IIS</span></span><br />
<span> </span><span>{</span><br />
<span> </span><span>Name</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">‘Web-Server’</span></span><br />
<span> </span><span>Ensure</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">‘Present’</span></span><br />
<span> </span><span>}</span><br />
<span> </span><br />
<span> </span><span><span style="color: #00008b">WindowsFeature</span></span><span> </span><span><span style="color: #8a2be2">ASP</span></span><br />
<span> </span><span>{</span><br />
<span> </span><span>Ensure</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">“Present”</span></span><br />
<span> </span><span>Name</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">“Web-Asp-Net45”</span></span><br />
<span> </span><span>}</span><br />
<span> </span><br />
<span> </span><span><span style="color: #00008b">Service</span></span><span> </span><span><span style="color: #8b0000">‘W3svc’</span></span><br />
<span> </span><span>{</span><br />
<span> </span><span>Name</span><span><span style="color: #a9a9a9">=</span></span><span><span style="color: #8b0000">‘w3svc’</span></span><br />
<span> </span><span>StartupType</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">‘Automatic’</span></span><br />
<span> </span><span>State</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">‘Running’</span></span><br />
<span> </span><span>DependsOn</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">‘[windowsfeature]iis’</span></span><br />
<span> </span><span>}</span><br />
<span> </span><span>}</span><br />
<span>}</span> </span></span></div>
</td>
</tr>
</tbody>
</table>
</div>
<h1></h1>
<p>2. Save your DSC configuration locally in a folder, I’ve saved mine to C:\DSC as <strong>MyCorpWebsite.ps1</strong></p>
<p>3. Load your DSC configuration into memory so that we can call it (just run the PowerScript in step 1)</p>
<p>4. Let’s generate the MOF file which will be consumed by the Local Configuration Manager, notice that I’m passing a parameter called <strong>–NodeName</strong> which will generate a MOF file for specifically that node:</p>
<p><strong>MyCorpWebsite -NodeName HRB1 -OutputPath c:\DSC\configurations</strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/image577.png"><img width="460" height="167" title="image" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/06/image_thumb445.png" border="0" /></a></p>
<hr />
<h2>Push the DSC configuration to a node and apply</h2>
<p>Now that you have created a DSC configuration and compiled it into a MOF file, we can <strong>push</strong> it to a node. Before you can push a DSC configuration to a node, you need to make sure that either <strong>WinRM listeners</strong> <em>or</em> <strong>PowerShell Remoting</strong> has been setup on your target machine. Enable-PSRemoting is an easy way to create the required WinRM listeners. A lot already has been written about how to setup PowerShell Remoting and creating WinRM listeners, if you are looking for information on just setting up the required WinRM listeners you can explore <a target="_blank" href="http://www.powershellmagazine.com/2014/04/01/desired-state-configuration-and-the-remoting-myth/">this article</a>.</p>
<p>Assuming that you have the prerequisites in place, we can now push the configuration to our node (in my example my host is called HRB1):</p>
<p><strong>Start-DscConfiguration –path C:\dsc\configurations –Verbose -Wait -Force –Credential (Get-Credential) –Computername HRB1</strong></p>
<p><em>Notice that we didn’t have to use PowerShell Remoting because of the WinRM listener being configured through Enable-PSRemoting.</em></p>
<p>It will first prompt us for our credentials:</p>
<blockquote><p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/image579.png"><img width="606" height="215" title="image" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/06/image_thumb447.png" border="0" /></a></p></blockquote>
<p>After we’ve authenticated, we will see this is our output:</p>
<blockquote><p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/image580.png"><img width="609" height="304" title="image" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/06/image_thumb448.png" border="0" /></a></p>
<h1></h1>
</blockquote>
<p>Let’s check with PowerShell Remoting if our configuration got applied:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/image581.png"><img width="661" height="105" title="image" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/06/image_thumb449.png" border="0" /></a></p>
<p>Cool stuff!</p>
<hr />
<h2>Upload your DSC configuration to Azure Automation and compile</h2>
<p>The remainder of this blog post will focus on option f (Enable the DSC VM extension and assign a DSC configuration, leveraging Azure Automation for pull server functionality ) – as previously discussed in this blog post. It is assumed that you are familiar with Azure Automation and that you’ve created an Azure Automation account in your subscription. If you are new to Azure Automation, please go <a target="_blank" href="https://azure.microsoft.com/en-us/documentation/learning-paths/automation/">here</a> to start.</p>
<p>We will now upload a DSC configuration to Azure Automation and compile it. Let’s use the same configuration as we’ve used previously with the exception that we are going to take out the node section since Azure Automation is going to assign the configuration to the node:</p>
<div style="overflow: auto;border-top: black 1px solid;;border-right: black 1px solid;width: 650px;border-bottom: black 1px solid;border-left: black 1px solid;padding: 5px">
<table border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td valign="top">
<div style="background: #cecece;padding: 5px"><span style="font-family: Consolas"><span style="font-size: 10pt">001<br />
002<br />
003<br />
004<br />
005<br />
006<br />
007<br />
008<br />
009<br />
010<br />
011<br />
012<br />
013<br />
014<br />
015<br />
016<br />
017<br />
018<br />
019<br />
020<br />
021</span></span></div>
</td>
<td nowrap="nowrap" valign="top">
<div style="background: #fcfcfc;padding: 5px"><span style="font-family: Consolas"><span><span style="color: #00008b"><span style="font-size: 10pt">Configuration</span></span></span><span style="font-size: 10pt"><span> </span><span><span style="color: #8a2be2">MyCorpWebsite</span></span><span> </span><span>{</span><br />
<span> </span><span><span style="color: #00008b">WindowsFeature</span></span><span> </span><span><span style="color: #8a2be2">IIS</span></span><br />
<span> </span><span>{</span><br />
<span> </span><span>Name</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">‘Web-Server’</span></span><br />
<span> </span><span>Ensure</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">‘Present’</span></span><br />
<span> </span><span>}</span><br />
<span> </span><br />
<span> </span><span><span style="color: #00008b">WindowsFeature</span></span><span> </span><span><span style="color: #8a2be2">ASP</span></span><br />
<span></span><span>{</span><br />
<span> </span><span>Ensure</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">“Present”</span></span><br />
<span></span><span>Name</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">“Web-Asp-Net45”</span></span><br />
<span> </span><span>}</span><br />
<span> </span><br />
<span> </span><span><span style="color: #00008b">Service</span></span><span> </span><span><span style="color: #8b0000">‘W3svc’</span></span><br />
<span> </span><span>{</span><br />
<span> </span><span>Name</span><span><span style="color: #a9a9a9">=</span></span><span><span style="color: #8b0000">‘w3svc’</span></span><br />
<span> </span><span>StartupType</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">‘Automatic’</span></span><br />
<span> </span><span>State</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">‘Running’</span></span><br />
<span> </span><span>DependsOn</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">‘[windowsfeature]iis’</span></span><br />
<span> </span><span>}</span><br />
<span>}</span> </span></span></div>
</td>
</tr>
</tbody>
</table>
</div>
<p>1. Use the following PowerShell script to upload your DSC configuration to Azure Automation and compile it:</p>
<div style="overflow: auto;border-top: black 1px solid;;border-right: black 1px solid;width: 650px;border-bottom: black 1px solid;border-left: black 1px solid;padding: 5px">
<table border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td valign="top">
<div style="background: #cecece;padding: 5px"><span style="font-family: Consolas"><span style="font-size: 10pt">001<br />
002<br />
003<br />
004<br />
005<br />
006<br />
007<br />
008<br />
009<br />
010<br />
011<br />
012<br />
013</span></span></div>
</td>
<td nowrap="nowrap" valign="top">
<div style="background: #fcfcfc;padding: 5px"><span style="font-family: Consolas"><span><span style="color: #0000ff"><span style="font-size: 10pt">Add-AzureRmAccount</span></span></span><span style="font-size: 10pt"><br />
<span><span style="color: #006400">#Get your Azure Automation account where you want to upload your DSC config to</span></span><br />
<span><span style="color: #ff4500">$AAaccount</span></span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #0000ff">Get-AzureRmAutomationAccount</span></span><span> </span><span><span style="color: #000080">-Name</span></span><span> </span><span><span style="color: #8a2be2">DscAzStack</span></span><span> </span><span><span style="color: #000080">-ResourceGroupName</span></span><span> </span><span><span style="color: #8a2be2">DscAzStack</span></span></p>
<p><span><span style="color: #006400">#Import DSC configuration</span></span><br />
<span><span style="color: #ff4500">$AAaccount</span></span><span> </span><span><span style="color: #a9a9a9">|</span></span><span> </span><span><span style="color: #0000ff">Import-AzureRmAutomationDscConfiguration</span></span><span> </span><span><span style="color: #000080">-SourcePath</span></span><span> </span><span><span style="color: #8b0000">‘C:\DSC\MyCorpWebsite.ps1’</span></span><span> </span><span><span style="color: #000080">-Published</span></span><span> </span><span><span style="color: #000080">-Force</span></span><br />
<span><span style="color: #ff4500">$AAaccount</span></span><span> </span><span><span style="color: #a9a9a9">|</span></span><span> </span><span><span style="color: #0000ff">Get-AzureRmAutomationDscConfiguration</span></span><span> </span><span><span style="color: #000080">-Name</span></span><span> </span><span><span style="color: #8a2be2">MyCorpWebsite</span></span></p>
<p><span><span style="color: #006400">#Compile the DSC configuration</span></span><br />
<span><span style="color: #ff4500">$job</span></span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$AAaccount</span></span><span> </span><span><span style="color: #a9a9a9">|</span></span><span> </span><span><span style="color: #0000ff">Get-AzureRmAutomationDscConfiguration</span></span><span> </span><span><span style="color: #000080">-Name</span></span><span> </span><span><span style="color: #8a2be2">MyCorpWebsite</span></span><span> </span><span><span style="color: #a9a9a9">|</span></span><span> </span><span><span style="color: #0000ff">Start-AzureRmAutomationDscCompilationJob</span></span></p>
<p><span><span style="color: #006400">#Get the status of the compilation job</span></span><br />
<span><span style="color: #ff4500">$job</span></span><span> </span><span><span style="color: #a9a9a9">|</span></span><span> </span><span><span style="color: #0000ff">Get-AzureRmAutomationDscCompilationJob</span></span> </span></span></div>
</td>
</tr>
</tbody>
</table>
</div>
<p> </p>
<p>That will give you this output:</p>
<blockquote><p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/image283.png"><img width="430" height="354" title="image" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/06/image_thumb193.png" border="0" /></a></p></blockquote>
<p>Starting the compilation job:</p>
<blockquote><p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/image284.png"><img width="716" height="197" title="image" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/06/image_thumb194.png" border="0" /></a></p></blockquote>
<p>After a short while we see the completion in the Azure Automation portal:</p>
<blockquote><p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/image285.png"><img width="441" height="387" title="image" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/06/image_thumb195.png" border="0" /></a></p></blockquote>
<p>Now that we have uploaded and compiled a DSC configuration into Azure Automation we can assign this configuration to a VM. There are two options for assigning a configuration to a VM:</p>
<p>1. Through the Azure Automation portal. This is currently limited to Azure VM’s only within the same subscription</p>
<p>2. Through PowerShell, for VM’s residing outside Azure, like on-premises VM’s or in different clouds like AWS</p>
<p>Since this blog post is focused on Azure Stack, PowerShell is going to be our option of choice.</p>
<hr />
<h2></h2>
<h2></h2>
<h2>Assign the DSC configuration to an existing VM</h2>
<h3></h3>
<p>In the <a target="_blank" href="https://blogs.technet.microsoft.com/privatecloud/2016/04/29/arm-concepts-in-azure-stack-for-the-wap-administrator-multi-tier-applications/">previous post</a> Victor talked already about leveraging <a target="_blank" href="https://github.com/Azure/azure-quickstart-templates/tree/master/dsc-extension-azure-automation-pullserver">this</a> Github template which you can use to onboard a non Azure VM. Let’s drill down a bit on that template.</p>
<p>The Github template leverages what is called a <strong>DSC metaconfiguration</strong> file to onboard the nodes and to configure the Local Configuration Manager (LCM). The DSC metaconfiguration file is stored <a target="_blank" href="https://github.com/Azure/azure-quickstart-templates/blob/master/dsc-extension-azure-automation-pullserver/UpdateLCMforAAPull.zip">here</a>. Let’s download, extract and examine the file the PowerShell way:</p>
<blockquote>
<div style="overflow: auto;width: 650px;border: black 1px solid;padding: 5px">
<table border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td valign="top">
<div style="background: #cecece;padding: 5px"><span style="font-family: consolas"><span style="font-size: 10pt">001<br />
002<br />
003<br />
004<br />
005<br />
006<br />
007<br />
008<br />
009</span></span></div>
</td>
<td nowrap="nowrap" valign="top">
<div style="background: #fcfcfc;padding: 5px"><span style="font-family: consolas"><span style="color: #ff4500"><span style="font-size: 10pt">$MetaConfigFileURL</span></span><span style="font-size: 10pt"> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">‘https://github.com/Azure/azure-quickstart-templates/raw/master/dsc-extension-azure-automation-pullserver/UpdateLCMforAAPull.zip’</span><br />
<span style="color: #ff4500">$MetaConfigFile</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">‘UpdateLCMforAAPull’</span><br />
<span style="color: #ff4500">$OutFolder</span> <span style="color: #a9a9a9">=</span> <span style="color: #8b0000">‘C:\DSC’</span><br />
<span style="color: #0000ff">Invoke-WebRequest</span> <span style="color: #000080">-Uri</span> <span style="color: #ff4500">$MetaConfigFileURL</span> `<br />
<span style="color: #000080">-OutFile</span> (<span style="color: #ff4500">$OutFolder</span> <span style="color: #a9a9a9">+</span> <span style="color: #8b0000">‘\’</span> <span style="color: #a9a9a9">+</span> <span style="color: #ff4500">$MetaConfigFile</span> <span style="color: #a9a9a9">+</span> <span style="color: #8b0000">‘.zip’</span>)<br />
<span style="color: #0000ff">Expand-Archive</span> (<span style="color: #ff4500">$OutFolder</span> <span style="color: #a9a9a9">+</span> <span style="color: #8b0000">‘\’</span> <span style="color: #a9a9a9">+</span> <span style="color: #ff4500">$MetaConfigFile</span> <span style="color: #a9a9a9">+</span> <span style="color: #8b0000">‘.zip’</span>) <span style="color: #000080">-DestinationPath</span> <span style="color: #ff4500">$OutFolder</span><br />
<span style="color: #0000ff">psedit</span> (<span style="color: #ff4500">$OutFolder</span> <span style="color: #a9a9a9">+</span> <span style="color: #8b0000">‘\’</span> <span style="color: #a9a9a9">+</span> <span style="color: #ff4500">$MetaConfigFile</span> <span style="color: #a9a9a9">+</span> <span style="color: #8b0000">‘.ps1’</span></span><span style="font-size: 10pt">)</span></span></div>
</td>
</tr>
</tbody>
</table>
</div>
</blockquote>
<p> </p>
<p>The last line in the above PowerShell script will open up the <strong>metaconfiguration</strong> file:</p>
<div style="overflow: auto;border-top: black 1px solid;;border-right: black 1px solid;width: 650px;border-bottom: black 1px solid;border-left: black 1px solid;padding: 5px">
<table border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td valign="top">
<div style="background: #cecece;padding: 5px"><span style="font-family: Consolas"><span style="font-size: 10pt">001<br />
002<br />
003<br />
004<br />
005<br />
006<br />
007<br />
008<br />
009<br />
010<br />
011<br />
012<br />
013<br />
014<br />
015<br />
016<br />
017<br />
018<br />
019<br />
020<br />
021<br />
022<br />
023<br />
024<br />
025<br />
026<br />
027<br />
028<br />
029<br />
030<br />
031<br />
032<br />
033<br />
034<br />
035<br />
036<br />
037<br />
038<br />
039<br />
040<br />
041<br />
042<br />
043<br />
044<br />
045<br />
046<br />
047<br />
048<br />
049<br />
050<br />
051<br />
052<br />
053<br />
054<br />
055<br />
056<br />
057<br />
058<br />
059<br />
060<br />
061<br />
062<br />
063<br />
064<br />
065<br />
066<br />
067<br />
068<br />
069<br />
070<br />
071<br />
072<br />
073<br />
074<br />
075<br />
076<br />
077<br />
078<br />
079<br />
080<br />
081<br />
082<br />
083<br />
084<br />
085<br />
086<br />
087</span></span></div>
</td>
<td nowrap="nowrap" valign="top">
<div style="background: #fcfcfc;padding: 5px"><span style="font-family: Consolas"><span><span style="color: #a9a9a9"><span style="font-size: 10pt">[</span></span></span><span style="font-size: 10pt"><span><span style="color: #00bfff">DscLocalConfigurationManager</span></span><span>(</span><span>)</span><span><span style="color: #a9a9a9">]</span></span><br />
<span><span style="color: #00008b">Configuration</span></span><span> </span><span><span style="color: #8a2be2">ConfigureLCMforAAPull</span></span><br />
<span>{</span><br />
<span> </span><span><span style="color: #00008b">param</span></span><br />
<span> </span><span>(</span><br />
<span> </span><span><span style="color: #a9a9a9">[</span></span><span><span style="color: #00bfff">Parameter</span></span><span>(</span><span>Mandatory</span><span><span style="color: #a9a9a9">=</span></span><span><span style="color: #ff4500">$True</span></span><span>)</span><span><span style="color: #a9a9a9">]</span></span><br />
<span> </span><span><span style="color: #ff4500">$RegistrationUrl</span></span><span><span style="color: #a9a9a9">,</span></span></p>
<p><span> </span><span><span style="color: #a9a9a9">[</span></span><span><span style="color: #00bfff">Parameter</span></span><span>(</span><span>Mandatory</span><span><span style="color: #a9a9a9">=</span></span><span><span style="color: #ff4500">$True</span></span><span>)</span><span><span style="color: #a9a9a9">]</span></span><br />
<span> </span><span><span style="color: #008080">[PSCredential]</span></span><span><span style="color: #ff4500">$RegistrationKey</span></span><span><span style="color: #a9a9a9">,</span></span></p>
<p><span> </span><span><span style="color: #008080">[Int]</span></span><span><span style="color: #ff4500">$RefreshFrequencyMins</span></span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #800080">30</span></span><span><span style="color: #a9a9a9">,</span></span><br />
<span> </span><br />
<span> </span><span><span style="color: #008080">[Int]</span></span><span><span style="color: #ff4500">$ConfigurationModeFrequencyMins</span></span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #800080">15</span></span><span><span style="color: #a9a9a9">,</span></span><br />
<span> </span><br />
<span> </span><span><span style="color: #008080">[String]</span></span><span><span style="color: #ff4500">$ConfigurationMode</span></span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">“ApplyAndMonitor”</span></span><span><span style="color: #a9a9a9">,</span></span><br />
<span> </span><br />
<span> </span><span><span style="color: #008080">[String]</span></span><span><span style="color: #ff4500">$NodeConfigurationName</span></span><span><span style="color: #a9a9a9">,</span></span></p>
<p><span> </span><span><span style="color: #008080">[Boolean]</span></span><span><span style="color: #ff4500">$RebootNodeIfNeeded</span></span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$False</span></span><span><span style="color: #a9a9a9">,</span></span></p>
<p><span> </span><span><span style="color: #008080">[String]</span></span><span><span style="color: #ff4500">$ActionAfterReboot</span></span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">“ContinueConfiguration”</span></span><span><span style="color: #a9a9a9">,</span></span></p>
<p><span> </span><span><span style="color: #008080">[Boolean]</span></span><span><span style="color: #ff4500">$AllowModuleOverwrite</span></span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$False</span></span><span><span style="color: #a9a9a9">,</span></span></p>
<p><span> </span><span><span style="color: #008080">[String]</span></span><span><span style="color: #ff4500">$Timestamp</span></span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">“”</span></span><br />
<span> </span><span>)</span></p>
<p><span> </span><span><span style="color: #00008b">if</span></span><span>(</span><span><span style="color: #a9a9a9">!</span></span><span><span style="color: #ff4500">$RefreshFrequencyMins</span></span><span> </span><span><span style="color: #a9a9a9">-or</span></span><span> </span><span><span style="color: #ff4500">$RefreshFrequencyMins</span></span><span> </span><span><span style="color: #a9a9a9">-eq</span></span><span> </span><span><span style="color: #8b0000">“”</span></span><span>)</span><br />
<span> </span><span>{</span><br />
<span> </span><span><span style="color: #ff4500">$RefreshFrequencyMins</span></span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #800080">30</span></span><br />
<span> </span><span>}</span></p>
<p><span> </span><span><span style="color: #00008b">if</span></span><span>(</span><span><span style="color: #a9a9a9">!</span></span><span><span style="color: #ff4500">$ConfigurationModeFrequencyMins</span></span><span> </span><span><span style="color: #a9a9a9">-or</span></span><span> </span><span><span style="color: #ff4500">$ConfigurationModeFrequencyMins</span></span><span> </span><span><span style="color: #a9a9a9">-eq</span></span><span> </span><span><span style="color: #8b0000">“”</span></span><span>)</span><br />
<span> </span><span>{</span><br />
<span> </span><span><span style="color: #ff4500">$ConfigurationModeFrequencyMins</span></span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #800080">15</span></span><br />
<span> </span><span>}</span></p>
<p><span> </span><span><span style="color: #00008b">if</span></span><span>(</span><span><span style="color: #a9a9a9">!</span></span><span><span style="color: #ff4500">$ConfigurationMode</span></span><span> </span><span><span style="color: #a9a9a9">-or</span></span><span> </span><span><span style="color: #ff4500">$ConfigurationMode</span></span><span> </span><span><span style="color: #a9a9a9">-eq</span></span><span> </span><span><span style="color: #8b0000">“”</span></span><span>)</span><br />
<span> </span><span>{</span><br />
<span> </span><span><span style="color: #ff4500">$ConfigurationMode</span></span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">“ApplyAndMonitor”</span></span><br />
<span> </span><span>}</span></p>
<p><span> </span><span><span style="color: #00008b">if</span></span><span>(</span><span><span style="color: #a9a9a9">!</span></span><span><span style="color: #ff4500">$ActionAfterReboot</span></span><span> </span><span><span style="color: #a9a9a9">-or</span></span><span> </span><span><span style="color: #ff4500">$ActionAfterReboot</span></span><span> </span><span><span style="color: #a9a9a9">-eq</span></span><span> </span><span><span style="color: #8b0000">“”</span></span><span>)</span><br />
<span> </span><span>{</span><br />
<span> </span><span><span style="color: #ff4500">$ActionAfterReboot</span></span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">“ContinueConfiguration”</span></span><br />
<span> </span><span>}</span></p>
<p><span> </span><span><span style="color: #00008b">if</span></span><span>(</span><span><span style="color: #a9a9a9">!</span></span><span><span style="color: #ff4500">$NodeConfigurationName</span></span><span> </span><span><span style="color: #a9a9a9">-or</span></span><span> </span><span><span style="color: #ff4500">$NodeConfigurationName</span></span><span> </span><span><span style="color: #a9a9a9">-eq</span></span><span> </span><span><span style="color: #8b0000">“”</span></span><span>)</span><br />
<span> </span><span>{</span><span> </span><br />
<span> </span><span><span style="color: #ff4500">$ConfigurationNames</span></span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$null</span></span><br />
<span> </span><span>}</span><br />
<span> </span><span><span style="color: #00008b">else</span></span><br />
<span> </span><span>{</span><br />
<span> </span><span><span style="color: #ff4500">$ConfigurationNames</span></span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span>@(</span><span><span style="color: #ff4500">$NodeConfigurationName</span></span><span>)</span><br />
<span> </span><span>}</span><span> </span></p>
<p><span> </span><span><span style="color: #00008b">Settings</span></span><br />
<span> </span><span>{</span><br />
<span> </span><span>RefreshFrequencyMins</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$RefreshFrequencyMins</span></span><br />
<span> </span><span>RefreshMode</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">“PULL”</span></span><br />
<span> </span><span>ConfigurationMode</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$ConfigurationMode</span></span><br />
<span> </span><span>AllowModuleOverwrite</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$AllowModuleOverwrite</span></span><br />
<span> </span><span>RebootNodeIfNeeded</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$RebootNodeIfNeeded</span></span><br />
<span> </span><span>ActionAfterReboot</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$ActionAfterReboot</span></span><br />
<span> </span><span>ConfigurationModeFrequencyMins</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$ConfigurationModeFrequencyMins</span></span><br />
<span> </span><span>}</span></p>
<p><span> </span><span><span style="color: #00008b">ConfigurationRepositoryWeb</span></span><span> </span><span><span style="color: #8a2be2">AzureAutomationDSC</span></span><br />
<span> </span><span>{</span><br />
<span> </span><span>ServerUrl</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$RegistrationUrl</span></span><br />
<span> </span><span>RegistrationKey</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$RegistrationKey</span></span><span><span style="color: #a9a9a9">.</span></span><span>GetNetworkCredential</span><span>(</span><span>)</span><span><span style="color: #a9a9a9">.</span></span><span>Password</span><br />
<span> </span><span>ConfigurationNames</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$ConfigurationNames</span></span><br />
<span> </span><span>}</span></p>
<p><span> </span><span><span style="color: #00008b">ResourceRepositoryWeb</span></span><span> </span><span><span style="color: #8a2be2">AzureAutomationDSC</span></span><br />
<span> </span><span>{</span><br />
<span> </span><span>ServerUrl</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$RegistrationUrl</span></span><br />
<span> </span><span>RegistrationKey</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$RegistrationKey</span></span><span><span style="color: #a9a9a9">.</span></span><span>GetNetworkCredential</span><span>(</span><span>)</span><span><span style="color: #a9a9a9">.</span></span><span>Password</span><br />
<span> </span><span>}</span></p>
<p><span> </span><span><span style="color: #00008b">ReportServerWeb</span></span><span> </span><span><span style="color: #8a2be2">AzureAutomationDSC</span></span><br />
<span> </span><span>{</span><br />
<span> </span><span>ServerUrl</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$RegistrationUrl</span></span><br />
<span> </span><span>RegistrationKey</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$RegistrationKey</span></span><span><span style="color: #a9a9a9">.</span></span><span>GetNetworkCredential</span><span>(</span><span>)</span><span><span style="color: #a9a9a9">.</span></span><span>Password</span><br />
<span> </span><span>}</span><br />
<span>}</span> </span></span></div>
</td>
</tr>
</tbody>
</table>
</div>
<p>These settings can all be modified and you can call these from within your own Github repository or a storage container from within Azure or Azure Stack. For example if you want to change the refresh cycle or the reboot behavior. You can find more information how to do so right <a target="_blank" href="https://azure.microsoft.com/en-us/documentation/articles/automation-dsc-onboarding/#generating-dsc-metaconfigurations">here</a>.</p>
<p>Since the <strong>azuredeploy.json</strong> file contains parameters, we can also pass them through PowerShell instead of editing the <strong>azuredeploy.parameters.json</strong> file.</p>
<blockquote><p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/image309.png"><img width="629" height="286" title="image" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/06/image_thumb213.png" border="0" /></a></p></blockquote>
<p>We can start the onboarding process to Azure Automation DSC in the following way and passing parameters to the <strong>New-AzureRmResourceGroupDeployment</strong> cmdlet. Notice that I’m passing also our DSC configuration <strong>MyCorpWebsite </strong>which we’ve created earlier, uploaded and compiled to Azure Automation DSC. You can find the variable below specified as <strong>nodeConfigurationName</strong>. If you have worked before with DSC, you probably have noticed that I have not specified an <strong>AllNodes</strong> section in the DSC configuration. This is because – in my example – Azure Automation acts as a pull server and assigns the configuration to the node, hence the<strong> MyCorpWebsite.localhost</strong> value. Please explore <a target="_blank" href="https://msdn.microsoft.com/en-us/powershell/dsc/configdata">this</a> link if you want to know more about <strong>AllNodes</strong> configuration and how to separate configuration and environment data.</p>
<div style="overflow: auto;border-top: black 1px solid;;border-right: black 1px solid;width: 650px;border-bottom: black 1px solid;border-left: black 1px solid;padding: 5px">
<table border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td valign="top">
<div style="background: #cecece;padding: 5px"><span style="font-family: Consolas"><span style="font-size: 10pt">001<br />
002<br />
003<br />
004<br />
005<br />
006<br />
007<br />
008<br />
009<br />
010<br />
011<br />
012<br />
013<br />
014<br />
015<br />
016<br />
017</span></span></div>
</td>
<td nowrap="nowrap" valign="top">
<div style="background: #fcfcfc;padding: 5px"><span style="font-family: Consolas"><span><span style="color: #ff4500"><span style="font-size: 10pt">$AAaccount</span></span></span><span style="font-size: 10pt"><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #0000ff">Get-AzureRmAutomationAccount</span></span><span> </span><span><span style="color: #000080">-Name</span></span><span> </span><span><span style="color: #8a2be2">DscAzStack</span></span><span> </span><span><span style="color: #000080">-ResourceGroupName</span></span><span> </span><span><span style="color: #8a2be2">DscAzStack</span></span><br />
<span><span style="color: #ff4500">$keys</span></span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$AAaccount</span></span><span> </span><span><span style="color: #a9a9a9">|</span></span><span> </span><span><span style="color: #0000ff">Get-AzureRmAutomationRegistrationInfo</span></span></p>
<p><span><span style="color: #ff4500">$RgDeployParams</span></span><span> </span><span><span style="color: #a9a9a9">=</span></span><span>@{</span><br />
<span> </span><span>TemplateUri</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">“https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/dsc-extension-azure-automation-pullserver/azuredeploy.json”</span></span><br />
<span> </span><span>Mode</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">‘Incremental’</span></span><br />
<span> </span><span>ResourceGroupName</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">‘DSCRG’</span></span><br />
<span> </span><span>TemplateParameterObject</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span>@{</span><br />
<span> </span><span>vmName</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">‘DSCVM2’</span></span><br />
<span> </span><span>registrationKey</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$keys</span></span><span><span style="color: #a9a9a9">.</span></span><span>PrimaryKey</span><br />
<span> </span><span>registrationUrl</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #ff4500">$Keys</span></span><span><span style="color: #a9a9a9">.</span></span><span>Endpoint</span><br />
<span> </span><span>nodeConfigurationName</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #8b0000">‘MyCorpWebsite.localhost’</span></span><br />
<span> </span><span>timestamp</span><span> </span><span><span style="color: #a9a9a9">=</span></span><span> </span><span><span style="color: #008080">[datetime]</span></span><span><span style="color: #a9a9a9">::</span></span><span>Now</span><span><span style="color: #a9a9a9">.</span></span><span>ToString</span><span>(</span><span>)</span><br />
<span> </span><span>}</span><br />
<span>}</span></p>
<p><span><span style="color: #0000ff">New-AzureRmResourceGroupDeployment</span></span><span> </span><span><span style="color: #8a2be2">@$RgDeployParams</span></span><span> </span><span><span style="color: #000080">-Force</span></span><span> </span><span><span style="color: #000080">-Verbose</span></span> </span></span></div>
</td>
</tr>
</tbody>
</table>
</div>
<h1></h1>
<p> </p>
<p>In the screenshot below you can see that the onboarding went successful:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/image317.png"><img width="684" height="344" title="image" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/06/image_thumb219.png" border="0" /></a></p>
<p>We can see in Azure Automation that the node has successfully on-boarded and it’s status:</p>
<blockquote><p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/image341.png"><img width="521" height="189" title="image" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/06/image_thumb238.png" border="0" /></a></p></blockquote>
<p>Let’s RDP into the VM and check the configuration on the VM itself:</p>
<blockquote><p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/image342.png"><img width="437" height="132" title="image" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/06/image_thumb239.png" border="0" /></a></p></blockquote>
<p>Cool!</p>
<p>If we check the LCM on the machine, we can see that the VM is configured in Pull mode and being managed by Azure Automation DSC:</p>
<blockquote><p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/image343.png"><img width="437" height="255" title="image" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/06/image_thumb240.png" border="0" /></a></p></blockquote>
<p>And if we run <strong>Get-DscConfiguration</strong> we can see our configuration:</p>
<blockquote><p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/image344.png"><img width="366" height="203" title="image" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/06/image_thumb241.png" border="0" /></a></p></blockquote>
<hr />
<h2>Installing applications/software with DSC</h2>
<p>Recently I got questions if you can also leverage DSC in a DevOps scenario where you need to configure the VM with packages. Yes absolutely! Let me first emphasize that DSC is not a replacement for System Center Configuration Manager (SCCM), which is a change & configuration management solution where software distribution is an important component. SCCM is build for software distribution in a potentially connected/disconnected environment where technologies like BITS, checkpoint restarting, bandwidth throttling, etc. combined with hard and software inventory has its own place. Now back to DSC, how can I get dependency software (packages) on the VM? Well you can leverage the <a target="_blank" href="https://msdn.microsoft.com/en-us/powershell/dsc/packageresource">DSC package resource</a> to start with:</p>
<blockquote>
<div style="overflow: auto;width: 650px;border: black 1px solid;padding: 5px">
<table border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td valign="top">
<div style="background: #cecece;padding: 5px"><span style="font-family: consolas"><span style="font-size: 10pt">001<br />
002<br />
003<br />
004<br />
005<br />
006<br />
007<br />
008</span></span></div>
</td>
<td nowrap="nowrap" valign="top">
<div style="background: #fcfcfc;padding: 5px"><span style="font-family: consolas"><span style="color: #0000ff"><span style="font-size: 10pt">Package</span></span><span style="font-size: 10pt"> <span style="color: #8a2be2">PackageExample</span><br />
{<br />
<span style="color: #0000ff">Ensure</span> <span style="color: #8a2be2">=</span> <span style="color: #8b0000">“Present”</span> <span style="color: #006400"># You can also set Ensure to “Absent”</span><br />
<span style="color: #0000ff">Path</span> <span style="color: #8a2be2">=</span> <span style="color: #8b0000">“$Env:SystemDrive\TestFolder\TestProject.msi”</span><br />
<span style="color: #0000ff">Name</span> <span style="color: #8a2be2">=</span> <span style="color: #8b0000">“TestPackage”</span><br />
<span style="color: #0000ff">ProductId</span> <span style="color: #8a2be2">=</span> <span style="color: #8b0000">“ACDDCDAF-80C6-41E6-A1B9-8ABD8A05027E”</span><br />
</span><span style="font-size: 10pt">}</span></span></div>
</td>
</tr>
</tbody>
</table>
</div>
</blockquote>
<p>You can define a <strong>GUID</strong> (in the above example <strong>ProductId</strong>) which will make sure that only a specific package will get installed and not a rogue MSI. <a target="_blank" href="http://social.technet.microsoft.com/wiki/contents/articles/29105.installing-msi-packages-using-powershell-desired-state-configuration.aspx">This example</a> shows how to install 7Zip.</p>
<p>Another option is to use an open source package manager like <a target="_blank" href="https://chocolatey.org/">Chocolatey</a>. Out of scope for this blog post, but if you want to get started with Azure Automation and Chocolately, please check out <a target="_blank" href="https://azure.microsoft.com/en-us/documentation/articles/automation-dsc-cd-chocolatey/">this</a> blog post. It will talk about continuous deployment to Virtual Machines using Automation DSC and Chocolatey in great detail.</p>
<hr />
<h2>Azure Automation Hybrid Runbook Worker</h2>
<p>Azure Automation runbooks are by default executed by Azure runbook workers. As the name says, those runbook worker reside in Azure. This would become a challenge if you want to execute runbooks in your Azure Stack environment. Well not completely, since the <strong>Hybrid Runbook Worker</strong> (HRB) is designed to execute runbooks on a machine/VM where the HRB role is enabled. This could be a VM within your Azure Stack environment. Why does this makes a difference? Well by running it in your Azure Stack environment you can access local resources (like local accounts), leverage local PowerShell modules and DLL’s and you can access your Azure Stack VM’s. This scenario also allows you to push DSC configurations to your VM’s if you don’t want to onboard them to Azure Automation DSC, but obviously you can run any PowerShell script against your Azure Stack VM’s. Read <a target="_blank" href="https://azure.microsoft.com/en-us/documentation/articles/automation-hybrid-runbook-worker/">this</a> if you want to install the HRB role in your Azure Stack environment. The image below shows an Azure Stack VM where the HRB role is enabled:</p>
<blockquote><p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/image348.png"><img width="379" height="343" title="image" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/06/image_thumb245.png" border="0" /></a></p></blockquote>
<p>Using a HRB, you can potentially investigate which Service Management Automation (SMA) runbooks you can leverage using a HBR. Remember that SMA uses PowerShell which is being used in Azure Automation as well. So if you have SMA runbooks like <a target="_blank" href="https://blogs.technet.microsoft.com/privatecloud/2013/08/15/automationservice-management-automation-runbook-spotlightexchange-distribution-list-creation/">these</a> or from the <a target="_blank" href="https://gallery.technet.microsoft.com/site/search?query=sma%20runbook&f%5B0%5D.Value=sma%20runbook&f%5B0%5D.Type=SearchText&ac=4">SMA gallery</a> these can most likely just be copied and re-used in Azure Automation.</p>
<hr />
<h2>Summary</h2>
<p>The most important takeaway from this post is that you should be able to reuse your Windows Azure Pack investments in Desired State Configuration (DSC) in Azure Stack. Your runbooks in Service Management Automation (SMA) can be potentially re-used in Azure Automation, the Hybrid Runbook Worker role might resolve challenges around executing remote runbooks versus executing them locally.</p>
<p>In this post we have talked about:</p>
<ul>
<li>Perform in-guest configurations in WAP and Azure Stack VM’s through DSC</li>
<li>Create your own DSC configuration</li>
<li>Upload your configuration to Azure Automation DSC and compile it</li>
<li>Onboard an existing on-premises VM to Azure Automation DSC and apply a DSC configuration</li>
<li>Install packages with DSC and links to integrate package managers like Chocolately</li>
<li>Leverage the Azure Automation Hybrid Runbook Worker to execute runbooks locally against your Azure Stack environment</li>
</ul>
<p>Happy automating!</p>
<p>Tiander.</p>
]]></content:encoded>
<wfw:commentRss>https://blogs.technet.microsoft.com/privatecloud/2016/06/29/arm-concepts-in-azure-stack-for-the-wap-administrator-in-guest-configuration-with-arm-and-technologies-such-as-virtual-machines-extensions-including-powershell-desired-state-configuration-d/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>Backup & Site Recovery (OMS)</title>
<link>https://blogs.technet.microsoft.com/privatecloud/2016/06/06/backup-site-recovery-oms/</link>
<comments>https://blogs.technet.microsoft.com/privatecloud/2016/06/06/backup-site-recovery-oms/#comments</comments>
<pubDate>Mon, 06 Jun 2016 12:15:11 +0000</pubDate>
<dc:creator><![CDATA[Kristian Nese [MSFT]]]></dc:creator>
<category><![CDATA[Uncategorized]]></category>
<category><![CDATA[ARM]]></category>
<category><![CDATA[Azure]]></category>
<category><![CDATA[Azure Site Recovery]]></category>
<category><![CDATA[JSON]]></category>
<category><![CDATA[Kristian Nese]]></category>
<category><![CDATA[MSOMS]]></category>
<guid isPermaLink="false">https://blogs.technet.microsoft.com/privatecloud/?p=8795</guid>
<description><![CDATA[We have recently announced the GA for our Backup & Site Recovery (OMS) in Azure Resource Manager, and I would like to use this opportunity to level set on what we are bringing, as well as give you some context and a real kick-start into deploying these resources. Context Microsoft Operations Management Suite (OMS) made its... <a href="https://blogs.technet.microsoft.com/privatecloud/2016/06/06/backup-site-recovery-oms/" class="read-more">Read more</a>]]></description>
<content:encoded><![CDATA[<h1></h1>
<p>We have recently announced the GA for our Backup & Site Recovery (OMS) in Azure Resource Manager, and I would like to use this opportunity to level set on what we are bringing, as well as give you some context and a real kick-start into deploying these resources.</p>
<p><strong>Context</strong></p>
<p>Microsoft Operations Management Suite (OMS) made its entry as a <em>Management-as-a-Service </em>offering, delivered entirely from the cloud as a SaaS solution, helping organizations to gain insight into their operations across clouds.</p>
<p>With <em>insight</em>, we got a holistic view of the entire operations from a Windows/Linux point of view, security, identity, malware, updates, configuration changes and much more – regardless of clouds.</p>
<p>This was an important and strategic move for us – knowing that organizations aren’t running entirely from a single datacenter anymore and that the cloud cadence had definitively been forming the landscape and the new demand for management in an entirely new way.</p>
<p>It was about time to reduce the complexity of doing cloud management.</p>
<p>Let us start this blog post by doing a breakdown of Microsoft OMS in the context of Microsoft Azure.</p>
<h3>Microsoft Azure</h3>
<p>First thing first, we need to emphasize that OMS is a constellation of some first-class citizens in Microsoft Azure.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/oms1.jpg"><img class="alignnone size-full wp-image-8805" src="https://msdnshared.blob.core.windows.net/media/2016/06/oms1.jpg" alt="oms1" width="214" height="168" /></a></p>
<p>This is important to know and be aware of, as you will bring this into consideration when you are later planning to deploy OMS into your organization, or behalf of customers if you are a Service Provider.</p>
<p>Microsoft Azure has been undergoing huge changes over the last 14-16 months with the release of Azure Resource Manager (ARM) API – and the <em>new</em> portal (portal.azure.com) that is built upon the new ARM model. For those of you who have been using Azure for a while, you know that the ‘previous’ Azure, also referred to as Service Management API and <em>classic</em> is still there, it is still available, and you can deploy and manage your resources into that model as well.</p>
<p>However, moving forward you will likely focus entirely on Azure in the context of Azure Resource Manager, which also brings consistency ‘down to earth’ with Microsoft Azure Stack.</p>
<p>The reason why I am bringing all this up is to give you a better understanding of where we are coming from and where we are going with OMS in all of this.</p>
<p>OMS is a set of Azure services and during its birth, it was based on the following services in Classic Azure:</p>
<ul>
<li>Operational Insight</li>
<li>Azure Automation</li>
<li>Azure Site Recovery</li>
<li>Azure Backup</li>
</ul>
<p>These were the services you got when you started with OMS.</p>
<p>They would surface into the OMS <em>Workspace</em> and gave you a consolidated view of what was going on.</p>
<p>However, most of the configuration had to take place on the actual resource level in the Azure portal.</p>
<p>In Azure now, they are referred to as:</p>
<ul>
<li>Log Analytics (formerly known as Operational Insight)</li>
<li>Azure Automation (same name, but new capabilities, features and Resource Provider)</li>
<li>Backup and Site Recovery (formerly known as Azure Backup and Azure Site Recovery, are now sharing the same Resource Provider within ARM)</li>
</ul>
<p><strong>What does this really mean?</strong></p>
<p>Since these services has reached ARM, this gives us plenty of more opportunities!</p>
<p>In regards to deployment, operations, management, RBAC and much more, we can leverage ARM templates to literally instantiate whatever we need in Azure.</p>
<p>In other words, we can treat our OMS resources just as any first class citizen in Azure.</p>
<p>Each of these Resource Providers have their unique namespace with different resource types.</p>
<p><strong>Log Analytics: “Microsoft.OperationalInsights/workspaces”</strong></p>
<p><strong>Azure Automation: “Microsoft.Automation/automationAccounts”</strong></p>
<p><strong>Azure Recovery Vault: “Microsoft.RecoveryServices/vaults”</strong></p>
<p>Since they are now within ARM, we can take advantage of built-in RBAC capabilities, Tags, policies, resource locks and much more.</p>
<p>It’s also worth mentioning that OMS will likely pull on other Azure services as well, such as Storage Accounts when you want to enable diagnostics on services and ingest this into Log Analytics for further analysis and research, and also globally or locally redundant storage for backup and replication scenarios.</p>
<h2>Backup and Site Recovery (OMS)</h2>
<p>Historically, there hasn’t been a clear distinguish between backup and disaster recovery for most customers and this has in some situations lead to confusion – while that’s the last thing you need when you are running into a situation where you need to perform either restore or a DR failover.</p>
<p>We want to make this as simple as possible so that you have a one stop solution when you need to manage your backup and recovery scenarios regardless of clouds, locations and workloads with Backup and Site Recovery (OMS).</p>
<p>Let us have a look at the new Resource Provider for Backup and Site Recovery (OMS) within Azure Resource Manager to point out some of the changes we are bringing.</p>
<h2>Deployment</h2>
<p>For deploying Backup and Site Recovery (OMS), you can use your preferred method whether this is through PowerShell cmdlets, ARM templates or the portal directly.</p>
<h3>Portal Experience</h3>
<ol>
<li>Login to <a href="https://portal.azure.com">https://portal.azure.com</a></li>
<li>Click ‘New’ and search for OMS</li>
<li>Select ‘Backup and Site Recovery (OMS)’ and click create</li>
</ol>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/oms2.jpg"><img class="alignnone size-medium wp-image-8806" src="https://msdnshared.blob.core.windows.net/media/2016/06/oms2-201x300.jpg" alt="oms2" width="201" height="300" /></a></p>
<ol start="4">
<li>Assign a name to the resource, select Azure region where you want to create the vault and a Resource Group</li>
</ol>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/oms3.jpg"><img class="alignnone size-medium wp-image-8816" src="https://msdnshared.blob.core.windows.net/media/2016/06/oms3-236x300.jpg" alt="oms3" width="236" height="300" /></a></p>
<p>That’s it! You have now created your Backup and Site Recovery (OMS) vault!</p>
<h3>Azure Resource Manager (ARM) template</h3>
<p>Simply click on this URL and you will be sent to the Azure Portal where you can specify the input parameters:</p>
<p><a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fkrnese%2FAzureDeploy%2Fmaster%2FOMS%2FMSOMS%2FBackupandRecoveryOMS%2Fazuredeploy.json" target="_blank">Deploy to Azure!</a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/oms4.jpg"><img class="alignnone size-medium wp-image-8826" src="https://msdnshared.blob.core.windows.net/media/2016/06/oms4-300x269.jpg" alt="oms4" width="300" height="269" /></a></p>
<h3>PowerShell</h3>
<ol>
<li>Login to your Azure subscription using Login-AzureRmAccount –credential (get-credential)</li>
</ol>
<ol start="2">
<li>Run the following cmdlet to create a new vault in an existing resource group:</li>
</ol>
<p>New-AzureRmRecoveryServicesVault -Name MyRecoveryVault -ResourceGroupName OMSRecovery -Location westeurope -Verbose</p>
<p>Or, you can deploy the template from GitHub using PowerShell:</p>
<p> </p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/oms10.jpg"><img class="alignnone wp-image-8885" src="https://msdnshared.blob.core.windows.net/media/2016/06/oms10-300x126.jpg" alt="oms10" width="417" height="175" /></a></p>
<p>Once deployed, you will be able to use your vault to configure the following scenarios – all from a single pane of glass!</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/oms5.jpg"><img class="alignnone size-medium wp-image-8827" src="https://msdnshared.blob.core.windows.net/media/2016/06/oms5-300x102.jpg" alt="oms5" width="300" height="102" /></a></p>
<p>With Site Recovery as part of the Resource Provider, you can now easily configure and setup your DR scenario(s), whether this is protection of HyperV/VMM environments to Azure or between your own datacenters, or VMware/physical. We have invested in the user experience to make it as simple as possible, where we guide you through the correct workflow depending on the scenario you are configuring for.</p>
<p>When you’re in the portal, you can look under ‘All Settings’ for the ‘Getting Started’ section.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/oms6.jpg"><img class="alignnone size-medium wp-image-8835" src="https://msdnshared.blob.core.windows.net/media/2016/06/oms6-219x300.jpg" alt="oms6" width="219" height="300" /></a></p>
<p>If you click on ‘Site Recovery’, we will ask you the right questions to help you configure your Site Recovery scenario.</p>
<p>Here’s a screenshot that shows the applicable steps for configuring protection of Hyper-V virtual machines on-prem to Azure</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/oms7.jpg"><img class="alignnone size-medium wp-image-8845" src="https://msdnshared.blob.core.windows.net/media/2016/06/oms7-300x173.jpg" alt="oms7" width="300" height="173" /></a></p>
<p>If you select anything different than showed above, the blades will update and reflect those changes so that you are confident to configure it correctly.</p>
<p>For backup scenarios, we are doing exactly the same, asking you where your workload is running and what you want to protect.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/oms8.jpg"><img class="alignnone size-medium wp-image-8855" src="https://msdnshared.blob.core.windows.net/media/2016/06/oms8-300x126.jpg" alt="oms8" width="300" height="126" /></a></p>
<p>Once you have configured your scenarios, you can manage them later from the same location.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/2016/06/oms91.jpg"><img class="alignnone size-full wp-image-8875" src="https://msdnshared.blob.core.windows.net/media/2016/06/oms91.jpg" alt="oms9" width="293" height="182" /></a></p>
<p><strong>Summary</strong></p>
<p>With all the core components of OMS available within Azure Resource Manager, we can now deploy and manage these resources in a declarative way just as we would do with any other resource in Azure.</p>
<p>Since combining both backup and site recovery in the same resource provider, we believe we have made it much simpler to configure and orchestrate the operations to ensure business continuity for our customers, regardless of clouds, locations and workloads.</p>
<p>You now have a one stop solution for all of this – and we encourage you to get started using the examples provided above to see how Backup and Site Recovery (OMS) can help you to an effective solution for your business continuity plans.</p>
<p>Kristian Nese, Senior Program Manager ECG CAT</p>
<p>(Feel free to join the conversation on twitter, by pinging me at @KristianNese )</p>
]]></content:encoded>
<wfw:commentRss>https://blogs.technet.microsoft.com/privatecloud/2016/06/06/backup-site-recovery-oms/feed/</wfw:commentRss>
<slash:comments>4</slash:comments>
</item>
<item>
<title>Part 3: How to configure WDS, Unattend.xml file, Windows PE Image, and Nano Server image to deploy a Nano Server at-a-scale</title>
<link>https://blogs.technet.microsoft.com/privatecloud/2016/05/13/how-to-configure-wds-unattend-xml-file-windows-pe-image-and-nano-server-image-to-deploy-a-nano-server/</link>
<comments>https://blogs.technet.microsoft.com/privatecloud/2016/05/13/how-to-configure-wds-unattend-xml-file-windows-pe-image-and-nano-server-image-to-deploy-a-nano-server/#respond</comments>
<pubDate>Fri, 13 May 2016 13:50:07 +0000</pubDate>
<dc:creator><![CDATA[Anders Ravnholt [MSFT]]]></dc:creator>
<category><![CDATA[Uncategorized]]></category>
<guid isPermaLink="false">https://blogs.technet.microsoft.com/privatecloud/?p=8076</guid>
<description><![CDATA[Over a series of blog posts we will describe a solution for how to deploy Nano Server at scale using Microsoft tools. The blog posts are: Part – 1: Nano Server Domain Join (Deployment-at-a-scale an introduction) Part – 2: How to build a Windows PE and Nano Server image to deploy Nano Server at-a-scale Part... <a href="https://blogs.technet.microsoft.com/privatecloud/2016/05/13/how-to-configure-wds-unattend-xml-file-windows-pe-image-and-nano-server-image-to-deploy-a-nano-server/" class="read-more">Read more</a>]]></description>
<content:encoded><![CDATA[<p>Over a series of blog posts we will describe a solution for how to deploy Nano Server at scale using Microsoft tools. The blog posts are:
</p>
<ul>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/05/02/nano-server-domain-join-deployment-at-a-scale-part-1-introduction/">Part – 1: Nano Server Domain Join (Deployment-at-a-scale an introduction)</a>
</li>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/05/04/part-2-how-to-build-a-windows-pe-and-nano-server-image-to-deploy-nano-server-at-scale/">Part – 2: How to build a Windows PE and Nano Server image to deploy Nano Server at-a-scale</a>
</li>
<li><strong>Part – 3: How to configure WDS, Unattend.xml file, Windows PE Image, and Nano Server image to deploy a Nano Server at-a-scale (This blog post)<br />
</strong></li>
<li>Part – 4: Bare Metal Deployment (BMD) Considerations
</li>
</ul>
<p>In the previous blog post (<a href="https://blogs.technet.microsoft.com/privatecloud/2016/05/04/part-2-how-to-build-a-windows-pe-and-nano-server-image-to-deploy-nano-server-at-scale/">here</a>) we discussed how to build a Windows PE and Nano Server image to deploy Nano Server. In this blog post we will discuss how to configure WDS, Unattend.xml file, WINPE Image, and Nano Server image to deploy Nano Server at-a-scale.
</p>
<p>The high level tasks in this blog post will be:
</p>
<ul>
<li>Pre-requisites for the solution
</li>
<li>Configuring WDS server
</li>
<li>Import Windows PE Image
</li>
<li>Import Nano Server Image
</li>
<li>Configure Unattend.xml file within WDS
</li>
<li>Deploy Nano Server using a Gen2 VM with input (Example 1).
</li>
<li>Deploy Nano Server using a Gen2 VM without input (Example 2).
</li>
<li>Next Step
</li>
</ul>
<p>
</p>
<p><strong>Pre-requisites for the solution:<br />
</strong></p>
<p>The following <strong>Pre-requisites</strong> are needed in order to deploy Nano Server and join it to a domain:
</p>
<ol>
<li>AD domain
</li>
<li>DHCP Server with IP scope which the VM or physical server can lease an IP address from
</li>
<li>WDS Server (Domain joined)
</li>
<li>Modified WinPE Image (<a href="https://blogs.technet.microsoft.com/privatecloud/2016/05/04/part-2-how-to-build-a-windows-pe-and-nano-server-image-to-deploy-nano-server-at-scale/">as created in the previous blog post</a>)
</li>
<li>Nano WIM / VHD / VHDX Image (<a href="https://blogs.technet.microsoft.com/privatecloud/2016/05/04/part-2-how-to-build-a-windows-pe-and-nano-server-image-to-deploy-nano-server-at-scale/">as created in the previous blog post)</a>
</li>
<li>Domain account(s) to create the AD computer object and authenticate with WDS server.
</li>
<li>Hyper-V server with two Gen2 VMs connected to same network as WDS server (used as examples in this blog post to simulate a physical UEFI Server)).
</li>
</ol>
<p>Please verify that these pre-requisites are available before starting the configuration of the WDS server.
</p>
<p>In this blog post we’ll be using two examples for the deployment of Nano Server and joining it to the domain.
</p>
<p><strong>Example 1</strong>: Use a simple unattend file to deploy Nano Server and provide all needed information manually during the process (<a href="https://1drv.ms/v/s!Am8Gg73bSTCtquoDNPEHRG3-hODPNA">Video</a>).
</p>
<p><strong>Example 2</strong>: Store all information in the Unattend file and provide no information during the installation (<a href="https://1drv.ms/v/s!Am8Gg73bSTCtquoDNPEHRG3-hODPNA">Video</a>)
</p>
<p><strong>Configuring Windows Deployment Server<br />
</strong></p>
<ol>
<li>Login as an administrator on the WDS Server
</li>
<li>Start <strong>Server Manager</strong> > <strong>Click Tools</strong> > <strong>Windows Deployment Services</strong>
</li>
<li>Select the WDS Server that should be used for Nano Server Deployment.
</li>
<li>Right click on WDS server and select <strong>Add Image Group</strong>
</li>
<li>Name the Image Group e.g. WIM and click <strong>Ok</strong>
</li>
</ol>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0635_Part3Howto1.png" alt="" />
</p>
<p><strong>Import WinPEImage<br />
</strong></p>
<ol>
<li>Copy the Windows PE Image (that was created earlier) to the WDS server (if it was made on another server) to a folder on the WDS server e.g. C:\WinPEImage\media\sources\boot.wim
</li>
<li>Browse to the location where you copied the Windows PE Image e.g. C:\WinPEImage\media\sources\boot.wim
</li>
<li>Click<strong> Open</strong> and click <strong>Next</strong>
</li>
<li>Give an Image Name and image description and click <strong>Next</strong> e.g. WinPEBoot
</li>
<li>Click <strong>Next</strong>
</li>
<li>Verify that the WinPE WIM Image imports successfully with a message saying: “<strong>The selected images were successfully added to the server</strong>” and click <strong>Finish</strong>.
</li>
</ol>
<p>
</p>
<p><strong>Import Nano Server WIM image<br />
</strong></p>
<ol>
<li>Copy the Nano WIM Image (that was created earlier) to the WDS server (if it was made on another server) to a folder on the WDS server e.g. C:\WinPEImage\NanoServer
</li>
<li>Right click on Install Group created earlier and select <strong>Add Install Image</strong>.
</li>
<li>Browse to the location where you placed the Nano WIM Image e.g. C:\WinPEImage\NanoServer
</li>
<li>Click Open and click next
</li>
<li>Give an Image Name and image description and click next e.g. Windows Server 2016 Nano TP5
</li>
<li>Click Next
</li>
<li>Verify that the Nano Server WIM Image imports successfully with a message saying “The selected images were successfully added to the server” and click Finish.
</li>
</ol>
<p>
</p>
<p><strong>Creating Unattend.xml files<br />
</strong></p>
<p>The solution uses unattend files to install Nano Server using WDS. The unattend file holds information that is needed to deploy the Nano Server such as disk partitioning, user name to authenticate with WDS as well as domain join user and Server Name.
</p>
<p>The solution allows you to decide how much information you would like to capture in the unattend file. For the information that is not specified in the unattend file, WDS / PowerShell script will prompt for the needed information.
</p>
<p>In the unattend file examples provided we are using US as default language and partitioning the disk as default as well. To change this please reference to the unattend link below.
</p>
<p>For more information on unattend files (click <a href="https://technet.microsoft.com/da-DK/library/c026170e-40ef-4191-98dd-0b9835bfa580">here</a>)
</p>
<p><strong>Creating an unattend file that asks for information.<br />
</strong></p>
<p>The first unattend file is the simplest one. To obtain the unattend file do the following.
</p>
<ol>
<li>Go to GitHub project: <a href="https://github.com/uday31in/Nano/tree/master/WinPENanoDomainJoin">WinPENanoDomainJoin</a>
</li>
<li>Download the following two files and save them to c:\WinPEImage
</li>
</ol>
<ul style="margin-left: 54pt">
<li><a href="https://github.com/uday31in/Nano/blob/master/WinPENanoDomainJoin/Gen2NoCredential.xml" title="Gen2NoCredential.xml"><span style="color:#4078c0;font-family:Helvetica;font-size:10pt">Gen2NoCredential.xml</span></a>
</li>
<li><a href="https://github.com/uday31in/Nano/blob/master/WinPENanoDomainJoin/Gen2WithCredential.xml" title="Gen2WithCredential.xml"><span style="color:#4078c0;font-family:Helvetica;font-size:10pt">Gen2WithCredential.xml</span></a>
</li>
</ul>
<ol>
<li>Open Gen2NoCredential.xml with a xml editor
</li>
<li>Go to the following section:
</li>
</ol>
<p>
<img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0635_Part3Howto2.png" alt="" />
</p>
<ol>
<li>Replace Domain, User Name and Password with a user that can authenticate with WDS Domain Server.
</li>
<li>Save the file in the WDS Remote Install directory e.g. D:\RemoteInstall
</li>
</ol>
<p>
</p>
<p><strong>Creating an unattend file that as all information in the unattend file.<br />
</strong></p>
<ol>
<li>Open Gen2WithCredential.xml with a xml editor
</li>
<li>Go to the following section:
</li>
</ol>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0635_Part3Howto3.png" alt="" />
</p>
<p style="margin-left: 36pt">This session is authentication WDS with a Domain user that is known by WDS.
</p>
<ol>
<li>Replace Domain, User Name and Password with a user that can authenticate with WDS Domain Server.
</li>
<li>
<div>Go to the following section
</div>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0635_Part3Howto4.png" alt="" />
</p>
<p>This section specifies which WIM file and Image group and Image Name that should be used for deployment
</p>
</li>
<li>Replace: Filename, ImageGroup and ImageName with the one configured in WDS in step “Configuring Windows Deployment Server”.
</li>
<li>Go to the following section
</li>
</ol>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0635_Part3Howto5.png" alt="" />
</p>
<p style="margin-left: 36pt">This section specifies the computer name of the Nano Server
</p>
<ol>
<li>Replace the computer name with one you would like to use for deployment.
</li>
<li>Save the file in the WDS Remote Install directory e.g. D:\RemoteInstall
</li>
</ol>
<p><strong>Configure Unattend file with WDS (Example 1 NoCredentials)<br />
</strong></p>
<ol>
<li>Open WDS console
</li>
<li>Right click on the WDS server used for Nano Deployment and select <strong>Properties</strong>.
</li>
<li>Select <strong>Client</strong> in the Tab
</li>
<li>Enable unattend installation
</li>
<li>Click on <strong>x64 (UEFI) architecture</strong>
</li>
<li>Click <strong>browse</strong> and go to the location where the first unattend file was saved (<a href="https://github.com/uday31in/Nano/blob/master/WinPENanoDomainJoin/Gen2NoCredential.xml" title="Gen2NoCredential.xml"><span style="color:#4078c0;font-family:Helvetica;font-size:10pt">Gen2NoCredential.xml</span></a><span style="color:#4078c0;font-family:Helvetica;font-size:10pt">)</span>.
</li>
<li>
<div>Check “<strong>Do not join the client to a domain after an Installation</strong>”
</div>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0635_Part3Howto6.png" alt="" />
</p>
</li>
<li>Click Ok
</li>
</ol>
<p><strong>Deploy Nano Server using a Gen2 VM with input (Example 1).<br />
</strong></p>
<ol>
<li>Open Hyper-V console on a Hyper-V server connected to the same network as WDS Server
</li>
<li>Create a Gen2 VM and connect the VM to the same network as WDS Server
</li>
<li>Verify that the VM is set to boot from the network adapter connected to the network where the WDS Server
</li>
<li>Start the VM
</li>
<li>Select the Nano Server image created earlier e.g. Windows Server 2016 Nano TP5 and click next
</li>
</ol>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0635_Part3Howto7.png" alt="" />
</p>
<ol>
<li>Select the partition and click next.
</li>
</ol>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0635_Part3Howto8.png" alt="" />
</p>
<ol>
<li>Wait for the server to install
</li>
</ol>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0635_Part3Howto9.png" alt="" />
</p>
<ol>
<li>
<div>Provide User and Password for Domain user that is going to join the Server to the domain
</div>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0635_Part3Howto10.png" alt="" />
</p>
</li>
<li>
<div>Provide Computer Name e.g. Nano5 and press Enter
</div>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0635_Part3Howto11.png" alt="" />
</p>
</li>
<li>
<div>Login with the user specified for Domain join e.g. fabric\administrator
</div>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0635_Part3Howto12.png" alt="" />
</p>
</li>
<li>
<div>Check that Nano Server is joined to the domain and computer Name is right.
</div>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0635_Part3Howto13.png" alt="" />
</p>
</li>
</ol>
<p><strong>Configure Unattend file with WDS (Example 2 With Credentials)<br />
</strong></p>
<ol>
<li>Open WDS console
</li>
<li>Right click on the WDS server used for Nano Deployment and select <strong>Properties</strong>.
</li>
<li>Select <strong>Client</strong> in the Tab
</li>
<li>Enable unattend installation
</li>
<li>Click on <strong>x64 (UEFI) architecture</strong>
</li>
<li>Click <strong>browse</strong> and go to the location where the first unattend file was saved (<a href="https://github.com/uday31in/Nano/blob/master/WinPENanoDomainJoin/Gen2NoCredential.xml" title="Gen2NoCredential.xml"><span style="color:#4078c0;font-family:Helvetica;font-size:10pt">Gen2NoCredential.xml</span></a><span style="color:#4078c0;font-family:Helvetica;font-size:10pt">)</span>.
</li>
<li>
<div>Check “<strong>Do not join the client to a domain after an Installation</strong>”
</div>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0635_Part3Howto14.png" alt="" />
</p>
</li>
<li>Click <strong>Ok</strong>
</li>
</ol>
<p><strong>Deploy Nano Server using a Gen2 VM without input (Example 2).<br />
</strong></p>
<ol>
<li>Open Hyper-V console on a Hyper-V server connected to the same network as WDS Server
</li>
<li>Create a Gen2 VM and connect the VM to the same network as WDS Server or use the VM from example 1
</li>
<li>Verify that the VM is set to boot from the network adapter connected to the network where the WDS Server
</li>
<li>
<div>Start the VM
</div>
<p>Note: If the VM does not download the WinPE image disabling secure boot might help. This is mostly if a WindowsPE image is used from a beta release of Windows Server.
</p>
</li>
<li>Verify that no questions are asked and deployment and install of Nano Server happens automatically.
</li>
<li>
<div>Login with the user specified for Domain join in the unattend file e.g. fabric\administrator
</div>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0635_Part3Howto15.png" alt="" />
</p>
</li>
<li>
<div>Check that Nano Server is joined to the domain and Computer Name is right.
</div>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0635_Part3Howto16.png" alt="" />
</p>
</li>
</ol>
<p><strong>Next Steps<br />
</strong></p>
<p>The Nano Server team hopes you have found the series of blog posts helpful in your process of deploying Nano Server at-a-scale.
</p>
<p>Please don’t forget to share your feedback with us via the comments section below or using the <a href="http://windowsserver.uservoice.com/forums/295068-nano-server">User Voice forum</a>!
</p>
<p>Regards
</p>
<p>Nano Server Team</p>
]]></content:encoded>
<wfw:commentRss>https://blogs.technet.microsoft.com/privatecloud/2016/05/13/how-to-configure-wds-unattend-xml-file-windows-pe-image-and-nano-server-image-to-deploy-a-nano-server/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>Part 2: How to build a Windows PE and Nano Server image to deploy Nano Server at scale</title>
<link>https://blogs.technet.microsoft.com/privatecloud/2016/05/04/part-2-how-to-build-a-windows-pe-and-nano-server-image-to-deploy-nano-server-at-scale/</link>
<comments>https://blogs.technet.microsoft.com/privatecloud/2016/05/04/part-2-how-to-build-a-windows-pe-and-nano-server-image-to-deploy-nano-server-at-scale/#respond</comments>
<pubDate>Wed, 04 May 2016 12:49:56 +0000</pubDate>
<dc:creator><![CDATA[Anders Ravnholt [MSFT]]]></dc:creator>
<category><![CDATA[Uncategorized]]></category>
<guid isPermaLink="false">https://blogs.technet.microsoft.com/privatecloud/?p=7895</guid>
<description><![CDATA[Over a series of blog posts we will describe a solution for how to deploy Nano Server at scale using Microsoft tools. The blog post series are: Part – 1: Nano Server Domain Join – Introduction Part – 2: How to build a Windows PE and Nano Server image to deploy Nano Server at scale... <a href="https://blogs.technet.microsoft.com/privatecloud/2016/05/04/part-2-how-to-build-a-windows-pe-and-nano-server-image-to-deploy-nano-server-at-scale/" class="read-more">Read more</a>]]></description>
<content:encoded><![CDATA[<p>Over a series of blog posts we will describe a solution for how to deploy Nano Server at scale using Microsoft tools. The blog post series are:
</p>
<ul>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/05/02/nano-server-domain-join-deployment-at-a-scale-part-1-introduction/">Part – 1: Nano Server Domain Join – Introduction</a>
</li>
<li><strong>Part – 2: How to build a Windows PE and Nano Server image to deploy Nano Server at scale (This blog post)</strong>
</li>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/05/13/how-to-configure-wds-unattend-xml-file-windows-pe-image-and-nano-server-image-to-deploy-a-nano-server/">Part – 3: How to configure WDS, Unattend.xml file, Windows PE Image, and Nano Server image to deploy a Nano Server at-a-scale</a>
</li>
<li>Part – 4: Bare Metal Deployment (BMD) Consideration
</li>
</ul>
<p>In this blog post we will explain how to build Windows Pre-installation Environment (Windows PE) and Nano Server WIM images to provision Nano Server for deployment at scale. Windows PE allows you to add optional components to the image, which will enable more advanced scenarios than what is available by default. Following the creation of the Windows PE Image, we will create a Nano Server WIM image with the needed components and configuration to run on a virtual or physical server in a datacenter.
</p>
<p>For general Nano Server deployment steps, see the Nano Server Deployment Guide: <a href="https://aka.ms/NanoServer">https://aka.ms/NanoServer</a>
</p>
<p>
</p>
<p>The high level tasks in this blog post are:
</p>
<ul>
<li><strong>Steps to build a Windows PE Image<br />
</strong></li>
<li><strong>Steps to build a Nano Server WIM Image<br />
</strong></li>
<li><strong>Next steps<br />
</strong></li>
</ul>
<p>
</p>
<p>
</p>
<p><span style="font-size:12pt"><strong>Steps to build a Windows PE Image:<br />
</strong></span></p>
<p>To build a Windows PE image please follow these steps:<strong><br />
</strong></p>
<ul>
<li>Download and install the Windows Assessment and Deployment Kit (Windows ADK) for Windows 10 with Windows PE tools
</li>
<li>Add the required optional components to the Windows PE image for this scenario
</li>
<li>Create a batch file for the Windows PE Image
</li>
<li>Add PowerShell file to the Windows PE image
</li>
<li>Add configuration files to the Windows PE image
</li>
<li>
<div>Unmount the Windows PE image and create media
</div>
<p style="margin-left: 18pt">
</p>
</li>
</ul>
<p><strong>Download and install Windows Assessment and Deployment Kit with Windows PE tools<br />
</strong></p>
<p style="margin-left: 18pt">The Windows ADK is a collection of tools and documentation that can be used to customize, assess, and deploy Windows operating systems to new computers. The Windows ADK enables two key scenarios: Windows deployment and Windows assessment. For this solution we are using the Windows PE sub component which is a minimal operating system designed to prepare a computer for installation and servicing of Windows. To install Windows PE please do the following:
</p>
<ol style="margin-left: 54pt">
<li>Download the Windows ADK for Windows 10 from here <a href="https://msdn.microsoft.com/en-us/windows/hardware/dn913721.aspx">https://msdn.microsoft.com/en-us/windows/hardware/dn913721.aspx</a>
</li>
<li>Run adksetup.exe
</li>
<li>Click install ADK
</li>
<li>Read license agreement and accept if in agreement.
</li>
<li>
<div>Select the following features
</div>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0646_Part2Howto1.png" alt="" />
</p>
</li>
<li>Click Install
</li>
<li>Once the wizard has installed with the selected components, click Start, and type deployment. Right-click <strong>Deployment and Imaging Tools Environment</strong> and then select Run as administrator
</li>
<li>
<div>To create a fresh WinPE image repository in <span style="color:black">C:\ do the following</span>
</div>
<p>Type <span style="color:black">copype amd64 C:\WinPEImage</span>
</p>
<p>
</p>
</li>
</ol>
<p><strong>Add the required optional components into Windows PE image for this scenario<br />
</strong></p>
<p style="margin-left: 18pt">By default, the Windows PE images does not have support for PowerShell, DISM and Disk configuration, all of which are required by the solution to configure Nano Server during provisioning described in this blog post series. To enable these features you need to add these optional packages to the Windows PE image using DISM: <em>WinPE-WMI, WinPE-NetFx, WinPE-Scripting, WinPE-PowerShell, WinPE-DismCmdlets, WinPE-SecureBootCmdlets, WinPE-StorageWMI, WinPE-WDS-Tools, WinPE-Setup, WinPE-Setup-Client.</em>ing. To add the optional components into the Windows PE image please do the following:
</p>
<ol style="margin-left: 54pt">
<li>
<div>Mount the Windows PE image running this command line:
</div>
<p>Dism /Mount-Image /ImageFile:”C:\WinPEImage\media\sources\boot.wim” /index:1 /MountDir:”C:\WinPEImage\mount”
</p>
</li>
<li>Open a browser and go to <a href="https://github.com/uday31in/Nano/tree/master/WinPENanoDomainJoin">https://github.com/uday31in/Nano/tree/master/WinPENanoDomainJoin</a>
</li>
<li>Download DISMWinPEInst.ps1<span style="color:#333333;font-family:Helvetica;font-size:10pt"><br />
</span>and save it as a file in C:\WinPEImage
</li>
<li>Run DISMWinPEInst.ps1 from an elevated PowerShell prompt
</li>
<li>
<div>Verify that all packages are installed correctly going through the output list of installed components and check that the components mentioned above have been installed.
</div>
<p>
</p>
</li>
</ol>
<p><strong>Add configuration files into the Windows PE image<br />
</strong></p>
<p style="margin-left: 18pt">In addition to the components added to the Windows PE image we need to modify the wpeinit file, create a boot.cmd and WinPENanoDomainJoin.ps1 file which will be launched as part of the Nano Server image deployment.
</p>
<p style="margin-left: 18pt">The role of the files being added are the following:
</p>
<ul style="margin-left: 54pt">
<li>
<div><strong>Wpeinit.ini<br />
</strong></div>
<p>By adding this file to the image you can specify which script Windows PE will execute as part of the boot process
</p>
</li>
<li>
<div><strong>Boot.cmd<br />
</strong></div>
<p>This file will execute the PowerShell script as Windows PE cannot execute PowerShell natively from Wpeinit.ini.
</p>
</li>
<li>
<div><strong>WinPENanoDomainJoin.ps1<br />
</strong></div>
<p>This file contains the PowerShell script that will add Nano Server to the domain and automate the deployment.
</p>
</li>
</ul>
<p><strong>Create the WinPENanoDomainJoin.ps1 PowerShell script<br />
</strong></p>
<p style="margin-left: 18pt">This script is stored on <a href="https://github.com/uday31in/Nano/tree/master/WinPENanoDomainJoin">GitHub</a> for easy access and reference as a sample script. The script should be downloaded and added to the Windows PE image and will be run after the Nano Server WIM file is installed to the physical or virtual server. The script will generate a domain blob and inject this into the Nano Server image using the parameters given by the unattend.xml or manually provided by the administrator during install.
</p>
<ul style="margin-left: 54pt">
<li>Open a browser and go to <a href="https://github.com/uday31in/Nano/tree/master/WinPENanoDomainJoin">https://github.com/uday31in/Nano/tree/master/WinPENanoDomainJoin</a>
</li>
<li>Download <a href="https://github.com/uday31in/Nano/blob/master/WinPENanoDomainJoin/WinPENanoDomainJoin.ps1" title="WinPENanoDomainJoin.ps1"><span style="color:#4078c0;font-family:Helvetica;font-size:10pt">WinPENanoDomainJoin.ps1</span></a><span style="color:#333333;font-family:Helvetica;font-size:10pt"> and save in C:\WinPEImage</span>
</li>
<li>Copy C:\WinPEImage\WinPENanoDomainJoin.ps1 C:\WinPEImage\mount\
</li>
</ul>
<p>
</p>
<p style="margin-left: 18pt"><strong>Create boot.cmd to launch WinPENanoDomainJoin.ps1</strong>
</p>
<p style="margin-left: 18pt">The boot.cmd file is used to execute the WDS setup and following this launch the WinPENanoDomainJoin.ps1 script. To create the WinPENanoDomainJoin.ps do the following:
</p>
<ul style="margin-left: 54pt">
<li>Open Notepad
</li>
<li>
<div>Add the following lines and save as boot.cmd in C:\WinPEImage\
</div>
<p style="background: #d0cece">x:\sources\setup /wds /noreboot
</p>
<p style="background: #d0cece">cd %~dp0%
</p>
<p style="background: #d0cece">x:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -File WinPENanoDomainJoin.ps1
</p>
</li>
<li>Copy C:\WinPEImage\Boot.cmd C:\WinPEImage\mount\
</li>
</ul>
<p>
</p>
<p style="margin-left: 18pt"><strong>Create Winpeshl.ini to launch boot.cmd<br />
</strong></p>
<p style="margin-left: 18pt">Winpeshl.ini controls whether a customized shell is loaded in Windows PE instead of the default Command Prompt window. To load a customized shell, create a file named Winpeshl.ini and place it in %SYSTEMROOT%\System32 of your customized Windows PE image. To do this do the following:<strong><br />
</strong></p>
<ul style="margin-left: 54pt">
<li>Start a command prompt
</li>
<li>Run Notepad C:\WinPEImage\mount\Windows\System32\Winpeshl.ini
</li>
<li>
<div>Insert the following lines and save the file
</div>
<p style="background: #d0cece">[LaunchApp]
</p>
<p style="background: #d0cece">AppPath = x:\boot.cmd
</p>
</li>
<li>
<div>Save the file
</div>
<p>
</p>
</li>
</ul>
<p><strong>Create lang.ini to set install language<br />
</strong></p>
<p style="margin-left: 18pt">The lang.ini will set the language used during the installation in the GUI. In this blog post we will use English US as the UI language.
</p>
<ol style="margin-left: 54pt">
<li>Start a command prompt
</li>
<li>Run Notepad C:\WinPEImage\mount\sources\lang.ini
</li>
<li>
<div>Insert the following lines and save the file
</div>
<p style="background: #d0cece">[Available UI Languages]
</p>
<p style="background: #d0cece">en-US = 3
</p>
<p style="background: #d0cece">[Fallback Languages]
</p>
<p style="background: #d0cece">en-US = en-us
</p>
<p>
</p>
</li>
</ol>
<p><strong>Save changes made to the wim file and unmount the image.<br />
</strong></p>
<p style="margin-left: 18pt">To save all the changes made to the Windows PE image do the following.
</p>
<ul style="margin-left: 54pt">
<li>Start a command prompt as administrator
</li>
<li>Run: Dism /Unmount-Image /MountDir:”C:\WinPEImage\mount” /commit
</li>
</ul>
<p>
</p>
<p>
</p>
<p><strong><span style="font-size:12pt">Steps to build a Nano Server Image:</span><br />
</strong></p>
<p>This section will explain how to build a Nano server WMI image to be deployed via WDS. This will be split into two options, physical hardware and virtual machines. To create this image, we are using standard OEM drivers for physical servers and using virtual drivers for virtual WIM image. If special drivers are needed these can be added as part of creating the WIM image which is explained here: <a href="https://aka.ms/nanoserver">https://aka.ms/nanoserver</a> . It is also possible to create VHD and VHDX files following the same concept and import these into WDS. This will not be part of this blog post but is explained <a href="https://aka.ms/nanoserver">here</a>.
</p>
<p>
</p>
<p style="margin-left: 18pt"><strong>Download the latest Windows Server 2016 image and load NanoServerImageGenerator PowerShell module<br />
</strong></p>
<ol style="margin-left: 54pt">
<li>Download the latest Windows Server 2016 build from here: <a href="https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-technical-preview">https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-technical-preview</a>
</li>
<li>Mount the image as a drive by right clicking on the ISO file and select mount
</li>
<li>Copy <em>NanoServerImageGenerator</em> folder from the \NanoServer folder in the Windows Server Technical Preview ISO to a folder on your hard drive
</li>
<li>Start Windows PowerShell as an administrator, change directory to the folder where you have placed the NanoServerImageGenerator folder and then import the module with <span style="font-family:Courier New;font-size:10pt">Import-Module .\NanoServerImageGenerator -Verbose</span>
</li>
</ol>
<p>
</p>
<p style="margin-left: 36pt"><strong>Nano Server in a virtual machine<br />
</strong></p>
<p style="margin-left: 36pt">In this section we’ll describe how to create the Nano Server WIM file to be used with virtual machines. Create a WIM for the Datacenter edition that includes the following features: Failover Clustering, Scale-out File Server and the Hyper-V guest drivers. Also enable Remote Management by running the following command which will prompt you for an administrator password for the new WIM file.
</p>
<p style="margin-left: 36pt"><span style="font-family:Courier New;font-size:10pt">New-NanoServerImage -Edition Datacenter -DeploymentType Guest -Clustering -Storage -EnableRemoteManagementPort -MediaPath <path to root of media> -BasePath .\Base -TargetPath .\NanoServerVM\<WMI File Name>.WIM<br />
</span></p>
<p style="margin-left: 36pt"><span style="font-family:Courier New;font-size:10pt">Example:<br />
</span></p>
<p style="margin-left: 36pt"><span style="font-family:Courier New;font-size:10pt">New-NanoServerImage -Edition Datacenter -DeploymentType Guest -Clustering -Storage -EnableRemoteManagementPort -MediaPath E:\ -BasePath .\Base -TargetPath .\NanoServerVM\NanoServerVM.WIM</span>
</p>
<p style="margin-left: 36pt"><strong>Nano Server on a physical computer<br />
</strong></p>
<p style="margin-left: 36pt">This section describes how to create the Nano Server WIM file to be used with physical hardware using the pre-installed device drivers. If your hardware requires a driver that is not already provided in order to boot or connect to a network, follow the steps <a href="https://aka.ms/nanoserver">here</a>. Create a WIM that includes the OEM drivers, Hyper-V, Scale-out File Server, Failover Clustering features and enable Remote Management by running the following command which will prompt you for an administrator password for the new WIM.
</p>
<p style="margin-left: 36pt"><span style="font-family:Courier New;font-size:10pt">New-NanoServerImage -Edition Datacenter -DeploymentType Host -MediaPath <path to root of media> -BasePath .\Base -TargetPath .\NanoServerPhysical\NanoServer.WIM -OEMDrivers -Compute –Clustering –Storage -EnableRemoteManagementPort<br />
</span></p>
<p style="margin-left: 36pt"><span style="font-family:Courier New;font-size:10pt">Example:<br />
</span></p>
<p style="margin-left: 36pt"><span style="font-family:Courier New;font-size:10pt">New-NanoServerImage -Edition Datacenter -DeploymentType Host -MediaPath E:\ -BasePath .\Base -TargetPath .\NanoServerPhysical\NanoServer.WIM -OEMDrivers -Compute –Clustering –Storage -EnableRemoteManagementPort</span>
</p>
<p>
</p>
<p>
</p>
<p><span style="font-size:12pt"><strong>Next steps<br />
</strong></span></p>
<p>In the next blog post we will configure Windows Deployment Server (WDS) with the newly created Windows PE and Nano Server WIM images. Then, we will configure two different unattend.xml files with input parameters required during the installation of Nano Server. Lastly we will provision a Nano Server using WDS and a VM running on Hyper-V.
</p>
<p>Following this blog post we will release two more blogs posts:
</p>
<ul>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/05/13/how-to-configure-wds-unattend-xml-file-windows-pe-image-and-nano-server-image-to-deploy-a-nano-server/">Part – 3: How to configure WDS, Unattend.xml file, Windows PE Image, and Nano Server image to deploy a Nano Server at-a-scale</a>
</li>
<li>Part – 4: Bare Metal Deployment (BMD) Considerations
</li>
</ul>
<p>That’s it for now. Please don’t forget to share your feedback with us via the comments section below or using the <a href="http://windowsserver.uservoice.com/forums/295068-nano-server">User Voice forum</a>!
</p>
<p>Regards
</p>
<p>The Nano Server Team</p>
]]></content:encoded>
<wfw:commentRss>https://blogs.technet.microsoft.com/privatecloud/2016/05/04/part-2-how-to-build-a-windows-pe-and-nano-server-image-to-deploy-nano-server-at-scale/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
<item>
<title>Part 1: Nano Server Domain Join (Deployment-at-a-scale an introduction)</title>
<link>https://blogs.technet.microsoft.com/privatecloud/2016/05/02/nano-server-domain-join-deployment-at-a-scale-part-1-introduction/</link>
<comments>https://blogs.technet.microsoft.com/privatecloud/2016/05/02/nano-server-domain-join-deployment-at-a-scale-part-1-introduction/#respond</comments>
<pubDate>Mon, 02 May 2016 14:31:55 +0000</pubDate>
<dc:creator><![CDATA[Anders Ravnholt [MSFT]]]></dc:creator>
<category><![CDATA[Uncategorized]]></category>
<category><![CDATA[Cloud Computing]]></category>
<category><![CDATA[Deployment]]></category>
<category><![CDATA[Modern Datacenter]]></category>
<category><![CDATA[Windows Server]]></category>
<guid isPermaLink="false">https://blogs.technet.microsoft.com/privatecloud/?p=7855</guid>
<description><![CDATA[Over a series of blog posts we will describe a solution for how to deploy Nano Server at scale using Microsoft tools. The blog posts are: Part – 1: Nano Server Domain Join (Deployment-at-a-scale an introduction) (This blog post) Part – 2: How to build a Windows PE and Nano Server image to deploy Nano... <a href="https://blogs.technet.microsoft.com/privatecloud/2016/05/02/nano-server-domain-join-deployment-at-a-scale-part-1-introduction/" class="read-more">Read more</a>]]></description>
<content:encoded><![CDATA[<p>Over a series of blog posts we will describe a solution for how to deploy Nano Server at scale using Microsoft tools. The blog posts are:</p>
<ul>
<li><strong>Part – 1: Nano Server Domain Join (Deployment-at-a-scale an introduction) (This blog post)<br />
</strong></li>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/05/04/part-2-how-to-build-a-windows-pe-and-nano-server-image-to-deploy-nano-server-at-scale/">Part – 2: How to build a Windows PE and Nano Server image to deploy Nano Server-at-a-scale</a></li>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/05/13/how-to-configure-wds-unattend-xml-file-windows-pe-image-and-nano-server-image-to-deploy-a-nano-server/">Part – 3: How to configure WDS, Unattend.xml file, Windows PE Image, and Nano Server image to deploy a Nano Server at-a-scale</a></li>
<li>Part – 4: Bare Metal Deployment (BMD) Considerations</li>
</ul>
<p><strong>Introduction<br />
</strong></p>
<p style="text-align: justify">As we are in the final leg of Windows Server 2016 development, many of you are already planning to deploy Nano Server in your organization at a large scale. For those of you who are evaluating Windows Server 2016 and Nano Server and have provided feedback, a huge THANK YOU. We are listening closely to your comments and have been actively making changes based on your input. Today’s topic is a great example.</p>
<p style="text-align: justify"><strong>Nano Server<br />
</strong></p>
<p style="text-align: justify">When deploying at scale, we see that most deployments are in clusters with homogeneous hardware such as a rack or two of servers configured with identical hardware configurations. In this case, we want to focus on providing a highly optimized and standardized, minimal footprint image that can be deployed and managed at scale. That’s where Nano Server comes in.</p>
<p>Nano Server is “Just-enough-OS” and provides the optimal choice to run in your datacenters and private cloud for Compute, Storage, DNS, Web and Containers workload to name a few. Nano Server is provided on the Windows Server 2016 media, but is not part of the Setup experience like you may be used to seeing with the other two options: “Server with Desktop Experience” or “Server Core”. Instead, Nano Server uses image based deployment and requires you to create an image for your configuration in order to deploy it (see <a href="https://aka.ms/nanoserver">https://aka.ms/nanoserver</a> for instructions).</p>
<p>In many scenarios, you might want to join Nano Server to your Active Directory domain for authentication or because your workload requires it such as Clustering. Nano Server is refactored from the ground-up to provide a minimal base OS footprint and thus Nano Server does not have the capability to do online domain join at the time of deployment which is typically used by most deployment/provisioning system like: Windows Deployment Services (WDS), Microsoft Deployment Toolkit (MDT) or System Center Configuration Manager (SCCM). For Nano Server, domain join is an offline process.</p>
<p>Since offline domain join may be new to some of you, there are some important considerations for this process. For Nano Server to join a domain offline, this involves creating a domain blob and applying the blob to an instance of Nano Server. The offline domain blob is a high privileged asset representing machine identity on the network and is important to safeguard. While these domain blobs are used one time only, you should secure these domain blobs (typically stored on a file share) and applying auditing and access control policies. When deploying generic images across datacenters, security and access control has an additional challenge because either:</p>
<ul>
<li>the generic image lacks security context to use for domain join, or</li>
<li>you have to explicitly specify a domain credential that can be used for domain join and ensure it is not stored in plain text</li>
</ul>
<p>Thus, when using offline domain join, you must use a security credential to read the offline domain blob from your network.</p>
<p>As with any online domain join operation, using offline domain join post deployment on Nano Server, a full reboot of the machine is required. This may require significant time on higher-end scale up servers if doing Bare Metal Deployment (BMD) – increasing overall time it will take for installation.</p>
<p><strong>Your Feedback (Thanks!)<br />
</strong></p>
<p>Based on your feedback we have received about the need to be able to easily domain join Nano Server deployments at scale, we have come up with a solution using Microsoft tools that are available today. This will enable you to deploy Nano Server in large numbers and still automate the deployment in a similar fashion to your Server with Desktop Experience and Server Core deployments today.</p>
<p><strong>The Challenges & Design Goals:<br />
</strong></p>
<p>The primary challenge that is addressed with this solution is “<strong>Deployment at scale of Nano Server</strong>” with customized images with the following design criteria’s in mind:</p>
<ul>
<li><strong>Simplicity</strong>: Only use one tool</li>
<li><strong>Speed:</strong> Minimize Reboots: Deploy end-to-end with a minimum of reboots, as a reboot can take long time (10+ minutes on large scale up physical servers)</li>
<li><strong>Security:</strong> Stay secure without taking high risks</li>
<li><strong>Automation:</strong> Minimum of / no manual steps in the process outside the deployment</li>
<li><strong>Goal:</strong> Full deployment and Domain Join in under 3 mins from boot to login screen</li>
</ul>
<p><strong>The Solution<br />
</strong></p>
<p>In order to address the above challenges & design goals, the following components enable most, if not all of the these:</p>
<ul>
<li>Windows Deployment Services (WDS) only</li>
<li>WinPE image with .NET and PowerShell added</li>
<li>Embedded PowerShell script</li>
<li>Variables controlled via Unattend xml file in WDS</li>
<li>No storage or blob files stored on shares</li>
<li>No storage of usernames / passwords to allow for maximum security.</li>
</ul>
<p><strong>Scoop of the solution:<br />
</strong></p>
<p>The main objective for the proposed solution is to provision a Nano Server image to a physical or virtual machine and domain join the server to a domain based on the following user input, which can be stored in an unattend.xml file or be provided by the administrator as part of the provisioning process.</p>
<p>– User Name</p>
<p>– Password</p>
<p>– Machine Name</p>
<p>* the domain name is taken from the user name</p>
<p><strong>Requirements for the solution:<br />
</strong></p>
<p>The following requirements are needed in order to deploy Nano Server and join it to a domain:</p>
<ol>
<li>AD domain</li>
<li>DHCP Server with IP scope which the VM or Physical server can connect with</li>
<li>WDS Server</li>
<li>Modified WinPE Image</li>
<li>Unattend XML file</li>
<li>Nano WIM / VHD / VHDX Image</li>
<li>Domain account(s) to create the AD computer object and authenticate with WDS server.</li>
</ol>
<p><strong>The process<br />
</strong></p>
<ol>
<li>Server PXE boots and gets an IP address from the DHCP Server</li>
<li>Downloads and boots the modified WinPE Image from the WDS server</li>
<li>Selection of Image from WDS (Automated)</li>
<li>Partitioning of Server (Automated)</li>
<li>Deployment of WIM / VHD / VHDX & Unattend.xml</li>
<li>PowerShell executes and joins Nano Server to the domain with domain credentials</li>
<li>Server reboots and is fully provisioned, including joined to the domain.</li>
</ol>
<p> </p>
<p><img src="https://msdnshared.blob.core.windows.net/media/2016/05/051516_0635_Part1Nano1.png" alt="" /></p>
<p> </p>
<p>This process takes about 2½ minutes using a virtual machine in our test environment. This might take longer depending on your network speed, disk performance, and if using a physical server, the post time for the server.</p>
<p>You can read more about WinPE <a href="https://technet.microsoft.com/en-gb/library/cc721977(v=ws.10).aspx">Order of Operations in WinPE</a> and <a href="https://technet.microsoft.com/en-gb/library/cc766093%28v=ws.10%29.aspx?f=255&MSPPError=-2147217396">WinPE Limitations</a>.</p>
<p><strong>The videos<br />
</strong></p>
<p>We have recorded two videos which show the deployment of Nano Server using WDS</p>
<p><strong>Video 1</strong>: <a href="https://1drv.ms/v/s!Am8Gg73bSTCtquoDNPEHRG3-hODPNA">This video deploys Nano Server to a VM without asking any questions, all information is stored in the unattend.xml file on the WDS server</a>.</p>
<p><strong>Video 2</strong>: <a href="https://1drv.ms/v/s!Am8Gg73bSTCtquoENPEHRG3-hODPNA">This video shows deployment of Nano Server with parameters given for Image, Partitions, User & Password and Server Name</a>.</p>
<p>Various scenarios between the two videos can be achieved, based on how much data is given in the unattend.xml file and automation done around it.</p>
<p><strong>Next Step Blog Posts<br />
</strong></p>
<p>In the next few blog posts, we will drill into this topic further. Here’s what we’re planning:</p>
<ul>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/05/04/part-2-how-to-build-a-windows-pe-and-nano-server-image-to-deploy-nano-server-at-scale/">Part – 2: How to build a Windows PE and Nano Server image to deploy Nano Server at-a-scale</a></li>
<li><a href="https://blogs.technet.microsoft.com/privatecloud/2016/05/13/how-to-configure-wds-unattend-xml-file-windows-pe-image-and-nano-server-image-to-deploy-a-nano-server/">Part – 3: How to configure WDS, Unattend.xml file, Windows PE Image, and Nano Server image to deploy a Nano Server at-a-scale</a></li>
<li>Part – 4: Bare Metal Deployment (BMD) Considerations</li>
</ul>
<p>Regards</p>
<p>The Nano Server Team</p>
]]></content:encoded>
<wfw:commentRss>https://blogs.technet.microsoft.com/privatecloud/2016/05/02/nano-server-domain-join-deployment-at-a-scale-part-1-introduction/feed/</wfw:commentRss>
<slash:comments>0</slash:comments>
</item>
</channel>
</rss>