tag:blogger.com,1999:blog-8937293075994104222024-03-07T04:34:10.457+01:00Virtualization and some coffeeCloud evangelist with a passion for Microsoft Private Cloud and Public Cloud. Hopefully you will find something useful here.
-Kristian NeseKristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.comBlogger338125tag:blogger.com,1999:blog-893729307599410422.post-88757711755672865512016-04-20T13:15:00.001+02:002016-04-20T13:15:25.168+02:00Connecting the dots with OMS and SLACK<div class="MsoNoSpacing">
In my last blog post, I spent some time trying to explain
why OMS is more than you think and how this fits into the next generation of
hybrid IT management, with Management-as-a-Service.</div>
<div class="MsoNoSpacing">
<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<a href="http://kristiannese.blogspot.no/2016/04/why-oms-is-more-than-you-think.html" target="_blank">Why OMS is more than you think</a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Today, I want to highlight something I myself find very
interesting, where we are using OMS as the source of our information towards
operations engineers.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>OMS Log Analytics<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
One of the key aspects of OMS is the Log Analytic
workspace. This is where you harvest the data from your hybrid operational
environment, and as I talked about in my previous blog post, you can have
multiple data sources – and even use custom logs to retrieve and centralize the
information you are looking for – but also (and perhaps more important) – the information
that you didn’t <i>knew</i> you were looking
for!<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Log Analytics let you easily search for any of your data
and from there, you can truly demonstrate your skillset by connecting the dots
to a complete remediation solution, or plug into some other system to either
deliver or manipulate the data or both.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
With Log Analytics, we are able to:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Search for any of our data<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Save searches and use them together with
Dashboards<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Use saved searches in conjunction with Alerts<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Get e-mail notification with detailed
information about the alert, search result and more<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Connect Alerts with Azure Automation to trigger
a Runbook that is either executed in Azure or through a Hybrid Worker <o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Connect Alerts with third-party systems using <b>WebHooks</b><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This blog post will focus on how to use OMS as the
foundation for an operational department and centralize the alerts
(informational, warning and critical) into SLACK.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
First, let us quickly get a better understanding of what
SLACK really is and why it might be useful in this particular scenario.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Many IT organizations are having a wide diversity of
different ways of doing collaboration. Some of them are good, some of them are
less good. However, the fact is that many channels might be used over time
which leads to <i>lack</i> of communication
and especially transparency when it comes to critical information around the
operations. <o:p></o:p></div>
<div class="MsoNoSpacing">
Slack is a messaging application where teams can share
files, talk and literally work <i>together</i>.
This lets organizations have everything in one place, moving away from the
devastating e-mail threads and so on. <o:p></o:p></div>
<div class="MsoNoSpacing">
With SLACK, everything that is shared is automatically
indexed and archived which is searchable. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Some of the advantages you will get immediately when
using SLACK is transparency to team communication for greater visibility into
what other teams are working on, it speeds up feedback and decision making and
make it a lot easier to find information and documents and more. <o:p></o:p></div>
<div class="MsoNoSpacing">
Las but not least – SLACK supports a wide range of tools,
which means you can integrate existing apps, systems etc to communicate with
SLACK to centralize the communication and information.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This is where OMS comes into play together with the
WebHook integration to SLACK.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Ok, I get it. The
information from our alerts can have a flow into one or more SLACK channels
where our teams can get everything in a single view, but what exactly is a
WebHook?<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I am glad you asked.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
WebHook is something you have used already if you have
been using Azure Automation – and especially together with Alerts in OMS. This
will leverage WebHooks.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The concept of WebHooks is really simple, and by simple I
mean it is a simple HTTP POST that occurs when ‘something’ happens. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Using OMS together with SLACK, OMS will POST a message to
a URL when certain things happen (the Log Analytic Search is showing some
result that will trigger the Alert workflow).<o:p></o:p></div>
<div class="MsoNoSpacing">
WebHooks helps us to receive valuable information when it
happens – instead of constantly pulling for the data. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In SLACK, you can add an ‘incoming webhook’ to your
channel that will accept data from external sources that will send a JSON
payload over HTTP. <o:p></o:p></div>
<div class="MsoNoSpacing">
Each channel in SLACK will be identified by a unique
incoming Webhook URL to which you can post the message from outside. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
A typical JSON payload will look similar to this:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: Consolas; font-size: 9.5pt;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2e75b6; font-family: Consolas; font-size: 9.5pt; mso-bidi-font-family: Consolas; mso-highlight: white;">"text"</span><span style="background: white; font-family: Consolas; font-size: 9.5pt;">: </span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt; mso-bidi-font-family: Consolas; mso-highlight: white;">"This is some random
text from Virtualization and some Coffee"</span><span style="background: white; font-family: Consolas; font-size: 9.5pt;">,<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2e75b6; font-family: Consolas; font-size: 9.5pt; mso-bidi-font-family: Consolas; mso-highlight: white;">"channel"</span><span style="background: white; font-family: Consolas; font-size: 9.5pt;">: </span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt; mso-bidi-font-family: Consolas; mso-highlight: white;">"#virtualization"</span><span style="background: white; font-family: Consolas; font-size: 9.5pt;">,<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2e75b6; font-family: Consolas; font-size: 9.5pt; mso-bidi-font-family: Consolas; mso-highlight: white;">"username"</span><span style="background: white; font-family: Consolas; font-size: 9.5pt;">: </span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt; mso-bidi-font-family: Consolas; mso-highlight: white;">"Kristian"</span><span style="background: white; font-family: Consolas; font-size: 9.5pt;">,<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2e75b6; font-family: Consolas; font-size: 9.5pt; mso-bidi-font-family: Consolas; mso-highlight: white;">"icon_emoji"</span><span style="background: white; font-family: Consolas; font-size: 9.5pt;">: </span><span style="background: white; color: #a31515; font-family: Consolas; font-size: 9.5pt; mso-bidi-font-family: Consolas; mso-highlight: white;">":KristianDancing"</span><span style="background: white; font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNoSpacing">
<span style="background: white; font-family: Consolas; font-size: 9.5pt;">}</span><span style="font-family: Consolas; font-size: 9.5pt;"><o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Once you have added the incoming WebHook to your SLACK
channel, you can take advantage of this when creating alerts in OMS.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Here's an overview of the workflow and architecture</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDfNq8NKiAdHJToN_nN4G_YzbrazzM4tPW3IbBzupvKiTHuxwtNiLJqS55xpIQbXocQ1e1tUR8HwMOgpa35XZIT8sjVAnvaqUAMtdAjiZQo1zupG4m3xx3cgWdTa-gTrF3heQKudhZfxo/s1600/slackarchitecture.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDfNq8NKiAdHJToN_nN4G_YzbrazzM4tPW3IbBzupvKiTHuxwtNiLJqS55xpIQbXocQ1e1tUR8HwMOgpa35XZIT8sjVAnvaqUAMtdAjiZQo1zupG4m3xx3cgWdTa-gTrF3heQKudhZfxo/s320/slackarchitecture.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Here’s an example on how to configure an Alert in OMS to
use a Webhook<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZv_bwEBX7eczwAxGntB_Mh2Hx8427flVOGWWvfmsxxdV_RFK-d1NtmTyX6183fEY0qXLsVc2Oxfqp7QK4iD45zD9OTZoyFpra-At4ldPN7dFo7qoJB652otSl4ZZgErSa505pwPtymD0/s1600/slack.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="223" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZv_bwEBX7eczwAxGntB_Mh2Hx8427flVOGWWvfmsxxdV_RFK-d1NtmTyX6183fEY0qXLsVc2Oxfqp7QK4iD45zD9OTZoyFpra-At4ldPN7dFo7qoJB652otSl4ZZgErSa505pwPtymD0/s320/slack.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
And this is an example on how it could look like in
SLACK, where we have different channels for different teams, depending on their
area of expertise, responsibility etc.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb8g9I_UlvJWOtFIN4J-wF4Ekj2GZaiuJmeiuPDbP4XYpKmQXE_akDMPgj4ldcqIcm00886pEGPtZH3KTXHcaiKcrQhzzMq5fovxDffoUAxLmgpiXUYaIcIm8dbKsRDb0B3urucpmp96U/s1600/slack+2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhb8g9I_UlvJWOtFIN4J-wF4Ekj2GZaiuJmeiuPDbP4XYpKmQXE_akDMPgj4ldcqIcm00886pEGPtZH3KTXHcaiKcrQhzzMq5fovxDffoUAxLmgpiXUYaIcIm8dbKsRDb0B3urucpmp96U/s320/slack+2.JPG" width="298" /></a></div>
<div class="MsoNoSpacing">
<o:p><br /></o:p></div>
<div class="MsoNoSpacing">
<o:p><br /></o:p></div>
<div class="MsoNoSpacing">
Happy integrating! <o:p></o:p></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com2tag:blogger.com,1999:blog-893729307599410422.post-54941936038531695432016-02-24T10:21:00.001+01:002016-02-24T10:21:11.633+01:00OMS: Automated VM protection using Azure Recovery Services, Automation and Log Analytics<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNoSpacing">
It’s me again, blogging from a random hotel room.<o:p></o:p></div>
<div class="MsoNoSpacing">
Last time we had a look into the combination of OMS and
Azure in order to ensure availability of a Windows Server container hosted on a
virtual machine in Azure.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<a href="http://kristiannese.blogspot.no/2016/02/azure-and-oms-better-together.html">http://kristiannese.blogspot.no/2016/02/azure-and-oms-better-together.html</a><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
(The templates and scripts will be published soon).<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This time, I would like to focus on another scenario I
think is very useful in the combination of Azure and OMS.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Recently, the GA of Azure Recovery Services were
announced under the ARM APIs, which I talked about in this post and covered
some considerations to be aware of - <a href="http://kristiannese.blogspot.no/2016/01/azure-site-recovery-and-azure-resource.html">http://kristiannese.blogspot.no/2016/01/azure-site-recovery-and-azure-resource.html</a><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In this blog post, I would like to cover a common
scenario that we will run into every now and then when customers wants to
protect virtual machines automatically to Azure in a programmatic way. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Overview<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
More and more customers are looking into how they can
leverage the Azure cloud today, and one of the low-hanging fruits are services
that can easily be plugged into existing services on-premises that will easily
enable hybrid cloud scenarios, such as Business Continuity and Disaster
Recovery. These services can be harnessed directly from Azure but provides you
with a more comprehensive solution when used in conjunction with the entire OMS
suite – that includes these services as well. <o:p></o:p></div>
<div class="MsoNoSpacing">
In a couple of minutes, you can have your services and
applications running healthy as ever in an Azure region once this has been
configured, in case of a failover. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In this article I will not go into design principals
around the recovery processes (we’ll save that one for later), but rather cover
a scenario that automatically will take care of some heavy lifting for you.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Use case<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Many organizations have Hyper-V running as their primary
hypervisor on-premises today, powering test, dev and production virtual
machines. Since Azure has been able to democratize disaster recovery with their
recovery services, people are looking into how to take advantage of this in a
streamlined and efficient way. My goal here is to show how you can onboard and
enable protection for newly created virtual machines on a Hyper-V host that has
been registered to your Recovery Services Vault in Azure, by combining events
that are logged into Log Analytics in OMS, monitored by a saved search that
also has an associated alert with remediation attached to it. <o:p></o:p></div>
<div class="MsoNoSpacing">
This will invoke a Runbook created in Azure Automation
that will enable replication on newly created virtual machines on that
particular Hyper-V host and replicate to Azure as the recovery site. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Breakdown of the
workflow<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->A VM gets created on the Hyper-V host.
Regardless of how it’s created, this will log a specific informational event in
the Hyper-V-VMMS-Admin log on the host, EventID 13002 that “A new virtual
machine was created”<b><o:p></o:p></b></div>
<div class="MsoNoSpacing" style="margin-left: .5in;">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->The OMS agent deployed on the host will fetch
this and ingest this into Log Analytics<b><o:p></o:p></b></div>
<div class="MsoNoSpacing" style="margin-left: .5in;">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->A search query is defined to monitor for this
specific event on this specific host<b><o:p></o:p></b></div>
<div class="MsoNoSpacing" style="margin-left: .5in;">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->An alert is created and associated with this
query, so an e-mail will be sent when this occur<b><o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->A runbook is created in Azure Automation that
will search for newly discovered virtual machines on the registered Hyper-V
host in the Azure Recovery Vault, look for VMs that isn’t protected and enable
protection for them.<b><o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->This runbook is associated with the alert and is
part of the remediation process <b><o:p></o:p></b></div>
<div class="MsoListParagraph">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH73USL0Ag-NARONfFsWGcR_vx1Mukq8Er70mhYdeMf49oYeGXOcU0mncVrotNNcZyUj1z7AHKRnKzMjgYsgIXw6GwcBxa2aE4sN1sGfHBV7jRfzyv1JM0TeW00WLcaxVI0aq3wd0muEo/s1600/Workflow.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="185" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH73USL0Ag-NARONfFsWGcR_vx1Mukq8Er70mhYdeMf49oYeGXOcU0mncVrotNNcZyUj1z7AHKRnKzMjgYsgIXw6GwcBxa2aE4sN1sGfHBV7jRfzyv1JM0TeW00WLcaxVI0aq3wd0muEo/s400/Workflow.JPG" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Getting started<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Before we can enable this scenario, we have to have some
prerequisites in place:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->OMS Workspace<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Azure Automation account<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->OMS agent installed on the applicable Hyper-V
hosts<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Azure Recovery Vault in ARM<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Runbooks<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Assuming you have all of the above except the runbooks, I’ll
cover the creation of the Azure Recovery Vault and the Runbook and stitch
everything together. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Creating Azure
Recovery Vault with Azure Resource Manager<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The following PowerShell cmdlets will enable Azure
Recovery Vault in your subscription and go through the creation of the Vault:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Note: You must
install and register the agent on your Hyper-V host manually in this process,
before proceeding with the rest of the script.<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Login to Azure and select Azure subscription</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Login-AzureRmAccount</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-Credential</span> (<span style="color: blue;">get-credential</span>
<span style="color: navy;">-Credential</span> <span style="color: blueviolet;">kristian.nese@ledzeppelin.onmicrosoft.com</span>)<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Select-AzureRmSubscription</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">–SubscriptionID $subID</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Check to see if your Azure subscription is enabled with ASR
resource providers</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Get-AzureRmResourceProvider</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-ProviderNamespace</span> <span style="color: darkred;">"Microsoft.RecoveryServices"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Get-AzureRmResourceProvider</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-ProviderNamespace</span> <span style="color: darkred;">"Microsoft.SiteRecovery"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Register ASR Resource Provider</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Register-AzureRmResourceProvider</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-ProviderNamespace</span> <span style="color: darkred;">"Microsoft.SiteRecovery"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Register-AzureRmProviderFeature</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-FeatureName</span> <span style="color: darkred;">"betaAccess"</span>
<span style="color: navy;">-ProviderNamespace</span> <span style="color: darkred;">"Microsoft.RecoveryServices"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Register-AzureRmResourceProvider</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-ProviderNamespace</span> <span style="color: darkred;">"Microsoft.RecoveryServices"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Verify to see that the RP is registered correctly</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Get-AzureRmResourceProvider</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-ProviderNamespace</span> <span style="color: darkred;">"Microsoft.RecoveryServices"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Get-AzureRmResourceProvider</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-ProviderNamespace</span> <span style="color: darkred;">"Microsoft.SiteRecovery"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Create a new ASR Recovery Vault</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">mkdir</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-Path</span> <span style="color: darkred;">"c:\ASRDemo"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$RG</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"DRGroup"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$Location</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"west europe"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$vault</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"HyperV"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$path</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"c:\ASRDemo"</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">New-AzureRmResourceGroup</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-Name</span> <span style="color: orangered;">$rg</span> <span style="color: navy;">-Location</span> <span style="color: orangered;">$location</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$vault</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">New-AzureRmRecoveryServicesVault</span> <span style="color: navy;">-Name</span> <span style="color: orangered;">$vault</span> <span style="color: navy;">-ResourceGroupName</span> <span style="color: orangered;">$rg</span>
<span style="color: navy;">-Location</span> <span style="color: orangered;">$location</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$FilePath</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AzureRmRecoveryServicesVaultSettingsFile</span> <span style="color: navy;">-Vault</span> <span style="color: orangered;">$vault</span> <span style="color: navy;">-Path</span> <span style="color: orangered;">$path</span> <span style="color: darkgrey;">|</span> <span style="color: blue;">%</span> <span style="color: blueviolet;">FilePath</span> <span style="color: darkgreen;">#
changed this to make sure we get the right filepath</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Import-AzureRmSiteRecoveryVaultSettingsFile</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">
<span style="color: navy;">-Path</span> <span style="color: orangered;">$FilePath</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Create a new Hyper-V Site in the ASR vault</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$sitename</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"KNHVSite"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">New-AzureRmSiteRecoverySite</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-Name</span> <span style="color: orangered;">$sitename</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Query the job</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Get-AzureRmSiteRecoveryJob</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Generate and download registration key for the site (Copy
the downloaded key to the Hyper-V host. You'll need the key to register the
Hyper-V host to the site)</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$SiteIdentifier</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AzureRmSiteRecoverySite</span>
<span style="color: navy;">-Name</span> <span style="color: orangered;">$sitename</span>
<span style="color: darkgrey;">|</span> <span style="color: blue;">Select</span> <span style="color: navy;">-ExpandProperty</span> <span style="color: blueviolet;">SiteIdentifier</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Get-AzureRmRecoveryServicesVaultSettingsFile</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">
<span style="color: navy;">-Vault</span> <span style="color: orangered;">$vault</span>
<span style="color: navy;">-SiteIdentifier</span> <span style="color: orangered;">$SiteIdentifier</span>
<span style="color: navy;">-SiteFriendlyName</span> <span style="color: orangered;">$sitename</span>
<span style="color: navy;">-Path</span> <span style="color: orangered;">$Path</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Download and install the agent on the Hyper-V host(s) from
this URL: https://aka.ms/downloaddra</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Verify that the Hyper-V host is registered in ASR </span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Get-AzureRmSiteRecoveryServer</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Create storage account with Geo-redundant storage</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$storageaccountID</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">New-AzureRmStorageAccount</span>
<span style="color: navy;">-ResourceGroupName</span> <span style="color: orangered;">$RG</span>
<span style="color: navy;">-Name</span> <span style="color: darkred;">"knasrdemo01"</span>
<span style="color: navy;">-Type</span> <span style="color: blueviolet;">Standard_GRS</span>
<span style="color: navy;">-Location</span> <span style="color: orangered;">$Location</span>
<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Create a replication policy and associate it with the
protection container</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$ReplicationFrequencyInSeconds</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"300"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$PolicyName</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">“DefaultPolicy”</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$Recoverypoints</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: purple;">1</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$storageaccountID</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AzureRmStorageAccount</span>
<span style="color: navy;">-Name</span> <span style="color: darkred;">"knasrdemo01"</span>
<span style="color: navy;">-ResourceGroupName</span> <span style="color: orangered;">$RG</span>
<span style="color: darkgrey;">|</span> <span style="color: blue;">Select</span> <span style="color: navy;">-ExpandProperty</span> <span style="color: blueviolet;">Id</span>
<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$PolicyResult</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">New-AzureRmSiteRecoveryPolicy</span>
<span style="color: navy;">-Name</span> <span style="color: orangered;">$PolicyName</span>
<span style="color: navy;">-ReplicationProvider</span> <span style="color: darkred;">“HyperVReplicaAzure”</span>
<span style="color: navy;">-ReplicationFrequencyInSeconds</span> <span style="color: orangered;">$ReplicationFrequencyInSeconds</span> <span style="color: navy;">-RecoveryPoints</span>
<span style="color: orangered;">$Recoverypoints</span> <span style="color: navy;">-ApplicationConsistentSnapshotFrequencyInHours</span>
<span style="color: purple;">1</span> <span style="color: navy;">-RecoveryAzureStorageAccountId</span>
<span style="color: orangered;">$storageaccountID</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Get the protection container and start the association</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$protectionContainer</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AzureRmSiteRecoveryProtectionContainer</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$Policy</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AzureRmSiteRecoveryPolicy</span> <span style="color: navy;">-FriendlyName</span> <span style="color: orangered;">$PolicyName</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$associationJob</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Start-AzureRmSiteRecoveryPolicyAssociationJob</span> <span style="color: navy;">-Policy</span> <span style="color: orangered;">$Policy</span> <span style="color: navy;">-PrimaryProtectionContainer</span> <span style="color: orangered;">$protectionContainer</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Once this has been created and the Hyper-V host(s) are
registered to Azure, you should be able to see the virtual machines on that
host by executing the following cmdlet:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Get-AzureRmSiteRecoveryProtectionEntity -ProtectionContainer
$protectionContainer | select friendlyname <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">FriendlyName<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">------------ <o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">ASRGEN2-01 </span><span lang="NO-BOK" style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-ansi-language: NO-BOK; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span lang="NO-BOK" style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-ansi-language: NO-BOK; mso-bidi-font-family: "Lucida Console";">ASRGEN2-03 <o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span lang="NO-BOK" style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-ansi-language: NO-BOK; mso-bidi-font-family: "Lucida Console";">ASRGEN2-02 <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b><span lang="NO-BOK">Preparing Azure Automation<o:p></o:p></span></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
There’s a few things we need in order to successfully
create and run our runbook in Azure Automation<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Assets<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.0in; mso-list: l0 level2 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]-->Credentials<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.0in; mso-list: l0 level2 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]-->Variables<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.0in; mso-list: l0 level2 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]-->Modules<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Runbook<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
For the assets, you can easily add the required assets by
using PowerShell.<o:p></o:p></div>
<div class="MsoNoSpacing">
In my case, I need the credentials to login to an Azure
subscription, and I also need to store the subscription ID in a variable.<o:p></o:p></div>
<div class="MsoNoSpacing">
This can be achieved using the following cmdlets:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Creating Automation
Variable<o:p></o:p></b></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: lightcyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">New-AzureRmAutomationVariable</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: moccasin; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">-Name</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: violet; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">SubscriptionID</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: moccasin; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">-Encrypted</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$false</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: moccasin; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">-Value</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$Subscription</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: moccasin; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">-ResourceGroupName</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: violet; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$RGName</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: moccasin; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">-AutomationAccountName</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: violet; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$AAName<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Creating
Automation Credential<o:p></o:p></b></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: lightcyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">New-AzureRmAutomationCredential</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: moccasin; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">-Name</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: violet; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">AutoAdmin</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: moccasin; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">-ResourceGroupName</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: violet; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$RGName</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: moccasin; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">-AutomationAccountName</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: violet; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$AAName</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: moccasin; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">-Value</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$cred</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Uploading
Automation Module<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Normally you would use a cmdlet for uploading PowerShell
modules to Azure Automation as well, but since we just want to grab a few of
them directly from the available PowerShell Gallery in the AA itself, we
quickly head over to the portal and grab them from there.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Install the following modules in this specific order.<o:p></o:p></div>
<div class="MsoNoSpacing">
<b>Note</b>: it can
take several minutes before the modules are installed and ready. You might find
yourself a cup of coffee while doing this, as some of these modules has
dependencies of each other and won’t import before the dependencies has
completed the import process<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikCYc16Wlrw8JSPEF6-2REE3KYJq-l9NCG5EVcmdhNrK2rIRmo4dWbuv78VA-1BueixZWgRU6ohUCjF7VcDKyWr6hGdAlQ1feUNqDJnfklNAZpFFgNbJdzeLthnpAt-OWp6MxSoGVD39U/s1600/module1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="163" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikCYc16Wlrw8JSPEF6-2REE3KYJq-l9NCG5EVcmdhNrK2rIRmo4dWbuv78VA-1BueixZWgRU6ohUCjF7VcDKyWr6hGdAlQ1feUNqDJnfklNAZpFFgNbJdzeLthnpAt-OWp6MxSoGVD39U/s320/module1.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNMmaiOgKA9K7Hrm9YMYgT7SBq3FoZvvgSRnwGV1sQ6Xfh4RL07TkGcsv35G0W7JMvOlC62PYcq-xZ-KCdDn9PnvOQ8Y5fUTChCVg-_HH3dQb98hPDqsxGZ11L8BYl0rmHKd7Fxd3xoag/s1600/module2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="204" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNMmaiOgKA9K7Hrm9YMYgT7SBq3FoZvvgSRnwGV1sQ6Xfh4RL07TkGcsv35G0W7JMvOlC62PYcq-xZ-KCdDn9PnvOQ8Y5fUTChCVg-_HH3dQb98hPDqsxGZ11L8BYl0rmHKd7Fxd3xoag/s320/module2.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFYpefEorg_CDxn5RhA-4wq0ecb6SnRFNF4gtd8U6vqoERB5bVlqfiZa6goxPT56LZ2APQnSmGDNtvi-vLn6-BdFOZMHhycudIe0Ab1opqjnKoE63Q2w3aQrVR1-yyEU3h6hS_2qA0eAQ/s1600/module4.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="96" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFYpefEorg_CDxn5RhA-4wq0ecb6SnRFNF4gtd8U6vqoERB5bVlqfiZa6goxPT56LZ2APQnSmGDNtvi-vLn6-BdFOZMHhycudIe0Ab1opqjnKoE63Q2w3aQrVR1-yyEU3h6hS_2qA0eAQ/s320/module4.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU1s5SdB24CjPydP2GxNKzvGpWXhVQRsRGFyelVXJHIwUysJgTOzCV3-ZO7R_Gy4MmDF5bsqF5yyLvB90aRvUkS1YOnwmDta4f-0t9Zms7Xcz_QdsJYNjqktrZev9OUtSYEcWdOw_yJBE/s1600/module3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="90" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgU1s5SdB24CjPydP2GxNKzvGpWXhVQRsRGFyelVXJHIwUysJgTOzCV3-ZO7R_Gy4MmDF5bsqF5yyLvB90aRvUkS1YOnwmDta4f-0t9Zms7Xcz_QdsJYNjqktrZev9OUtSYEcWdOw_yJBE/s320/module3.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Creating the
Runbook<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Now that the prereqs are in place, it is time to author
the Runbook that will do the following:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Runbook<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Runbook for enabling DR on unprotected Hyper-V VMs</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$Admin</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AutomationPSCredential</span> <span style="color: navy;">-Name</span>
<span style="color: blueviolet;">AzureAdmin</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$Subscription</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AutomationVariable</span>
<span style="color: navy;">-Name</span> <span style="color: blueviolet;">SubscriptionID</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Login-AzureRmAccount</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-Credential</span> <span style="color: orangered;">$Admin</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Select-AzureRmSubscription</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-SubscriptionId</span> <span style="color: orangered;">$Subscription</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Fetching some variables for this particular setup</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$RG</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"DRGroup"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$Location</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"west europe"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$vault</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"HyperV"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$sitename</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"KNHVSite"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$vault</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AzureRmRecoveryServicesVault</span> <span style="color: navy;">-Name</span> <span style="color: orangered;">$vault</span> <span style="color: navy;">-ResourceGroupName</span> <span style="color: orangered;">$rg</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$storageaccount</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"knasrdemo01"</span>
<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Creating a temp directory to store the VaultSettingsFile</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$tempFileName</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: orangered;">$env:TEMP</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$FilePath</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AzureRmRecoveryServicesVaultSettingsFile</span> <span style="color: navy;">-Vault</span> <span style="color: orangered;">$vault</span> <span style="color: navy;">-Path</span> <span style="color: orangered;">$tempFileName</span>
<span style="color: darkgrey;">|</span> <span style="color: blue;">%</span> <span style="color: blueviolet;">FilePath</span> <span style="color: darkgreen;">#
changed this to make sure we get the right filepath</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Import-AzureRmSiteRecoveryVaultSettingsFile</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">
<span style="color: navy;">-Path</span> <span style="color: orangered;">$FilePath</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$SiteIdentifier</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AzureRmSiteRecoverySite</span>
<span style="color: navy;">-Name</span> <span style="color: orangered;">$sitename</span>
<span style="color: darkgrey;">|</span> <span style="color: blue;">Select</span> <span style="color: navy;">-ExpandProperty</span> <span style="color: blueviolet;">SiteIdentifier</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Get-AzureRmRecoveryServicesVaultSettingsFile</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">
<span style="color: navy;">-Vault</span> <span style="color: orangered;">$vault</span>
<span style="color: navy;">-SiteIdentifier</span> <span style="color: orangered;">$SiteIdentifier</span>
<span style="color: navy;">-SiteFriendlyName</span> <span style="color: orangered;">$sitename</span>
<span style="color: navy;">-Path</span> <span style="color: orangered;">$tempFileName</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$protectionContainer</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AzureRmSiteRecoveryProtectionContainer</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Get Storage Account</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$storageaccountID</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AzureRmStorageAccount</span>
<span style="color: navy;">-Name</span> <span style="color: orangered;">$storageaccount</span>
<span style="color: navy;">-ResourceGroupName</span> <span style="color: orangered;">$RG</span>
<span style="color: darkgrey;">|</span> <span style="color: blue;">Select</span> <span style="color: navy;">-ExpandProperty</span> <span style="color: blueviolet;">Id</span>
<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Get Recovery Policy</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$policy</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AzureRmSiteRecoveryPolicy</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Enabling VMs for protection</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$protectionEntity</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AzureRmSiteRecoveryProtectionEntity</span>
<span style="color: navy;">-ProtectionContainer</span> <span style="color: orangered;">$protectionContainer</span>
<span style="color: darkgrey;">|</span> <span style="color: blue;">Where-Object</span>
{<span style="color: orangered;">$_</span><span style="color: darkgrey;">.</span>FriendlyName
<span style="color: darkgrey;">-like</span> <span style="color: darkred;">"*asr*"</span>
<span style="color: darkgrey;">-and</span> <span style="color: orangered;">$_</span><span style="color: darkgrey;">.</span>ProtectionStatus <span style="color: darkgrey;">-eq</span>
<span style="color: darkred;">"Unprotected"</span>}<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkblue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">foreach</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> (<span style="color: orangered;">$entity</span>
<span style="color: darkblue;">in</span> <span style="color: orangered;">$protectionEntity</span>)<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkblue;">if</span>
(<span style="color: orangered;">$protectionEntity</span><span style="color: darkgrey;">.</span>ProtectionStatus
<span style="color: darkgrey;">-eq</span> <span style="color: darkred;">"Unprotected"</span>)<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blue;">Write-Output</span>
<span style="color: darkred;">"They aren't protected!"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blue;">Set-AzureRmSiteRecoveryProtectionEntity</span>
<span style="color: navy;">-ProtectionEntity</span> <span style="color: orangered;">$entity</span>
<span style="color: navy;">-Policy</span> <span style="color: orangered;">$Policy</span>
<span style="color: navy;">-Protection</span> <span style="color: blueviolet;">Enable</span>
<span style="color: navy;">-RecoveryAzureStorageAccountId</span> <span style="color: orangered;">$storageaccountID</span> <span style="color: navy;">-OS</span>
<span style="color: blueviolet;">Windows</span> <span style="color: navy;">-OSDiskName</span>
<span style="color: orangered;">$protectionEntity</span><span style="color: darkgrey;">.</span>Disks<span style="color: darkgrey;">[</span><span style="color: purple;">0</span><span style="color: darkgrey;">].</span>Name <span style="color: navy;">-Verbose</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkblue;">else</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blue;">Write-Output</span>
<span style="color: darkred;">"They were protected already :-)"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> } <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal">
If you want to use this in your environment, ensure you are
changing the variables to meet your needs.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyHQYxEpwHaFqaZVAjg1hQoFMmiHp8crHQHtV9SdEY8v34nqhnUPX7xwxU7I2ALSEVDlSXedzs_ph7ujesPM6kjuwomMOOTdwr06bdRf0JmGAzhkuZCYz9ay6e9JrhLe0J-snKDZrvZbI/s1600/runbook3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="188" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyHQYxEpwHaFqaZVAjg1hQoFMmiHp8crHQHtV9SdEY8v34nqhnUPX7xwxU7I2ALSEVDlSXedzs_ph7ujesPM6kjuwomMOOTdwr06bdRf0JmGAzhkuZCYz9ay6e9JrhLe0J-snKDZrvZbI/s320/runbook3.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz6HeDiq9H5YgHpqvsrt8-rgky0fGgv_R94KYfBNnHEhM1h5OZ1ykoP7tOn7H7H2Ol0HaL3VbalRJ01Vzv63HhTDgcotDecHRZeYiTJli-jYiAmMbLaTqCZkX2P4dssP_2ffPXdvhhWIo/s1600/runbook.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhz6HeDiq9H5YgHpqvsrt8-rgky0fGgv_R94KYfBNnHEhM1h5OZ1ykoP7tOn7H7H2Ol0HaL3VbalRJ01Vzv63HhTDgcotDecHRZeYiTJli-jYiAmMbLaTqCZkX2P4dssP_2ffPXdvhhWIo/s320/runbook.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1gI0Z8na5i-mef3J-3jKFZ8rNCW0YIoDDX3rZir7TnK2-lKfcm2isjCfW-dffGj3T_PjmyQrmltYUY5vZZVHWWP3fRbrhCLHU5qtPf3MFDOBtd-cS9Dr7VmrhuMxhaSo0nLHtyI1N2K8/s1600/runbook2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="101" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1gI0Z8na5i-mef3J-3jKFZ8rNCW0YIoDDX3rZir7TnK2-lKfcm2isjCfW-dffGj3T_PjmyQrmltYUY5vZZVHWWP3fRbrhCLHU5qtPf3MFDOBtd-cS9Dr7VmrhuMxhaSo0nLHtyI1N2K8/s320/runbook2.JPG" width="320" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b>OMS<o:p></o:p></b></div>
<div class="MsoNoSpacing">
Assuming you already have the host registered to the
Workspace, you should do the following steps to be able to get the information you
are looking for to enable this scenario where you want to leverage the runbook
to protect newly created VMs.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Adding logs to OMS<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In the OMS workspace, Click on ‘Settings’<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht5lxyloq-oQDB6iZnp1ngvXPk4R1bl6GgLdewSgYkTYhhCdl-g_dWvaBwjuSAlKYIxYQiqS3TZtVDbAHc2TjSQ4j0ZaI31ZNKueiZ0fmd4hRsEaVadjw-Q1ZqUpq4XRS5oezdZK3SMCI/s1600/oms1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="288" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht5lxyloq-oQDB6iZnp1ngvXPk4R1bl6GgLdewSgYkTYhhCdl-g_dWvaBwjuSAlKYIxYQiqS3TZtVDbAHc2TjSQ4j0ZaI31ZNKueiZ0fmd4hRsEaVadjw-Q1ZqUpq4XRS5oezdZK3SMCI/s320/oms1.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<br /><div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Navigate to ‘Data’ and click on ‘Windows Event Logs’<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj78DnLYExtBvhiSleLmEL7MuWApNpTDeTp1Hr2NbNihldTSVIHvsnKO44OXUtyuwkaw-PZr2Sc6WQiXKGHxJ-5kunH0jfTeHNZ_0LqGusNwEYCfXk2qz9rtSb_ZdKRTV1q8nQ8M-Y5r5U/s1600/oms2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj78DnLYExtBvhiSleLmEL7MuWApNpTDeTp1Hr2NbNihldTSVIHvsnKO44OXUtyuwkaw-PZr2Sc6WQiXKGHxJ-5kunH0jfTeHNZ_0LqGusNwEYCfXk2qz9rtSb_ZdKRTV1q8nQ8M-Y5r5U/s320/oms2.JPG" width="247" /></a></div>
<div class="MsoNoSpacing">
<o:p><br /></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Add the following log that will contain the information
about creation of virtual machines on the host<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN7F2EOFtW0e3TzmR2k7ujzo-XZB3W2vFMDzLcmLCw3l_BXVhggvuItBOm8cbExLDdoh92ys143UsTC-qQXMCvX6V4esh6slfl3ROwUrYIoLed5OzaJSzm6sftv_V5MCu7UJUJ6B4b_QQ/s1600/oms3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="58" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN7F2EOFtW0e3TzmR2k7ujzo-XZB3W2vFMDzLcmLCw3l_BXVhggvuItBOm8cbExLDdoh92ys143UsTC-qQXMCvX6V4esh6slfl3ROwUrYIoLed5OzaJSzm6sftv_V5MCu7UJUJ6B4b_QQ/s320/oms3.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<o:p><br /></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Ensure that Error, Warning and Information is selected<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJMFWzGZk6bfftko44mT_BFK8bfCRju4-rW1vdKU7XmqETjk3r-UPHDi_ZG2IkQodqCDNNVyNAQk2nfoxikeKXW-CLsfDmuA24beLDqZqmtaHAECkYrwGS_iylMNj-61xv1KXUGR_aOqc/s1600/oms4.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="78" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJMFWzGZk6bfftko44mT_BFK8bfCRju4-rW1vdKU7XmqETjk3r-UPHDi_ZG2IkQodqCDNNVyNAQk2nfoxikeKXW-CLsfDmuA24beLDqZqmtaHAECkYrwGS_iylMNj-61xv1KXUGR_aOqc/s320/oms4.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<o:p><br /></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Note: </b>OMS
doesn’t care about what has already happened, so only new events in this log
will appear in OMS.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Next, go back and drill into ‘Log Search’<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhv0lTu2BnSsYdnAFO8FmbiTiM-_2KXpuOk2ojfC5ZC57XZOTKvrFyU3-0TJ88-rXJR8sLvCzn7qzsk8KM_Aq3vmg8b2VDzeUvX_rp6e7I6ycXpA718-MkUjwyPKmK1xwAzzXTHXG8w7E/s1600/oms5.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhv0lTu2BnSsYdnAFO8FmbiTiM-_2KXpuOk2ojfC5ZC57XZOTKvrFyU3-0TJ88-rXJR8sLvCzn7qzsk8KM_Aq3vmg8b2VDzeUvX_rp6e7I6ycXpA718-MkUjwyPKmK1xwAzzXTHXG8w7E/s1600/oms5.JPG" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I use the following search to pinpoint the specific
EventID and the Hyper-V host<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
EventID=13002 host11 | Select Computer, Activity,
TimeGenerated, Message, EventLog<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I have saved the search and categorized it as ‘Hyper’V.<o:p></o:p></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifGFqluXSckz6eR9NurXBBhmvGMoPkvUoZiyKbXyq5LK9IHf1AI44E5f2aVz-7SN_Zeh1i15AL2IY3OXiJs2mrgN9uRyVd7sTF3ZvXEae3OA2q3Wi3PmRzNn5toaI1iVQgwRrkg6WmVto/s1600/oms6.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="77" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifGFqluXSckz6eR9NurXBBhmvGMoPkvUoZiyKbXyq5LK9IHf1AI44E5f2aVz-7SN_Zeh1i15AL2IY3OXiJs2mrgN9uRyVd7sTF3ZvXEae3OA2q3Wi3PmRzNn5toaI1iVQgwRrkg6WmVto/s320/oms6.JPG" width="320" /></a></div>
<div>
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Now, I want to enable alerting on this search, so I click
on the search and then on the ‘Alert’ button<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUns38yH3c26n_6ITS6uooCLvjhHFUnk_YDHbjhF1aPcfbftpenWhnc6lEA-RGeCXmBAdy-RcETmoNd-J8MvyC93Iov0_nFv-csl_7hDV1vnQd-jxHNYbXe2yFuVPgU1v5pJtNJhqLNRw/s1600/oms7.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="103" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUns38yH3c26n_6ITS6uooCLvjhHFUnk_YDHbjhF1aPcfbftpenWhnc6lEA-RGeCXmBAdy-RcETmoNd-J8MvyC93Iov0_nFv-csl_7hDV1vnQd-jxHNYbXe2yFuVPgU1v5pJtNJhqLNRw/s320/oms7.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<o:p><br /></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Assign a name to the alert and specify when the query
should run and when an alert should be generated. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDFJrk57tZV539JCLqLyzBSo3PnDmbJKfmGlaYGjj8QRkB3IaGEbGM1KAt0ZZIYXxh_MoilRSpHEEddR_fI5njcOlo5uF-9XYPisGYi8ZNSHkf-6LuV0Fu37JHY7TRpnIL8LY5nLEKerA/s1600/oms8.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDFJrk57tZV539JCLqLyzBSo3PnDmbJKfmGlaYGjj8QRkB3IaGEbGM1KAt0ZZIYXxh_MoilRSpHEEddR_fI5njcOlo5uF-9XYPisGYi8ZNSHkf-6LuV0Fu37JHY7TRpnIL8LY5nLEKerA/s320/oms8.JPG" width="207" /></a></div>
<div class="MsoNoSpacing">
<o:p><br /></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I then specify the recipient of the alert and give it a
name.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkpf3jFrgS_iaIt5Uzgx1upe1OBzc4MdGLXcrwdMvmi8vpevoW9CTeHTsMWwnGUmIwHudP7UVLh6oi6jFvL2XD7_2Oyq_KGq0Ggelz8pKoX64yNUSDD9kbvuOT5H5cKhjjNy0ZXH8TwyI/s1600/oms9.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkpf3jFrgS_iaIt5Uzgx1upe1OBzc4MdGLXcrwdMvmi8vpevoW9CTeHTsMWwnGUmIwHudP7UVLh6oi6jFvL2XD7_2Oyq_KGq0Ggelz8pKoX64yNUSDD9kbvuOT5H5cKhjjNy0ZXH8TwyI/s320/oms9.JPG" width="216" /></a></div>
<div class="MsoNoSpacing">
<o:p><br /></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
As a last step, I connect the alert with the newly
created Runbook in Azure Automation and ensure that it will be executed by
using an Azure worker and click save.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkG3PjNP9Vip2UWJ3xCZ7j9s-JoB0Rq4LFpF11_vrk2u2ggrofMDZZeeM4h6NVV_T8HcNOvQMbe6_cKwWnOMLlL-mPLBKXETDq3nfGD04a_7I087ov2U8yiVWJW9rHxu1utLitSpelyZQ/s1600/oms10.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkG3PjNP9Vip2UWJ3xCZ7j9s-JoB0Rq4LFpF11_vrk2u2ggrofMDZZeeM4h6NVV_T8HcNOvQMbe6_cKwWnOMLlL-mPLBKXETDq3nfGD04a_7I087ov2U8yiVWJW9rHxu1utLitSpelyZQ/s320/oms10.JPG" width="229" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Creating a new VM
to trigger the alert<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Heading over to my Hyper-V host I created some new
virtual machines.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl_1k_l_8me6hB6FYr0DQdCaOvN1x6S_TdCoW6-KNb2v5Q6cohqaioWH23_lpeIBh_QLjRpp8x8De_86Uf336cufTp1A7pUi0FjYou4gxhn6CjYiYVdIIp3IQjut34_VA0-aHz_e1QFUs/s1600/host1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="102" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl_1k_l_8me6hB6FYr0DQdCaOvN1x6S_TdCoW6-KNb2v5Q6cohqaioWH23_lpeIBh_QLjRpp8x8De_86Uf336cufTp1A7pUi0FjYou4gxhn6CjYiYVdIIp3IQjut34_VA0-aHz_e1QFUs/s320/host1.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<o:p><br /></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Coffee time<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Since OMS will use this search query every 15 mins, I had
enough time to make myself some coffee while waiting for the e-mail to drop in
my inbox<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Alert<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Once the search query detect a new event, the alert is
triggered and an e-mail is fired away to my inbox.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXlDH5aA_xY8QL8mpcqS4PJ0WqjRBhejwo-7xdtZxf-Co-Sb81-57QegiETS2Ay4RvGD6jjpNdkVArc-T9FGPBRv8XMqvdEIWwmcwHAVyqfCrylxRNOBC1gzMiNhiG6KO_rb_CXMebKl0/s1600/alert1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="113" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXlDH5aA_xY8QL8mpcqS4PJ0WqjRBhejwo-7xdtZxf-Co-Sb81-57QegiETS2Ay4RvGD6jjpNdkVArc-T9FGPBRv8XMqvdEIWwmcwHAVyqfCrylxRNOBC1gzMiNhiG6KO_rb_CXMebKl0/s320/alert1.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<o:p><br /></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Remediation<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This should invoke the associated runbook for
remediation, and when I check into the Job view in Azure, I can see that it has
successfully been executed and also the output that tells me that replication
has now been enabled on the unprotected VMs.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkq4mPYbq7dRwlPzLLkHweK8UomBfwRx_TFzcXy-c9VCgbUUNWPr5NrlJrdCLvRWbnHRewYVE5h9DbXicoxqKhK_Hw6LFzZF0Ddivhx8a2_PV2yVXcndX2z4wTBggn1WXChiWRH33U1wU/s1600/remediation2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="151" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkq4mPYbq7dRwlPzLLkHweK8UomBfwRx_TFzcXy-c9VCgbUUNWPr5NrlJrdCLvRWbnHRewYVE5h9DbXicoxqKhK_Hw6LFzZF0Ddivhx8a2_PV2yVXcndX2z4wTBggn1WXChiWRH33U1wU/s320/remediation2.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<o:p><br /></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Verifying the
remediation<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Using PowerShell, I can access my Recovery Vault and
check to see which VMs are in the process of being protected in Azure by using
the following cmdlet:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: lightcyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Get-AzureRmSiteRecoveryProtectionEntity</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: moccasin; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">-ProtectionContainer</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$protectionContainer</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: lightgrey; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">|</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: lightcyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">select</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: violet; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">FriendlyName</span><span style="color: lightgrey; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">,</span><span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> </span><span style="color: violet; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">ProtectionStateDescription <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The output shows that several machines are already
protected while the newly created VM is in the process of doing an initial
replication<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">FriendlyName ProtectionStateDescription <o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">------------ -------------------------- <o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">ASRGEN2-04
Protected <o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">ASRGEN2-02
Protected <o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">ASRGEN2-01 Initial
replication is in progress<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">ASRGEN2-03 Protected <o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Closing note<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This was yet another blog post that shows some of the
capabilities of combining OMS, Azure and Azure Services together.<o:p></o:p></div>
<div class="MsoNoSpacing">
Moving forward, I will focus more on some of these
scenarios to show where we have some gaps today, and how you can overcome those
gaps with a little effort in engineering.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
By the end of the day, we can more or less achieve
whatever we want as long as there’s an API for it, and that’s exactly what this
blog post was showing. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<br />
<div class="MsoNoSpacing">
Thanks!<o:p></o:p></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com1tag:blogger.com,1999:blog-893729307599410422.post-40804994435368362942016-02-18T19:46:00.002+01:002016-02-18T19:46:35.579+01:00Azure and OMS – Better Together<div class="MsoNoSpacing">
<span lang="NO-BOK">Azure
and OMS – Better Together<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Recently, Microsoft announced an enhancement to both
Azure and OMS where you can now simply enable the OMS extension for your
virtual machines and they will start to report directly to the OMS Workspace
associated with that subscription.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In this blog post, I will walk you through a real-world
example on how we integrated OMS with Azure to ensure availability for some
Windows Server Containers as part of a project.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Overview<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
We wanted to be able to rapidly test and deploy Windows
Server containers to Azure using Azure Resource Manager templates. This would
of course lead to development of one or more ARM templates, leveraging custom
script extension to perform the heavy lifting within the virtual machine(s).<o:p></o:p></div>
<div class="MsoNoSpacing">
If you are familiar with container technology and have
followed the investment from Microsoft in this area lately, you have probably
heard of the Azure Container Service that now is in the public preview. This is
an end-to-end solution that you can spin up in Azure using a very abstracted
template that will instantiate around 23 resources for you. <o:p></o:p></div>
<div class="MsoNoSpacing">
If you want to achieve the same with Windows Server
Containers today, you must rely on your own ARM skills to make this happen, as
the current Container Service is Linux-only. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Container technology is an additional layer of
abstraction that you can host on a virtual machine, and whatever you put inside
a container today should either be considered as stateless, or you should have
externalized the state through the application layer. <o:p></o:p></div>
<div class="MsoNoSpacing">
In our case we were using stateless containers that would
go down in case the container host (the virtual machine) went down or had a
reboot in Azure. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
With the capabilities available in Microsoft OMS today,
this should be a real good use case to combine resources in Azure and OMS to
ensure that if the specific event occurred, the container should be running and
respond to requests in minutes. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Understanding the
requirements<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Windows Container is a part of Windows Server 2016
Technical Preview 4 today, which is an available image for you to use in Azure.
<o:p></o:p></div>
<div class="MsoNoSpacing">
Although there’s two supported runtimes for containers in
2016, only Windows Server – and not Hyper-V Containers is supported, as the
latter requires support for nested virtualization. <o:p></o:p></div>
<div class="MsoNoSpacing">
Further, the image in Azure is running Server Core –
which also applies to the Windows Server Containers you can host there. In other
words, there’s no graphical user interface <span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;">J</span><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
When you use the image in Azure, you will get a default –
empty Windows Server Core Image to use for your container exploration. If you
want to add applications, server roles and more to a container, you need to be
aware that you should treat your containers as Lego blocks. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In our case, there was a need to test several specific
Web applications hosted on a Windows Server Containers.<o:p></o:p></div>
<div class="MsoNoSpacing">
This meant we had to build something that would spin up a
new container image, add the Web-Server Role to it, and commit the container to
the library as an image so that we could use <u>that</u> image when deploying
the web applications on top of it.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
From an ARM template perspective, that would mean that we
would add a Custom Script Extension resource and associate it with the virtual
machine resource. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The Custom Script Extension would then point to a
repository that contains the script (PowerShell script in this case). The PowerShell
script would support several input parameters so that the entire ARM template
would be reusable for others who would like to deploy something similar in the
same fashion.<o:p></o:p></div>
<div class="MsoNoSpacing">
The script would spin up and create containers, and
ensure that the correct firewall settings and NAT rules were applied from the
container host to the container(s), so the container could be publicly
accessible from the outside, following the rules that were defined in the
Network Security Group in the template. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>So far, so great<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
From a deployment perspective, this should be good. <o:p></o:p></div>
<div class="MsoNoSpacing">
Since containers aren’t the same as virtual machines as
you can run on your local Hyper-V, you will not get anything that reminds you
of Live Migration in the current build. So for us to increase uptime and
availability for the containers on the container host, OMS became very
interesting.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
With the OMS extension, we could easily associate the
virtual machine with an OMS Workspace to retrieve critical information about
our containers runtime environment. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Not only do we get the insight of our environment in OMS,
but we can also leverage the agent to invoke another powerful Azure/OMS
resource – Azure Automation.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The goal was now to monitor the virtual machine for
specific events, and if the Log Search query would return such result in a
given timeframe, we would link that result to an alert we have created in OMS. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
From there, we could do remediation through an Azure
Automation Runbook. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Since this was an event that was going on inside the
operating system of the virtual machine, a Hybrid Worker was considered as the
best solution, so that we could trigger Azure Automation to invoke the runbook
within the Hybrid Worker context.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Since the OMS agent is also the same agent you would use
for Hybrid Worker to Azure Automation, we only had to tell the agent where to
register post deployment.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In order to handle this, another Extension (OMS agent)
was added to the ARM template, instructed to be deployed before the Custom
Script Extension who now also would be responsible for registering the OMS
agent with Azure automation.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>OMS<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Generally speaking, people seems to be confused when it
comes to OMS at its capabilities. <o:p></o:p></div>
<div class="MsoNoSpacing">
Out of the box you get an extreme amount of intel that
you can leverage to act upon and become predictive in the way you do management
of your resources, regardless of cloud, operating system and location. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This is brought to through Log Analytics, which now is a
resource within the Azure Resource Manager API. Together with Log Analytics,
you can use Azure Automation (tight integration) as well as Azure Site Recovery
and Azure Backup – both who will reach the UX experience in the new portal in the
near future. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Once you have connected sources to OMS, the data harvest
can begin.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
You can decide what type of data you will gather, and you
can take advantage of existing solutions from a ‘Solution Gallery’ that gives
you pre-defined searches, views and insight based on the solution it represent.
Examples here are:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Change tracking<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Security and Audit<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->System Update & Assessment <o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->SQL Assessment<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->AD Assessment<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Malware Assessment<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
These are just a few examples, and by using OMS – which is
Management as a Service delivered from the cloud, you can expect the cloud
cadence to be applied to these solutions, reducing Time-To-Market and
Time-To-Value which is very good for your business.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>The Solution<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Azure Resource
Manager template<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The example Azure Resource Manager Template I will
describe here is constructed so that it currently takes input parameters for:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Containerhost (name of the virtual machine that
will host the container(s)<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Containername (name of the container to
instantiate)<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->vmSize (SKU)<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->adminaccount (administrator account for the
container host vm)<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->adminpwd (password for the admin account)<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->vNetName (name of the virtual network to be
created)<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->OMSWorkspaceID (the ID for your OMS Workspace)<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->OMSWorkspaceKey (the primary key for your OMS
Workspace)<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->AAEndpoint (the endpoint to your Azure
Automation account)<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Token (the primary key for your Azure Automation
account)<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The resources that will be deployed (in this specific
order) are:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Storage accounts, public IP address, network
security group and availabilityset are deployed in parallel<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Virtual network will start deployment as soon as
the network security group has completed<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Virtual network interface will start deploying
when virtual network and public IP address has completed<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Virtual machine will start deployment once
storage accounts and virtual network interface has completed<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Virtual machine extension (OMS agent) will start
deployment when the virtual machine has completed<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Virtual machine extension (Custom Script
Extension) will start deployment once the OMS extension has completed</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7TqiBJTDpX0QsXmPi8708GCn1rLL_R3FOR45QcT38lABiZoPFaTZwxXTfmioJN6NihVZpcjIjovXX16tX8kMXaRuLvZ7gU0Xfg3uliS-NasckSjRZ4wY75HxUDjITLQDKs6jUUgUErnc/s1600/oms2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="155" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7TqiBJTDpX0QsXmPi8708GCn1rLL_R3FOR45QcT38lABiZoPFaTZwxXTfmioJN6NihVZpcjIjovXX16tX8kMXaRuLvZ7gU0Xfg3uliS-NasckSjRZ4wY75HxUDjITLQDKs6jUUgUErnc/s400/oms2.JPG" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<o:p></o:p><br />
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Once everything has deployed, we should receive
an output from the template that will give us the URL to the deployed
container, available on port 80<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjANx43Msk0WNwXUC3yBEX7ZY-ZzM4ik4Ue9hxWEiJtUqPWolzEZk5_WKkhbejXrQAhYjGutwnmhdpdjJqbs3bLTpbjlqBl7Mdk0vjImDSFIk3MCt2IE-fTaXZMSKEeWc_BNvV3fAI-vBo/s1600/OMS1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="117" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjANx43Msk0WNwXUC3yBEX7ZY-ZzM4ik4Ue9hxWEiJtUqPWolzEZk5_WKkhbejXrQAhYjGutwnmhdpdjJqbs3bLTpbjlqBl7Mdk0vjImDSFIk3MCt2IE-fTaXZMSKEeWc_BNvV3fAI-vBo/s400/OMS1.JPG" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimHmIH3qDa20wH0fH_l08q_bh81iLzX1WN2Y2nlE5SbHlw7LBIcSYHYmXhvQSeMFRt1EatdTZ57-gzcIWRwV68CbzbBW-_mzl3bRFKA5QQQUd-3dvZFHALTtnhUgXZ0AW6OEDT0iz_HJ8/s1600/OMSUrl.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="55" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimHmIH3qDa20wH0fH_l08q_bh81iLzX1WN2Y2nlE5SbHlw7LBIcSYHYmXhvQSeMFRt1EatdTZ57-gzcIWRwV68CbzbBW-_mzl3bRFKA5QQQUd-3dvZFHALTtnhUgXZ0AW6OEDT0iz_HJ8/s400/OMSUrl.JPG" width="400" /></a></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>OMS Search<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
For OMS to find relevant information, the following
search was used:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Type=SecurityEvent
EventID=4608 OR EventID=1100 "4608 - Windows is starting up." contp4
| Select Computer, Activity, TimeGenerated<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This search is targeting the specific virtual machine
running the containers.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
From this search, an alert was created that was linked to
a runbook I had created to start any containers that had State –eq “Off”.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRAtDCqYOiSTgtd_mCfhujQtSWqhnWPYEmB9AUVFZadwT9i9y-TFv3xyXoK_6KmxN0RqfFirSkXBCLym1aweyJMFflambmtlUFcA6KeWfwDu3UoXVRTpqNelMG8MKvsKCmKyIQRCNlHJ8/s1600/oms+alert+1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRAtDCqYOiSTgtd_mCfhujQtSWqhnWPYEmB9AUVFZadwT9i9y-TFv3xyXoK_6KmxN0RqfFirSkXBCLym1aweyJMFflambmtlUFcA6KeWfwDu3UoXVRTpqNelMG8MKvsKCmKyIQRCNlHJ8/s320/oms+alert+1.JPG" width="165" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTfBx3BSQbCtHVU-DggYf6if_fHBU6KpN0yxvzjYbtNnakkjCUOmtfFlVGJp08XlplCNQ39hpoA5OSJkyGkkCRdbzjwu3OG67xQzFuiEv13F3Ki1h_QiViJwjxlLx0BHZ7pYxtylK8YaQ/s1600/oms+alert+2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTfBx3BSQbCtHVU-DggYf6if_fHBU6KpN0yxvzjYbtNnakkjCUOmtfFlVGJp08XlplCNQ39hpoA5OSJkyGkkCRdbzjwu3OG67xQzFuiEv13F3Ki1h_QiViJwjxlLx0BHZ7pYxtylK8YaQ/s320/oms+alert+2.JPG" width="153" /></a></div>
<o:p></o:p><br />
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The runbook should then be executed by a Hybrid Worker,
which would be the container host itself.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Testing<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
To test and verify that things are working, we would
trigger a restart of the virtual machine in Azure.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD0YIXZgvdbMrzblb_RcdkgA4cv_yGLmj4UIqs6f0TL2xJ5rmzux9A9FSCICU5Jz_YeE0wZBE_Dvy7MsAkeuONxD4i4ZER6vgQiQSBbwfeQ_0t83ugiFXbJ_Zu-6sBlGxHKNob8FC5MP4/s1600/restart.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD0YIXZgvdbMrzblb_RcdkgA4cv_yGLmj4UIqs6f0TL2xJ5rmzux9A9FSCICU5Jz_YeE0wZBE_Dvy7MsAkeuONxD4i4ZER6vgQiQSBbwfeQ_0t83ugiFXbJ_Zu-6sBlGxHKNob8FC5MP4/s1600/restart.JPG" /></a></div>
<br />
<div class="MsoNoSpacing">
Once the virtual machine has started, we can see that the
following event has been logged to our OMS Workspace</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj70PZxNbsUEc8FqCDXcEhg7SOlU0zal1GBcHI1zYO-EWqu2UFvYx5QQ3bBRevvG8M4bYUAnjRnYjl0EhuH1FH93yhHh009WRUDsbx9OQpVAal3xa4xfnxtYPfQi2-KyNA6OeyVTcUtUr4/s1600/oms+alert+success.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="125" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj70PZxNbsUEc8FqCDXcEhg7SOlU0zal1GBcHI1zYO-EWqu2UFvYx5QQ3bBRevvG8M4bYUAnjRnYjl0EhuH1FH93yhHh009WRUDsbx9OQpVAal3xa4xfnxtYPfQi2-KyNA6OeyVTcUtUr4/s400/oms+alert+success.JPG" width="400" /></a></div>
<o:p></o:p><br />
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This also results in an e-mail notification according to
our configuration, and should also generate a webhook to invoke the remediation
runbook that’s created in Azure Automation<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC9avodDYNfPs7g13uWKDzHbrzwZSSgwI57CHPLcbggcRtAqrOB0sbty3RamwrhVRymVKx39oX81A80PfGbAH7EVgDEM8R2_z2ZgL_jqdFzX81dhvWHmL5fCSUwXBz87NPQTKhj7H-9WU/s1600/OMS+remediation+1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="142" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC9avodDYNfPs7g13uWKDzHbrzwZSSgwI57CHPLcbggcRtAqrOB0sbty3RamwrhVRymVKx39oX81A80PfGbAH7EVgDEM8R2_z2ZgL_jqdFzX81dhvWHmL5fCSUwXBz87NPQTKhj7H-9WU/s400/OMS+remediation+1.JPG" width="400" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX81FTA6CnCCbW7OXBHLalNqRuONIdefnh66s__1Xrq8SYdCzYDfZNBsfch8K04Kyyi0qaejcq1TU4FnOwhspUHE9PjfpuwyMKqB-uYElYiGyfedaw2WYTrGblbCMmJHpCEsmPEXvhBVE/s1600/OMS+remediation+2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="165" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX81FTA6CnCCbW7OXBHLalNqRuONIdefnh66s__1Xrq8SYdCzYDfZNBsfch8K04Kyyi0qaejcq1TU4FnOwhspUHE9PjfpuwyMKqB-uYElYiGyfedaw2WYTrGblbCMmJHpCEsmPEXvhBVE/s400/OMS+remediation+2.JPG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
By hitting the ULR to my container again, I can verify it is responding on port 80 and is brought up again just as expected.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO_YUfH1q5er0PxH8T89AmghrBuyqwRMWgCdlv3Z_TztSEa0RXNjm-q46EOYKaPDseoGht9-9sIhphie2J06RzFTuo1-WvFSCnXUyCUvDQa4FmutJBuRtotc1WLvTfUm_GNnEDa_qfhg0/s1600/OMS+remediation+3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="106" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO_YUfH1q5er0PxH8T89AmghrBuyqwRMWgCdlv3Z_TztSEa0RXNjm-q46EOYKaPDseoGht9-9sIhphie2J06RzFTuo1-WvFSCnXUyCUvDQa4FmutJBuRtotc1WLvTfUm_GNnEDa_qfhg0/s400/OMS+remediation+3.JPG" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Hopefully you found this blog post useful to show <i>some</i> of the capabilities by leveraging Microsoft OMS together with Azure services.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In the next blog post, I'll cover the ideal setup for Microsoft OMS for Service Providers.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b><span style="color: lime;">(The templates, scripts and examples will be live on my github.com/krnese account as soon as they are polished a bit. Check in there later or follow me on twitter @KristiaNese to get the latest updates)</span></b></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com1tag:blogger.com,1999:blog-893729307599410422.post-13962224641561769832016-02-01T13:59:00.000+01:002016-02-01T13:59:37.032+01:00Free book! Cloud Consistency with Azure Resource Manager<div class="MsoNormal">
<b>Finally!</b><o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
I was able to spend some wife points this weekend to
finalize the new book “Cloud Consistency with Azure Resource Manager”.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 18.0pt; line-height: 107%;"><a href="https://gallery.technet.microsoft.com/Cloud-Consistency-with-0b79b775">Download
"Cloud Consistency with Azure Resource Manager"</a><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
This book is aiming to get you started with Azure Resource
Manager and covers many examples on how to author templates, use functions as
well as exploring many of the other aspects of Azure Resource Manager<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicf5gfz7ivkTL3bFmzUiUUCbbHA4FNglZq52iA_ycf98HvXW79iI1bHTCutgA0dFSNp4i2c0ZR1M1hIG36NcbbpqxuTfgEzlfTWaeEGyp2DLnri5Ej4ylIhabRa4etpo4-w2aGatycmHY/s1600/cloudcloud.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="232" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicf5gfz7ivkTL3bFmzUiUUCbbHA4FNglZq52iA_ycf98HvXW79iI1bHTCutgA0dFSNp4i2c0ZR1M1hIG36NcbbpqxuTfgEzlfTWaeEGyp2DLnri5Ej4ylIhabRa4etpo4-w2aGatycmHY/s320/cloudcloud.png" width="320" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><br /></b></div>
<div class="MsoNormal">
<b>Here’s a snapshot of the content:</b><o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoToc1" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Acknowledgements:</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc1" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">About the authors</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc2" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Kristian Nese | @KristianNese</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc2" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span lang="NO-BOK" style="color: windowtext; mso-ansi-language: NO-BOK;">Flemming Riis |
@FlemmingRiis</span></span><u1:p></u1:p><span lang="NO-BOK" style="font-size: 13.5pt; line-height: 107%; mso-ansi-language: NO-BOK;"><o:p></o:p></span></div>
<div class="MsoToc1" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span lang="NO-BOK" style="color: windowtext; mso-ansi-language: NO-BOK;">Background</span></span><u1:p></u1:p><span lang="NO-BOK" style="font-size: 13.5pt; line-height: 107%; mso-ansi-language: NO-BOK;"><o:p></o:p></span></div>
<div class="MsoToc1" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span lang="NO-BOK" style="color: windowtext; mso-ansi-language: NO-BOK;">Introduction</span></span><u1:p></u1:p><span lang="NO-BOK" style="font-size: 13.5pt; line-height: 107%; mso-ansi-language: NO-BOK;"><o:p></o:p></span></div>
<div class="MsoToc1" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span lang="NO-BOK" style="color: windowtext; mso-ansi-language: NO-BOK;">Microsoft Azure</span></span><u1:p></u1:p><span lang="NO-BOK" style="font-size: 13.5pt; line-height: 107%; mso-ansi-language: NO-BOK;"><o:p></o:p></span></div>
<div class="MsoToc1" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Microsoft Azure Stack</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc1" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Cloud Computing and Modern Application Modeling</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc2" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Step 1 – Service Templates</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc2" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Step 2 – VM Roles</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc2" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Step 3 – Azure Resource Manager</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc2" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Summary</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc1" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">IaaS v2 – Azure Resource Manager API replaces Service
Management API</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc1" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Consistent Management Layer</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc3" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Azure PowerShell</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc3" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Azure CLI</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc3" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Azure Resource Manager Rest API</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc3" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Azure Portal</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc1" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Azure Resource Manager Templates</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc2" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Deploying with Azure Resource Manager</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc2" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Where can we deploy our Azure Resource Manager
Templates</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc2" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Explaining the template format</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc2" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Authoring the first Azure Resource Manager Template</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc2" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Adding parameter file</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc2" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Visual Studio</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc2" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">PowerShell</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc2" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Azure Portal</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc2" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Idempotency with Azure Resource Manager</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc3" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Resource Explorer</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc3" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Imperative Deployment with Azure Resource Manager</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc2" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Advanced Azure Resource Manager Templates</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc3" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Functions</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoToc3" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Extensions</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoTocHeading">
</div>
<div class="MsoToc3" style="margin-bottom: 0.0001pt;">
<span style="font-size: 13.5pt; line-height: 107%;"><span style="color: windowtext;">Write once, deploy anywhere</span><o:p></o:p></span><u1:p></u1:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Instead of jumping right into the authoring experience and
learn how an ARM template is constructed, we wanted to give you enough context
to know what’s going on in the industry, what is changing and how you should
prepare yourself to take advantage of this new way of managing your cloud
resoueces.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
If you have been playing around with Azure already, you are
probably very familiar with some of the content already. If you are new, and
especially interested in Microsoft Azure Stack, you should be glad to know that
everything you learn in this book can be addressed there as well.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
It has been a great experience writing this book, covering
some of the most interesting stuff we have available right now, and I have to
emphasize that this book will also be updated as we move forward to keep up
with all the great things that is happening in the Microsoft Cloud.<o:p></o:p></div>
<w:sdt docparttype="Table of Contents" docpartunique="t" id="-394049380" sdtdocpart="t">
</w:sdt>
<br />
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
I really hope you enjoy it.<o:p></o:p></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com0tag:blogger.com,1999:blog-893729307599410422.post-13338989852152458012016-01-19T20:30:00.002+01:002016-01-19T20:30:38.104+01:00Azure Site Recovery and Azure Resource Manager<div class="MsoNoSpacing">
Recently, I was working with the new Azure Site Recovery
Resource Provider in Azure Resource Manager.<o:p></o:p></div>
<div class="MsoNoSpacing">
Since we now have support for this through PowerShell, I
wanted to create a solution that would automatically add VMs to the protection
group.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
To get VMs protected, it is quite straightforward, but you
want to plan this a bit more carefully when you are designing for real-world
scenarios.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Planning and
Considerations<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: 36.0pt; mso-list: l0 level1 lfo1; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Resource Groups<o:p></o:p></div>
<div class="MsoNoSpacing">
Everything you create in ARM will belong to a Resource
Group. This should be common knowledge by now, but it is worth a friendly
reminder to avoid any potential confusion<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: 36.0pt; mso-list: l0 level1 lfo1; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Storage Accounts<o:p></o:p></div>
<div class="MsoNoSpacing">
For using ASR and having Azure as the Recovery Site, you
must also create a storage account that can receive and hold the vhds for the
protected virtual machines. When you power up a virtual machine – either as
part of a DR drill (test failover) or perhaps for a more permanent time using
planned/unplanned failover, remember that this is where the disks will be
located. As a friendly reminder, the storage accounts must also belong to a
Resource Group. It is important that the storage account is created in the same
region as the ASR resource itself. <o:p></o:p></div>
<div class="MsoNoSpacing">
If you choose to use a storage account created in classic
(Azure Service Management API), then the VMs will be visible in the classic
portal afterwards. If you use a storage account in the ARM model, you are good
to go in the new portal.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: 36.0pt; mso-list: l0 level1 lfo1; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Network<o:p></o:p></div>
<div class="MsoNoSpacing">
You want to be able to connect to your virtual machines
post failover. This requires network connectivity – among other things. Where you
place the virtual network isn’t imported as long as it is within the same
region. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: 36.0pt; mso-list: l0 level1 lfo1; text-indent: -18.0pt;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Virtual Machines <o:p></o:p></div>
<div class="MsoNoSpacing">
During test/planned/unplanned failover, the virtual
machine will have their storage located on the storage account you have created
for your ASR configuration. The virtual networks might be in a different
resource group as well. This is important to know, as every VM (regardless of
test/planned/unplanned failover) will be instantiated in its own – new Resource
Group, only containing the virtual machine object and the virtual network
interface. All other resources are in different Resource Group(s).<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>What you need to
be aware of<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In addition to the design considerations for Resource
Groups, storage and networking, you must remember a couple of things. For being
able to access virtual machines post a failover, you need to ensure that you
have enabled RDP within the guest (Windows) if doing so. Next, you must have
either a jump-host on the target virtual network where the recovered VM is
running, or simply create a Network Security Group with the required rules,
associated with either the subnet or the vNics itself.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I have created a PowerShell script that is currently
being polished before publishing, where I will share my findings on this topic
to make an efficient DR process of your virtual machines. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com1tag:blogger.com,1999:blog-893729307599410422.post-50155614946553328262016-01-11T20:26:00.002+01:002016-01-11T20:48:35.900+01:002016 - The year of Microservices and Containers<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNoSpacing">
This is the first blog post I am writing this year.</div>
<div class="MsoNoSpacing">
<o:p></o:p></div>
<div class="MsoNoSpacing">
I was planning to publish this before Christmas, but I
figured out it would be better to wait and reflect even more about the trends
that’s currently taking place in this industry.<o:p></o:p></div>
<div class="MsoNoSpacing">
So what’s a better way to start the New Year other than
with something I really think will be one of the big bets for the coming
year(s)?<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I drink a lot of coffee. In fact, I might suspect it will
kill me someday. On a positive note, at least I was the one who was controlling
it. Jokes aside, I like to drink coffee when I'm thinking out loud around technologies and
potentially reflect on the steps we’ve made so far. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Going back to 2009-10 when I was entering the world of virtualization
with Windows Server 2008 R2 and Hyper-V, I couldn’t possible imagine how things
would change in the future.<o:p></o:p></div>
<div class="MsoNoSpacing">
At this very day, I realized that the things we were
doing back then, was just the foundation to what we are seeing today. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The same arguments are being used throughout the
different layers of the stack. <o:p></o:p></div>
<div class="MsoNoSpacing">
We need to optimize our resources, increase density, flexibility
and provide fault-tolerant, resilient and highly-available solutions to bring
our business forward.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
That was the approach back then – and that’s also the
approach right now.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
We have constantly been focusing on the infrastructure
layer, trying to solve whatever issues that might occur. We have been in the belief
that if we actually put our effort into the infrastructure layer, then the
applications we put on top of that will be smiling from ear to ear.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
But things change. <o:p></o:p></div>
<div class="MsoNoSpacing">
The infrastructure change, and the applications are
changing.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Azure made its debut in 2007-08 I remember. Back then it
was all about Platform as a Service offerings.<o:p></o:p></div>
<div class="MsoNoSpacing">
The offerings were a bit limited back then, giving us
cloud services (web role – and worker role), caching and messaging systems such
as Service Bus, together with SQL and other storage options such as blob, table
and queue. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Many organizations were really struggling back then to
get a good grasp of this approach. It was complex. It was a new way of
developing and delivering services, and in almost all cases, the application
had to be rewritten to fully functional using the PaaS components in Azure.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
People were just getting used to virtual machines and has
started to use them frequently also a part of test and development of new
applications. Many customers went deep into virtualization in production as
well, and the result was a great demand from customers for having the
opportunity to host virtual machines in Azure too.<o:p></o:p></div>
<div class="MsoNoSpacing">
This would simplify any migration of “legacy”
applications to the cloud, and more or less solve the well-known challenges we
were aware of back then.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
During the summer in 2011 (if my memory serves me well),
Microsoft announced their support of Infrastructure as a Service in Azure. Finally
they were able to hit the high note!<o:p></o:p></div>
<div class="MsoNoSpacing">
Now what?<o:p></o:p></div>
<div class="MsoNoSpacing">
An increased consumption of Azure was the natural result,
and the cloud came a bit closer to most of the customers out there. Finally there
was a service model that people could really understand. They were used to
virtual machines. The only difference now was the runtime environment, which
was now hosted in Azure datacenters instead of their own. At the same time, the
PaaS offerings in Azure had evolved and grown to become even more
sophisticated. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
It is common knowledge now, and it was common knowledge
back then that PaaS was the optimal service model for applications living in
the cloud, compared to IaaS. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<i>By the end of the
day, each and every developer and business around the globe would prefer to
host and provide their applications to customers as SaaS instead of anything
else, such as traditional client/server applications. <o:p></o:p></i></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>So where are we
now?<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
You probably might wonder where the heck I am going with this?
<o:p></o:p></div>
<div class="MsoNoSpacing">
And trust me, I also wondered at some point. I had to get
another cup of coffee before I was able to do a further breakdown.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Looking at Microsoft Azure and the services we have
there, it is clear to me that the ideal goal for the IaaS platform is to get as
near as possible to the PaaS components in regards to scalability, flexibility,
automation, resiliency, self-healing and much more. <o:p></o:p></div>
<div class="MsoNoSpacing">
For those who have been deep into Azure with Azure
Resource Manager know that there’s some really huge opportunities now to
leverage the actual platform to deliver IaaS that you ideally don’t have to
touch.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
With features such as VM Scale Sets (preview), Azure
Container Service (also preview), and a growing list of <i>extensions</i> to use together with your compute resources, you can
potentially instantiate a state-of-the-art infrastructure hosted in Azure,
without having to touch the infrastructure (of course you can’t touch Azure
infrastructure, but I am now talking about the virtual infrastructure itself,
the one you are basically responsible of). <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The IaaS building blocks in Azure is separated in a way
so that you can look at them as individual scale-units. Compute, Storage and
Networking are all combined to bring you virtual machines. Having this approach
with having the loosely coupled, we can also see that these building blocks are
empowering many of the PaaS components in Azure itself that lives upon the
IaaS. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The following graphic shows how the architecture is
layered.<o:p></o:p></div>
<div class="MsoNoSpacing">
Once Microsoft Azure Stack becomes available on-prem, we
will have one consistent platform that brings the same capabilities to your own
datacenter as you can use in Azure already.<o:p></o:p></div>
<div class="MsoNoSpacing">
<o:p><br /></o:p></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzs0zsmjE43dCuXEqqIPLlf-Ukyw1CvxKTSELgL3bBiQBCJCyZRZzwq0CXAgxcNp7m7GY98XLzsCerTV8qd0Rb_0LJD38-pVzBBxrrBGg-6FxZioFbDP6uIDvEObYn3ka797ZXUQj_vXU/s1600/iaaspaas.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="226" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzs0zsmjE43dCuXEqqIPLlf-Ukyw1CvxKTSELgL3bBiQBCJCyZRZzwq0CXAgxcNp7m7GY98XLzsCerTV8qd0Rb_0LJD38-pVzBBxrrBGg-6FxZioFbDP6uIDvEObYn3ka797ZXUQj_vXU/s400/iaaspaas.JPG" width="400" /></a></div>
<div class="MsoNoSpacing">
<o:p> </o:p> </div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Starting at the bottom, IaaS is on the left side while
PaaS is on the right hand side.<o:p></o:p></div>
<div class="MsoNoSpacing">
By climbing up, you can see that both Azure Stack and
Azure Public cloud – which will be consistent has the same approach. VMs and VM
Scale sets covers both IaaS and PaaS, but VM Scale Sets is place more on the
right hand side than VMs. This is because VM Scale Sets is considered as the
powering backbone from the other PaaS services on top of it. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Also VM Extensions leans more to the right as it gives us
the opportunity to do more than traditional IaaS. We can extend our virtual
machines to perform advanced in-guest operations when using extensions, so
anything from provisioning of complex applications, configuration management and
more can be handled automatically by the Azure platform. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
On the left hand side on top of VM Extensions, we will
find Cluster orchestration such as SCALR, RightScale, Mesos and Swarm. Again dealing
with a lot of infrastructure, but also providing orchestration on top of it.<o:p></o:p></div>
<div class="MsoNoSpacing">
Batch is a service that is powered by Azure compute and
is a compute job scheduling service that will start a pool of virtual machines
for you, installing applications and staging data, running jobs with as many
tasks as you have.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Going further to the right, we are seeing two very
interesting things – which also is the main driver for the entire blog post.
Containers and Service Fabric is leaning more to the PaaS side, and it is not
by coincident that Service Fabric is at the right hand side of containers.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Let us try to do a breakdown of containers and Service
Fabric<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Comparing
Containers and Service Fabric<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Right now in Azure, we have a new preview service that I encourage
everyone who’s interesting in container technology to look into. The ACS
Resource Provider provides you basically with a very efficient and low-cost
solution to instantiate a complete container environment using a single Azure
Resource Manager API call to the underlying resource provider. After completion
of the deployment, you will be surprised to find 23 resources within a single
resource groups containing all the components you need to have a complete
container environment up and running. <o:p></o:p></div>
<div class="MsoNoSpacing">
One important thing to note at this point is that ACS is
Linux first and containers first, in comparison to Service Fabric – which is
Windows first and also microservices first rather to container first.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
At this time it is ok to be confused. And perhaps this is
a good time for me to explain the difficulties to put this on paper.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I am now consuming the third cup of coffee.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Azure explains it
all<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Let us take some steps back to get some more context into
the discussion we are entering.<o:p></o:p></div>
<div class="MsoNoSpacing">
If you want to keep up with everything that comes in
Azure nowadays, that is more or less a full-time job. The rapid pace of
innovation, releases and new features is next to crazy. <o:p></o:p></div>
<div class="MsoNoSpacing">
Have you ever wondered how the engineering teams are able
to ship solutions this fast – also with this level of quality?<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Many of the services we are using today in Azure is
actually running <i>on</i> Service Fabric as
Microservices. This is a new way of doing development and is also the true
implementation of DevOps, both as a culture and also from a tooling point of
view. <o:p></o:p></div>
<div class="MsoNoSpacing">
Meeting customer expectations isn’t easy. But it is
possible when you have a platform that supports and enables it. <o:p></o:p></div>
<div class="MsoNoSpacing">
As I stated earlier in this blog post, the end goal for
any developer would be to deliver their solutions using the SaaS service model.
<o:p></o:p></div>
<div class="MsoNoSpacing">
That is the desired model which implies continuous
delivery, automation through DevOps, adoption of automatable, elastic and
scalable microservices.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Wait a moment. What
exactly is Service Fabric?<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Service Fabric provides the complete runtime management
for microservices and is dealing with the things we have been fighting against
for decades. Out-of-the box, we get hyper scale, partitioning, rolling
upgrades, rollbacks, health monitoring, load balancing, failover and
replication. All of these capabilities is built-in so we can focus on building
those applications we want to be scalable, reliable, consistent and available
microservices.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Service Fabric provides a model so you can wrap together
the code for a collection of related microservices and their related
configuration manifests to an application package. The package is then deployed
to a Service Fabric Cluster (this is actually a cluster that runs on one as
much as many thousands Windows virtual machines – yes, hyper scale). We have
two defined programming models in Service Fabric, which is ‘Reliable Actor’ and
‘Reliable Service’. Both of these models provides you with – and makes it
possible to write both stateless and stateful applications. This is breaking
news. <o:p></o:p></div>
<div class="MsoNoSpacing">
You can go ahead and create and develop stateless
applications in more or less the same way you have been doing for years, trusting
to externalize the state to some queuing system or some other data store, but
again handling the complexity of having a distributed application at scale.
Personally I think the stateful approach in Service Fabric is what make this so
exciting. Being able to write stateful applications that is constantly
available, having a primary/replica relationship with its members is very
tempting. We are trusting the Service Fabric itself to deal with all the
complexity we have been trying to enable in the Infrastructure layer for years,
at the same time as the stateful microservices keep the logic and data close so
we don’t need queues and caches. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Ok, but what about
the container stuff you mentioned?<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
So Service Fabric provides everything out of the box. You
can think of it as a complete way to handle everything from beginning to the
end, including a defined programming model that even brings an easy way of
handling stateful applications.<o:p></o:p></div>
<div class="MsoNoSpacing">
ACS on the other side provides a core infrastructure
which provides significant flexibility but this brings a cost when trying to implement <i>stateful</i> services. However,
the applications themselves are more portable since we can run them wherever
Docker containers can run, while microservices on Service Fabric can only run
on Service Fabric. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The focus for ACS right now is around open source
technologies that can be taken in whole or in part. The orchestration layer and
also the application layer brings a great level of portability as a result of
that, where you can leverage open source components and deploy them wherever
you want. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In the end of the day, Service Fabric has a more restrictive
nature but also gives you a more rapid development experience, while ACS
provides the most flexibility.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>So what exactly is
the comparison of Containers and microservices with Service Fabric at this
point?<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
What they indeed do have in common is that this is
another layer of abstraction in addition to the things we are already dealing
with. Forget what you know about virtual machines for a moment. Containers and
microservices is exactly what engineers and developers are demanding to unlock
new business scenarios, especially in a time where IoT, Big Data, insight and analytics
is becoming more and more important for businesses world wide. The cloud itself
is the foundation that enables all of this, but having the great flexibility
that both container – and service fabric provides is really speeding up the
innovation we’re seeing.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
For organizations that has truly been able to adopt the
DevOps mindset, they are harnessing that investment and is capable of shipping
quality code at a much more frequent cadence than ever before. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Coffee number 4
and closing notes<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
First I want to thank you for spending these minutes
reading my thoughts around Azure, containers, microservices, Service Fabric and
where we’re heading. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
2016 is a very exciting year and things are changing very
fast in this industry. We are seeing customers who are making big bets in
certain areas, while others are taking a potential risk of not making any bets
at all. I know at least from my point of view what’s the important focus moving
forward. And I will do my best to guide people on my way.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
While writing these closing notes, I can only use the
opportunity to point to the tenderloin in this blog post:</div>
<div class="MsoNoSpacing">
<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
My background is all about ensuring that the
Infrastructure is providing whatever the applications need. <o:p></o:p></div>
<div class="MsoNoSpacing">
That skillset is far from obsolete, however, I know that
the true value belongs to the upper layers. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
We are hopefully now realizing that even the
infrastructure that we have been ever so careful about is turning into
commodity, and now handled more through an ‘infrastructure as code’ approach
than ever before, trusting that it works, empowers the PaaS components – that again
brings the world forward while powering SaaS applications. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Container technologies and Microservices as part of
Service Fabric is taking that for granted, and from now on, I am doing the
same.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com1tag:blogger.com,1999:blog-893729307599410422.post-75092680951367536572015-12-21T11:24:00.000+01:002015-12-21T11:24:24.620+01:00Azure Windows Server Container with IIS<div class="MsoNoSpacing">
A couple of months ago, Microsoft announced their plans
for Azure and containers where they would provide you with a first class
citizen resource provider in Azure so that you could build, run and manage
scalable clusters of hosts machines onto which containerized applications would
be running. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
What you also probably have noticed is that Microsoft is
having an open approach to container management. In fact, the container service
is currently based and pre-configured with Docker and Apache Mesos, so any
tools you would prefer for management “should just work”.<o:p></o:p></div>
<div class="MsoNoSpacing">
This is a new game for me to play so I am learning a lot.
<span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;">J</span><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In the meantime, I am also working a lot with Windows
Server Containers in Windows Server Technical Preview 4 – which is an image
that is available in the Azure gallery.<o:p></o:p></div>
<div class="MsoNoSpacing">
However, I wanted to extend the experience a bit and
decided to create my own ARM template that will ‘mimic’ some of the
functionality in the Azure Container Resource Provider, to actually instantiate
a new container running IIS Web-Server and be available for requests.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The template will deploy:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->A Vnet<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Network interface<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Public IP address with DNS (the DNS will be
based on the hostname.region.cloudapp.azure.com and provided as output once the
deployment has completed)<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Storage account<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Network Security Group to allow RDP to the host –
as well as http<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Virtual machine (based on the TP4 image)<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.0in; mso-list: l0 level2 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]-->Custom
Extension that will:<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.5in; mso-list: l0 level3 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;">§<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]-->Spin
up a new Windows Server Container based on the existing image (server core)<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.5in; mso-list: l0 level3 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;">§<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]-->Install
Web-Server within the newly created container<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.5in; mso-list: l0 level3 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;">§<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]-->Stop
the container – and create a new container image<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.5in; mso-list: l0 level3 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;">§<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]-->Deploy
a new container based on the newly created container image<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.5in; mso-list: l0 level3 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;">§<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]-->Create
a static NAT rule and a firewall rule to allow traffic on port 80 to the
container from the host<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This is a working experiment and I am planning to extend
the template with more applicable tasks as we move forward.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The template can be explored and deployed from this GitHub repo: </div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
https://github.com/krnese/AzureDeploy/tree/master/AzureContainerWeb </div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkcGDROCdSUia16l2OeM5f2qdewi7PY4-97zJorFNzf023iWzQB4XVTzmNTrX43Kav8kuxtkJiPjlWmnu1tHMwRVYoLe3L-iRXPlPS7uPAg61dF2zo82_VnGcHGo_SYyzCD-Ff3vUhNb0/s1600/azurecontainer.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="304" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkcGDROCdSUia16l2OeM5f2qdewi7PY4-97zJorFNzf023iWzQB4XVTzmNTrX43Kav8kuxtkJiPjlWmnu1tHMwRVYoLe3L-iRXPlPS7uPAg61dF2zo82_VnGcHGo_SYyzCD-Ff3vUhNb0/s320/azurecontainer.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com0tag:blogger.com,1999:blog-893729307599410422.post-85406489557798797522015-12-03T08:07:00.000+01:002015-12-03T08:07:17.196+01:00Getting started with Containers in Azure<div class="MsoNoSpacing">
Recently, I had a presentation/workshop in Norway at a
Docker conference (<a href="http://www.code-conf.com/day-of-docker-osl15/program/#knese">http://www.code-conf.com/day-of-docker-osl15/program/#knese</a>
)</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj85eqR9xblc-Vq9AG2CJwfUMzi94DmnZ_mVI3NhlY-MhiLLfptHqv7aGuDNWMbV3yq9B3Dp_4p7w6i5HFWIQk1MgfPLKCREkmzktxxAmSL6KqBf72QpDYhDspo0_Do13miriv3BbyGcTc/s1600/docker.jpg" imageanchor="1"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj85eqR9xblc-Vq9AG2CJwfUMzi94DmnZ_mVI3NhlY-MhiLLfptHqv7aGuDNWMbV3yq9B3Dp_4p7w6i5HFWIQk1MgfPLKCREkmzktxxAmSL6KqBf72QpDYhDspo0_Do13miriv3BbyGcTc/s320/docker.jpg" width="180" /></a></div>
<div class="MsoNoSpacing">
<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This was quite a new audience for me and it was great to
be the person who showed them what Microsoft is doing in the era of container
technologies, using both Microsoft Azure and Windows Server 2016 Technical
Preview 4.<o:p></o:p></div>
<div class="MsoNoSpacing">
<o:p><br /></o:p></div>
<div class="MsoNoSpacing">
<o:p><b>The big picture</b> </o:p></div>
<div class="MsoNoSpacing">
<o:p><br /></o:p></div>
<div class="MsoNoSpacing">
One of the key things to point out is that containers are
“just” a part of the big picture that we are seeing in these days.<o:p></o:p></div>
<div class="MsoNoSpacing">
The following graphic shows where we are coming from –
and also where we’re heading.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEv1TtIMhnUCAWmMR7ctflBuUYDeB-_nZJr7lwHTCiz7-7Lz3vYG95PhiMtiMJPHtdRjJvCoEiDMcf7wYUKCind9JcE_CwzPdFFBoEAgYH1w5F8uYjygFhQ2xgPc9QbWY6Ln5D8gkGGmc/s1600/container.JPG" imageanchor="1"><img border="0" height="253" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEv1TtIMhnUCAWmMR7ctflBuUYDeB-_nZJr7lwHTCiz7-7Lz3vYG95PhiMtiMJPHtdRjJvCoEiDMcf7wYUKCind9JcE_CwzPdFFBoEAgYH1w5F8uYjygFhQ2xgPc9QbWY6Ln5D8gkGGmc/s400/container.JPG" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Starting at the bottom, the early generation in this
industry used to have a lot of physical machines to run their business. We all
know that having workloads and applications on physical machines is not where
we want to be today, because that is not flexible, scalable and for sure want
do any good for our demand for utilization.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Above physical machines we can find machine
virtualization. This should all be quite common now and we have been very good
at virtualizing servers for quite some time. In fact, we are now not only
virtualizing servers – but also the other infra components too, such as
networks and storage.<o:p></o:p></div>
<div class="MsoNoSpacing">
Machine virtualization in this context is showing us that
we are abstracting the compute resources from the underlying physical machine –
which introduces us to the first stepping stones towards flexibility,
scalability and increase the utilization.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Further, we have infrastructure hosting which can be seen
as the early days of cloud, although the exact service model here is not
defined. This means that “someone” would do the investment and ensure the
required amount of capacity for you as a customer, and you can have your
workloads and applications hosted in the hosting datacenter. This was machine
virtualization at scale.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The next step is the more familiar service models we can
consume from a cloud, such as Infrastructure as a Service, Platform as a Service
and Software as a Service. Although these service models are different, they
share the same set of attributes such as elasticity, self-servicing, broad
network access, chargeback/usage and resource pooling. Especially elasticity
and resource pooling is a way to describe the level of flexibility, scalability
and utilization we can achieve. I expect you as the reader to be quite
comfortable with cloud computing in general, so I won’t dive deeper into the
definition at this point.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Next, we are now facing an era where containers are lit
up – regardless whether you are a developer or IT-pro. Containers builds on
many of the same principals as machine virtualization, where abstraction is
key. A container can easily be lifted – and shifted to other deployment
environments without having the same cost, luggage and complexity as a virtual
machine – as a comparison. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In the Microsoft world we have two different runtimes for
containers.<o:p></o:p></div>
<div class="MsoNoSpacing">
Windows Server Containers that are sharing the kernel
with the container <i>host</i> which is
ideal for scalability, performance and resource utilization. <o:p></o:p></div>
<div class="MsoNoSpacing">
Hyper-V Containers gives you the exact same experience,
only that the kernel in this case isn’t shared among the containers. This is
something you need to specify during deployment time. Hyper-V Containers will
give you the level of isolation you require and is ideal when the containers
aren’t trusting each other nor the container host.<o:p></o:p></div>
<div class="MsoNoSpacing">
Microsoft has also announced that they will come with
their own Azure Container Service in the future, as a first-class citizen
resource provider managed by ARM.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Last but not least, we have something called “microservices”
on the top in this graphic. In the context of Microsoft we are talking about
Service Fabric – which is currently a preview feature in Microsoft Azure today.<o:p></o:p></div>
<div class="MsoNoSpacing">
Service Fabric is a distributed system platform where you
can build scalable, reliable and easily managed applications for the cloud. This
is where we are really seeing that the redundancy, high-availability,
resiliency and flexibility isn’t built into the infrastructure – but handled at
the application level instead.<o:p></o:p></div>
<div class="MsoNoSpacing">
Service Fabric represents the next-generation middleware
platform for building and managing these enterprise class, tier-1 cloud scale
services.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<i>From a Microsoft
Azure standpoint it is also important that you know that “VM Scale Sets” (<a href="http://kristiannese.blogspot.no/2015/11/getting-started-with-vm-scale-sets-with.html">http://kristiannese.blogspot.no/2015/11/getting-started-with-vm-scale-sets-with.html</a>
) is the IaaS that enables these PaaS services (Azure Container Service +
Service Fabric).<o:p></o:p></i></div>
<div class="MsoNoSpacing">
<i>Also, as part of
Windows Server 2016 Technical Preview 4, we will be able to leverage Nano
Server for containers too, so you can get the optimal experience for your
born-in-the-cloud applications.<o:p></o:p></i></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
So, that was me trying to put things into context and why
I spent some time that day to have a workshop on Containers using Azure.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Getting started with Containers in Microsoft Azure</b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The material I used for this workshop can be found in
this public GitHub repo: <a href="https://github.com/krnese/AzureDeploy/tree/master/AzureContainer">https://github.com/krnese/AzureDeploy/tree/master/AzureContainer</a><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWscIshMGA8Wq-Ij-eCyKoeup1X541PiaBHZHXu_SVRn9IvhI9_J0q8m9n_vYvSk-WBMs1h8vvC2H3sOFNFTW3lT20VRwZx4HFOq3BOQ1LxGFMNqKujMsmB49fmmZBw5INLqSejDhH3Ec/s1600/container2.JPG" imageanchor="1"><img border="0" height="321" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWscIshMGA8Wq-Ij-eCyKoeup1X541PiaBHZHXu_SVRn9IvhI9_J0q8m9n_vYvSk-WBMs1h8vvC2H3sOFNFTW3lT20VRwZx4HFOq3BOQ1LxGFMNqKujMsmB49fmmZBw5INLqSejDhH3Ec/s400/container2.JPG" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I created an ARM template that will:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Create a new storage account<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Create a new Network Security Group<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.0in; mso-list: l0 level2 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]-->Create
a new vNet and associate the new subnet with the NSG<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Create a new network interface<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.0in; mso-list: l0 level2 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]-->Associate
the vNic with a public IP address<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.0in; mso-list: l0 level2 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]-->Associate
the vNic with the vNet<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Create a new virtual machine<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.0in; mso-list: l0 level2 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]-->Associate
the VM with the storage account<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.0in; mso-list: l0 level2 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]-->Associate
the VM with the network interface<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.0in; mso-list: l0 level2 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;"> </span></span><!--[endif]-->Use
Custom Script Extension that will create x amount of Windows Server Containers
based on the parameter (count) input<o:p></o:p></div>
<div class="MsoNoSpacing">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh9Ae2LkLdYEL0G0xEZyJF82DQolQuKJiehZIEpp3MH0qBu7m7ABw4F8_fxdQZmwuuW1Tdj82Jm4jPH-js6vnm5CTwXvpfIrWVcRLEzrctunKSBt8mGQZoXtWJi3_pDqkKD_wLoXQ-FeI/s1600/container3.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh9Ae2LkLdYEL0G0xEZyJF82DQolQuKJiehZIEpp3MH0qBu7m7ABw4F8_fxdQZmwuuW1Tdj82Jm4jPH-js6vnm5CTwXvpfIrWVcRLEzrctunKSBt8mGQZoXtWJi3_pDqkKD_wLoXQ-FeI/s400/container3.JPG" width="331" /></a><o:p> </o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
If you deploy this from GitHub and follow the ps1
examples you should be able to simulate the life-cycle of containers in Windows
Server 2016 TP4.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<o:p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-YVx606oijDQ4e9be59lfdNTJI4-fx9oXcxL_lCYNTLbWZTC40VSIcBaZYNfmVIzj_vRr2uKqZha8Av0OhbOEWQTMksxHRK-9QcN_Dxwewisf1DqQ6G4QLe7YKHGHKVXAPIIQnUAjhmA/s1600/container4.JPG" imageanchor="1"><img border="0" height="155" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-YVx606oijDQ4e9be59lfdNTJI4-fx9oXcxL_lCYNTLbWZTC40VSIcBaZYNfmVIzj_vRr2uKqZha8Av0OhbOEWQTMksxHRK-9QcN_Dxwewisf1DqQ6G4QLe7YKHGHKVXAPIIQnUAjhmA/s400/container4.JPG" width="400" /></a></o:p></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com0tag:blogger.com,1999:blog-893729307599410422.post-37261244090065462062015-11-20T12:36:00.000+01:002015-11-20T12:36:58.127+01:00Getting started with VM Scale Sets with Azure Resource Manager<div class="MsoNoSpacing">
Recently, Microsoft announced the public preview of ‘VM
Scale Sets’ which is a new Azure Compute resource
(Microsoft.Compute/virtualMachineScaleSets) that lets customers deploy and
manage a set of virtual machines that are identical.</div>
<div class="MsoNoSpacing">
<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Sounds familiar?<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Yes, but at the same time, this is new. Let me explain
why.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Azure Compute, Network and Storage serves as the backend
for many familiar Azure Services that we are using already today, such as Web
Apps, Batch, Azure Automation and much more. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
You have probably also heard about the newly announced
public preview of Service Fabric – which is the ideal platform for microservices
and containerized workloads to ensure business continuity and reliable
applications, completely changing the way customers can develop applications at
hyper-scale. <o:p></o:p></div>
<div class="MsoNoSpacing">
But did you know that the Service Fabric is also a
service that runs on top of a virtual machine, requires network connectivity
using a “normal” network in Azure and also can use some of the storage features
in the backend?<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
That is also where the VM Scale Sets can come into play,
serving as the perfect foundation for those kind of services and applications
you want to build. <o:p></o:p></div>
<div class="MsoNoSpacing">
VM Scale Sets are designed to support autoscale and doesn’t
require any pre-provisioning of the virtual machines.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Network and storage features are of course incorporated as
you would expect, so that you can easily leverage VM Scale Sets as a first
class citizen in Azure, following the Resource Group structure you prefer.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I encourage you to take a closer look at VM Scale Sets,
which is a new resource type within the Microsoft.Compute namespace for the
CRP.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I have already created an Azure Resource Manager template
that let you deploy VM Scale Sets – using DSC VM Extension to configure
Web-Server (IIS), as well as deploying a virtual machine you can use for
management. <o:p></o:p></div>
<div class="MsoNoSpacing">
There’s also additional details such as load balancing,
network security groups and more that you can explore.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<a href="https://github.com/krnese/AzureDeploy/tree/master/VMScaleSets">https://github.com/krnese/AzureDeploy/tree/master/VMScaleSets</a><o:p></o:p></div>
<div class="MsoNoSpacing">
<o:p><br /></o:p></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivnKP4vPYU0elFUo4uy1yZ8b8zZvswgk3ajuYgGqTiFOZ7rWqlwmUbzuSPR2eLPeAj-ZI2LNWFbbVAG9SnPTmTi_bTHvyIfFQalj-E4rBfgmRlNV-hDGCiNzdtUPHK_j_9rqtMwHghbV8/s1600/vmss2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="265" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivnKP4vPYU0elFUo4uy1yZ8b8zZvswgk3ajuYgGqTiFOZ7rWqlwmUbzuSPR2eLPeAj-ZI2LNWFbbVAG9SnPTmTi_bTHvyIfFQalj-E4rBfgmRlNV-hDGCiNzdtUPHK_j_9rqtMwHghbV8/s320/vmss2.JPG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheCJQ3HpmrqjIfPrKtyVTRFlY_kDRgDZdpROMLOsUde-qDQ9Z7l7fLfQFrba3GBeyIZPsexkhmHLyjExWlazMGV5ROkbrJ9h45SiyJNLu2TylXUt-zb-dkPIyZ29crW9noHipLELNAhVw/s1600/vmss.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheCJQ3HpmrqjIfPrKtyVTRFlY_kDRgDZdpROMLOsUde-qDQ9Z7l7fLfQFrba3GBeyIZPsexkhmHLyjExWlazMGV5ROkbrJ9h45SiyJNLu2TylXUt-zb-dkPIyZ29crW9noHipLELNAhVw/s320/vmss.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<o:p><br /></o:p></div>
<div class="MsoNoSpacing">
Have fun – and happy scaling! <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com0tag:blogger.com,1999:blog-893729307599410422.post-30551693705990932952015-10-29T00:23:00.001+01:002015-10-29T00:23:41.183+01:00Azure Resource Manager – Deployment options<div class="MsoNoSpacing">
Hi
all,</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This is just a quick blog post to demonstrate how to
provision an IaaS environment in Azure with the VM DSC extension to instantiate
a new Web Server (IIS). <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Say what?<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
You have probably seen many examples of this already, so I
won’t try to sell you something new here.<o:p></o:p></div>
<div class="MsoNoSpacing">
However, I want to point out the difference of using an
Azure Resource Manager template (.json, declarative) compared to using
PowerShell – in an imperative way.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The reason for this blog post is the newly released
AzureRM PowerShell module which introduces us to a new set of cmdlets (the
downside here is that I am now forced to update the whitepaper… <a href="https://gallery.technet.microsoft.com/Cloud-Consistency-with-0b79b775">https://gallery.technet.microsoft.com/Cloud-Consistency-with-0b79b775</a>
).<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Where we are
coming from<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Previously with the Service Management API, we normally
created our virtual machines in a similar way to this:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$image</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AzureVMImage</span> <span style="color: navy;">-ImageName</span>
<span style="color: darkred;">"a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-201412.01-en.us-127GB.vhd"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$vnet</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AzureVNetSite</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$vm</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">New-AzureVMConfig</span> <span style="color: navy;">-Name</span>
<span style="color: orangered;">$VMName</span> <span style="color: navy;">-InstanceSize</span>
<span style="color: darkred;">"Basic_A2"</span> <span style="color: navy;">-ImageName</span> <span style="color: orangered;">$image</span><span style="color: darkgrey;">.</span>ImageName<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">### Deploy a new domain joined VM</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$vm</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Add-AzureProvisioningConfig</span> <span style="color: navy;">-VM</span>
<span style="color: orangered;">$vm</span> <span style="color: navy;">-AdminUsername</span>
<span style="color: orangered;">$username</span> <span style="color: navy;">-Password</span>
<span style="color: orangered;">$pwd</span> <span style="color: navy;">-WindowsDomain</span>
<span style="color: navy;">-JoinDomain</span> <span style="color: darkred;">"azure.systemcenter365.com"</span>
<span style="color: navy;">-Domain</span> <span style="color: darkred;">"azure"</span>
<span style="color: navy;">-DomainUserName</span> <span style="color: darkred;">"knadm"</span>
<span style="color: navy;">-DomainPassword</span> <span style="color: darkred;">"superPWD"</span>
<span style="color: darkgrey;">|</span> <span style="color: blue;">Set-AzureSubnet</span>
<span style="color: navy;">-SubnetNames</span> <span style="color: orangered;">$vnet</span><span style="color: darkgrey;">.</span>subnets<span style="color: darkgrey;">.</span>name
<span style="color: darkgrey;">|</span> <span style="color: blue;">Set-AzureStaticVNetIP</span>
<span style="color: navy;">-IPAddress</span> <span style="color: darkred;">"10.0.40.52"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">New-AzureVM</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-VM</span> <span style="color: orangered;">$vm</span> <span style="color: navy;">-Location</span> <span style="color: darkred;">"North Europe"</span> <span style="color: navy;">-VNetName</span>
<span style="color: orangered;">$vnet</span><span style="color: darkgrey;">.</span>name
<span style="color: navy;">-ServiceName</span> <span style="color: orangered;">$ServiceName</span>
<span style="color: navy;">-Verbose</span> <span style="color: navy;">-WaitForBoot</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNoSpacing">
Also, if I wanted to add DSC to my VM using the Service
Management API, I would have to do something like this:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Fire and forget some DSC</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$dscvm</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AzureVM</span> <span style="color: navy;">-ServiceName</span>
<span style="color: orangered;">$ServiceName</span> <span style="color: navy;">-Name</span>
<span style="color: orangered;">$VMName</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Set-AzureVMDSCExtension</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-VM</span> <span style="color: orangered;">$dscvm</span> <span style="color: navy;">-ConfigurationArchive</span> <span style="color: darkred;">"azureDSCDemo.ps1.zip"</span>
<span style="color: navy;">-ConfigurationName</span> <span style="color: darkred;">"tester"</span>
<span style="color: darkgrey;">|</span> <span style="color: blue;">Update-AzureVM <o:p></o:p></span></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This has drastically changed with Azure Resource Manager,
which introduces us to a new world with a lot of more opportunities (someone
would also say more complexity). <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Where we are going</b><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In order to show you where we are heading with this, I
would like to point you to my GitHub repo where you can find some learning
examples on how this looks like by using Azure Resource Manager <i>templates</i> – but also the new AzureRM
PowerShell module<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>ARM Template with
a single-button deployment + PowerShell cmdlet for deployment<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<a href="https://github.com/krnese/AzureDeploy/tree/master/DSCExample">https://github.com/krnese/AzureDeploy/tree/master/DSCExample</a>
<o:p></o:p><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRlqojVDlzFYGT_QZpU36MODOJ8wonyS8oV8k2ViUpACvMEhFaDY8M7s6xA6kYqhUI_QyY5yHQ40hPfBPzBfLaUP-w_ohxIblf3PzCyRPdwc38zHmmo2OQWlBa5fmx5ln5n2mmVfEvk-g/s1600/armarm.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="321" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRlqojVDlzFYGT_QZpU36MODOJ8wonyS8oV8k2ViUpACvMEhFaDY8M7s6xA6kYqhUI_QyY5yHQ40hPfBPzBfLaUP-w_ohxIblf3PzCyRPdwc38zHmmo2OQWlBa5fmx5ln5n2mmVfEvk-g/s400/armarm.JPG" width="400" /></a></div>
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>PowerShell script
using the new AzureRM Module to create IaaS environment with DSC<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<a href="https://github.com/krnese/AzureDeploy/blob/master/PS/AzureRM%201.0.ps1">https://github.com/krnese/AzureDeploy/blob/master/PS/AzureRM%201.0.ps1</a>
<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Here’s the example using PowerShell: <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Connect to your Azure subscription</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Add-AzureRmAccount</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-Credential</span> (<span style="color: blue;">get-credential</span>)<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Add some variables that you will use as you move forward</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Global</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$RGname</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"KNRGTest01"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$Location</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"west europe"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span lang="NO-BOK" style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-ansi-language: NO-BOK; mso-bidi-font-family: "Lucida Console";"># Storage</span><span lang="NO-BOK" style="font-family: "Lucida Console"; font-size: 9.0pt; mso-ansi-language: NO-BOK; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span lang="NO-BOK" style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-ansi-language: NO-BOK; mso-bidi-font-family: "Lucida Console";">$StorageName</span><span lang="NO-BOK" style="font-family: "Lucida Console"; font-size: 9.0pt; mso-ansi-language: NO-BOK; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span>
<span style="color: darkred;">"Knstor5050"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span lang="NO-BOK" style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-ansi-language: NO-BOK; mso-bidi-font-family: "Lucida Console";">$StorageType</span><span lang="NO-BOK" style="font-family: "Lucida Console"; font-size: 9.0pt; mso-ansi-language: NO-BOK; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span>
<span style="color: darkred;">"Standard_LRS"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Network</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$vnicName</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"vmvNic"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$Subnet1Name</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"Subnet1"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$vNetName</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"KNVnet01"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$vNetAddressPrefix</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"192.168.0.0/16"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$vNetSubnetAddressPrefix</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"192.168.0.0/24"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Compute</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$VMName</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"KNVM01"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$ComputerName</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: orangered;">$VMName</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$VMSize</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"Standard_A2"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$OSDiskName</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: orangered;">$VMName</span> <span style="color: darkgrey;">+</span> <span style="color: darkred;">"osDisk"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Create a new Azure Resource Grou</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$RG</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">New-AzureRmResourceGroup</span> <span style="color: navy;">-Name</span>
<span style="color: orangered;">$RGname</span> <span style="color: navy;">-Location</span>
<span style="color: orangered;">$location</span> <span style="color: navy;">-Verbose</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Create Storage</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$StorageAccount</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">New-AzureRmStorageAccount</span>
<span style="color: navy;">-ResourceGroupName</span> <span style="color: orangered;">$RGname</span>
<span style="color: navy;">-Name</span> <span style="color: blueviolet;">knstor5050</span>
<span style="color: navy;">-Type</span> <span style="color: orangered;">$StorageType</span>
<span style="color: navy;">-Location</span> <span style="color: orangered;">$Location</span>
<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Create Network</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$PIP</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">New-AzureRmPublicIpAddress</span> <span style="color: navy;">-Name</span>
<span style="color: orangered;">$vnicName</span> <span style="color: navy;">-ResourceGroupName</span>
<span style="color: orangered;">$RGname</span> <span style="color: navy;">-Location</span>
<span style="color: orangered;">$Location</span> <span style="color: navy;">-AllocationMethod</span>
<span style="color: blueviolet;">Dynamic</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$SubnetConfig</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">New-AzureRmVirtualNetworkSubnetConfig</span>
<span style="color: navy;">-Name</span> <span style="color: orangered;">$Subnet1Name</span>
<span style="color: navy;">-AddressPrefix</span> <span style="color: orangered;">$vNetSubnetAddressPrefix</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$vNET</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">New-AzureRmVirtualNetwork</span> <span style="color: navy;">-Name</span>
<span style="color: orangered;">$vNetName</span> <span style="color: navy;">-ResourceGroupName</span>
<span style="color: orangered;">$RGname</span> <span style="color: navy;">-Location</span>
<span style="color: orangered;">$Location</span> <span style="color: navy;">-AddressPrefix</span>
<span style="color: orangered;">$vNetAddressPrefix</span> <span style="color: navy;">-Subnet</span> <span style="color: orangered;">$SubnetConfig</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$Interface</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">New-AzureRmNetworkInterface</span>
<span style="color: navy;">-Name</span> <span style="color: orangered;">$vnicName</span>
<span style="color: navy;">-ResourceGroupName</span> <span style="color: orangered;">$RGname</span>
<span style="color: navy;">-Location</span> <span style="color: orangered;">$Location</span>
<span style="color: navy;">-SubnetId</span> <span style="color: orangered;">$vnet</span><span style="color: darkgrey;">.</span>Subnets<span style="color: darkgrey;">[</span><span style="color: purple;">0</span><span style="color: darkgrey;">].</span>Id <span style="color: navy;">-PublicIpAddressId</span> <span style="color: orangered;">$pip</span><span style="color: darkgrey;">.</span>Id<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Create Compute</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Setup local VM object</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$Credential</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-Credential</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$VirtualMachine</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">New-AzureRmVMConfig</span>
<span style="color: navy;">-VMName</span> <span style="color: orangered;">$VMName</span>
<span style="color: navy;">-VMSize</span> <span style="color: orangered;">$VMSize</span>
<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$VirtualMachine</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Set-AzureRmVMOperatingSystem</span>
<span style="color: navy;">-VM</span> <span style="color: orangered;">$VirtualMachine</span>
<span style="color: navy;">-Windows</span> <span style="color: navy;">-ComputerName</span>
<span style="color: orangered;">$ComputerName</span> <span style="color: navy;">-Credential</span>
<span style="color: orangered;">$credential</span> <span style="color: navy;">-ProvisionVMAgent</span>
<span style="color: navy;">-EnableAutoUpdate</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$VirtualMachine</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Set-AzureRmVMSourceImage</span>
<span style="color: navy;">-VM</span> <span style="color: orangered;">$VirtualMachine</span>
<span style="color: navy;">-PublisherName</span> <span style="color: blueviolet;">MicrosoftWindowsServer</span>
<span style="color: navy;">-Offer</span> <span style="color: blueviolet;">WindowsServer</span>
<span style="color: navy;">-Skus</span> <span style="color: blueviolet;">2012-R2-Datacenter</span>
<span style="color: navy;">-Version</span> <span style="color: darkred;">"latest"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$VirtualMachine</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Add-AzureRmVMNetworkInterface</span>
<span style="color: navy;">-VM</span> <span style="color: orangered;">$VirtualMachine</span>
<span style="color: navy;">-Id</span> <span style="color: orangered;">$interface</span><span style="color: darkgrey;">.</span>Id <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$OSDiskUri</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: orangered;">$StorageAccount</span><span style="color: darkgrey;">.</span>PrimaryEndpoints<span style="color: darkgrey;">.</span>Blob<span style="color: darkgrey;">.</span>ToString() <span style="color: darkgrey;">+</span>
<span style="color: darkred;">"vhds/"</span> <span style="color: darkgrey;">+</span>
<span style="color: orangered;">$OSDiskName</span> <span style="color: darkgrey;">+</span>
<span style="color: darkred;">".vhd"</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$VirtualMachine</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Set-AzureRmVMOSDisk</span>
<span style="color: navy;">-VM</span> <span style="color: orangered;">$VirtualMachine</span>
<span style="color: navy;">-Name</span> <span style="color: orangered;">$OSDiskName</span>
<span style="color: navy;">-VhdUri</span> <span style="color: orangered;">$OSDiskUri</span>
<span style="color: navy;">-CreateOption</span> <span style="color: blueviolet;">fromImage</span>
<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Deploy the VM in Azure</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">New-AzureRmVM</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-ResourceGroupName</span>
<span style="color: orangered;">$RGname</span> <span style="color: navy;">-Location</span>
<span style="color: orangered;">$Location</span> <span style="color: navy;">-VM</span>
<span style="color: orangered;">$VirtualMachine</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Publish DSC config to your newly created storage account</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Publish-AzureRmVMDscConfiguration</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-ResourceGroupName</span> <span style="color: orangered;">$RGname</span>
<span style="color: navy;">-ConfigurationPath</span> <span style="color: blueviolet;">.\webdsc.ps1</span>
<span style="color: navy;">-StorageAccountName</span> <span style="color: blueviolet;">knstor5050</span>
<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Add DSC Extension with config to the newly created VM</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Set-AzureRmVMDscExtension</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-ResourceGroupName</span> <span style="color: orangered;">$RGname</span>
<span style="color: navy;">-VMName</span> <span style="color: orangered;">$virtualmachine</span><span style="color: darkgrey;">.</span>Name <span style="color: navy;">-ArchiveBlobName</span>
<span style="color: blueviolet;">webdsc.ps1.zip</span> <span style="color: navy;">-ArchiveStorageAccountName</span>
<span style="color: blueviolet;">knstor5050</span> <span style="color: navy;">-ConfigurationName</span>
<span style="color: blueviolet;">webdsc</span> <span style="color: navy;">-Version</span>
<span style="color: purple;">2.7</span> <span style="color: navy;">-Location</span>
<span style="color: orangered;">$location</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
#
Good night</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Please have a look at these examples, and I encourage you
to explore the new opportunities with the AzureRM module.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
Happy ARMing!<br />
<div class="MsoNoSpacing">
<o:p></o:p></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com0tag:blogger.com,1999:blog-893729307599410422.post-26224958698277051312015-10-02T12:10:00.000+02:002015-10-02T12:10:10.522+02:00Azure Resource Manager - Linking Templates<div class="MsoNoSpacing">
This summer, we wrote a whitepaper named <b>«Cloud
Consistency with Azure Resource Manager» </b>that you can download from here: <a href="https://gallery.technet.microsoft.com/Cloud-Consistency-with-0b79b775">https://gallery.technet.microsoft.com/Cloud-Consistency-with-0b79b775</a></div>
<div class="MsoNoSpacing">
<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This whitepaper will soon be updated with new content,
more examples and guidance around best practices for template authoring.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In the meantime I’ve been writing some templates that can
be used by you to learn how you can link templates to have a nested deployment.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The basic example is available on GitHub - <a href="https://github.com/krnese/AzureDeploy/tree/master/Basic">https://github.com/krnese/AzureDeploy/tree/master/Basic</a><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX0yalLisj9vk_9U5OLB2Dsvb_gm3N8NS9yHqSmOUKyvRvgkFWXdGdvRdMZHv6nzwk6C4Xd78RFBmtdD9c4pZuBGI6rAPeRer4rL-D53P4XMK9pPXHoElxnHoxwzga62Pp40lqz_tFH58/s1600/nested+IaaS.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="289" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiX0yalLisj9vk_9U5OLB2Dsvb_gm3N8NS9yHqSmOUKyvRvgkFWXdGdvRdMZHv6nzwk6C4Xd78RFBmtdD9c4pZuBGI6rAPeRer4rL-D53P4XMK9pPXHoElxnHoxwzga62Pp40lqz_tFH58/s320/nested+IaaS.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
You can explore all templates, but in essence I’m doing
the following:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Have a dedicated template for storage that takes
some input parameters and can be used separately <o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Have a dedicated template for virtual network
that takes some input parameters and can be used separately<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Have a master template that also contains
compute, vNic and publicIP resource types that links to the storage and vnet
templates<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Again, this is a very easy example and I will provide you
with a more advanced example in a couple of days where we split this up even
further and are able to have a much more flexible and dynamic deployment
scenario around IaaS/PaaS.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Pay attention to the resource section in the
azuredeploy.json document, where we are using the API version “2015-01-01” and
the resource type “Microsoft.Resources/deployments”.<o:p></o:p></div>
<div class="MsoNoSpacing">
Here I am linking to a public Uri for the template
(hosted on my github) and specify the parameters I’d like to use in my
configuration.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGgdxNbelyT4jA6G-bKAv0gCpILoN0itUHDiqHCHRZSQeVDQmLQK80ZZZXYX4K_KMyMngo2tJsRsh_eLBsnV4oGzskPUGRiBRceNfa7B2LG7D4CDL_h98wjPqBzTgSdtblg9hnLi-A9u0/s1600/nested+iaas2.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGgdxNbelyT4jA6G-bKAv0gCpILoN0itUHDiqHCHRZSQeVDQmLQK80ZZZXYX4K_KMyMngo2tJsRsh_eLBsnV4oGzskPUGRiBRceNfa7B2LG7D4CDL_h98wjPqBzTgSdtblg9hnLi-A9u0/s320/nested+iaas2.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
You can hit the “Deploy to Azure” link in order to
explore the json structure in Azure and do an actual deployment.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWbqyH8Csj_fYzZD28Q9JqwU-mEGaslw1NV-cvzCfyM_gGGVHk861MB3KEohhuGF3F6jn7cVbbHIGl4ECXgy0qGdiw_kJXG9CoyQgdqUPu_cAQXxKvC2uR2KhjiaKApYab0RVb9moW6Ts/s1600/nested+iaas3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="319" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWbqyH8Csj_fYzZD28Q9JqwU-mEGaslw1NV-cvzCfyM_gGGVHk861MB3KEohhuGF3F6jn7cVbbHIGl4ECXgy0qGdiw_kJXG9CoyQgdqUPu_cAQXxKvC2uR2KhjiaKApYab0RVb9moW6Ts/s320/nested+iaas3.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
If you want do deploy it through PowerShell, you can also
see that the “Microsoft.Resources/deployments” resource types are being used.</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia5EYNXby7mV5wlAU5XnLQWYSv-FOYkNI0I7gG5Red1uW7h0O7pbmQmVWacAf54k4PXfnFap-UIKXdcsx91FyL5quXa3ireTN7XOy2MDx2JoZVNDZyqFptfUG_3K0PZ5w2TKxRUB5B7FY/s1600/nested+iaas4.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="106" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia5EYNXby7mV5wlAU5XnLQWYSv-FOYkNI0I7gG5Red1uW7h0O7pbmQmVWacAf54k4PXfnFap-UIKXdcsx91FyL5quXa3ireTN7XOy2MDx2JoZVNDZyqFptfUG_3K0PZ5w2TKxRUB5B7FY/s320/nested+iaas4.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<o:p></o:p></div>
<div class="MsoNoSpacing">
Happy authoring – and see you next time.</div>
<div class="MsoNoSpacing">
<o:p></o:p></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com0tag:blogger.com,1999:blog-893729307599410422.post-76799535206801244222015-09-27T23:55:00.001+02:002015-09-27T23:55:27.331+02:00Explaining Windows Server Containers - Part Three<div class="MsoNoSpacing">
In the last blog post, I talked about the architecture of
container images and how to use them in a similar way like our kids are using
Lego.</div>
<div class="MsoNoSpacing">
<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Today, I want to shift focus a bit and talk more about
management of container life-cycle using Docker in the Windows Server Technical
Preview 3.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
If you have any challenges or problems in your IT
business today and ask me for advice, I would most likely point you to
something that adds more abstraction.<o:p></o:p></div>
<div class="MsoNoSpacing">
Abstraction is key, and is how we have solved big and
common challenges so far in this industry.<o:p></o:p></div>
<div class="MsoNoSpacing">
When we covered the architecture of containers in part 1,
we compared it with server virtualization.<o:p></o:p></div>
<div class="MsoNoSpacing">
Both technologies are solving the same challenges. However,
they are doing it at different abstraction layer. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
With cloud computing we have had the IaaS service model
for a long time already, helping organization to speed up their processes and
development by leveraging this service model either in a private cloud, public
cloud or both – in a hybrid cloud. <o:p></o:p></div>
<div class="MsoNoSpacing">
However, being able to spin up new virtual machines isn’t
necessarily the answer to all the problems in the world. <o:p></o:p></div>
<div class="MsoNoSpacing">
Sure it makes you more agile and let you utilize your
resources far better compared to physical machines, but it is still a machine. A
machine requires management at the OS level, such as patching, backup,
configuration and more. Since you also
have access at the OS level you might end up in a situation where you have to
take actions that involves networking as well.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This is very often where it get complex for organizations
with a lot of developers. <o:p></o:p></div>
<div class="MsoNoSpacing">
They need to focus, learn and adopt new skillsets, just
to be capable of doing testing of their applications. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Wouldn’t it be nice if they didn’t have to care about
this jungle of complexity at all, knowing nothing about the environment they
will be shipping software into?<o:p></o:p></div>
<div class="MsoNoSpacing">
Given the fact that there’s different peoples involved
when it comes to software development and managing the environment of the
software, the challenges grows together with the organization itself and scale
becomes a problem.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>This is where
containers comes to the rescue – or do they?<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Containers has a good approach since all applications
within a container look the same on the outside from the host environment
perspective. <o:p></o:p></div>
<div class="MsoNoSpacing">
We can now wrap our software together within a container
and ship the container image to a shared repository and don’t deal with any of
the complexity that a managed OS normally require from us. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I have seen this in action, and here’s an example that
normally trigger people’s interest:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l1 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->1)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->A developer create something new – or simply
commit some changes to their version control system (GitHub, VSO etc).<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l1 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->2)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->A new image (Docker in this case) is built with
the application.<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l1 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->3)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->The new Docker image goes through the entire
testing and approval process.<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l1 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->4)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->The image is committed to a shared repo.<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l1 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->5)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->The new Docker image is deployed into
production.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This seems like a well-known story we all have heard in
the IaaS world, right?<o:p></o:p></div>
<div class="MsoNoSpacing">
Please note that no infrastructure was touched from the
developer perspective during these steps. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This was just one example of real world organizations are
using containers today, and I will cover more good use cases as we move forward
in this blog series.<o:p></o:p></div>
<div class="MsoNoSpacing">
It is important that we’re honest and admit that new
technologies that gives us more and more capabilities, features and
possibilities, will at the same time introduce us for some new challenges as
well.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
With containers, we can easily end up in a scenario where
the situation can remind us a bit about the movie called “Inception” ( <a href="https://en.wikipedia.org/wiki/Inception">https://en.wikipedia.org/wiki/Inception</a>
). It might be hard to know exactly where you are when you are working - and
have access to all the different abstraction layers. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In Technical Preview 3 of Windows Server 2016, Windows
Server containers can be managed both with PowerShell <i>and</i> Docker.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>What exactly is
Docker?</b><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Docker has been around for years and ensures automated
deployments into containers by providing an additional layer of abstraction and
automation of OS virtualization on Linux, MAC OS and Windows.<o:p></o:p></div>
<div class="MsoNoSpacing">
Just as with Windows Server containers, Docker provides
resource isolation by using namespaces to allow independent containers to run
within a single Linux instance, instead of having the overhead of running and
maintaining virtual machines.<o:p></o:p></div>
<div class="MsoNoSpacing">
Although Linux containers wasn’t something new, it had
been around for years already, Docker made those Linux containers become available
for the general IT guy by simplifying the tooling and workflows. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In Windows Server 2016 TP3, containers can be deployed by
both Docker APIs and the Docker client, and Windows Server Containers. Later,
Hyper-V containers will be available too. <o:p></o:p></div>
<div class="MsoNoSpacing">
They important thing to note is that Linux containers
will (always) require Linux APIs from the host kernel itself, and Windows
Server Containers will require Windows APIs from the host Windows kernel. So although
you can’t run Linux on Windows or vice versa, you can manage all of these
containers with the same Docker client.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
So getting back to the topic here – how to do management
of containers?<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Since Docker was first, this blog post will focus on the
management experience by using Docker in TP3. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Note: </b>In TP3,
we are not able to see nor manage the containers if they are created outside of
our preferred management solution. Meaning that containers that are created
with Docker can only be managed by using Docker, and containers created with
PowerShell can only be managed by using PowerShell.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
During my testing on TP3, I have run into many
issues/bugs when testing management of containers.<o:p></o:p></div>
<div class="MsoNoSpacing">
In the following recipe, I would like to point out that
the following has been done:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l2 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]-->1)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->I downloaded the image from Microsoft that
contains the Server Core image with the running container feature in addition to
Docker<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l2 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]-->2)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->I joined the container host to my AD domain<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l2 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]-->3)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->I enabled the server for remote management and
opened some required firewall ports<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l2 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]-->4)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->I learned that everything I would like to test
regarding Docker, should be performed on the container host itself, logged on
through RDP<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Once I’ve logged into the container host, I run the
following cmdlet to see my images:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: Consolas;">Docker images <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This shows two images.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Next, I run the following cmdlet:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: Consolas;">Docker ps<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This will list all the containers on the system (note
that Docker is only able to see containers created by Docker).<o:p></o:p></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiKMEgjjuyGvgPtz3KqNBj1ylx9JXZTsyhX2AAAn38MiU34MU0TojUvsrcOM8MMkp0Bi53_LPAYV4zBkHPuj1SbVVjyN9aXMr9gplmRXzT2UceIqZCp0roeHukN6SEqU1HCDC0MrPzoq8/s1600/docker1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="113" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiKMEgjjuyGvgPtz3KqNBj1ylx9JXZTsyhX2AAAn38MiU34MU0TojUvsrcOM8MMkp0Bi53_LPAYV4zBkHPuj1SbVVjyN9aXMr9gplmRXzT2UceIqZCp0roeHukN6SEqU1HCDC0MrPzoq8/s400/docker1.JPG" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The next thing I’d like to show off, was how to pull an
image from the Docker hub and then run it from my container host. First I get
an overview of all the Images that’s compatible with my system:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: Consolas;">Docker search server<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I see that Microsoft/iis seems like a good option in my
case, so I run the following cmdlet to download it:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: Consolas;">Docker pull Microsoft/iis<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This will first download the image and then extract it.<o:p></o:p></div>
<div class="MsoNoSpacing">
In the screen shot below, you can see all the steps I
have taken so far and the output. Obviously the last part didn’t work as
expected and I wasn’t able to pull the image down to my TP3 container host.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC2U2r9Sl2k51mx1UV7SBaWpMLkdeVoxfX_iY_IxcWz-lCiHbv2JrV3hFRgGwqYWc7kbkCTXNuGqp0rZelJJ1l1HjFqbOEIpJ_41RZMOO3GJQC7Cg-ed4COqmQEpAkky4mR7qo0x776rM/s1600/docker3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="255" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC2U2r9Sl2k51mx1UV7SBaWpMLkdeVoxfX_iY_IxcWz-lCiHbv2JrV3hFRgGwqYWc7kbkCTXNuGqp0rZelJJ1l1HjFqbOEIpJ_41RZMOO3GJQC7Cg-ed4COqmQEpAkky4mR7qo0x776rM/s400/docker3.JPG" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
So heading back to the basics then and create a new
container based on an existing image.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: Consolas;">Docker run –it –name krnesedemo
windowsservercore powershell<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This will:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo3; text-indent: -.25in;">
<!--[if !supportLists]-->1)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->Create a new container based on the Windows
Server Core image<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo3; text-indent: -.25in;">
<!--[if !supportLists]-->2)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->Name the container “krnesedemo”<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo3; text-indent: -.25in;">
<!--[if !supportLists]-->3)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->Start an interactive PowerShell session since –it
was specified. Note that this is one of the reasons why you have to run this
locally on the container host. The cmdlet doesn’t work remotely</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This will literally take seconds, and then my new
container is ready with a PowerShell prompt. <o:p></o:p></div>
<div class="MsoNoSpacing">
Below you can see that I am running some basic cmdlets to
verify that I am actually in a container context and not in the container <i>host</i>.<o:p></o:p></div>
<div class="MsoNoSpacing">
Also note the error I get after installing the Web-Server
feature. This is a known error in TP3 that you have to run some cmdlets several
times in order to get the right result. Executing it the second time shows that
it went as planned.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqFJUa6XnfUSdPaqI3ecZZ3ft48UbZfjw0DU5oubyzf0aAan_WZjWCF7GLAik0qohao5G0c06Kav6c6ZzPJjRn5JORBGtQ5_jWLIbzGJ1e-erS9Stz0793vH6UTY1AC8Wxjf8FVfo2IBk/s1600/docker4.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="277" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqFJUa6XnfUSdPaqI3ecZZ3ft48UbZfjw0DU5oubyzf0aAan_WZjWCF7GLAik0qohao5G0c06Kav6c6ZzPJjRn5JORBGtQ5_jWLIbzGJ1e-erS9Stz0793vH6UTY1AC8Wxjf8FVfo2IBk/s400/docker4.JPG" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
After exiting the session (exit), I will be back at the
container host’s cmdline session.<o:p></o:p></div>
<div class="MsoNoSpacing">
I run the following cmdlet to see all the running
containers:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: Consolas;">Docker ps –a<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This shows that the newly created container “krnesedemo”
is running PowerShell in an interactive session, when it was started and when I
exited it.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEg5-UrEyIKx1S_JNb_2blbWS1f2_9Xtlr7bKpBdpSoOFb_1CiuWD0R28KYWC6JgrMtfKWr5HXi5bm7iE1Tn_Ki9W_JYwBbLjkACx_OkVv0XpC4T9KQ7SZ95t_jhkHxr4i3tqApm0yxuE/s1600/docker6.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="127" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEg5-UrEyIKx1S_JNb_2blbWS1f2_9Xtlr7bKpBdpSoOFb_1CiuWD0R28KYWC6JgrMtfKWr5HXi5bm7iE1Tn_Ki9W_JYwBbLjkACx_OkVv0XpC4T9KQ7SZ95t_jhkHxr4i3tqApm0yxuE/s320/docker6.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Now, I want to commit the changes I did (installed
Web-Server) and create a new image with the following cmdlet:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: Consolas;">Docker commit
krnesedemo demoimage<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In my environment, this cmdlet takes a few minutes to
complete. I also experienced some issues when the container was running prior
to executing this command. So my advice would be to run “Docker stop “container
name” “ prior to committing it. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
After verifying that the image has been created (see
picture below), I run the following cmdlet to create a new container based on
the newly created image:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: Consolas;">Docker run –it –name demo02
demoimage powershell<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<span style="font-family: Consolas;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwS6fH_UEUgwjOkxM7qbAm83KKjg76YHUSCxELECsepWjetgeR67vinjk0SsGMkRHAKXVS4gn_X5t9ZC_MtEFOF8uLxecq7S0o71xsCf5ymZfw9MgmKkksaV_9aPdYJOxIKbHZ_IPBXGs/s1600/docker7.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwS6fH_UEUgwjOkxM7qbAm83KKjg76YHUSCxELECsepWjetgeR67vinjk0SsGMkRHAKXVS4gn_X5t9ZC_MtEFOF8uLxecq7S0o71xsCf5ymZfw9MgmKkksaV_9aPdYJOxIKbHZ_IPBXGs/s400/docker7.JPG" width="400" /></a></div>
<div class="MsoNoSpacing">
<span style="font-family: Consolas;"><br /></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
We have now
successfully created a new container based on our newly created image, and
through the interactive session we can also verify that the Web-Server is
present.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6BJm49ZIzbCbPgJRZ0p_oJy9ZXueyqywF8CUlfwGj7rYULZIiEx5YtkihKKndThvCAVjK2X0GERCSMFGSNGK0IswAcIkmuzizMa3bDCercBlzPygMvXMweXXC2PGK9xO23INFK0nQDpk/s1600/docker8.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="105" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6BJm49ZIzbCbPgJRZ0p_oJy9ZXueyqywF8CUlfwGj7rYULZIiEx5YtkihKKndThvCAVjK2X0GERCSMFGSNGK0IswAcIkmuzizMa3bDCercBlzPygMvXMweXXC2PGK9xO23INFK0nQDpk/s400/docker8.JPG" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Next time I
will dive more into the PowerShell experience and see how you can leverage your
existing skillset to create a good management platform for your Windows
Containers. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com3tag:blogger.com,1999:blog-893729307599410422.post-50712830658904155272015-09-07T09:49:00.001+02:002015-09-07T09:49:36.389+02:00Explaining Windows Server Containers – Part Two<div class="MsoNoSpacing">
In<a href="http://kristiannese.blogspot.no/2015/09/explaining-windows-server-containers.html" target="_blank"> Part One</a>, I covered the concept of Containers,
compared to server virtualization in a Microsoft context.</div>
<div class="MsoNoSpacing">
<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Today, I want to highlight the architecture of container
images and how you can use them as building blocks to speed up deployment.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Before we start</b><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
If you have a background in Server Virtualization, you
are probably very familiar with VM templates.<o:p></o:p></div>
<div class="MsoNoSpacing">
A VM template is a sysprep’d image that is generalized
and can be deployed over and over again. It is normally configure with its
required components and applications and kept up to date with the latest
patches. <o:p></o:p></div>
<div class="MsoNoSpacing">
A VM template contains the complete operating system (and
eventually its associated data disk(s)) and has been used by administrators and
developers for years when they want do rapidly be able to test and deploy their
applications on top of those VMs.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
With Containers, this is a bit different. In the previous
blog post I explained that Containers are basically what we call “OS
Virtualization” and with Windows Server Containers the kernel is shared between
the container <i>host</i> and its
containers. <o:p></o:p></div>
<div class="MsoNoSpacing">
So, a container image is not the same as a VM image.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Container Image</b><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Think of a container image as a snapshot/checkpoint of a
running container that can be re-deployed many times, isolated in its own user
mode with namespace virtualization.<o:p></o:p></div>
<div class="MsoNoSpacing">
Since the kernel is shared, it is no need for the
container image to contain the OS partition<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
When you have a running container, you can either stop
and discard the container once you are done with it, or you can stop and
capture the state and modifications you have made by transforming it into a
container image. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
We have two types of container images. A Container <i>OS</i> image is the first layer in
potentially many image layers that make up a container. This image contains the
OS environment and is also immutable – which means it cannot be modified. <o:p></o:p></div>
<div class="MsoNoSpacing">
A container image is stored in its local repository so
that you can re-use the images as many times you’d like on the container host.
It is also possible to store the images in a remote repository, making them available
for multiple container hosts. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Let us see how the image creation process works with
Windows Server Containers<strong><span style="color: #2a2a2a; font-family: "Segoe UI",sans-serif; font-size: 10.0pt; font-weight: normal; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></strong></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<strong><span style="color: #2a2a2a; font-family: "Calibri",sans-serif; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Segoe UI"; mso-fareast-font-family: "Times New Roman"; mso-hansi-theme-font: minor-latin;">Working
with Container Images<o:p></o:p></span></strong></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<strong><span style="color: #2a2a2a; font-family: "Calibri",sans-serif; font-weight: normal; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Segoe UI"; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman"; mso-hansi-theme-font: minor-latin;">In the current release, Windows
Server Containers can be managed by Docker client and PowerShell.<o:p></o:p></span></strong></div>
<div class="MsoNoSpacing">
<strong><span style="color: #2a2a2a; font-family: "Calibri",sans-serif; font-weight: normal; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Segoe UI"; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman"; mso-hansi-theme-font: minor-latin;">This blog post will focus on the
PowerShell experience and show which cmdlets you need to run in order to build
images, just as easy as you would do by playing with Lego </span></strong><strong><span style="color: #2a2a2a; font-family: Wingdings; font-weight: normal; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Segoe UI"; mso-bidi-font-weight: bold; mso-char-type: symbol; mso-fareast-font-family: "Times New Roman"; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;">J</span></strong><strong><span style="color: #2a2a2a; font-family: "Calibri",sans-serif; font-weight: normal; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Segoe UI"; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman"; mso-hansi-theme-font: minor-latin;"><o:p></o:p></span></strong></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="color: #2a2a2a; font-family: Calibri, sans-serif;">First, we will explore the properties of a Container Image. An Image contains a Name, Publisher and a version </span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizNj6siQADkmWM_nnwIuhuH0lqNsg5EskY7usi-3U0B6AD2q_qB4y7dscnZzmJ8PvsLiye7Gq5L5Bnqa6np6Re0cgYYJZONgRBtKCwVLL-xKLGztmjrjW_k-_F_kgBwT1TfrSvbWRn5Mk/s1600/September+2015+329.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizNj6siQADkmWM_nnwIuhuH0lqNsg5EskY7usi-3U0B6AD2q_qB4y7dscnZzmJ8PvsLiye7Gq5L5Bnqa6np6Re0cgYYJZONgRBtKCwVLL-xKLGztmjrjW_k-_F_kgBwT1TfrSvbWRn5Mk/s320/September+2015+329.JPG" width="240" /></a></strong></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><br /></strong></div>
<div class="separator" style="clear: both; text-align: start;">
<strong><span style="font-family: Calibri, sans-serif;">We are executing - and storing the following cmdlet in a variable: $conimage = Get-ContainerImage -Name "WinSrvCore" </span></strong></div>
<div style="font-family: 'Segoe UI', sans-serif; font-size: 10pt;">
<br /></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrGdvANt03B7fCSC4oJR-VscTDbareGdGKxgCRY9rI_1sIHuzspLX_5i7xPYoRbqvRa5-9D7PP_yUPAtH7IDGb7eMmt_7Nv8zsKPReWhXl2By0cDwgwiy0eAAEyM6c7ZTrAjgtlQnoupE/s1600/September+2015+330.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrGdvANt03B7fCSC4oJR-VscTDbareGdGKxgCRY9rI_1sIHuzspLX_5i7xPYoRbqvRa5-9D7PP_yUPAtH7IDGb7eMmt_7Nv8zsKPReWhXl2By0cDwgwiy0eAAEyM6c7ZTrAjgtlQnoupE/s320/September+2015+330.JPG" width="320" /></a></strong></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><br /></strong></div>
<div class="separator" style="clear: both; text-align: start;">
<strong><span style="font-family: Calibri, sans-serif;">Next, we create a new container based on this image by executing - and storing the following cmdlet in a variable: $con = New-Container -Name "Demo" -ContainerImage $conimage -SwitchName "VM". </span></strong></div>
<div style="font-family: 'Segoe UI', sans-serif; font-size: 10pt;">
<br /></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7YLIkm4YetHy0vVxNlDqFhn8TC9ilBNTymuUR6K1hN74jw-dCejBIZ3sdtxX7DMm4ALFlC97olLHiAFvTVM95VDRmScO2uo11Pw3XpA2J-qugXxcWm3oE3B4kF3DqwIfpWzfTY-ri6hw/s1600/September+2015+331.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7YLIkm4YetHy0vVxNlDqFhn8TC9ilBNTymuUR6K1hN74jw-dCejBIZ3sdtxX7DMm4ALFlC97olLHiAFvTVM95VDRmScO2uo11Pw3XpA2J-qugXxcWm3oE3B4kF3DqwIfpWzfTY-ri6hw/s320/September+2015+331.JPG" width="320" /></a></strong></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><br /></strong></div>
<div class="separator" style="clear: both; text-align: start;">
<strong><span style="font-family: Calibri, sans-serif;">Once the container is deployed, we will start it and invoke a command that installs the Web-Server role within this container ( Invoke-Command -ContainerId $con.ContainerId -RunAsAdministrator { Install-WindowsFeature -Name Web-Server } ). You can see that the picture below shows that the blue Lego block is now on top of the brown one (as in layers). </span></strong></div>
<div style="font-family: 'Segoe UI', sans-serif; font-size: 10pt;">
<br /></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi38n3foivIVm4U8T2k_KTPevuUBbdytuo5gKA30gZMUQf0rql237YPDcPjXU6G_XHrnpdUqzjSDTUB66uSWHkfg-1eYMhl4pR5ZjUJZsSBKN3Ripo5MyrhOrplBij9Dgrn4wJmgMt0Bgw/s1600/September+2015+332.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi38n3foivIVm4U8T2k_KTPevuUBbdytuo5gKA30gZMUQf0rql237YPDcPjXU6G_XHrnpdUqzjSDTUB66uSWHkfg-1eYMhl4pR5ZjUJZsSBKN3Ripo5MyrhOrplBij9Dgrn4wJmgMt0Bgw/s320/September+2015+332.JPG" width="320" /></a></strong></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><br /></strong></div>
<div class="separator" style="clear: both; text-align: start;">
<strong><span style="font-family: Calibri, sans-serif;">As described earlier in this blog post, we can stop the running container and create an image if we want to keep the state. We are doing that by executing New-ContainerImage -Container $con -Name Web -Publisher KRN -Version 1.0</span></strong></div>
<div style="font-family: 'Segoe UI', sans-serif; font-size: 10pt;">
<br /></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkDKvvb-CFLYoZu9_cZHRWvjUidhQSenEL2ctBp8WVYnh453k1snTgzzd7N1srOh-UTTjDxJ9gsLFebtwkbTEZHJvH1YNUtLgnHXwUXVjJ69w03slolOiZ6pmVJCPXxsiS8Zyz-MtQ45A/s1600/September+2015+333.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkDKvvb-CFLYoZu9_cZHRWvjUidhQSenEL2ctBp8WVYnh453k1snTgzzd7N1srOh-UTTjDxJ9gsLFebtwkbTEZHJvH1YNUtLgnHXwUXVjJ69w03slolOiZ6pmVJCPXxsiS8Zyz-MtQ45A/s320/September+2015+333.JPG" width="320" /></a></strong></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><br /></strong></div>
<div class="separator" style="clear: both; text-align: start;">
<strong><span style="font-family: Calibri, sans-serif;">If we now executes Get-ContainerImage, we have two images. One that has only the ServerCore, and another one that has ServerCore <i>and</i> the Web-Server Role installed. </span></strong></div>
<div style="font-family: 'Segoe UI', sans-serif; font-size: 10pt;">
<br /></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEig9GJ-txqzPOVxczMD1ESTWHuF8lYV2qAAymoD3oW91rmW2OUfXuEWQeNKHIVl-gSmNBD01NifHMKk-zgV1TkNP8Wil2iRmxZLdARzcpTdug_koBfET3AoTkJOvGdWGr-NZwChyADG1kA/s1600/September+2015+334.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEig9GJ-txqzPOVxczMD1ESTWHuF8lYV2qAAymoD3oW91rmW2OUfXuEWQeNKHIVl-gSmNBD01NifHMKk-zgV1TkNP8Wil2iRmxZLdARzcpTdug_koBfET3AoTkJOvGdWGr-NZwChyADG1kA/s320/September+2015+334.JPG" width="240" /></a></strong></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><br /></strong></div>
<div class="separator" style="clear: both; text-align: start;">
<strong><span style="font-family: Calibri, sans-serif;">We will repeat the process and create a new container based on the newly created Container Image.</span></strong></div>
<div style="font-family: 'Segoe UI', sans-serif; font-size: 10pt;">
<br /></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT_xptWM-2BSq6g7_SKk-fv1Rt33_Qek3wczre9GSvD3IJR2WIOuNa612ZfAYoNr6yhPbMPWnVuY7XzOPKVIvFhZTYLXxVN4A6llBCE4h5ezVS5kDVOOV6hbUCaIKSQtdBO38xSmd5OpA/s1600/September+2015+336.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiT_xptWM-2BSq6g7_SKk-fv1Rt33_Qek3wczre9GSvD3IJR2WIOuNa612ZfAYoNr6yhPbMPWnVuY7XzOPKVIvFhZTYLXxVN4A6llBCE4h5ezVS5kDVOOV6hbUCaIKSQtdBO38xSmd5OpA/s320/September+2015+336.JPG" width="320" /></a></strong></div>
<div style="font-family: 'Segoe UI', sans-serif; font-size: 10pt;">
<br /></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmUNjgG_QI8-gY7_KlJ5TlrPbbvDYodcj5SlBV4trUnVM4KidZcUVglE61MR40fidfrI6HQIVzLT0_zQZLw8VPzP9ltxZ79X41UT8zqREVHqFPnlQeJ9hdg_zF3InokRNIrFMNXDSojlQ/s1600/September+2015+337.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmUNjgG_QI8-gY7_KlJ5TlrPbbvDYodcj5SlBV4trUnVM4KidZcUVglE61MR40fidfrI6HQIVzLT0_zQZLw8VPzP9ltxZ79X41UT8zqREVHqFPnlQeJ9hdg_zF3InokRNIrFMNXDSojlQ/s320/September+2015+337.JPG" width="320" /></a></strong></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><br /></strong></div>
<div class="separator" style="clear: both; text-align: start;">
<strong><span style="font-family: Calibri, sans-serif;">In this container, we will install a web application too. The grey Lego block on top of the blue shows that this is an additional layer.</span></strong></div>
<div style="font-family: 'Segoe UI', sans-serif; font-size: 10pt;">
<br /></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqWKjH1eke4rLg0YvyZ1V4fU8uSqX5EbHaUjPgjmkXk-JVG-oc3AJPW6W17ztF1eO1MTJExAhntsQkV_otDnJSHgmwCVrwTp5WHlNI4xs3NFu6Iw7s0KAoz95DYm1JST78y2sXlVcZcMQ/s1600/September+2015+338.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqWKjH1eke4rLg0YvyZ1V4fU8uSqX5EbHaUjPgjmkXk-JVG-oc3AJPW6W17ztF1eO1MTJExAhntsQkV_otDnJSHgmwCVrwTp5WHlNI4xs3NFu6Iw7s0KAoz95DYm1JST78y2sXlVcZcMQ/s320/September+2015+338.JPG" width="320" /></a></strong></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><br /></strong></div>
<div class="separator" style="clear: both; text-align: start;">
<strong><span style="font-family: Calibri, sans-serif;">We are then stopping the running container again and creates another container image, containing the web application too.</span></strong></div>
<div style="font-family: 'Segoe UI', sans-serif; font-size: 10pt;">
<br /></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8dYtoknj7PQ43fy4eWbWepaiq5rUCYhyphenhypheng1ZR4k1HKuaiRgEifqkeHs1jzkjjFW4O0gJgyQWtgue8JTPSMKJSALuaHpiiey0k4dk4l5aTftzSEg8Xw0kwh0yR66Krp6LHHpZZg5kEf1Cg/s1600/September+2015+339.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8dYtoknj7PQ43fy4eWbWepaiq5rUCYhyphenhypheng1ZR4k1HKuaiRgEifqkeHs1jzkjjFW4O0gJgyQWtgue8JTPSMKJSALuaHpiiey0k4dk4l5aTftzSEg8Xw0kwh0yR66Krp6LHHpZZg5kEf1Cg/s320/September+2015+339.JPG" width="320" /></a></strong></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><br /></strong></div>
<div class="separator" style="clear: both; text-align: start;">
<strong><span style="font-family: Calibri, sans-serif;">In the local repository, we have now three different container images in a layered architecture.</span></strong></div>
<div style="font-family: 'Segoe UI', sans-serif; font-size: 10pt;">
<br /></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXoCEimWbPMKooiFi6iFlEOOckqBYvOosbTyLUWy7ydyQbTvY2YxDCIRMttCXRGatdzK9IliCMXF-fdcSEyzcDzddMLeh46KuI2byAY3YILqlgeN8mN9Hbn9Oeclls8UqvkMMqnymz5pU/s1600/September+2015+340.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXoCEimWbPMKooiFi6iFlEOOckqBYvOosbTyLUWy7ydyQbTvY2YxDCIRMttCXRGatdzK9IliCMXF-fdcSEyzcDzddMLeh46KuI2byAY3YILqlgeN8mN9Hbn9Oeclls8UqvkMMqnymz5pU/s320/September+2015+340.JPG" width="320" /></a></strong></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><br /></strong></div>
<div class="separator" style="clear: both; text-align: center;">
<strong><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJp6oZAjvb_cMidlNe2XHgVfAsTwInctd6-gl63eF_xyaGCpYX6OpwFmfGwf8W5ZaP10DSNoLClu4oQ-J_3NrVTFpd7hrVrRoSOKudvJLH7DldnvcqFZXd8y9vN-xvvlWeGRLsL5SkjSk/s1600/September+2015+335.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJp6oZAjvb_cMidlNe2XHgVfAsTwInctd6-gl63eF_xyaGCpYX6OpwFmfGwf8W5ZaP10DSNoLClu4oQ-J_3NrVTFpd7hrVrRoSOKudvJLH7DldnvcqFZXd8y9vN-xvvlWeGRLsL5SkjSk/s320/September+2015+335.JPG" width="240" /></a></strong></div>
<div class="separator" style="clear: both; text-align: center;">
<strong><br /></strong></div>
<div class="separator" style="clear: both; text-align: start;">
<strong><span style="font-family: Calibri, sans-serif;">Hopefully you found this useful, and I will soon be back with part three of this blog series.</span></strong></div>
<div class="separator" style="clear: both; text-align: start;">
<strong><span style="font-family: Calibri, sans-serif;">Perhaps you will see more Lego as well .... :-) </span></strong></div>
<div class="separator" style="clear: both; text-align: start;">
<strong><span style="font-family: Calibri, sans-serif;"><br /></span></strong></div>
<div class="separator" style="clear: both; text-align: start;">
<strong><span style="font-family: Calibri, sans-serif;">-kn</span></strong></div>
<div class="separator" style="clear: both; text-align: start;">
<strong><span style="font-family: Calibri, sans-serif;"><br /></span></strong></div>
<div class="separator" style="clear: both; font-family: 'Segoe UI', sans-serif; font-size: 10pt; text-align: center;">
<strong><br /></strong></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
</div>
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com1tag:blogger.com,1999:blog-893729307599410422.post-71628990098513190472015-09-06T23:43:00.000+02:002015-09-06T23:43:45.596+02:00A Personal Note<div class="MsoNoSpacing">
<span lang="NO-BOK">A
personal note<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
It is Sunday evening. I am doing what I’ve been doing for
the last 5-6 years. I am literally preparing myself for the upcoming week at
work. <o:p></o:p></div>
<div class="MsoNoSpacing">
There’s so much things to do, so much to learn, so much
to share and achieve during a normal week of work.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In today’s industry, things are happening at a cadence we’ve
never seen before. Cloud computing has definitively lead to an extreme pace of
innovation that is really hard to keep up with, unless you are all in and have
chosen the right battles to fight. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I am currently the CTO for one of the largest SI in the Nordics,
which of course requires a lot from me. In addition, I am also a Microsoft MVP
within Cloud & Datacenter that takes a lot of my time outside of work
hours. <o:p></o:p></div>
<div class="MsoNoSpacing">
Attending several conferences each and every year,
visiting customers around the entire globe and spending a lot of my time doing
research & development, I had over 200 flights in 2015. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
It is all good. I have been doing this for the last 5-6 years. I am used to it and I can admit it is also my passion. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
At home, I have my significant other (<a href="https://twitter.com/ITfruen" target="_blank">Kristine</a>) that takes care of
our house and our 4 kids. Ideally, she would love to see that I was able to
spend more time at home with her and our kids. But she know what I am and what
I do. We have an agreement that I am able to focus more on my work, while she
takes care of the things that are happening at home. Again, I have been doing
this for the last 5-6 years and it’s all good. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I grew up in a valley where my parents had a farm with cattle’s.
The situation there was quite similar to what we are practicing in our family. My
dad was doing the work on the farm while my mum took care of our house and me
and my two elder brothers. <o:p></o:p></div>
<div class="MsoNoSpacing">
I and my brothers helped him as good – and as much as we
could when we grew up. We learned that quality was important. That we had to do
things properly. If we took any shortcuts, it would backfire. We learned it
back then. We learned it the hard way.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I learned a lot of growing up on a farm under these
circumstances. No matter what happened, my dad always had to do his work. In the
end of the day, all of his cows were depending on him. They needed their daily
care, food, water and much more. He could never say that “I don’t feel well
today, I have to call in sick”. No. it wasn’t possible. <o:p></o:p></div>
<div class="MsoNoSpacing">
He did his job in order to provide for his family, which
was the most important thing in his life. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The same thing can be said about my father in law. His work
was the foundation for his family. Working with logistics, he went to work
every day and answered any call he might receive outside of work hours to help
his co-workers no matter what the situation was. He did his work with pride
too. <o:p></o:p></div>
<div style="border-bottom: solid windowtext 1.0pt; border: none; mso-border-bottom-alt: solid windowtext .75pt; mso-element: para-border-div; padding: 0in 0in 1.0pt 0in;">
<div class="MsoNoSpacing" style="border: none; mso-border-bottom-alt: solid windowtext .75pt; mso-padding-alt: 0in 0in 1.0pt 0in; padding: 0in;">
<br /></div>
</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
It is September now. The 9<sup>th</sup> month in the
year. We have had some significant losses during the last 10 months. My father
in law passed away in December after losing the battle against liver cancer. He
fought to the bitter end. Although he had cancer and was under treatment
(chemotherapy), he was showing up on work every day, doing more than people
expected from him – given the circumstances. <o:p></o:p></div>
<div class="MsoNoSpacing">
He wasn’t aware of any other way. He had been doing this
for over 30 years, and it was all good.<o:p></o:p></div>
<div class="MsoNoSpacing">
Late in March this year. It was my father’s turn. He suddenly
passed away, unexpectedly and shocking for all of us. The last thing he did before
he passed away was to complete a project that he had promised our two sons. <o:p></o:p></div>
<div class="MsoNoSpacing">
A couple of years ago, my father almost lost his right
hand in an accident while working on his farm. Due to this injury, he had to
let go of his cattle as he couldn’t take care of them anymore. <o:p></o:p></div>
<div class="MsoNoSpacing">
However, he still had a lot of buildings and land to
maintain and kept up with that. <o:p></o:p></div>
<div class="MsoNoSpacing">
He had been doing this for over 40 years, and it was all
good.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Looking back at these two events makes me sad. It is
always very hard and tough when you are losing someone you love, that plays an
significant role for the entire family.<o:p></o:p></div>
<div class="MsoNoSpacing">
Back when it happened, I was sad, I was devastated. I did
my best to take care of my own family, our children. I still am and we work
through our losses every day as a unit. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
But I didn’t stop. I continued to work. I sat down on every Sunday, just like this one and prepared for the upcoming week.<o:p></o:p></div>
<div class="MsoNoSpacing">
I learned a lot from these two men. My core values cannot be
questioned and is something I live and breathe every day. I take care of the
one’s I love, I provide for them and I do what I am.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I honor these men through my actions, my commitments and
my passion. I have been doing this for the last 5-6 years, and it’s all good.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Thanks for reading.</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
-kn</div>
<br />
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com2tag:blogger.com,1999:blog-893729307599410422.post-24570218055237008102015-09-06T22:11:00.001+02:002015-09-06T22:11:16.390+02:00Explaining Windows Server Containers – Part One<div class="MsoNoSpacing">
You have heard a lot about it lately, Microsoft is
speeding up on their container investment and we can see the early beginning in
Windows Server 2016 Technical Preview 3.</div>
<div class="MsoNoSpacing">
<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
But before we start to go deep into the container
technology in TP3, I would like to add some more context so that you more
easily can absorb and understand what exactly is going on here.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Server Virtualization<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Container technologies belongs to the virtualization
category, but before we explain the concept and technology that gives us “containerization”,
we will take a few steps back and see where we are coming from.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Server (virtual machine) virtualization is finally
mainstream for the majority of the industry by now.<o:p></o:p></div>
<div class="MsoNoSpacing">
We have been using virtualization in order to provide an
isolated environment for guest instances on a host to increase machine density,
enable new scenarios, speed up test & development etc.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Server virtualization gave us an abstraction where every
virtual machine were in the belief of that they had their own CPU, I/O
resources, memory and networking. <o:p></o:p></div>
<div class="MsoNoSpacing">
In the Microsoft world, we first started with server
virtualization using a type 2 hypervisor, such as Virtual Server and Virtual PC
– where all the hardware access was emulated through the operating system
itself, meaning that the virtualization software was running in user mode, just
as every other application on that machine. <o:p></o:p></div>
<div class="MsoNoSpacing">
So a type 2 Hypervisor have in essence two hardware
abstraction layers, turning them all into bad candidates for real world
workloads.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This changed with Hyper-V in Windows Server 2008, where
Microsoft introduced their first type 1 hypervisor.<o:p></o:p></div>
<div class="MsoNoSpacing">
Hyper-V is a microkernelized hypervisor that implements a
shared virtualization stack and a distributed driver model that is very
flexible and secure. <o:p></o:p></div>
<div class="MsoNoSpacing">
With this approach, Microsoft had finally a hypervisor
that could run workloads considered as “always-on” and also based on x64
architecture. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I don’t have to go through the entire story of Hyper-V,
but to summarize: Hyper-V in these days reminds you a bit of VMware – only it
is better!<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
As stated earlier, server virtualization is key and a <i>common</i> requirement for cloud computing. In
fact, Microsoft wouldn’t have such a good story today if it wasn’t for the investment
they made in Hyper-V. <o:p></o:p></div>
<div class="MsoNoSpacing">
If you look closely, the Cloud OS vision with the entire “cloud
consistency” approach derives from the hypervisor itself. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Empowering IaaS<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In Azure today, we have many sophisticated offerings
around the Infrastrucutre as a Service delivery model, focusing on core compute,
networking and storage capabilities. Also, they have taken this a step further
where we can use something called VM extensions in our virtual machines, so
that during provisioning time – or post deployment, we can interact with the
virtual machine operating system to perform some really advanced stuff. Examples
here could be deployment and configuration of a complex LoB application. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Microsoft Azure and Windows Azure Pack (Azure
technologies on-prem) has been focusing on IaaS for a long time, and today we
have literally everything we need to use any of these cloud environments to
rapidly instantiate new test & dev environments, spinning up virtual
machine instances in isolated networks and fully leverage the software-defined
datacenter model that Microsoft provides. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
But what do we do when virtual machines aren’t enough? What
if we want to be even more agile? What if we don’t want to sit down and wait
for the VM to be deployed, configured and available before we can verify our
test results? What if we want to maximize our investments even further and
increase the hw utilization to the maximum?<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This is where containers comes handy and provides us with
OS virtualization. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>OS Virtualization<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<b><br /></b></div>
<div class="MsoNoSpacing">
Many people have already started to compare Windows Server Containers with technologies such as Server App-V and App-V (for desktops).</div>
<div class="MsoNoSpacing">
Neither of these comparisons are really true, as Windows Server Containers covers a lot more and has some fundamental differences when looking at the architecture and use cases. </div>
<div class="MsoNoSpacing">
The concept, however, might be similar, as App-V technologies (both for server and desktop) aimed to deliver isolated application environments, in its own sandbox. Things could either be executed locally or streamed from a server. </div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Microsoft will give us two options when it comes to
container technology:<o:p></o:p></div>
<div class="MsoNoSpacing">
Windows Server Containers and Hyper-V Containers. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<i><span style="color: red;">Before you get confused or starts to raise questions: You can
run both Windows Server Containers <u>and</u> Hyper-V Containers within a VM
(where the VM is the Container </span></i><span style="color: red;">host)<i>. However, using Hyper-V Containers would require
that Hyper-V is installed. <o:p></o:p></i></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In <b>Windows Server
Container</b>, the container is a process that executes in its own <i>isolated</i> user mode of the operating
system, but where the kernel is shared between the container <i>host</i> and all of its containers.<o:p></o:p></div>
<div class="MsoNoSpacing">
To achieve isolation between the Containers and the
Container Hosts, namespace virtualization is used to provide independent
session namespace and kernel object namespace isolation per container<o:p></o:p></div>
<div class="MsoNoSpacing">
In addition, each container is isolated behind a network
compartment using NAT (meaning that the container host has a Hyper-V Virtual
Switch configured, connected to the containers).<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
For applications executing in a container process, all
file and registry changes are captured through their respective drivers (file
filter driver and registry filter). System state are shown as read-only to the
application. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
With this architecture of Windows Server Containers, it
is very likely that this is an ideal approach for applications within the same
trust boundary since the host kernel and APIs are shared among the containers. Windows
Server Containers is the most optimized solution when reduced start-up time is
important to you.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
On the other hand, we also have something called <b>Hyper-V Containers</b> (this is not
available in Technical Preview 3).<o:p></o:p></div>
<div class="MsoNoSpacing">
A Hyper-V Container provides the same capabilities as Windows
Server Containers, but has its own (isolated) copy of the Windows kernel and
memory directly assigned to them. There is of course pros and considerations
with every type of technology, and with Hyper-V Containers you will achieve
more isolation and better security, but have a less efficient start-up and
density compared to Windows Server Containers. <span style="font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The following two pictures shows the difference between server
virtualization and OS virtualization (Windows Server Containers)<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsnvzmdanyPp05q4npFa28oJTSWUcXe7VYftwlFOalaGXhQkQiRrRrNkji3ePq6t-Vk1yO5ZJlc_jzuM8AUSbr5YxIZTZzRuIZoxxwbEkRlrX_LX0lKnxdPi9IEVZzmT40fKXWVIYU75k/s1600/server+virtualization.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsnvzmdanyPp05q4npFa28oJTSWUcXe7VYftwlFOalaGXhQkQiRrRrNkji3ePq6t-Vk1yO5ZJlc_jzuM8AUSbr5YxIZTZzRuIZoxxwbEkRlrX_LX0lKnxdPi9IEVZzmT40fKXWVIYU75k/s400/server+virtualization.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Server Virtualization</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_-tNdD0WuIjBid2rjAGy3jNzvlHJctDsuGRqUWxLJYUhTQ9lgspWBaohQgf8QjM2iGZ1u2B2lkud5wNar8Im53gwB0JFc2aOB3kV5bKo_JfRz6IrZzd0ogPI2lZsUUQUB89MfxuTgqX0/s1600/Os+virtualization.JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="185" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_-tNdD0WuIjBid2rjAGy3jNzvlHJctDsuGRqUWxLJYUhTQ9lgspWBaohQgf8QjM2iGZ1u2B2lkud5wNar8Im53gwB0JFc2aOB3kV5bKo_JfRz6IrZzd0ogPI2lZsUUQUB89MfxuTgqX0/s400/Os+virtualization.JPG" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">OS Virtualization</td></tr>
</tbody></table>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>So, what are the use cases for Windows Server Containers?</b><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
It is still early days with Windows Server 2016 Technical
Preview 3 so things are subject to change.<o:p></o:p></div>
<div class="MsoNoSpacing">
However, there are things we need to start to think about
right now when it comes to how to leverage containers.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
If you take a closer look at Docker (which has been doing
this for a long time already), you might get a hint of what you can achieve
using container technology.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Containers aren’t necessarily the right solution for all
kind of applications, scenarios and tools you may think of, but gives you a unique
opportunity to speed up testing, development and to effectively enable DevOps
scenarios that embraces continuous delivery.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Containers can be spun up in seconds and we all know that
having multiple new “objects” in our environment can also lead to a demand of
control and management that also introduces us for a new toolset. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I am eager to share more of my learning of Windows Server
Containers with you, and will shortly publish part two of this blog series.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com0tag:blogger.com,1999:blog-893729307599410422.post-36181364786035934342015-08-19T21:34:00.000+02:002015-08-19T21:34:02.695+02:00Getting started with Nano Server for Compute and Cluster<div class="MsoNoSpacing">
I assume you have heard the news that Windows Server <i>and</i> System Center 2016 TP3 is publicly
available by now.</div>
<div class="MsoNoSpacing">
<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This means you can download and play around with the bits
in order to get some early hands-on experience on the available scenarios and features.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
One of the key scenarios that’s available in this preview
is the following:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l3 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Nano Server (enhanced – and covered in this blog
post)<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l3 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Windows Container (new – and very well explained
by Aidan Finn at <a href="http://www.aidanfinn.com/">www.aidanfinn.com</a> )<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l3 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Storage Spaces Direct (enhanced – and covered
here very soon)<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l3 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->Network Controller (new – and covered here in <i>detail</i> very very soon <span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;">J</span> )<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
So, let us start to talk about Nano Server.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
During Ignite earlier this year, Nano Server was
introduced by the legend himself, Mr. Snover.<o:p></o:p></div>
<div class="MsoNoSpacing">
Let us be very clear: Nano Server is not even comparable
to Server <i>Core</i>, that Microsoft has
been pushing since the release of it, where you run a full Windows Server without
any graphical user interface. However, some of the concepts are the same and
applicable when it comes to Nano. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Some of drivers for Nano Server was based on customer
feedback, and you might be familiar with the following statements:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l1 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]-->-<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]--><b>Reboots
impact my business<o:p></o:p></b></div>
<div class="MsoNoSpacing">
Think about Windows Server in general, not just Hyper-V
in a cluster context – which more or less deals with reboots. <o:p></o:p></div>
<div class="MsoNoSpacing">
Very often you would find yourself in a situation where
you had to reboot a server due to an update – of a component you in fact wasn’t
using, nor aware of was installed on the server (that’s a different topic, but
you get the point).<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l1 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]-->-<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]--><b>What’s up
with the server image? It’s way too big!<o:p></o:p></b></div>
<div class="MsoNoSpacing">
From a WAP standpoint, using VMM as the VM Cloud
Provider, you have been doing plenty of VM deployments. You normally have to
sit and wait for several minutes just for the data transfer to complete. Then there’s
the VM customization if it’s a VM Role, and so on and so forth. Although thing
has been improving over the last years with Fast-File-Copy and support of ODX,
the image size is very big. And don’t forget - this affects backup, restore and
DR scenarios too, in addition to the extra cost on our networking fabric
infrastructure. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l1 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]-->-<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]--><b>Infrastructure
requires too many resources<o:p></o:p></b></div>
<div class="MsoNoSpacing">
I am running and operating a large datacenter today,
where I have effectively been able to standardize on the server roles and
features I only need. However, the cost per server is too high when it comes to
utilization, and really make an impact on the VM density. <o:p></o:p></div>
<div class="MsoNoSpacing">
Higher VM density lower my costs and increases my
efficiency & margins.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<i>I just want the
components I need….and nothing more… please<o:p></o:p></i></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
So speaking of which components we really need.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Nano Server is designed for the Cloud, which means it’s
effective and goes along with a “Zero-footprint” model. Server Roles and
optional features live outside of the Nano Server itself, and we have
stand-alone packages that we adds to the image by using DISM. More about that
later.<o:p></o:p></div>
<div class="MsoNoSpacing">
Nano Server is a “headless”, 64-bit only, deployment
option for Windows Server that according to Microsoft marketing is refactored
to focus on “Cloud OS Infrastructure” and “Born-in-the-cloud applications”. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The key roles and features we have today is the
following:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l1 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]-->-<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]--><b>Hyper-V<o:p></o:p></b></div>
<div class="MsoNoSpacing">
Yes, this is (If you ask me) the key – and the flagship
when it comes to Nano Server. You might remember the stand-alone Hyper-V server
that was based on the Windows Kernel but only ran the Hyper-V Role? Well, the
Nano Server is much smaller and <i>only</i>
is based on Hyper-V, sharing the exact same architecture as the Hypervisor we
know from the GUI based Windows Server edition. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l1 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]-->-<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]--><b>Storage
(SOFS)<o:p></o:p></b></div>
<div class="MsoNoSpacing">
As you probably know already, compute without storage is
quite useless, given the fact that Virtual Machines is nothing but a set of
files on a disk <span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;">J</span> <o:p></o:p></div>
<div class="MsoNoSpacing">
With a package for storage, we are able to instantiate
several Nano Servers with the storage role to act as storage nodes based on
Storage Spaces Direct (shared-nothing storage). This is very cool and will of
course qualify for its own blog post in the near future.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l1 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]-->-<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]--><b>Clustering</b><o:p></o:p></div>
<div class="MsoNoSpacing">
Both Hyper-V and Storage (SOFS) relies (in many
situations) on the Windows Failover Cluster feature. Luckily, the cluster
feature servers as its own package for Nano Server and we can effectively
enable critical infra roles in a HA configuration using clustering. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l1 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]-->-<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]--><b>Windows
Contain</b>er<o:p></o:p></div>
<div class="MsoNoSpacing">
This is new in TP3 – and I suggest you read Aidan’s blog
about the topic. However, you won’t be able to test/verify this package on Nano
Server in this TP, as it is missing several of its key requirements and dependencies.
<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l1 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]-->-<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]--><b>Guest
Package</b><o:p></o:p></div>
<div class="MsoNoSpacing">
Did you think that you had to run Nano Server on your
physical servers only? Remember that Nano is designed for the “born-in-the-cloud
applications” too, so you can of course run them as virtual machines. However,
you would have to add the Guest Package to make them aware that they are
running on top of Hyper-V.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In addition, we have packages for OEM Drivers (package of
all drivers in Server Core), OneCore ReverseForwarders and Defender.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Remote Management</b><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Nano Server is all about being effective, leverage the
cloud computing attributes, being effective, scalable and achieve more. In order
to do so, we must understand that Nano Server is all about remote management. <o:p></o:p></div>
<div class="MsoNoSpacing">
With a subset of Win32 support, PowerShell Core, ASP.NET5,
we aren’t able to use Nano Server for <i>everything</i>.
But that is also the point here.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Although Nano is refactored to run on CoreCLR, we have
full PowerShell language compatibility and remoting. Examples here are
Invoke-Command, New-PSSession, Enter-PSSession etc. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Getting started
with Nano Server for Compute<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Alright, so let us get over to some practical examples on
how to get started with Nano Server for Compute, and how to actually do the configuration.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Originally, this blog post was a bit longer than it is
now, since Microsoft just published some new content over at TechNet. Here you
will find a good guidance on how to deploy Nano: <a href="https://technet.microsoft.com/en-us/library/mt126167.aspx">https://technet.microsoft.com/en-us/library/mt126167.aspx</a><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I must admit, that the experience of installing and configuring
Nano wasn’t state of the art in TP2.<o:p></o:p></div>
<div class="MsoNoSpacing">
Now, in TP3, you can see that we have the required
scripts and files located on the media itself, which simplifies the process.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiu2Nu9YAQXlUzPI-luXuDNGiSr-6nfkGD0WJEpsrRHRencGcOoReeXVgyEguYVK2i-kjcYJrvjx2vmk70lGiXYJiV995WhJKGzgjP2ClQ2O8rZ1K9i4EBvhIz0iktnD5P0OgoH0laYxMA/s1600/nanoimage1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="122" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiu2Nu9YAQXlUzPI-luXuDNGiSr-6nfkGD0WJEpsrRHRencGcOoReeXVgyEguYVK2i-kjcYJrvjx2vmk70lGiXYJiV995WhJKGzgjP2ClQ2O8rZ1K9i4EBvhIz0iktnD5P0OgoH0laYxMA/s400/nanoimage1.JPG" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo3; text-indent: -.25in;">
<!--[if !supportLists]-->1.<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->Mount the media and dot-source the ‘convert-windowsimage.ps1’
and ‘new-nanoserverimage.ps1’ script in a PowerShell ISE session<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo3; text-indent: -.25in;">
<!--[if !supportLists]-->2.<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->Next, see the following example on how to create
a new image for your Nano server (this will create a VHD that you could <i>either</i> upload to a WDS if you want to
deploy it on a physical server, or mount it to a virtual machine<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo3; text-indent: -.25in;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFw5InTg2JN7t4rB6D0Plrc0c8vdAsRJLTiYAalIot38fLPFv7wRPYwFcND8ZF_LO0UGa6Ut_L8464ebDu_7tyUlRede5Wg72hYsOcdmNlXYaPOp0FS36_WfNpOFg8xkhYUSQq97A5qY0/s1600/nanocompute.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgFw5InTg2JN7t4rB6D0Plrc0c8vdAsRJLTiYAalIot38fLPFv7wRPYwFcND8ZF_LO0UGa6Ut_L8464ebDu_7tyUlRede5Wg72hYsOcdmNlXYaPOp0FS36_WfNpOFg8xkhYUSQq97A5qY0/s400/nanocompute.JPG" width="400" /></a></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo3; text-indent: -.25in;">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo3; text-indent: -.25in;">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo3; text-indent: -.25in;">
<!--[if !supportLists]-->3.<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->By running the cmdlet, you should have a new
image<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In our example, we uploaded the vhd to our WDS (Thanks
Flemming Riis for facilitating this).<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
If you pay close attention to the paramhash table, you
can see the following:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$paramHash</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> @{<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">MediaPath
<span style="color: darkgrey;">=</span> <span style="color: darkred;">'G:\'</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">BasePath
<span style="color: darkgrey;">=</span> <span style="color: darkred;">'C:\nano\new'</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">TargetPath
<span style="color: darkgrey;">=</span> <span style="color: darkred;">'C:\Nano\compute'</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">AdministratorPassword
<span style="color: darkgrey;">=</span> <span style="color: orangered;">$pass</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">ComputerName
<span style="color: darkgrey;">=</span> <span style="color: darkred;">'nanohosttp3'</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Compute
<span style="color: darkgrey;">=</span> <span style="color: orangered;">$true</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Clustering
<span style="color: darkgrey;">=</span> <span style="color: orangered;">$true</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">DriversPath
<span style="color: darkgrey;">=</span> <span style="color: darkred;">"c:\drivers"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">EnableIPDisplayOnBoot
<span style="color: darkgrey;">=</span> <span style="color: orangered;">$True</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">EnableRemoteManagementPort
<span style="color: darkgrey;">=</span> <span style="color: orangered;">$True</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Language
<span style="color: darkgrey;">=</span> <span style="color: darkred;">'en-us'</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">DomainName
<span style="color: darkgrey;">=</span> <span style="color: darkred;">'drinking.azurestack.coffee'</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">}
<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Compute = $true </b>and<b> Clustering = $true. <o:p></o:p></b></div>
<div class="MsoNoSpacing">
This means that both the compute <i>and</i> the clustering package will be added to the image. In addition,
since we are deploying this on a physical server, we learned the hard way
(thanks again Flemming) that we needed some HP drivers for networks and storage
controller. We are therefore pointing to the location (<b>DriversPath = “c:\drivers” </b>) where we extracted the drivers so they
get added to the image. <o:p></o:p></div>
<div class="MsoNoSpacing">
Through this process, we are also pre-creating the
computer name object in Active Directory as we want to domain join the box to “<b>drinking.azurestack.coffee</b>”.<o:p></o:p></div>
<div class="MsoNoSpacing">
If you pay attention to the guide at Technet, you can see
how you can set a static IP address on your Nano Server. We have simplified the
deployment process in our fabric as we are rapidly deploying and decommissioning
compute on the fly, so all servers get their IP config from a DHCP server.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Once the servers were deployed (this took literally under
4 minutes!), we could move forward and very that everything was as we desired.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l2 level1 lfo4; text-indent: -.25in;">
<!--[if !supportLists]-->1)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->Nano Servers were joined to domain<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l2 level1 lfo4; text-indent: -.25in;">
<!--[if !supportLists]-->2)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->We had remote access to the nano servers<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB3cVyYIRqRFEuXuzCAwHW3ft9Zo_hijlfg0DCbMgReAr2LR6TsACmOWM2l26GCn2FdhbhZ1gS7azWG3mS_SFpigRSzX8bgjW56Y82y09A5G9i5xl3mWx6Ae0zqIlvIEMh3clfnUJZ9eE/s1600/nano+remote.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="97" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgB3cVyYIRqRFEuXuzCAwHW3ft9Zo_hijlfg0DCbMgReAr2LR6TsACmOWM2l26GCn2FdhbhZ1gS7azWG3mS_SFpigRSzX8bgjW56Y82y09A5G9i5xl3mWx6Ae0zqIlvIEMh3clfnUJZ9eE/s320/nano+remote.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Since Nano Server is all about remote management, we used
the following PowerShell cmdlets in order to configure the compute nodes,
create the cluster etc.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Preparing your mgmt server</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Install-WindowsFeature</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-Name</span> <span style="color: blueviolet;">RSAT-Hyper-V-Tools</span><span style="color: darkgrey;">,</span> <span style="color: blueviolet;">Hyper-V-Tools</span><span style="color: darkgrey;">,</span> <span style="color: blueviolet;">Hyper-V-PowerShell</span><span style="color: darkgrey;">,</span> <span style="color: blueviolet;">RSAT-Clustering</span><span style="color: darkgrey;">,</span> <span style="color: blueviolet;">RSAT-Clustering-MGMT</span><span style="color: darkgrey;">,</span> <span style="color: blueviolet;">RSAT-AD-PowerShell</span>
<span style="color: navy;">-Verbose</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Creating Nano Compute Cluster</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$clustername</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"nanocltp3"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$nodes</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"hvtp301, hvtp302"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$ip</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"10.0.0.50"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">New-Cluster</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-Name</span> <span style="color: orangered;">$clustername</span> <span style="color: navy;">-Node</span>
<span style="color: orangered;">$nodes</span> <span style="color: navy;">-StaticAddress</span>
<span style="color: orangered;">$ip</span> <span style="color: navy;">-NoStorage</span>
<span style="color: navy;">-Verbose</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Connecting to storage server and create SMB share with
proper permissions</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$storage</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"nanostor"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Enter-PSSession</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-ComputerName</span> <span style="color: blueviolet;">nanostor</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">MD</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blueviolet;">D:\VMS</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">ICACLS.EXE</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blueviolet;">D:\VMS</span>
<span style="color: blueviolet;">--%</span> <span style="color: blueviolet;">/Grant
drinking\knadm:(CI)(OI)F</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">ICACLS.EXE</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blueviolet;">D:\VMS</span>
<span style="color: blueviolet;">--%</span> <span style="color: blueviolet;">/Grant
drinking\hvtp301$:(CI)(OI)F</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">ICACLS.EXE</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blueviolet;">D:\VMS</span>
<span style="color: blueviolet;">--%</span> <span style="color: blueviolet;">/Grant
NTDEV\benarm-zeta$:(CI)(OI)F</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">ICACLS.EXE</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blueviolet;">D:\VMS</span>
<span style="color: blueviolet;">/Inheritance:R</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">New-SmbShare</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-Name</span> <span style="color: blueviolet;">VMS</span> <span style="color: navy;">-Path</span> <span style="color: blueviolet;">D:\VMS</span> <span style="color: navy;">–FullAccess</span>
<span style="color: blueviolet;">drinking\knadm</span><span style="color: darkgrey;">,</span>
<span style="color: blueviolet;">drinking\hvtp301$</span><span style="color: darkgrey;">,</span>
<span style="color: blueviolet;">drinking\hvtp302$</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Configuring Constrained Delegation</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Enable-SmbDelegation</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">–SmbServer</span> <span style="color: orangered;">$storage</span>
<span style="color: navy;">–SmbClient</span> <span style="color: blueviolet;">hvtp301</span>
<span style="color: navy;">-Verbose</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Enable-SmbDelegation</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">–SmbServer</span> <span style="color: orangered;">$storage</span>
<span style="color: navy;">-SmbClient</span> <span style="color: blueviolet;">hvtp302</span>
<span style="color: navy;">-Verbose</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Configure Hyper-V settings for Cluster usage</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$vmhosts</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span>@(<span style="color: darkred;">"hvtp301"</span><span style="color: darkgrey;">,</span>
<span style="color: darkred;">"hvtp302"</span>)<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$vhdpath</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"\\nanostor\vms\"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$vmconfigpath</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"\\nanostor\vms\"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$lmsettings</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"5"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkblue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">foreach</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> (<span style="color: orangered;">$vmhost</span>
<span style="color: darkblue;">in</span> <span style="color: orangered;">$vmhosts</span>)<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blue;">Set-VMHost</span>
<span style="color: navy;">-ComputerName</span> <span style="color: orangered;">$vmhost</span>
<span style="color: navy;">-MaximumVirtualMachineMigrations</span> <span style="color: orangered;">$lmsettings</span> <span style="color: navy;">-VirtualHardDiskPath</span>
<span style="color: orangered;">$vhdpath</span> <span style="color: navy;">-VirtualMachinePath</span>
<span style="color: orangered;">$vmconfigpath</span> <span style="color: navy;">-VirtualMachineMigrationAuthenticationType</span>
<span style="color: blueviolet;">Kerberos</span> <span style="color: navy;">-Verbose</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Create VM based on Nano Image</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$vm</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"nanovm1"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$nanohost</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: darkred;">"hvtp301"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">New-VM</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-ComputerName</span>
<span style="color: orangered;">$nanohost</span> <span style="color: navy;">-Name</span>
<span style="color: orangered;">$vm</span> <span style="color: navy;">-MemoryStartupBytes</span>
<span style="color: purple;">512mb</span> <span style="color: navy;">-VHDPath</span>
<span style="color: blueviolet;">\\nanostor\vms\blank1.vhd</span> <span style="color: navy;">-SwitchName</span> <span style="color: blueviolet;">VMSwitch</span>
<span style="color: navy;">-Generation</span> <span style="color: purple;">1</span>
<span style="color: navy;">-Verbose</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Make the VM highly available</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Add-ClusterVirtualMachineRole</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-VMName</span> <span style="color: orangered;">$vm</span> <span style="color: navy;">-Cluster</span> <span style="color: orangered;">$clustername</span>
<span style="color: navy;">-Verbose</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Start the VM</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Start-VM</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-ComputerName</span>
<span style="color: blueviolet;">hvtp301</span> <span style="color: navy;">-Name</span>
<span style="color: orangered;">$vm</span> <span style="color: navy;">-Verbose <o:p></o:p></span></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
As you can see, we are also creating a virtual machine
here that is obviously based on a vhd with the guest drivers installed. We tested
on how to do this manually by using DISM on an empty image.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The following example can be used in order to service
your Nano vhd.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Nano servicing</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Create a mountpoint</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">md</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blueviolet;">mountpoint</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Mount the image into the mountpoint you just created</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">dism</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blueviolet;">/Mount-Image</span>
<span style="color: blueviolet;">/ImageFile:.\blank.vhd</span> <span style="color: blueviolet;">/Index:1</span> <span style="color: blueviolet;">/MountDir:.\mountpoint</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Add your package. In this example, we will add packages for
Storage, Cluster and Virtual Guest Services</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">dism</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blueviolet;">/Add-Package</span>
<span style="color: blueviolet;">/PackagePath:G:\NanoServer\Packages\Microsoft-NanoServer-Guest-Package.cab</span>
<span style="color: blueviolet;">/Image:.\mountpoint</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">dism</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blueviolet;">/Add-Package</span>
<span style="color: blueviolet;">/PackagaPath:G:\NanoServer\Packages\Microsoft-NanoServer-FailoverCluster-Package.cab</span>
<span style="color: blueviolet;">/Image:.\mountpoint</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">dism</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blueviolet;">/Add-Package</span>
<span style="color: blueviolet;">/PackagePath:G:\NanoServer\Packages\Microsoft-NanoServer-Storage-Package.cab</span>
<span style="color: blueviolet;">/Image:.\mountpoint</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Commit and dismount</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">dism</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blueviolet;">/Unmount-Image</span>
<span style="color: blueviolet;">/MountDir:.\mountpoint</span> <span style="color: blueviolet;">/commit</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Copy the vhd over to the smb share for the compute cluster</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Copy-Item</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-Path</span> <span style="color: blueviolet;">.\blank.vhd</span> <span style="color: navy;">-Destination</span>
<span style="color: blueviolet;">\\nanostor\vms</span> <span style="color: navy;">-Verbose
<o:p></o:p></span></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The following screen shot shows the Nano Cluster that is running
a virtual machine with Nano Server installed:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsQQAThGD6xFzqyKuOV6AMB3cCmGxykv7KDDiyUvo7JydmP5Rf1hTENJphQ_j72Txgin599kH82OEJml-zRCbPFyH6WqnC1nX8Ptkhm2wpoamc7-wrnbjTRZZp2EdGnlNDoy6I5l3-ubI/s1600/nano+cluster.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="233" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsQQAThGD6xFzqyKuOV6AMB3cCmGxykv7KDDiyUvo7JydmP5Rf1hTENJphQ_j72Txgin599kH82OEJml-zRCbPFyH6WqnC1nX8Ptkhm2wpoamc7-wrnbjTRZZp2EdGnlNDoy6I5l3-ubI/s400/nano+cluster.JPG" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>NB: I am aware
that my PowerShell cmdlets didn’t configure any VMswitch as part of the
process. In fact, I have reported that as a bug as it is not possible to do so
using the Hyper-V module. The VM switch was created successfully using the
Hyper-V Manager console.<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Happy Nano’ing, and I will cover more later.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
(I also hope that I will see you during our SCU session
on this topic next week)<o:p></o:p></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com0tag:blogger.com,1999:blog-893729307599410422.post-88945494235713868972015-08-10T23:04:00.000+02:002015-08-10T23:04:17.074+02:00My Sessions at System Center Universe<div class="MsoNoSpacing">
If you haven’t signed up for the conference by now, you
should really hurry up.</div>
<div class="MsoNoSpacing">
<o:p></o:p></div>
<div class="MsoNoSpacing">
Have a look at the sessions we are about to present
during this year conference here in Europe:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<a href="http://planning.systemcenteruniverse.ch/">http://planning.systemcenteruniverse.ch/</a><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I will have 4 sessions this year, covering a lot of
interesting stuff that I want to share with you.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
On Monday, we will do a joint session together with
Savision (partner) and several industry experts, such as Robert, Thomas and
Kevin.<o:p></o:p></div>
<div class="MsoNoSpacing">
<b>The session title
is “Are ITIL and System Center BFF?”<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<a href="http://planning.systemcenteruniverse.ch/Planing/SessionDetail/152?DateId=0">http://planning.systemcenteruniverse.ch/Planing/SessionDetail/152?DateId=0</a><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<i>In the modern world
where organizations are facing new challenges to be more competitive, they are
looking for better ways to improve the quality and efficiency of their IT
Service delivery using ITIL framework. Gain valuable insights and best
practices on how you can adopt the ITIL framework to Microsoft System Center
and OMS from real world experiences together with Savision’s Jonas Lenntun, and
Microsoft MVPs Robert Hedblom, Kristian Nese, Kevin Greene and Thomas Maurer.<o:p></o:p></i></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>On Tuesday, I will
have the “Early Morning Discussion – Microsoft Azure Stack” together with
Thomas Maurer. <o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<a href="http://planning.systemcenteruniverse.ch/Planing/SessionDetail/91?DateId=1">http://planning.systemcenteruniverse.ch/Planing/SessionDetail/91?DateId=1</a><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Bring all your questions and we will answer as much as we
can, while consuming some crazy amount of coffee during this hour. <o:p></o:p></div>
<div class="MsoNoSpacing">
I will also bring my laptop in case we have to show you
some live demos. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Immediately after
the morning discussion, me and Thomas will take you into the next generation of
infrastructure by introducing you to Nano Server.<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<a href="http://planning.systemcenteruniverse.ch/Planing/SessionDetail/150?DateId=1">http://planning.systemcenteruniverse.ch/Planing/SessionDetail/150?DateId=1</a><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<i>In this session we
will walk you through how Nano Server is changing the fundamental way we look
at fabric servers and workloads. Nano Service will change the way we build
servers and solve fundamental challenges which we have encountered over the
past years embracing cloud fundamentals. <o:p></o:p></i></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I can guarantee you a lot of breathtaking demos during
this session. <o:p></o:p></div>
<div class="MsoNoSpacing">
(Although the expected level of this session will be 200,
there will definitively be a lot of PowerShell code to cover, since Nano Server
is a headless x64 server without any local console).<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>On Wednesday, I
will go solo and talk about “Modern Application Modeling and Configuration for
Infrastructure Clouds”.<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<a href="http://planning.systemcenteruniverse.ch/Planing/SessionDetail/108?DateId=2">http://planning.systemcenteruniverse.ch/Planing/SessionDetail/108?DateId=2</a><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<i>For more than two
decades, the way to manage applications on enterprise distributed systems has
followed consistent patterns, and has proven to be very effective. But new
paradigms have emerged and are changing how IT is delivering business value,
and how IT interacts with business units and end users. Among these new
paradigms are: cloud computing (including multi-tenancy and self-service),
DevOps, outsourcing, hosting, and more. These paradigms come with different
layers and assignments of responsibilities, that underlying technologies must
implement for the end-to-end process to remain efficient, scalable and
flexible. This session goes through these changes, explains how Microsfot
solutions are adapting to them, and summarizes the vision for modern
application management in infrastructure as a service (whether on-prem, or in
the public cloud or both).<o:p></o:p></i></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This should be a very interesting session to follow,
where we will walk down the memorial lane and see where we eventually ends up
and how to deal with it.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Later on
Wednesday, I will do my last session – and I am really looking forward to this
one, as it is about a subject that is very close to my heart: “Deep-dive on
Azure Resource Manager”.<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<a href="http://planning.systemcenteruniverse.ch/Planing/SessionDetail/157?DateId=2">http://planning.systemcenteruniverse.ch/Planing/SessionDetail/157?DateId=2</a><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<i>Join me to take the
shortcut on Azure Resource Manager (ARM). ARM will definitively have an impact
on your career, and probably has already. Once Azure Stack arrives on-prem, we
will have a true consistency through ARM that will change the way we are
modeling and delivering our services to the clouds. During this session, you
will learn how a template is constructed and how to create and deploy your
cloud resources.<o:p></o:p></i></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Please note the following:<o:p></o:p></div>
<div class="MsoNoSpacing">
The ARM session is level 400 – and also a side session. That
means there will only be room for 15 persons. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>After the session,
I really need to jump into a taxi and get to the airport.<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<br />
<div class="MsoNoSpacing">
I hope I’ll see you in Basel in a few days <span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;">J</span><o:p></o:p></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com0tag:blogger.com,1999:blog-893729307599410422.post-1786541894344452782015-08-03T12:10:00.001+02:002015-08-03T12:10:13.515+02:00Explaining PowerShell Direct<div class="MsoNoSpacing">
One of the most frequently asked questions I get from my
customers is something like this:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
“We have a multi-tenant environment where everything is
now software-defined, including the network by using network virtualization. As
a result of that, we can no longer provide value added services to these
customers, as we don’t have a network path into the environments”.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Last year, I wrote a blog post that talks about “Understanding
your service offerings with Azure Pack” – which you can read here: <a href="http://kristiannese.blogspot.no/2014/10/understanding-windows-azure-pack-and.html">http://kristiannese.blogspot.no/2014/10/understanding-windows-azure-pack-and.html</a><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I won’t get into all of those details, but a common
misunderstanding nowadays is that both enterprises and service providers expect
that they will be able to manage their customers in the same way as they always
have been doing.<o:p></o:p></div>
<div class="MsoNoSpacing">
The fact that many organizations are now building their
cloud infrastructure with several new capabilities, such as network
virtualization and self-servicing, makes this very difficult to achieve. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I remember back at TechDays in Barcelona, when I got the
chance to talk with one of the finest Program Manager’s at Microsoft, Mr. Ben
Armstrong.<o:p></o:p></div>
<div class="MsoNoSpacing">
We had a discussion about this and he was (as always)
aware of these challenges and sad he had some plans to simplify service management
in a multi-tenant environment directly in the platform.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
As a result of that, we can now play around with <b>PowerShell Direct</b> in Windows Server
2016 Technical Preview. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Background<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Walking down the memorial lane, we used to have Virtual
Server and Virtual PC when we wanted to play around with virtualization in the
Microsoft world. Both of these solutions were what we call a “type 2 hypervisor”,
where all the hardware access was emulated through the operating system that
was actually running the virtual instances. <o:p></o:p></div>
<div class="MsoNoSpacing">
With Windows Server 2008, we saw the first version of
Hyper-V which was truly a type 1 hypervisor. <o:p></o:p></div>
<div class="MsoNoSpacing">
In the architecture of Hyper-V – and also the reason why
I am telling you all of this, is that we have something called <b>VMBus.<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The VMBus is a communication mechanism (high-speed
memory) used for interpartition communication and device enumeration on systems
with multiple active virtualized partitions. The VMBus is responsible for the
communication between the parent partition (the Hyper-V host) and the child
partition(s) (virtual machines with Integration Components installed/enabled).<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
As you can see, the VMBus is critical for communication
between host and virtual machines, and we are able to take advantage of this
channel in several ways already.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In Windows Server 2012 R2, we got the following:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><b>Copy-VMFile
<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Copy-VMFile let you copy file(s) from a source path to a
specific virtual machine running on the host. This was all done within the
context of the VMBus, so there’s no need for network connectivity to the
virtual machines at all. For this to work, it required you to enable “Guest
Services” on the target VMs as part of the integration services. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Here’s an example on how to achieve this using
PowerShell:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Enable guest services</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Enable-VMIntegrationService</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-Name</span> <span style="color: darkred;">'Guest Service
Interface'</span> <span style="color: navy;">-VMName</span> <span style="color: blueviolet;">mgmtvm</span> <span style="color: navy;">-Verbose</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Copy file to VM via VMBus</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Copy-VMFile</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-Name</span> <span style="color: blueviolet;">mgmtvm</span> <span style="color: navy;">-SourcePath</span>
<span style="color: blueviolet;">.\myscript.ps1</span> <span style="color: navy;">-DestinationPath</span>
<span style="color: darkred;">“C:\myscript.ps1”</span> <span style="color: navy;">-FileSource</span>
<span style="color: blueviolet;">Host</span> <span style="color: navy;">-Verbose <o:p></o:p></span></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><b>Remote
Console via VMBus<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Another feature that was shipped with Windows Server 2012
R2 was something called “Enhanced Session Mode”. This would leverage a RDP
session via the VMBus.<o:p></o:p></div>
<div class="MsoNoSpacing">
Using RDP, we could now logon to a virtual machine
directly from Hyper-V Manager and even copy files in and out of the virtual
machine. In addition, USB and printing would also now be possible – without any
network connectivity from the host to the virtual machines.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
And last but not least, this was the foundation for the
Remote Console feature with System Center and Windows Azure Pack- which you can
read more about here: <a href="http://kristiannese.blogspot.no/2014/02/configuring-remote-console-for-windows.html">http://kristiannese.blogspot.no/2014/02/configuring-remote-console-for-windows.html</a><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
And now back to the point. With Windows Server 2016, we
will get PowerShell Direct.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
With PowerShell Direct we can now in an easy and reliable
way run PowerShell cmdlets and scripts directly inside a virtual machine
without relying on technologies such as PowerShell remoting, RDP and VMConnect.
<o:p></o:p></div>
<div class="MsoNoSpacing">
Leveraging the VMBus architecture, we are literally
bypassing all the requirements for networking, firewall, remote management –
and access settings. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
However, there are <i>some</i>
requirements in the time of writing this:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->You must be connected to a Windows 10 or a
Windows Server technical preview <b>host</b>
with virtual machines that are running Windows 10 or Windows Server technical preview
as the <b>guest operating system</b><o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->You must be logged in with Hyper-V Admin creds
on the host<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><b>You need
user credentials for the virtual machine!<o:p></o:p></b></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]-->The virtual machine that you want to connect to
must run locally on the host and be booted<b><o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Clearly, it should be obvious that both the host and the
guest need to be on the same OS level. The reason for this is that VMBus is
relying on the virtualization service client in the guest – and the
virtualization service provider on the host, which need to be the same version.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
But what’s interesting to see here is that in order to
take advantage of PowerShell Direct, we need to have user credentials for the
virtual machine’s guest operating system itself. <o:p></o:p></div>
<div class="MsoNoSpacing">
Also, if we want to perform something awesome within that
guest, we probably need admin permission too – unless we are able to dance
around with JEA, but I have been able to test that yet.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Here’s an example on what we can do using PowerShell
Direct<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Get credentials to access the guest</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$cred</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-Credential</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Create a PSSession targeting the VMName from the Hyper-V
Host</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Enter-PSSession</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-VMName</span> <span style="color: blueviolet;">mgmtvm</span> <span style="color: navy;">-Credential</span> <span style="color: orangered;">$cred</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Running a cmdlet within the guest context</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Get-Service</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">|</span> <span style="color: blue;">Where-Object</span> {<span style="color: orangered;">$_</span><span style="color: darkgrey;">.</span>Status <span style="color: darkgrey;">-like</span>
<span style="color: darkred;">"*running*"</span> <span style="color: darkgrey;">-and</span> <span style="color: orangered;">$_</span><span style="color: darkgrey;">.</span>name <span style="color: darkgrey;">-like</span> <span style="color: darkred;">"*vm*"</span> } <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">[mgmtvm]: PS C:\Users\administrator.DRINKING\Documents>
Get-Service | Where-Object {$_.Status -like "*running*" -and $_.name
-like "*vm*" }<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Status Name DisplayName <o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">------ ---- ----------- <o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Running
vmicguestinterface Hyper-V Guest Service Interface <o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Running
vmicheartbeat Hyper-V
Heartbeat Service <o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Running
vmickvpexchange Hyper-V Data
Exchange Service <o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Running vmicrdv Hyper-V Remote Desktop
Virtualizati...<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Running
vmicshutdown Hyper-V Guest
Shutdown Service <o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Running
vmictimesync Hyper-V Time
Synchronization Service <o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Running
vmicvmsession Hyper-V VM
Session Service <o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Running vmicvss Hyper-V Volume Shadow Copy
Requestor <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
As you can see, [mgmtvm] shows that the context is the
virtual machine and we have successfully listed all the running services
related to the integration services. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Although this is very cool and shows that it works, I’d
rather show something that might be more useful.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
We can enter a PSSession as showed above, but we can also
directly invoke a command through invoke-command and use –scriptblock. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">#Invoke command, create and start a DSC configuration on the
localhost</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Invoke-Command</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-VMName</span>
<span style="color: blueviolet;">mgmtvm</span> <span style="color: navy;">-Credential</span>
(<span style="color: blue;">Get-Credential</span>) <span style="color: navy;">-ScriptBlock</span>
{<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># DSC Configuration</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkblue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Configuration</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blueviolet;">myWeb</span> {<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkblue;">Node</span> <span style="color: darkred;">"localhost"</span> {<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkblue;">WindowsFeature</span>
<span style="color: blueviolet;">Web</span> {<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> Ensure <span style="color: darkgrey;">=</span>
<span style="color: darkred;">"Present"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> Name <span style="color: darkgrey;">=</span>
<span style="color: darkred;">"Web-Server"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">}<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Enuct the DSC config</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">myWeb</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Start and apply the DSC configuration</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Start-DscConfiguration</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blueviolet;">.\myWeb</span> <span style="color: navy;">-Wait</span> <span style="color: navy;">-Force</span> <span style="color: navy;">-Verbose</span> } <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
From the example above, we are actually invoking a DSC
configuration that we are creating and applying on the fly, from the host to
the virtual machine using PowerShell Direct.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Here’s the output:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">PS C:\Users\knadm> #Invoke command, create and start a DSC
configuration on the localhost<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Invoke-Command -VMName mgmtvm -Credential (Get-Credential)
-ScriptBlock {<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># DSC Configuration<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Configuration myWeb {<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> Node
"localhost" {<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> WindowsFeature
Web {<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> Ensure =
"Present"<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> Name =
"Web-Server"<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">}<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Enuct the DSC config<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">myWeb<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Start and apply the DSC configuration<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Start-DscConfiguration .\myWeb -Wait -Force -Verbose }<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">cmdlet Get-Credential at command pipeline position 1<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Supply values for the following parameters:<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: darkorange; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">WARNING: The configuration 'myWeb' is loading one or more
built-in resources without explicitly importing associated modules. Add
Import-DscResource –ModuleName ’PSDesire<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: darkorange; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">dStateConfiguration’ to your configuration to avoid this
message.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> Directory:
C:\Users\administrator.DRINKING\Documents\myWeb<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Mode
LastWriteTime Length
Name PSComputerName <o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">----
------------- ------
----
-------------- <o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: whitesmoke; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">-a----
03-08-2015 11:34 1834 localhost.mof
mgmtvm
<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: Perform operation 'Invoke CimMethod' with following
parameters, ''methodName' = SendConfigurationApply,'className' =
MSFT_DSCLocalConfigurationManager,'namespace<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Name' = root/Microsoft/Windows/DesiredStateConfiguration'.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: An LCM method call arrived from computer MGMT16 with user
sid S-1-5-21-786319967-1790529733-2558778247-500.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]: LCM: [
Start Set ]<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]: LCM: [
Start Resource ] [[WindowsFeature]Web]<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]: LCM: [
Start Test ]
[[WindowsFeature]Web]<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]: [[WindowsFeature]Web]
The operation 'Get-WindowsFeature' started: Web-Server<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]:
[[WindowsFeature]Web] The operation 'Get-WindowsFeature' succeeded:
Web-Server<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]: LCM: [ End Test
] [[WindowsFeature]Web] in 22.0310 seconds.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]: LCM: [
Start Set ]
[[WindowsFeature]Web]<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]:
[[WindowsFeature]Web] Installation started...<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]:
[[WindowsFeature]Web]
Continue with installation?<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]:
[[WindowsFeature]Web] Prerequisite processing started...<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]:
[[WindowsFeature]Web] Prerequisite processing succeeded.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: darkorange; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">WARNING: [MGMT16]:
[[WindowsFeature]Web] You must restart this server to finish the
installation process.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]:
[[WindowsFeature]Web] Installation succeeded.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]: [[WindowsFeature]Web]
successfully installed the feature Web-Server<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]:
[[WindowsFeature]Web] The Target machine needs to be restarted.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]: LCM: [
End Set ]
[[WindowsFeature]Web] in 89.0570
seconds.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]: LCM: [
End Resource ] [[WindowsFeature]Web]<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]: [] A reboot is
required to progress further. Please reboot the system.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: darkorange; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">WARNING: [MGMT16]: [] A reboot is required to progress
further. Please reboot the system.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]: LCM: [
End Set ]<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: [MGMT16]: LCM: [
End Set ]
in 113.0260 seconds.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: Operation 'Invoke CimMethod' complete.<o:p></o:p></span></div>
<div class="MsoNormal" style="background: rgb(1, 36, 86); margin-bottom: 0.0001pt;">
<span style="color: cyan; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">VERBOSE: Time taken for configuration job to complete is 115.028
seconds <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In this example I am using one of the built-in DSC
resources in Windows Server. If I wanted to do more advanced configuration that
would require custom DSC resources, I would have to copy those resources to the
guest using the Copy-VMFile cmdlet first. All in all, I am able to do a lot
around vm management with the new capabilities through VMBus.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
So, what can we expect to see now that we have the
opportunity to provide management directly, native in the compute platform
itself?<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Let me walk you through a scenario here where the tenant
wants to provision a new virtual machine.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In Azure Pack today, we have a VM extension through the
VM Role. If we compare it to Azure and its new API through Azure Resource
Manager, we have even more extension to play around with. <o:p></o:p></div>
<div class="MsoNoSpacing">
These extensions gives us an opportunity to do more than
just OS provisioning. We can deploy – and configure advanced applications just
the way we want to.<o:p></o:p></div>
<div class="MsoNoSpacing">
Before you continue to read this, please note that I am
not saying that PowerShell Direct is a VM extension, but still something useful
you can take advantage of in this scenario.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
So a tenant provision a new VM Role in Azure Pack, and the
VM Role is designed with a checkbox that says “Enable Managed Services”. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Now, depending on how each service provider would like to
define their SLA’s etc, the tenant has now made it clear that they want managed
services for this particular VM Role and hence need to share/create credentials
for the service provider to interact with the virtual machines. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I’ve already been involved in several engagements in this
scope and I am eager to see the end-result once we have the next bits fully
released.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Thanks to the Hyper-V team with Ben and Sarah, for
delivering value added services and capabilities on an ongoing basis!</div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com0tag:blogger.com,1999:blog-893729307599410422.post-45790922462687145522015-07-28T23:21:00.000+02:002015-07-28T23:21:10.400+02:00Re-associate orphaned virtual machine with its VM role in System Center 2012 R2 with Update Rollup 7<div class="MsoNoSpacing">
If you have been using Azure Pack and the VM Cloud
Provider, you have most likely been tempted to use the concept of VM Roles too.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
VM Roles is a powerful technology that makes it possible
for you to provide a lot more than just a sysprep’d operating system to your
tenants. Through a resource <i>extension</i>,
a VM Role can be deployed with any application you’d like, ready to go for the tenants.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
However, there has been some challenges since the release
of Azure Pack and VM Roles.<o:p></o:p></div>
<div class="MsoNoSpacing">
Some of the challenges has been related to Azure Pack
directly, and some of the challenges has been related to Virtual Machine
Manager.<o:p></o:p></div>
<div class="MsoNoSpacing">
I won’t cover everything here, but the following picture
should summarize some of the challenges of a VM Role and a stand-alone VM,
where some parts such as “static disk” wasn’t enabled for VM Roles before UR5. With
UR6, we also got support for Gen2 VMs as part of the VM Roles. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxeYcEHWAumYkOv51SP4v0jrOMNz_rxf24HE4IntZ8jWCmwsIwdauuH-YyGg7Z8OyVF4oieixlI3f23dsf0ULecLGRSrJYs0aFTpOiTNn8bwR7jSz4WAuKDsb57PKKeN6etpbWId5NeQs/s1600/ur7.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="165" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxeYcEHWAumYkOv51SP4v0jrOMNz_rxf24HE4IntZ8jWCmwsIwdauuH-YyGg7Z8OyVF4oieixlI3f23dsf0ULecLGRSrJYs0aFTpOiTNn8bwR7jSz4WAuKDsb57PKKeN6etpbWId5NeQs/s320/ur7.JPG" width="320" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Also note that “backup” and “DR” on VM Role is
categorized as a “no go”. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Luckily and as usual, David and his great team at
Microsoft has listened to our feedback – and with Update Rollup 7 for Virtual
Machine Manager 2012 R2, we are now able to <b>re-associate a VM Role!</b><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Background:</b><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
A couple of months ago, I reached out to the VMM team
through <a href="https://twitter.com/Darmour_MSFT">David Armour</a> and
explained a rather bad situation for him that one of my customer suddenly was
in the middle of.<o:p></o:p></div>
<div class="MsoNoSpacing">
It turned out that several of my MVP friends also had
experienced similar issues and this was becoming a critical issue for those
customers. Here’s some details around the problem we saw:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In the case of some underlying storage issues in the
cloud environment, many of the virtual machines that was running in VMM, SPF
and Azure Pack ended up in a pretty bad state, and the only way to solve it was
to generate new IDs for those VMs. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal">
Now, this sounds very tempting and applicable in certain
scenarios. But given the fact that the VMs actually were part of a VM Role in
Azure Pack, turned out to be a bad experience. <o:p></o:p></div>
<div class="MsoNormal">
Once a VM is no longer associated with the VM Role in WAP,
it will appear as a stand-alone VM with no way for you to perform advanced
operations through the tenant portal. The VM Role itself will appear as an orphaned
object. <o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Our biggest challenge in this satiation was:<span lang="NL"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="text-indent: -.25in;">
1)<span style="font-family: "Times New Roman",serif; font-size: 7.0pt;"> </span>There
was no way to re-associate a VM instance with a VM role once this relationship
was broken (so Remove-SCVirtualMachine with –Force parameter was not an option)<span lang="NL"><o:p></o:p></span></div>
<div class="MsoListParagraph" style="text-indent: -.25in;">
2)<span style="font-family: "Times New Roman",serif; font-size: 7.0pt;"> </span><i>If</i>
we could re-associate with a VM role (once the VM appeared in VMM again with
new ID), the usage would be broken for that VM. Yes the customer was actually
using the usage API in WAP to charge their tenants.<o:p></o:p></div>
<div class="MsoListParagraph" style="text-indent: -.25in;">
<br /></div>
<div class="MsoNormal">
<span lang="NL">For this customer
the issue was most likely caused by some underlying storage problems. However,
you could easily end up in a similar situation by using native Microsoft
technologies such as backup/restore and DR through Hyper-V Replica/ASR. Or
simplier, by removing and adding a host/cluster to a VMM Cloud<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNoSpacing">
<span lang="NL">With Update
Rollup 7, we have finally support for re-associate <i>both</i> an orpahned VM from a VM Role <i>and</i> a Service Template deployment.<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b><span lang="NL">Example of a PowerShell cmdlet that will join an
orphaned virtual machine to a VM Role:<o:p></o:p></span></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span lang="NL">$myvm =
Get-SCVirtualMachine –Name “KN01”<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<span lang="NL">$myVMRole =
Get-CloudResource –Name “mywebservice”<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<span lang="NL">Join-SCVirtualMachine
–VM $myvm –VMRole $myVMRole<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span lang="NL">For more
information, please read the following KB:<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<a href="https://support.microsoft.com/en-us/kb/3083085">https://support.microsoft.com/en-us/kb/3083085</a><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com0tag:blogger.com,1999:blog-893729307599410422.post-83751493671767499322015-07-02T22:55:00.002+02:002015-07-02T22:55:12.482+02:00Cloud Consistency with Azure Resource Manager - Finally available!<div class="MsoNoSpacing">
I am very glad to announce the following:</div>
<div class="MsoNoSpacing">
<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->1)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->I am renewed as a Cloud & Datacenter MVP –
for the fifth time!<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->2)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->As a courtesy, we are releasing our newest
whitepaper “Cloud Consistency with Azure Resource Manager<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I have been doing a lot of engineering the last year,
and Azure Resource Manager is one of the technologies I consider as a game
changer and let us finally be able to achieve what we have always wanted,
without knowing it was this we really wanted.<o:p></o:p></div>
<div class="MsoNoSpacing">
An idempodent and declarative way to describe our cloud
resources, regardless of location and resource type.<o:p></o:p></div>
<div class="MsoNoSpacing">
Together with Desired-State Configuration, this is one of
my big bets as we move forward.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I really hope that you will enjoy this whitepaper while
we are all waiting for Microsoft Azure Stack, that will bring the ARM
capabilities on-prem.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
If you want to see more of Azure Resource Manager and how
to model your cloud resources and applications, I would like to invite you to
System Center Universe in Basel in August, where I will be giving several deep
dive sessions on the topic:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<a href="http://www.systemcenteruniverse.ch/">http://www.systemcenteruniverse.ch/</a><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
You can download the whitepaper from TechNet Gallery by
following this URL:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<a href="https://gallery.technet.microsoft.com/Cloud-Consistency-with-0b79b775">https://gallery.technet.microsoft.com/Cloud-Consistency-with-0b79b775</a><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
BTW: Here's the look on my daughters face when witnessing the capabilities of Azure Resource Manager</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4BL3ID7GPzVAPoUlnS8Vj0gm_N8TDqv7R_2DMaaMUjFryL2F7CdYFFNhSvokqBwgixFWM0Hb2sgJ5M8s5nbHNEB6xV1EY0LAKq04fxKlP2YTzbVQZMEPZ9wIib1gKZ1pkx7Ma4pBbhB4/s1600/oliviaen.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4BL3ID7GPzVAPoUlnS8Vj0gm_N8TDqv7R_2DMaaMUjFryL2F7CdYFFNhSvokqBwgixFWM0Hb2sgJ5M8s5nbHNEB6xV1EY0LAKq04fxKlP2YTzbVQZMEPZ9wIib1gKZ1pkx7Ma4pBbhB4/s400/oliviaen.jpg" width="251" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Thank you!<o:p></o:p></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com2tag:blogger.com,1999:blog-893729307599410422.post-8535574172997115252015-06-02T14:25:00.004+02:002015-06-02T14:25:56.851+02:00Announcing a new whitepaper!<div class="MsoNoSpacing">
Hi
everyone!</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
It has been quite quiet here on this blog since last
month, but there’s of course some reasons for that.<o:p></o:p></div>
<div class="MsoNoSpacing">
I would like to use this opportunity to give you a
heads-up on an upcoming whitepaper that I have been working on together with a
few other subject matter experts.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This blog post is not about the specific whitepaper
itself, but the goal is rather to give you an explanation of why we are having this
approach – putting a lot of effort into a whitepaper instead of publishing
books.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I have personally been authoring books myself, and also
together with other authors. The experience was interesting to say the least,
and also required a lot of my time. Not just to do the research, testing and
writing, but also to meet the deadlines, engage with reviewers and much more. <o:p></o:p></div>
<div class="MsoNoSpacing">
In short, the flexibility you have to modify – or even
change the subject, is very very limited when working with books.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The limited flexibility is a showstopper in a business
where drastic changes (as in new features and releases) happens at a much
faster cadence than ever before. <o:p></o:p></div>
<div class="MsoNoSpacing">
In order to be able to adopt, learn and apply all what’s
happening, – writing whitepapers seems like a better idea than doing books. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
At least this is what <u>we </u>think. When discussing
this with some of our peers, we often get questions around royalties etc. to be
honest, you will never ever get rich by writing a book, unless you are writing
some fiction about some magic wizard with glasses, or a girl describing her
fantasies of a rich man. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
So jokes aside, we do this because of the following
reasons:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="background: yellow; font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-highlight: yellow;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span style="background: yellow; mso-highlight: yellow;">We enjoy doing it<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This is not a secret at all. Of course we will spend some
massive amount of time on these projects, and probably our significant others
would have a grin every now and then. But we enjoy so much, that it is worth
the risk and potential penalty we might get. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="background: yellow; font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-highlight: yellow;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span style="background: yellow; mso-highlight: yellow;">For our own learning and knowledge<o:p></o:p></span></div>
<div class="MsoNoSpacing" style="margin-left: .5in;">
<br /></div>
<div class="MsoNoSpacing">
Let us be honest. We dive deep into this to learn it by
heart. There’s no secret that the technology we will cover will be our bread
and butter, so we better know what we are doing.<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in;">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="background: yellow; font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-highlight: yellow;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span style="background: yellow; mso-highlight: yellow;">To share it with the community<o:p></o:p></span></div>
<div class="MsoNoSpacing" style="margin-left: .5in;">
<br /></div>
<div class="MsoNoSpacing">
Do it once –and do it right. We spend a lot of our time
in forums, conferences, etc and engage with the community. Being able to point
towards a rather comprehensive guide that many can benefit from, instead of
supporting 1:1 is beneficial for all of us<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="background: yellow; font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-highlight: yellow;">·<span style="font-family: 'Times New Roman'; font-size: 7pt; font-stretch: normal;">
</span></span><!--[endif]--><span style="background: yellow; mso-highlight: yellow;">Recognition<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
If you do something good and useful, I can ensure you
that many people – regardless whether they know you or not, will appreciate it
and give you credits. We’ve heard several times from our previous whitepaper
(Hybrid Cloud with NVGRE (Cloud OS) ) that it helped peers, IT-pro’s,
engineers, students and CxO’s to make a real difference. This is probably worth
the effort all alone.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
So let me introduce you to the upcoming whitepaper that
will hit the internet very shortly:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>“Cloud Consistency
with Azure Resource Manager”<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This whitepaper will focus on cloud consistency using
Azure Resource Manager in both the public cloud with Azure, as well as the
private and hosted clouds with Azure Stack.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
I won’t disclose more about the content, structure or the
initial thoughts right now, but I encourage you to stay tuned and download it
once it is available on the TechNet Gallery.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Thanks for reading!<o:p></o:p></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com0tag:blogger.com,1999:blog-893729307599410422.post-66719493476863536142015-05-08T09:28:00.000+02:002015-05-08T09:28:07.675+02:00Microsoft Azure Stack with a strong ARM<div class="MsoNoSpacing">
How did God manage to create the world in only 6 days?<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l2 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->-<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->He had no legacy!<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
With that, I would like to explain what the new Microsoft
Azure Stack is all about.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
As many of you already know, we have all been part of a
journey over the last couple of years where Microsoft is aiming for consistency
across their clouds, covering private, service provider and public. <o:p></o:p></div>
<div class="MsoNoSpacing">
Microsoft Azure has been the leading star and it is quite
clear with a “mobile first, cloud first” strategy that they are putting all
their effort into the cloud, and later, make bits and bytes available for
on-prem where it make sense.<o:p></o:p></div>
<div class="MsoNoSpacing">
Regarding consistency, I would like to point out that we
have had “Windows Azure Services for Windows Server” (v1) and “Windows Azure
Pack” (v2) – that brought the tenant experience on-prem with portals and <i>common</i> API’s. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Let us stop there for a bit. <o:p></o:p></div>
<div class="MsoNoSpacing">
The API’s we got on-prem as part of the service
management APIs was <i>common</i> to the
ones we had in Azure, but they weren’t <i>consistent
</i>nor <i>identical</i>.<o:p></o:p></div>
<div class="MsoNoSpacing">
If you’ve ever played around with the Azure Powershell
module, you have probably noticed that we had different cmdlets when targeting
an Azure Pack endpoint compared to Microsoft Azure. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
For the portal experience, we got 2 portals. One portal
for the Service Provider – where the admin could configure the underlying
resource providers, create hosting plans and define settings and quotas through
the admin API. These hosting plans were made available to the tenants in the
tenant portal with subscriptions, where that portal – was accessing the
resources through the tenant API.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The underlying resource providers were different REST
APIs that could contain several different resource types. Take the VM Cloud
resource provider for example, that is a combination of System Center Virtual
Machine Manager and System Center Service Provider Foundation. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Let us stop here as well, and reflect of what we have
just read.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l1 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]-->1)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->So far, we have had a common set of APIs between
Azure Pack and Azure<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l1 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]-->2)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->On-prem, we are relying on System Center in
order to bring IaaS into Azure Pack<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
With cloud consistency in mind, it is about time to point
out that to move forward, we have to get the exact same APIs on-prem as we have
in Microsoft Azure.<o:p></o:p></div>
<div class="MsoNoSpacing">
Second, we all know that there’s no System Center
components that are managing the Hyper-Scale cloud in Azure<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Let us take a closer look at the architecture of
Microsoft Azure Stack<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDHY7GDV6KJJR_UnZVXNdsvdBbLElVUoadICHJVQtCGt3MhY9M76g0ysEIqYqsgB-GBGf8dzKdKyC9uXwnUReGEYBAYSEjobElECjLSCYULsPXaf25Fg6vv3Fdb9Z_1qbQrK8vModb_BA/s1600/architecture.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDHY7GDV6KJJR_UnZVXNdsvdBbLElVUoadICHJVQtCGt3MhY9M76g0ysEIqYqsgB-GBGf8dzKdKyC9uXwnUReGEYBAYSEjobElECjLSCYULsPXaf25Fg6vv3Fdb9Z_1qbQrK8vModb_BA/s400/architecture.JPG" width="387" /></a></div>
<div class="MsoNoSpacing">
<o:p><br /></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Starting at the top, we can see that we have the same –
consistent browser experience.<o:p></o:p></div>
<div class="MsoNoSpacing">
The user facing services consists of hubs, a portal shell
site and RP <i>extensions</i> for both admins (service provider) and tenant. This shows
that we won’t have two different portals as we have in Azure Pack today, but
things are differentiated through the extensions.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
These components are all living on top of something
called “Azure Resource Manager”, which is where all the fun and consistency for
real is born.<o:p></o:p></div>
<div class="MsoNoSpacing">
Previously in Azure, we were accessing the Service
Management API when interacting with our cloud services.<o:p></o:p></div>
<div class="MsoNoSpacing">
Now, this has changed and Azure Resource Manager is the <u>new,
consistent and powerful</u> API that will be managing <u>all the underlying
resource providers, regardless of clouds<b>.
<o:p></o:p></b></u></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Azure Resource Manager introduces an entirely new way of
thinking about your cloud resources. <o:p></o:p></div>
<div class="MsoNoSpacing">
A challenge with both Azure Pack and the former Azure
portal was that once we had several components that made up an application, it
was really hard to manage the life-cycle of it. This has drastically changed
with ARM, where we can now imagining a complex service, such as a SharePoint
farm – containing many different tiers, instances, scripts, applications. With ARM,
we can use a template that will create a resource group (a logical group that
will let you control RBAC, life-cycle, billing etc on the entire group of
resources, but you can also specify this at a lower level on the resources
itself) with the resources you need to support the service.<o:p></o:p></div>
<div class="MsoNoSpacing">
Also, the ARM itself is idempotent, which means it has a
declarative approach. You can already start to imagine how powerful this will
be.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In the context of the architecture of Azure Stack as we
are looking at right now, this means we can:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l3 level1 lfo3; text-indent: -.25in;">
<!--[if !supportLists]-->1)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->Create an Azure Gallery Template (.json) <o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.0in; mso-list: l3 level2 lfo3; text-indent: -.25in;">
<!--[if !supportLists]-->a.<span style="font-size: 7pt; font-stretch: normal;"> </span><!--[endif]-->Deploy
the template to Microsoft Azure<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.0in;">
or/and<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: 1.0in; mso-list: l3 level2 lfo3; text-indent: -.25in;">
<!--[if !supportLists]-->b.<span style="font-size: 7pt; font-stretch: normal;"> </span><!--[endif]-->Deploy
the template to Microsoft Azure <b>Stack</b><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
It is time to take a break and put a smile on your face.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Now, let us explain the architecture a bit further.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Under the Azure Resource Manager, we will have several
Core Management Resource Providers as well as Service Resource Providers.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The Core Management Resource Providers consists of
Authorization – which is where all the RBAC settings and policies are living. All
the services will also share the same Gallery now, instead of having separate
galleries for Web, VMs etc as we have in Azure Pack today. Also, all the
events, monitoring and usage related settings are living in these core
management resource providers. One of the benefits here is that third parties
can now plug in their resource providers and harness the existing architecture
of these core RPs. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Further, we have currently Compute, Network and Storage
as Service Resource Providers.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
If we compare this with what we already have in Azure
Pack today through our VM Cloud Resource Provider, we have all of this through a
single resource provider (SCVMM/SCSPF) that basically provides us with
everything we need to deliver IaaS. <o:p></o:p></div>
<div class="MsoNoSpacing">
I assume that you have read the entire blog post till
now, and as I wrote in the beginning, there’s no System Center components that
are managing Microsoft Azure today.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
So why do we have 3 different resource providers in Azure
Stack for compute, network and storage, when we could potentially have
everything from the same RP?<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In order to leverage the beauty of a cloud, we need the
opportunity to have a loosely coupled infrastructure – where the resources and
different units can scale separately and independent of each other. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Here’s an example of how you can take advantage of this:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo4; text-indent: -.25in;">
<!--[if !supportLists]-->1)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->You want to deploy an advanced application to an
Azure/Azure Stack cloud, so you create a base template containing the common
artifacts, such as image, OS settings etc<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo4; text-indent: -.25in;">
<!--[if !supportLists]-->2)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->Further, you create a separate template for the
NIC settings and the storage settings<o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo4; text-indent: -.25in;">
<!--[if !supportLists]-->3)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->As part of the deployment, you create references
and eventually some “depends-on” between these templates so that everything
will be deployed within the same Azure Resource Group (that shares the same
common life-cycle, billing, RBAC etc) <o:p></o:p></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo4; text-indent: -.25in;">
<!--[if !supportLists]-->4)<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->Next, you might want to change – or eventually
replace some of the components in this resource group. As an example, let us
say that you put some effort into the NIC configuration. You can then delete
the VM (from the Compute RP) itself, but keep the NIC (in the Network RP).<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This gives us much more flexibility compared to what we
are used to. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Summary<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
So, Microsoft is for real bringing Azure services to <b>your</b> datacenters now, as part of the
2016 wave that will be shipped next year. The solution is called “Microsoft
Azure Stack” and won’t “require” System Center – but you can use System Center
if you want for managing purposes etc., which is probably a very good idea. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
It is an entirely new product for you datacenter – which is
a cloud-optimized application platform, using Azure-based compute, network and
storage services<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In the next couple of weeks, I will write more about the
underlying resource providers and also how to leverage the ARM capabilities. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Stay tuned for more info around Azure Stack and Azure
Resource Manager.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com0tag:blogger.com,1999:blog-893729307599410422.post-56446894025694869682015-05-04T08:51:00.001+02:002015-05-04T08:51:26.870+02:00Azure Site Recovery: Generation 2 VM support<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">For
almost a year ago, Microsoft announced the preview of a cloud service that has
turned out to be the leading star when it comes to Hybrid Cloud scenarios, out
of the box from Microsoft.<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">Microsoft
Azure Site Recovery let customers extend their datacenter solutions to the
cloud to ensure business continuity and availability on-demand. <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">The
solution itself is state of the art and covers many different scenarios – and
can rather be seen as their “umbrella” when it comes to availability and
recovery in the cloud, as it has several different offerings in different
flavors under its wings. <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">Besides
supporting DR protection of VMware and Physical computers (newly announced),
Azure Site Recovery is considered as mandatory for organizations that need DR
for their Hyper-V environments, regardless whether the cloud or a secondary
location on-prem is the actual DR target.<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">Just
recently, Microsoft announced support for protecting <b>Generation 2 Virtual Machines </b>to Azure. <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">This is
fantastic good news and shows that the journey towards cloud consistency is
established for sure. <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b><span style="font-family: "Segoe UI",sans-serif;">Let me add some context before we look
into the details</span></b><span style="font-family: "Segoe UI",sans-serif;">.<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">I’ve been
working with the brilliant Azure Site Recovery Product Group at Microsoft for a
long time now, and I have to admit that these guys are outstanding. Not only do
they ship extremely good quality of code, but they also listen to feedback. And
when I say listen, they actually engage with you and really tries to understand
your concern. In the end of the day, we are all on the same team, working
towards the best experience and solution possible. <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">During
TechEd in Barcelona, I was co-presenting “Microsoft Azure Site Recovery:
Leveraging Azure as your Disaster Recovery Site” (<a href="http://channel9.msdn.com/Events/TechEd/Europe/2014/CDP-B314">http://channel9.msdn.com/Events/TechEd/Europe/2014/CDP-B314</a>
) together with Manoj, and this is when our real discussion started. <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">Using
Azure as the secondary site for DR scenarios makes perfect sense and many
customers would like to take benefit from this as soon as possible. However, we
often saw that these customers had deployed their virtual machines as
Generation 2 VMs – which wasn’t suited for the Azure platform. This was a
blocker and the amount of Gen2 VMs were increasing every day. <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">Earlier
in January this year, I made a community survey around the topic and the result
was very clear:<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">Yes –
people would love to use Azure as their secondary site, <i>if</i> there was support of Generation 2 VMs in the Cloud.<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">I am glad
to say that the Product Group listened and now we can start to protect
workloads on Gen2 VMs too.<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<b><span style="font-family: "Segoe UI",sans-serif;">But, how does this work?<o:p></o:p></span></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">When you
enable a VM for protection, the data is sent to an endpoint in Azure, and
nothing special has happened so far.<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">However,
the ASR service will perform a conversion in the service at the time of
failover to Gen1. <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<i><span style="font-family: "Segoe UI",sans-serif;">What?<o:p></o:p></span></i></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">Let me
explain further. <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">In case
of a disaster where you need to perform a failover to Azure, the VM(s) is
converted and started as Gen1, running in Azure. <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">The ASR
backend services used during failover has the conversion logic. At failover
time, backend service reads Gen2 OS disk and convert the disk to Gen1 OS disk
(hence the requirements of the OS disk in Azure). <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">If you
need/want/have to failback to your on-prem Hyper-V environment, the VM will of
course be converted back to Gen2.<o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<span style="font-family: "Segoe UI",sans-serif;">For more
details – check out the official blog post by one of the PM’s, Anoob Backer <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<br />
<div class="MsoNoSpacing">
<span style="font-family: 'Segoe UI', sans-serif; font-size: 10pt;"><a href="http://azure.microsoft.com/blog/2015/04/28/disaster-recovery-to-azure-enhanced-and-were-listening/">http://azure.microsoft.com/blog/2015/04/28/disaster-recovery-to-azure-enhanced-and-were-listening/</a>
</span><span style="font-family: "Segoe UI",sans-serif;"><o:p></o:p></span></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com1tag:blogger.com,1999:blog-893729307599410422.post-66116145394077077742015-04-30T11:34:00.003+02:002015-04-30T11:34:56.305+02:00VM Checkpoints in Windows Azure Pack<div class="MsoNoSpacing">
Fresh from the factory, Update Rollup 6 has been released
and shipped by Microsoft.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This isn’t a blog post that will point out all the bug
fixes and the amazing work all of the teams has been doing, but rather point
you towards a highly requested feature, that finally made its way to the tenant
portal in Windows Azure Pack.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
With Update Rollup 6, we now supports <b>creation and restore </b>of Hyper-V
checkpoints on virtual machines, provided by the VM Cloud Resource Provider.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Tenants that have deployed virtual machines may now
create checkpoints and restore them on their own, without any interaction from
the cloud provider. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Let us have a closer look at how this actually works, how
to configure it and what additional steps you might want to take as part of
this implementation.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Enabling create,
view and restore of virtual machine checkpoints at the Hosting Plan level<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Once the UR6 is installed for WAP and the underlying
resource provider, you will notice some changes in the admin portal.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
First, navigate to a Hosting Plan of yours – that contains
the VM Cloud Resource Provider.<o:p></o:p></div>
<div class="MsoNoSpacing">
When you scroll down, you can see that we have some
settings related to checkpoints.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR-3rGFSwx37p_y2re-bMfdjMBSUGSQIakEvocGR_UtlEVHpbIbcssOR3Q0KO1qZrWzH2M5ReaPUQzhgXb8VkIksFGQa9GX_-tAVEGfBflpuW69b-0ODRa3hu4XP0owMRXtwOSWHJwBnE/s1600/capture.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR-3rGFSwx37p_y2re-bMfdjMBSUGSQIakEvocGR_UtlEVHpbIbcssOR3Q0KO1qZrWzH2M5ReaPUQzhgXb8VkIksFGQa9GX_-tAVEGfBflpuW69b-0ODRa3hu4XP0owMRXtwOSWHJwBnE/s1600/capture.jpg" height="373" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Create, view and
restore virtual machine checkpoints</b> – will let the tenants that has
subscriptions based on this hosting plan, be able to perform these actions on their
virtual machines.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>View and restore
virtual machine checkpoints</b> – let the tenants view and restore virtual
machine checkpoints, but not create them. This can for example be performed by
the cloud provider on an agreed schedule.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
When you enable either of these options, an update job is
taking place at the plan level and communicates the changes back to VMM,
ensuring that the tenants will have permissions to take these actions in the
tenant portal once it has completed. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmVhmWHuqMCOQUi7rZKuujWMCTWRYVJ-sHxG2kiRIkqKr9K8LPbU5uG4dreG8xmLodk8Salug_mz8QhWICgcbb4B7_xAg-sNVqnZDnWoz-qrHzj2Cl480nSPoB0_dB8v1zaDDzZ7dyLRw/s1600/Capture2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmVhmWHuqMCOQUi7rZKuujWMCTWRYVJ-sHxG2kiRIkqKr9K8LPbU5uG4dreG8xmLodk8Salug_mz8QhWICgcbb4B7_xAg-sNVqnZDnWoz-qrHzj2Cl480nSPoB0_dB8v1zaDDzZ7dyLRw/s1600/Capture2.jpg" height="72" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
If we switch over to the tenant portal, we can see that
when we drill into one of the existing VMs (click on the VM<span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;">à</span>Dashboard) we have some
new actions available.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-yiU3fBOHKMD7YmD671TCevgVZWba1XfN4dTD6fB2a9eMZqbw0rBZWq4fq3TGLdtrBD4xAo-1Q04u4EnCClrnp6utX5G8SG7NXZolBq92QRU_8V7TtB8qqfty8662e36BA-J6WYYNJ6Q/s1600/capture3.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-yiU3fBOHKMD7YmD671TCevgVZWba1XfN4dTD6fB2a9eMZqbw0rBZWq4fq3TGLdtrBD4xAo-1Q04u4EnCClrnp6utX5G8SG7NXZolBq92QRU_8V7TtB8qqfty8662e36BA-J6WYYNJ6Q/s1600/capture3.JPG" height="340" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<i>If you would manage
checkpoints for your VM Roles, you can of course do that too, but you then have
to drill into each specific <u>instance</u>, as the VM role potentially can
have multiple instances when supporting scale-out</i>.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheJz6NeKkGn6M2lnOaZgAxsNO4i72JbglXZI-ktSSCdTaQx_1J_xnNJpnCNWrVdDclv9yYqJui2g3-HOqQZqF7cUj48CWZGy3dPoeucNm6iImh9WqQrvWoFrSv38kW3pxLNP-hos_ItAE/s1600/capture4.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheJz6NeKkGn6M2lnOaZgAxsNO4i72JbglXZI-ktSSCdTaQx_1J_xnNJpnCNWrVdDclv9yYqJui2g3-HOqQZqF7cUj48CWZGy3dPoeucNm6iImh9WqQrvWoFrSv38kW3pxLNP-hos_ItAE/s1600/capture4.JPG" height="291" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
To create a new checkpoint, simply click on Checkpoint and
type the name of the checkpoint and eventually a description.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAF8D9D74UfmuH5NxW02GAYXl_YYenxAEuLuSt4mE0eYgtbwG2uzSfNfxp6zZTZpQ84rSSYjY9AcR8yrnYf81OnIwUp9FWzwb7xBZNDkyJVGAp-I-v1Qkb4-A3tC3a0SK2Jgcf5XwpGUU/s1600/capture5.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAF8D9D74UfmuH5NxW02GAYXl_YYenxAEuLuSt4mE0eYgtbwG2uzSfNfxp6zZTZpQ84rSSYjY9AcR8yrnYf81OnIwUp9FWzwb7xBZNDkyJVGAp-I-v1Qkb4-A3tC3a0SK2Jgcf5XwpGUU/s1600/capture5.JPG" height="376" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
If we switch back to the fabric and VMM, we can see that
a VMM job has completed with details about the checkpoint process for this
specific tenant, with the name and description we typed.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3gsIxo8h0Qt1agArgZNfUSULgjs0pgmwZhPBw2O4CpXSo3-rH76u6fmJC1QXNZj8Z8OGEOZfwOQZGE8pSD1cuU5J-5pe7Rz8gyyE5NJD1ft6ss_5C8EBdgIWCFTpLb9xLAwcqB4uIhfo/s1600/capture6.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3gsIxo8h0Qt1agArgZNfUSULgjs0pgmwZhPBw2O4CpXSo3-rH76u6fmJC1QXNZj8Z8OGEOZfwOQZGE8pSD1cuU5J-5pe7Rz8gyyE5NJD1ft6ss_5C8EBdgIWCFTpLb9xLAwcqB4uIhfo/s1600/capture6.JPG" height="230" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
If we would like to perform the same operation again,
creating an additional checkpoint on the same virtual machine, we get a message
telling us that the existing checkpoint will be deleted.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFPbJd4SMzaafE12SXQKFqzszgvvdmTtO2_hSI47WOli2Hma_0ExjMMURc2LU5JyauLw1x-iG351u6aZlrDctNSLMf4_YGaWwfrMvH8qAm_UI6PRcjgGiu-B-bq3OEyi8p4lfnVAEitCE/s1600/capture7.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFPbJd4SMzaafE12SXQKFqzszgvvdmTtO2_hSI47WOli2Hma_0ExjMMURc2LU5JyauLw1x-iG351u6aZlrDctNSLMf4_YGaWwfrMvH8qAm_UI6PRcjgGiu-B-bq3OEyi8p4lfnVAEitCE/s1600/capture7.JPG" height="400" width="366" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This is because that the current checkpoint integration
in WAP will only keep one checkpoint, and avoid the scenario where you could
potentially have a long chain of differential disks. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
When we create the second checkpoint, we can switch back
to VMM to see what’s actually happening:<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
First, a new checkpoint is created.<o:p></o:p></div>
<div class="MsoNoSpacing">
Second, the previous checkpoint is deleted.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpFZ3LIM7UlNXki_PDGTCk4GmvDDN8qTd18lmlLZIqaOgbnzBBFS4gOsESYf9beJuSj-2Gvg1bFKLvrQBZVwifWu_jSLthk44VtXMMQtCJ9RrPKfn2lK8pzl-YCf1aUDEm6VaQrfZdti4/s1600/capture8.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpFZ3LIM7UlNXki_PDGTCk4GmvDDN8qTd18lmlLZIqaOgbnzBBFS4gOsESYf9beJuSj-2Gvg1bFKLvrQBZVwifWu_jSLthk44VtXMMQtCJ9RrPKfn2lK8pzl-YCf1aUDEm6VaQrfZdti4/s1600/capture8.JPG" height="15" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
When we explore the checkpoints settings on the VM itself
afterwards, we see that we only have the latest checkpoint listed.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirQagVLeKqQMNymiS0ptK2XpiQMKfTfdnfExW_TJxnvrXR4L6mgnxrAvhztVSabrDg0kJNu13MpYgENcZP6WcGRgCEpVIU92vriDJnjwb85T2P37HCNVSaY4l03OTvpBVoZHV98UTo2Jo/s1600/capture9.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirQagVLeKqQMNymiS0ptK2XpiQMKfTfdnfExW_TJxnvrXR4L6mgnxrAvhztVSabrDg0kJNu13MpYgENcZP6WcGRgCEpVIU92vriDJnjwb85T2P37HCNVSaY4l03OTvpBVoZHV98UTo2Jo/s1600/capture9.JPG" height="136" width="320" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Regarding the <b>restore
process</b>, we can also perform this from the same view in the tenant portal.<o:p></o:p></div>
<div class="MsoNoSpacing">
Once you click on the restore button, the tenant portal
will show you the metadata of the available checkpoint, such as name,
description and when it was created. Once you click the confirm button, the
restore process will start in VMM.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaBPeyD4cwv9VYh7y57_dT4-GxJ-NbGhPnXdJNXLF4qZvtNUshInlhVOU-IEC7KMOPThHN2RN_9v7k6WJ7ah1hu-MYv4FQY8NGQfjddtexiF6O2ZLMnhSkr1E3Y1q_QUPtliD65tY_WUA/s1600/capture10.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhaBPeyD4cwv9VYh7y57_dT4-GxJ-NbGhPnXdJNXLF4qZvtNUshInlhVOU-IEC7KMOPThHN2RN_9v7k6WJ7ah1hu-MYv4FQY8NGQfjddtexiF6O2ZLMnhSkr1E3Y1q_QUPtliD65tY_WUA/s1600/capture10.JPG" height="347" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgV6v3tsh25CQu1qNBjHh_oSDMI209nFjTLRl8pAjS4Wn3mTjVIDDVqetzqHb1PY92N2TkiGvCUqAVfTCXpDyTHKszhhCy1H6DOVhrRBndC5Z7wvb6etyg-zuZNhppiXW67qnXJBxY-akI/s1600/capture11.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgV6v3tsh25CQu1qNBjHh_oSDMI209nFjTLRl8pAjS4Wn3mTjVIDDVqetzqHb1PY92N2TkiGvCUqAVfTCXpDyTHKszhhCy1H6DOVhrRBndC5Z7wvb6etyg-zuZNhppiXW67qnXJBxY-akI/s1600/capture11.JPG" height="72" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<b>Now what?<o:p></o:p></b></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
If you are familiar with how checkpoints in Hyper-V
works, then you know that each static disk will be either .vhd or .vhdx –
depending on the format you are using (.vhdx was introduced with Windows Server
2012 and should be the preferred format, but Azure is still using .vhd).<o:p></o:p></div>
<div class="MsoNoSpacing">
Once you create a checkpoint, a new disk (.avhd or
.avhdx) will be created– a differential disk, containing all the new write
operations, while read operations will occur on both the parent disk (vhdx) and
the newly created differential disk. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmUxqhXH3UwdHWLk9X-8jpr2FWQZumdnSzhNFhUA_4enaIXJd7YyUhROxLIL-mkiM7a4LM4hSgB8bNozIg6BzHoMpcOPr2iEl4ocPVbcwgul6vO2PrUVuS7aQkYJyLjnDaiMnFuJqwtJE/s1600/capture12.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmUxqhXH3UwdHWLk9X-8jpr2FWQZumdnSzhNFhUA_4enaIXJd7YyUhROxLIL-mkiM7a4LM4hSgB8bNozIg6BzHoMpcOPr2iEl4ocPVbcwgul6vO2PrUVuS7aQkYJyLjnDaiMnFuJqwtJE/s1600/capture12.JPG" height="193" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
To summarize, this might not be an ideal situation when
it comes to performance, life-cycle management and storage optimization. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Since we don’t have any action in the tenant portal to
perform a delete operation, this can be scary in some scenarios. <o:p></o:p></div>
<div class="MsoNoSpacing">
The fact that the VM will always run on a checkpoint once
a checkpoint is created, means you will always be able to restore to your
latest checkpoint from the portal. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In order to solve this challenge, we can leverage the
integration of Service Management Automation in Azure Pack.<o:p></o:p></div>
<div class="MsoNoSpacing">
One of the best things with Azure Pack and the VM Cloud
resource provider, is that we can extend it and create valued added solutions
and services by linking certain actions happening in the tenant portal, to
automated tasks that are executed by a SMA runbook in the backend.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The following screenshot shows that there’s an event
related to creation of VMM Checkpoints performed by the tenant, which can
easily be linked to a runbook.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtGKwSWlHk4EmdLuzbPmV-w3ZeH3nF8o4p1PcHJrZYJHdLvsNkbccAe0TovOPvTGqHtmgaBTo7f3i0KGZV-dd5PzhaHt0LvGNGx2HkqkvkpazZ6i6M9E3E51DvIqs4SPfkdDWQcsskVkw/s1600/capture13.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtGKwSWlHk4EmdLuzbPmV-w3ZeH3nF8o4p1PcHJrZYJHdLvsNkbccAe0TovOPvTGqHtmgaBTo7f3i0KGZV-dd5PzhaHt0LvGNGx2HkqkvkpazZ6i6M9E3E51DvIqs4SPfkdDWQcsskVkw/s1600/capture13.JPG" height="308" width="400" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Here’s an example of a runbook that will check for
checkpoints created on VMs belonging to a specific VMM Cloud that is used in a
Hosting Plan in WAP. If there’s any checkpoints that exists, they will be
deleted and the VMs will have their disks merged back to a static disk
(.vhd/.vhdx).<o:p></o:p></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><# <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">.SYNOPSIS <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Wokflow to check for - and eventually delete old VM
checkpoints<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> #></span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkblue;">workflow</span> <span style="color: blueviolet;">delete-scvmcheckpoint</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">{ <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgreen;"># Connection
to access VMM server. </span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: orangered;">$VmmConnection</span>
<span style="color: darkgrey;">=</span> <span style="color: blue;">Get-AutomationConnection</span>
<span style="color: navy;">-Name</span> <span style="color: darkred;">'SCVMM'</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: orangered;">$VmmServerName</span>
<span style="color: darkgrey;">=</span> <span style="color: orangered;">$VmmConnection</span><span style="color: darkgrey;">.</span>ComputerName
<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blue;">inlinescript</span>
<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">{ <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgreen;"># Import VMM
module. </span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Import-Module</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blueviolet;">virtualmachinemanager</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkgreen; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"># Connect to VMM server.
</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Get-SCVMMServer</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-ComputerName</span> <span style="color: orangered;">$Using:VmmServerName</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: orangered; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">$vms</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkgrey;">=</span> <span style="color: blue;">Get-SCVirtualMachine</span> <span style="color: darkgrey;">|</span>
<span style="color: blue;">Where-Object</span> {<span style="color: orangered;">$_</span><span style="color: darkgrey;">.</span>Cloud <span style="color: darkgrey;">-like</span> <span style="color: darkred;">"*Copenhagen IaaS*"</span> <span style="color: darkgrey;">-and</span> <span style="color: orangered;">$_</span><span style="color: darkgrey;">.</span>VMCheckpoints
}<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkblue;">foreach</span>
(<span style="color: orangered;">$vm</span> <span style="color: darkblue;">in</span>
<span style="color: orangered;">$vms</span>) <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Get-SCVMCheckpoint</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-VM</span> <span style="color: orangered;">$vm</span> <span style="color: darkgrey;">|</span> <span style="color: blue;">Remove-SCVMCheckpoint</span>
<span style="color: navy;">-RunAsynchronously</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> } <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">}<span style="color: navy;">-PSComputerName</span> <span style="color: orangered;">$VmmServerName</span>
<span style="color: navy;">-PSCredential</span> <span style="color: orangered;">$VmmCredential</span> <o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">} <o:p></o:p></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
This simple code can so be added to a schedule that will
execute this runbook on a daily basis – as an example, ensuring that no VMs in
the cloud will run on a checkpoint on a long term.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Thanks for reading!<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<br />
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com0tag:blogger.com,1999:blog-893729307599410422.post-54396405535057704602015-04-15T12:35:00.002+02:002015-04-15T12:52:14.967+02:00Why I am investing in DSC<div class="MsoNoSpacing">
In order to get a good grasp on something new, like a
technology, it is always important to find a use case.</div>
<div class="MsoNoSpacing">
<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Once you have a use case, I can ensure you that the
learning process is much more interesting, fun – and perhaps easier too.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
That is what I did when I went deep into Desired State
Configuration. I found a use case.<o:p></o:p></div>
<div class="MsoNoSpacing">
My use case was to leverage DSC as part of VM Roles in
Azure Pack in a way that would be valid for the future too.<br />
<br /></div>
<h2>
<strong><span style="font-family: "Calibri Light",sans-serif; mso-ascii-theme-font: major-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: major-bidi; mso-hansi-theme-font: major-latin;">Here comes some reasons for my decision.</span></strong> </h2>
<div>
<br /></div>
<div class="MsoNoSpacing">
Powershell has been around for some time now, and one of
the best benefits by learning and using the shell is the amount of work you are
able to do, combining modules, components, technologies and much more through
the same API. Considering that everything that MS builds and do – regardless of
cloud, will be accessible and manageable through Powershell in addition to
other options, ensures that this is a real no-brainer. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
With Windows Management Framework 4.0, we also got
Powershell Desired State Configuration added to our table. <o:p></o:p></div>
<div class="MsoNoSpacing">
Powershell Desired State Configuration is Microsoft’s way
to implement an idempotent configuration that ensures that the “desired state”
will be reached by applying the entire configuration, regardless of the current
state.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->-<span style="font-size: 7pt; font-stretch: normal;">
</span><!--[endif]-->But, what does this really mean? Aren’t we able
to do <u>everything</u> using native Powershell scripts already?<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
That is correct. There’s no “limits” by using Powershell
natively today.<o:p></o:p></div>
<div class="MsoNoSpacing">
However, with native Powershell scripts you are
responsible for building all the error handling and logic into your scripts. And
as you probably know, that can be both very time consuming and challenging. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Desired State Configuration handles this automatically
for you, letting you make and deploy any incremental changes to your configuration
over time without risking the system to be put in a bad state. <o:p></o:p></div>
<div class="MsoNoSpacing">
If you have any configuration drift? Depending on how the
<i>Local Configuration Manager</i> is
configured – the engine that’s responsible for applying the configuration and
follow the instructions, the system can heal itself by enforcing the desired
state. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Think of Powershell Desired State Configuration as a
contract between you and your nodes (manageable objects).<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In order to create and deliver this “contract”, Desired
State Configuration is based on CIM – and use WinRM for communicating. CIM uses
a language called Manaed Object Format – often referred to as “MOF”. Powershell
Desired State Configuration is a way to create and distribute MOF files that
can be applied to systems supporting this standard. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The way it’s applied to the node(s) is either through “Push”
or “Pull”. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<i>(The difference
between Push and Pull is out of scope right now and deserves a dedicated blog
post later on. I promise).<o:p></o:p></i></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
To put it short, the Pull mechanism requires some
infrastructure in order to work, where the node(s) are talking to the Pull
server – either through SMB, Http or Https. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The Push method is pretty straight forward and what you
can start using right out of the box. DSC requires that WinRM listeners are
configured so that the CIM can push the configuration to the remote systems. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<h2>
Here’s an example of how a Powershell DSC Configuration looks like:<o:p></o:p></h2>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: darkblue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">configuration</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: blueviolet;">DNS</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">{<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkblue;">node</span> <span style="color: blueviolet;">kndsc006</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: darkblue;">WindowsFeature</span>
<span style="color: blueviolet;">DNS</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> Name <span style="color: darkgrey;">=</span>
<span style="color: darkred;">"DNS"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> Ensure <span style="color: darkgrey;">=</span>
<span style="color: darkred;">"Present"</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> IncludeAllSubFeature <span style="color: darkgrey;">=</span> <span style="color: orangered;">$true</span><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">}<o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">DNS</span></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="background: white; margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";">Start-DscConfiguration</span><span style="font-family: "Lucida Console"; font-size: 9.0pt; mso-bidi-font-family: "Lucida Console";"> <span style="color: navy;">-wait</span> <span style="color: navy;">-force</span> <span style="color: navy;">-Verbose</span> <span style="color: blueviolet;">.\DNS <o:p></o:p></span></span></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
As you can see, the format here is quite easy to read.</div>
<div class="MsoNoSpacing">
We can easily see that we will install (Ensure = "Present") DNS (Name = "DNS") on the target node (kndsc006). </div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Actually,
it is so easy to read that Powershell newbies like me are able to manage <span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;">J</span><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Hopefully this gave you some more context about the “why”,
but we are not done yet.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
In Azure today, we are able to leverage DSC as part of
the VM extension, meaning we can create – upload – and apply our DSC
configuration to Azure IaaS virtual machines. The method of applying the config
for these VMs are “Push”. <o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
As you probably know, we don’t have the exact same
capabilities on-prem in order to leverage DSC as part of Azure Pack. However,
we are able to simulate the same experience at some extent, by using the
combination of DSC, SMA and VM Roles (<a href="http://kristiannese.blogspot.no/2015/03/application-modeling-with-vm-roles-dsc.html">http://kristiannese.blogspot.no/2015/03/application-modeling-with-vm-roles-dsc.html</a>
)<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Moving forward, we know that the consistency across clouds
will be as near as 1:1 with the introduction of Azure Resource Manager that
will introduce us for a complete new way to interact with our cloud services –
regardless of location. Also worth to note, the Azure Resource Manager itself
will be idempotent.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
What about your existing DSC scripts?<o:p></o:p></div>
<div class="MsoNoSpacing">
Exactly, that is the main point here. These
configurations will be valid using Azure Resource Manager too <span style="font-family: Wingdings; mso-ascii-font-family: Calibri; mso-ascii-theme-font: minor-latin; mso-char-type: symbol; mso-hansi-font-family: Calibri; mso-hansi-theme-font: minor-latin; mso-symbol-font-family: Wingdings;">J</span><o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
So in essence, you invest in DSC now and use it both for
Azure Pack (VM Roles + SMA) and Azure (VM Extension), and later on you can
reuse the investment you’ve made into the era of Azure Resource Manager.<o:p></o:p></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Hopefully this gave you some inspiration to start
learning Desired State Configuration, available in Windows Management Framework
4.0 – but also available in 5.0 (which is in Preview). <o:p></o:p></div>
<div class="MsoNoSpacing">
Please note that everything you do in Azure when using
the DSC VM Extension there is based on the 5.0 version. <o:p></o:p></div>
<div class="MsoNoSpacing">
</div>
<div class="MsoNoSpacing">
<br /></div>
Kristian Nesehttp://www.blogger.com/profile/11112639253922959602noreply@blogger.com0