<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Piyush Ranjan's blog on Core Azure and Big Data</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/piyushranjan/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/piyushranjan/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 04:08:13 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Custom Probe for IaaS Load Balanced sets in Windows Azure and ACL – Part 2</title>
      <link>https://docs.microsoft.com/archive/blogs/piyushranjan/custom-probe-for-iaas-load-balanced-sets-in-windows-azure-and-acl-part-2</link>
      <pubDate>Thu, 09 Jan 2014 19:42:00 GMT</pubDate>
      <dc:creator><![CDATA[Piyush Ranjan (MSFT)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/piyushranjan/2014/01/09/custom-probe-for-iaas-load-balanced-sets-in-windows-azure-and-acl-part-2/</guid>
      <description><![CDATA[In a previous post (Part 1), assorted facts about LB sets with Custom probes and ACLs were...]]></description>
      <content:encoded><![CDATA[<p>In a previous post (<a href="https://blogs.msdn.com/b/piyushranjan/archive/2014/01/09/custom-probe-for-iaas-load-balanced-sets-in-windows-azure-and-acl-part-1.aspx">Part 1</a>), assorted facts about LB sets with Custom probes and ACLs were discussed. This second part takes a specific example scenario to provide a walkthrough.</p>
<h1>Scenario</h1>
<p>Two IaaS VMs will be configured as web servers and put in a Load Balanced set. Custom HTTP probe will be configured on a non-standard port. A custom ASP.Net MVC application will be deployed on each VM that will listen on the probe-port and simulate the process of monitoring the health of the VM. It will respond either with HTTP status 200 indicating good health, or with HTTP status 404, in case of errors etc. Finally, ACL will be specified on the public load-balanced endpoint to accept traffic only from designated remote address space.</p>
<h1>Walkthrough</h1>
<p>For the example scenario, the following steps were carried out.</p>
<h2>Provision VMs in Cloud Service</h2>
<p>Two IaaS VM&rsquo;s named as <strong>vmlbcustprobe1</strong> and <strong>vmlbcustprobe2</strong> were provisioned in a Cloud Service named as <strong>cslbcustprobe.cloudapp.net</strong>. These used the Azure gallery images for Windows Server 2012 R2 Operating System.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/2626.vms-n-cloudservicePNG.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/2626.vms_2D00_n_2D00_cloudservicePNG.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/2626.vms-n-cloudservicePNG.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/2626.vms_2D00_n_2D00_cloudservicePNG.PNG" alt="" border="0" /></a></p>
<pre><span style="font-size: small;"><em>Figure 1: IaaS VM&rsquo;s provisioned in a Cloud Service</em></span></pre>
<h2><br />Create LB set with Custom probes</h2>
<p><br />From the Azure portal UI, navigate to the page for Endpoints on the first VM (vmlbcustprobe1), and add a &ldquo;Stand-alone endpoint&rdquo; for HTTP on port 80. Also, select the option for Custom probes and supply the parameters as:</p>
<ul>
<li>Probe protocol: HTTP</li>
<li>Probe path: &ldquo;/&rdquo;</li>
<li>Probe port: &ldquo;1001&rdquo;. The portal UI will give a warning about port mismatch which can be ignored.</li>
<li>Probe interval: 15 and Number of probes: 2</li>
</ul>
<p>To complete the LB set configuration, navigate to the Endpoints screen on the second VM (vmlbcustprobe2) and select the option for &ldquo;Add an endpoint to an Existing Load balanced set&rdquo;. Once configured, the endpoint configuration screens should look as in Figure 2.</p>
<p>&nbsp;</p>
<pre><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/3823.endpoint-1-2.3-cmb.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/3823.endpoint_2D00_1_2D00_2.3_2D00_cmb.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/3823.endpoint-1-2.3-cmb.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/3823.endpoint_2D00_1_2D00_2.3_2D00_cmb.PNG" alt="" border="0" /></a></pre>
<pre><span style="font-size: small;"><em>Figure 2: LB set with custom probes defined</em></span></pre>
<h2><br />Prepare individual VM&rsquo;s for probe</h2>
<p><br />The VM&rsquo;s in this example will be used as members of a web farm. Also, the custom probe for the LB set is using HTTP. Both of these will use IIS. Connect to each VM using RDP and from Server Manager --&gt; Role and Features, install IIS. Make sure the &ldquo;Application Development&rdquo; features are selected. See Figure 3.</p>
<pre><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/2742.install-iis.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/2742.install_2D00_iis.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/2742.install-iis.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/2742.install_2D00_iis.png" alt="" border="0" /></a></pre>
<pre><span style="font-size: small;"><em>Figure 3: Install IIS from Role and Features on each VM</em></span></pre>
<p>&nbsp;</p>
<p>Create a file with name &ldquo;Default.htm&rdquo; and drop it into the &ldquo;c:\inetpub\wwwroot&rdquo; folder of each VM. The contents of the Default.htm file will simply display the name of the VM that is being accessed; see Figure 4.</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/3113.Default-htm.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/3113.Default_2D00_htm.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/3113.Default-htm.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/3113.Default_2D00_htm.PNG" alt="" border="0" /></a></p>
<p><span style="font-size: small;"><em>Figure 4: Default.htm on each VM displays the local hostname</em></span></p>
<p>&nbsp;</p>
<p>In a real deployment, there will be full blown web application deployed on the Default web site (HTTP port 80)..</p>
<h2>Create a custom application for Custom Probe</h2>
<p>For the present example, the Probe protocol is HTTP and the Probe-port is 1001 &ndash; note that this is different from the port 80. The web site for the actual application will be deployed on the port 80, whereas port 1001 will be used for custom probing of VM for health check. I prefer to keep the two functionalities separate.</p>
<p>For the custom HTTP probing, an ASP.Net MVC application is used in the present example, as that is convenient, but strictly speaking one could have any custom process listening for HTTP requests on port 1001. Using Visual Studio in your development environment, create a new ASP.Net MVC project and select all default options.</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/6574.aspnet-1-2-comb.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/6574.aspnet_2D00_1_2D00_2_2D00_comb.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/6574.aspnet-1-2-comb.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/6574.aspnet_2D00_1_2D00_2_2D00_comb.PNG" alt="" border="0" /></a></p>
<p><span style="font-size: small;"><em>Figure 5: Create a custom application for custom probing</em></span></p>
<p>&nbsp;</p>
<p>Edit the code for HomeController to simulate some custom error checking. In the present case, one VM raises a 404 exception if the minutes in the current timestamp are even and the other VM raises exception if the minutes are odd; see Figure 6.</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/1805.controller-code.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/1805.controller_2D00_code.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/1805.controller-code.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/1805.controller_2D00_code.PNG" alt="" border="0" /></a></p>
<p><span style="font-size: small;"><em>Figure 6: HomeController code modified to simulate custom health check</em></span></p>
<p>&nbsp;</p>
<p>The code has been modified to force only one VM to return HTTP status 200 at a time, so that one can see the web farm responding from different VM&rsquo;s at different times. The custom application, when tested in the development environment should show the default Welcome page when indicating a healthy VM, and should show 404 error message when simulating some issue; see Figure 7.</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/7384.custom-app-display.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/7384.custom_2D00_app_2D00_display.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/7384.custom-app-display.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/7384.custom_2D00_app_2D00_display.PNG" alt="" border="0" /></a></p>
<p><span style="font-size: small;"><em>Figure 7: Custom health check application in normal and error states</em></span></p>
<h2>Deploy custom probe application to VM<span style="font-size: 12px;">&nbsp;</span></h2>
<p>The custom application for the present example is ready to be deployed to the VM&rsquo;s in the web farm. The next set of steps outlines the process.</p>
<h4>Copy the custom health check application<br /><br /></h4>
<p>Copy the application binaries and other relevant files to some convenient folder on each VM; for the present example, the files were copied to &ldquo;C:\web\MvcProbeApp&rdquo;.<br /><br /></p>
<h4>Create New web site for Custom probe</h4>
<p>Using Remote Desktop connect to each IaaS VM in the web farm, and launch IIS Manager. Right-click the Sites node and select &ldquo;Add Website&rdquo; to create a new web site; see Figure 8.</p>
<pre>&nbsp;</pre>
<pre><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/3515.iis-new-site.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/3515.iis_2D00_new_2D00_site.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/3515.iis-new-site.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/3515.iis_2D00_new_2D00_site.png" alt="" border="0" /></a></pre>
<pre><span style="font-size: small;"><em>Figure 8: Create a new Web Site for the custom probe application</em></span></pre>
<pre>&nbsp;</pre>
<p>The new site creation form will gather the configuration information as in Figure 9. Notice that port 1001 is specified to distinguish this site from the main web site which would be on port 80. The Physical path points to the location where the custom application binaries were copied.</p>
<pre>&nbsp;</pre>
<pre><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/7142.iis-newsite-form.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/7142.iis_2D00_newsite_2D00_form.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/7142.iis-newsite-form.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/7142.iis_2D00_newsite_2D00_form.png" alt="" border="0" /></a></pre>
<pre><span style="font-size: small;"><em>Figure 9: Configuration information for Custom probe Web site</em></span></pre>
<pre>&nbsp;</pre>
<p>The site by itself can be tested from within the VM itself by browsing the Url <a href="https://localhost:1001/">https://localhost:1001/</a>.</p>
<pre>&nbsp;</pre>
<h4>Open Probe-port in Firewall</h4>
<p>The port 1001 chosen as the Probe-port for the present example needs to be opened in the firewall on each VM. This port is not part of the load balanced endpoint; rather it is used by the host agent internally on the private IP address. Opening this port does not pose any risks as it is not exposed through the Cloud Service public IP address.</p>
<p>The web farm should now be fully operational and accessible through Url <a href="https://cslbcustprobe.cloudapp.net/">https://cslbcustprobe.cloudapp.net</a> . The way the custom probe has been defined, only one VM at a time will return a healthy status (200). Thus, the web site page should cycle between VM1 and VM2 on repeated hits.</p>
<h1>Protect LB set Endpoint with ACL</h1>
<p>The public endpoint exposed through the LB set can be restricted for access from a few designated address spaces, if necessary. It will depend upon whether the hosted web site is intended to be accessed by everyone on the internet, or only from a restricted pool of remote IP addresses. For the purpose of illustration, 175.1.0.3 was designated as the only remote IP address authorized to access the web site. ACL can be applied using Powershell (see the blog sites mentioned before) or using UI from the Azure portal. To use the Azure portal, navigate to any one of the VM instances in the LB set; for example vmlbcustprobe1 in the present example. Go to the page for Endpoints and after selecting the load balanced endpoint, click on &ldquo;Manage ACL&rdquo; at the bottom of the page. This will bring up the UI for specifying ACL as shown in Figure 10.</p>
<p>&nbsp;</p>
<pre><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/7652.acl-on-endpoint.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/7652.acl_2D00_on_2D00_endpoint.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/7652.acl-on-endpoint.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/7652.acl_2D00_on_2D00_endpoint.PNG" alt="" border="0" /></a></pre>
<pre><span style="font-size: small;"><em>Figure 10: Specify ACL on LB set endpoint</em></span></pre>
<pre>&nbsp;</pre>
<p>Note that since this is an endpoint on a LB set, the ACL needs to be specified precisely once, on any one of the VM&rsquo;s in the set. The endpoint on other VM&rsquo;s will automatically reflect the ACL.</p>]]></content:encoded>
    </item>
    <item>
      <title>Custom Probe for IaaS Load Balanced sets in Windows Azure and ACL – Part 1</title>
      <link>https://docs.microsoft.com/archive/blogs/piyushranjan/custom-probe-for-iaas-load-balanced-sets-in-windows-azure-and-acl-part-1</link>
      <pubDate>Thu, 09 Jan 2014 18:43:00 GMT</pubDate>
      <dc:creator><![CDATA[Piyush Ranjan (MSFT)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/piyushranjan/2014/01/09/custom-probe-for-iaas-load-balanced-sets-in-windows-azure-and-acl-part-1/</guid>
      <description><![CDATA[In Windows Azure, if a group of IaaS VM&rsquo;s need load balancing, for example when hosting a Web...]]></description>
      <content:encoded><![CDATA[<p>In Windows Azure, if a group of IaaS VM&rsquo;s need load balancing, for example when hosting a Web Farm, this can be done by putting them in a Load Balanced set. Further, the health of individual VM&rsquo;s in the load balanced set can be monitored using a Custom probe to decide if any of these need to be removed or added back to the farm. The interesting thing about the custom probes is that they enable the ability to monitor something meaningful and very application specific rather than simply accepting a VM to be healthy if it is alive. A VM could very well be alive and yet not be doing what the application needs it to. Finally, the public endpoint exposed by the Load Balanced set (LB set) may be protected by ACL&rsquo;s (Access Control List) to allow traffic only from designated IP Address ranges, if so desired.</p>
<p>Both features &ndash; the Custom probes and the ACL&rsquo;s &ndash; have been around for some time and are well documented officially as well as in blogs. My personal favorites are the blogs by Michael Washam at <a href="https://michaelwasham.com/tag/windows-azure-load/">Creating Highly Available Workloads with Windows Azure</a> and <a href="https://michaelwasham.com/windows-azure-powershell-reference-guide/network-access-control-list-capability-in-windows-azure-powershell/">Network Access Control List Capability in Windows Azure Powershell</a>. Despite this, I have found myself answering questions on the mechanics of using these features. The purpose of the present note is to have a fresh take at Custom probes and ACL&rsquo;s using a walkthrough of a scenario, and revisit some of the questions that I have come across.</p>
<h1>Assorted facts</h1>
<p>Before showing a walkthrough, an assortment of questions that usually come up in discussions, are addressed in this section.</p>
<h2>LB sets and Custom probes</h2>
<ul>
<li>What&nbsp;exactly is the purpose of the Custom probes in LB sets? IaaS VM&rsquo;s in a Cloud Service can in fact be added to a Load Balanced set with or without a custom probe. The Load Balanced endpoint however needs to know which VM&rsquo;s within the set are active. This information is provided by an agent that runs on the host node which monitors the VM&rsquo;s located there; see Figure 1. If there is no custom probe, the best that the agent can do is check if the VM&rsquo;s are alive. With custom probes, the application developer gets a chance to implement some custom logic within the VM&rsquo;s to respond to health check.</li>
</ul>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/3286.lbset-agent-probe.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/3286.lbset_2D00_agent_2D00_probe.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/3286.lbset-agent-probe.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/3286.lbset_2D00_agent_2D00_probe.PNG" alt="" border="0" /></a></p>
<p><em>Figure 1:&nbsp;VM&rsquo;s in an LB set with Custom probes for health check</em></p>
<ul>
<li>Custom probes are completely independent of the type of O/S (Windows or Linux) running within the VM.</li>
<li>There are two types of probe protocols: TCP, and HTTP, though the HTTP is the more popular.</li>
<li>The port designated for probe can be any port. It does not have to be port 80 for HTTP Probe-protocol. In fact, I prefer a port other than port 80 to keep things separate &ndash; the main website on port 80 and the custom probe on some other port. However, the Azure portal displays a &ldquo;Port mismatch&rdquo; warning if, while configuring the LB set, the probe port is chosen to be different from the port on the endpoint. The warning can be ignored.</li>
<li>The custom logic can be implemented in any process listening on the designated Probe-port. It does not have to be IIS, although IIS is very convenient.</li>
<li>Load Balanced sets with custom probes can be created in Azure portal through UI or alternatively using Powershell: <a href="https://msdn.microsoft.com/en-us/library/dn408486.aspx">Set-AzureLoadBalancedEndpoint</a>. Also, see the blog post referenced above.</li>
<li>The Load Balanced set discussed here is for VM&rsquo;s in a single Cloud Service in a single datacenter. If HA/DR capability across datacenter is needed, consider <a href="https://msdn.microsoft.com/en-us/library/windowsazure/hh744833.aspx">Windows Azure Traffic Manager</a>.</li>
</ul>
<h2>ACLs for Endpoints</h2>
<div>
<ul>
<li>ACLs work only for Public endpoints, not for private IP addresses in Azure.</li>
<li>The endpoint could be for a stand-alone Cloud Service or for one located in a VNet (Virtual Network).</li>
<li>For now, ACL work only for IaaS VM&rsquo;s but in future PaaS endpoints will be supported also.</li>
<li>ACLs can be applied to a regular public endpoint, or to a load-balanced endpoint (LB set). The blog post referenced above discusses the syntax for both cases, if using Powershell.</li>
<li>ACLs can also be applied through the Azure portal UI.</li>
<li>The Remote-subnet specified in the definition of ACL must also be a publicly visible address space. It cannot be a private IP Address range.</li>
<li>The Remote-subnet is only a notation meant to allow the specification of a range of addresses. But one can always specify a single remote IP Addresses also, using the /32 in CIDR notation; for example: 175.1.0.1/32 means just the IP address 175.1.0.1.</li>
<li>ACLs are independent of the guest O/S in the VM&rsquo;s (Windows or Linux).</li>
<li>When using Powershell, one can create a template &ndash; the AclConfig &ndash; using New-AzureAclConfig and Set-AzureAclConfig. This is a very useful feature as the template can then be reused many times. The AclConfig can also be retrieved from an existing endpoint on a VM using the Get-AzureAclConfig and then reused.</li>
<li>Multiple Rules can be added to the same ACL (i.e. AclConfig). The Rules within a single ACL (AclConfig) constitute an ordered list, where higher-order (or lower in the portal based list) take precedence.</li>
</ul>
<pre>&nbsp;</pre>
</div>]]></content:encoded>
    </item>
    <item>
      <title>Point-to-Site VPN in Azure Virtual Networks</title>
      <link>https://docs.microsoft.com/archive/blogs/piyushranjan/point-to-site-vpn-in-azure-virtual-networks</link>
      <pubDate>Sat, 01 Jun 2013 22:11:00 GMT</pubDate>
      <dc:creator><![CDATA[Piyush Ranjan (MSFT)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/piyushranjan/2013/06/01/point-to-site-vpn-in-azure-virtual-networks/</guid>
      <description><![CDATA[The capability to VPN from individual machines (Point-to-Site VPN) into Windows Azure Virtual...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">The capability to VPN from individual machines (Point-to-Site VPN) into Windows Azure Virtual Networks is in preview mode at the moment, but is already generating a lot of excitement. It replaces the older Azure Connect technology which also provided Point-to-Site connectivity, but which used a relay based mechanism that was slow, and which forced you to install an agent on your laptop/workstation. It is also of great interest because the Point-to-Site technology utilizes SSTP (secure socket tunneling protocol) and thus is able to work through firewalls and NAT devices.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">The steps for configuring a Point-to-Site VPN are already well documented <a href="https://msdn.microsoft.com/en-us/library/windowsazure/dn133792.aspx"><span style="color: #0563c1;">here</span></a>. The official documentation should be read carefully as that is the definitive source of information. However, as well documented as it is, I like to see a walkthrough of the configuration steps with screenshots and actual addresses/values etc. as that is a very useful when one is playing with a new feature for the first time. I did not see anything relevant so decided to take screenshots of my own set up. Hopefully, folks will find it useful to see a full walkthrough.</span></p>
<h1><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Planning</span></h1>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">There are three areas of planning needed before starting to configure the VNet, viz.</span></p>
<ul>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Address space for the VNet and the subnets</span></li>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">One or more DNS servers</span></li>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Address space on the client side</span></li>
</ul>
<h2><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Address space for VNet</span></h2>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">I chose 10.1.0.0/16 as the overall address space for the VNet from which to carve out the subnets. A small subnet dedicated to DNS was carved as 10.1.1.0/29 which provides three usable addresses 10.1.1.4 through 10.1.1.6 &ndash; to be discussed a bit more, below. Two subnets, 10.1.2.0/24 and 10.1.3.0/24 were carved out for locating my application related VM&rsquo;s. Finally, a subnet for the VPN Gateway was again carved out as 10.1.4.0/29. These are shown in the screenshot, below. Note that the subnet for Gateway gets added automatically by the Portal UI when you click on the link labeled as &ldquo;add gateway subnet&rdquo;.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/3817.vnet-2.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/3817.vnet_2D00_2.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/3817.vnet-2.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/3817.vnet_2D00_2.PNG" alt="" border="0" /></a></span></p>
<h2><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">DNS Servers for VNet</span></h2>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">I intend to deploy several Cloud Services in the VNet, and therefore need to deploy my own DNS server for name resolution across the Cloud Service boundary. There is an interesting conundrum though &ndash; I have not even created the VM that will eventually be configured as a DNS server; and yet, the Portal UI forces me to specify the DNS Server&rsquo;s IP address right away while configuring the VNet itself. Actually, to be accurate, a recent change in the behavior of VNet now does permit specifying the DNS server later on when the VNet is already fully configured and is in use. But this new feature is still not available through the Azure Portal UI; you have to add the DNS server information using Powershell. Thus, for now, I continue to use a trick that is described, next.<br /></span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Specify a subnet for DNS as 10.1.1.0/29 as shown in the screenshot, above. In theory, this subnet will have 32 &ndash; 29 = 3 bits to use toward the available addresses, which amounts to 2^3 = 8 possibilities. But, 000 and 111 are always reserved (for whole subnet and broadcast), and it is my understanding that Azure further reserves 001, 010, and 011. Thus, the addresses that are really available are those corresponding to 100, 101 and 110 (i.e. 10.1.1.4, 10.1.1.5, and 10.1.1.6). Eventually, when I do create a VM and add it to this subnet, it&nbsp;would be&nbsp;quite safe to assume that this VM will get assigned the IP address 10.1.1.4. Thus, having created a subnet for DNS like this, I can specify my DNS server during the VNet configuration even though the DNS server machine does not even exist, yet.</span></p>
<p>&nbsp;</p>
<h2><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Address space on the Client side</span></h2>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">In order to set up the VPN to this VNet, you have to specify the range of IP addresses that your client machines will be located in; i.e. the address space of your laptop, workstations etc. This address space must be a private address space and must not overlap with the address space of the VNet (in the present walkthrough the 10.1.0.0/16). At home, I have a router-plus-NAT combo device which also dispenses DHCP addresses in the range 192.168.1.0/24. Thus, this is the address space I picked for VPN clients.</span></p>
<h1><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Configure Virtual Network</span></h1>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">At this point we have all the information needed to configure the VNet. In the portal UI, navigate to the section where new Network items can be created and choose &ldquo;Custom Create.&rdquo;</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/8765.vnet-10.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/8765.vnet_2D00_10.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/8765.vnet-10.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/8765.vnet_2D00_10.PNG" alt="" border="0" /></a></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Specify the name of the VNet and the name of an Affinity group.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/4024.vnet-11.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/4024.vnet_2D00_11.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/4024.vnet-11.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/4024.vnet_2D00_11.PNG" alt="" border="0" /></a></span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">On the DNS Server and VPN Connectivity page, specify the DNS IP address as 10.1.1.4 (as discussed, above) and give it some suitable name. Also, select the checkbox for Point-to-Site VPN Connectivity.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/1106.vnet-14.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/1106.vnet_2D00_14.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/1106.vnet-14.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/1106.vnet_2D00_14.PNG" alt="" border="0" /></a></span></p>
<p>&nbsp;</p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Next, we need to specify the client side address space on the Point-to-Site Connectivity page. Use the 192.168.1.0/24 as discussed, above.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/6320.vnet-15.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/6320.vnet_2D00_15.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/6320.vnet-15.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/6320.vnet_2D00_15.PNG" alt="" border="0" /></a></span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Next, on the Virtual Network Address space page, enter the Address space as 10.1.0.0/16 and then specify the various Subnets as planned, before. Finally, click on the link for &ldquo;add gateway subnet&rdquo; to add the Gateway subnet as 10.1.4.0/29.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/4657.vnet-2.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/4657.vnet_2D00_2.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/4657.vnet-2.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/4657.vnet_2D00_2.PNG" alt="" border="0" /></a></span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Click through to the end and save the Virtual Network.</span></p>
<h1><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Create VPN Gateway</span></h1>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Click the link for the newly create VNet and navigate to the dashboard page. It should look like the following:</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/6472.vnet-16.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/6472.vnet_2D00_16.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/6472.vnet-16.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/6472.vnet_2D00_16.PNG" alt="" border="0" /></a></span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">At the bottom of the screen, click on the Create gateway icon to start provisioning the Gateway VM&rsquo;s in the Virtual Network.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/1321.vnet-17.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/1321.vnet_2D00_17.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/1321.vnet-17.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/1321.vnet_2D00_17.PNG" alt="" border="0" /></a></span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">This will take some time as the gateway VM&rsquo;s are provisioned and configured. Once this step completes, the Gateway IP address will be displayed on the page and VPN connectivity page will look as below.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/4214.vnet-4.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/4214.vnet_2D00_4.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/4214.vnet-4.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/4214.vnet_2D00_4.PNG" alt="" border="0" /></a></span></p>
<h1><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Create and upload Certificates</span></h1>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Certificates are used to authenticate the VPN clients. Read more about it at <a title="this link" href="https://msdn.microsoft.com/en-us/library/windowsazure/dn133792.aspx">this link</a>, and <a title="this link" href="https://msdn.microsoft.com/en-us/library/windowsazure/gg551722.aspx">this link</a> for Management certificates, in general. Using makecert utility, generate a Root certificate as shown, below. Specify a suitable name for the Root certificate.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">makecert -sky exchange -r -n "CN=PRMgmtRootCert" -pe -a sha1 -len 2048 -ss My "PRMgmtRootCert.cer"</span></p>
<p>&nbsp;</p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">This command will create and then install a certificate in the Certificate store on your current machine. Also, a &ldquo;.cer&rdquo; file (without the private key) corresponding to this certificate will be put in the current file folder from where the makecert command was run. The &ldquo;.cer&rdquo; certificate file needs to be uploaded to the Virtual Network. It is also recommended that you export the Root certificate along with its private key (i.e. the &ldquo;.pfx&rdquo; file) from the Certificate store and keep it somewhere safe so that if necessary this root certificate can be installed on some other machine.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">To upload the &ldquo;.cer&rdquo; file for the Root certificate just generated, click on the &ldquo;Upload client certificate&rdquo; link shown in the screenshot above and supply the path to the certificate. Once the Root certificate has been uploaded, the icons on the VNet dashboard will change to look as below:</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/6242.vnet-6.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/6242.vnet_2D00_6.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/6242.vnet-6.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/6242.vnet_2D00_6.PNG" alt="" border="0" /></a></span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Using the Root certificate, generate one or more client certificates and distribute to your team members. These client certificates will be used in the authentication process during the VPN session.</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">makecert.exe -n "CN=PRMgmtClientCert1" -pe -sky exchange -m 96 -ss My -in "PRMgmtRootCert" -is my -a sha1</span></p>
<p>&nbsp;</p>
<h1><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Download and install the VPN package</span></h1>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">The Virtual Network is now fully configured. In order to initiate a VPN session, you need to download and install a VPN package on your client machine. Depending upon whether your client machine is a 32 bit machine or 64 bit, pick the appropriate download link from the page shown above. An executable file will be downloaded which will be named after your VNet (in my case it was named as &ldquo;vnetprvnt.exe&rdquo;). Execute this VPN package on the client machine to configure the VPN settings on the local machine. Note that this VPN package is not an agent, even though it appears as if you are installing something on your local machine. Instead, the package is just a tool to configure the built-in RRAS features of your Windows Operating System.<br /></span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Once the package is run successfully, your client machine is ready to VPN into the VNet. An icon should show up in the network area of your machine, as shown below for my Windows Server 2012 machine.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/2664.vnet-7.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/2664.vnet_2D00_7.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/2664.vnet-7.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/2664.vnet_2D00_7.PNG" alt="" border="0" /></a></span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Click on the icon to start the connection; you&nbsp;may have to pick the client certificate that is chained to the Root certificate uploaded to VNet.&nbsp;Then, to verify that VPN connectivity is working, go to a command prompt and run ipconfig /all.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/6472.vnet-8.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/6472.vnet_2D00_8.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/6472.vnet-8.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/6472.vnet_2D00_8.PNG" alt="" border="0" /></a></span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">You now have&nbsp;a Point-to-Site VPN to Virtual Network working.</span></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Copying Captured VM Image in Azure IaaS</title>
      <link>https://docs.microsoft.com/archive/blogs/piyushranjan/copying-captured-vm-image-in-azure-iaas</link>
      <pubDate>Sat, 01 Jun 2013 00:13:00 GMT</pubDate>
      <dc:creator><![CDATA[Piyush Ranjan (MSFT)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/piyushranjan/2013/06/01/copying-captured-vm-image-in-azure-iaas/</guid>
      <description><![CDATA[An image is a bootable virtual hard disk (.vhd) that has been cleaned up so that it acts as a...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: Calibri; font-size: small;">An image is a bootable virtual hard disk (.vhd) that has been cleaned up so that it acts as a template for creating new Virtual Machines in Azure IaaS. One usually picks an image from the Windows Azure Image gallery to provision VM&rsquo;s. However, a very useful scenario is where one wants to customize a VM and then export it as an image so that further VM&rsquo;s could be provisioned from that same image and therefore have identical customization. In order for a Windows VM to be exported as an image, it needs to be &ldquo;sysprep&rsquo;d&rdquo; and likewise for a Linux VM one has to do &ldquo;waagent &ndash;deprovision&rdquo;. The full set of steps are already well documented and can be found </span><a href="https://www.windowsazure.com/en-us/manage/windows/how-to-guides/capture-an-image/"><span style="color: #0563c1; font-family: Calibri; font-size: small;">here</span></a><span style="font-family: Calibri; font-size: small;"> for Windows and </span><a href="https://www.windowsazure.com/en-us/manage/linux/how-to-guides/capture-an-image/"><span style="color: #0563c1; font-family: Calibri; font-size: small;">here</span></a><span style="font-size: small;"><span style="font-family: Calibri;"> for Linux.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">However, there are a few quirks to the way the capture process works and these are not very well documented. For example, when you capture an image from the Azure portal (as described in the documentation cited above), the user interface gives no option to specify where the image (i.e. the captured VHD file) will be located &ndash; which storage account? Which container? In fact, it automatically stores the new image file in the same storage account where the original VM used to be, and the blob container is automatically chosen to be &ldquo;vhds&rdquo;. Further, while we do get an option to provide a name for the image &ndash; this is the name with which the image will appear in the gallery &ndash; there is no option given for naming the vhd file, which gets assigned an auto-generated unique but nonsensical name.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">There is an additional issue with the image captured as discussed above. It turns out that any new VM provisioned from that image will always have its vhd stored in the same storage account as that which contains the image; i.e. one cannot provision a VM in a different storage account. This is quite significant and if one needs to put the new VM in a different storage account, then the only way of doing so is to first create an image in this other storage account by copying the previously created image from the previous storage account.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">The copying of image from one storage account to another is largely a matter of copying the underlying blob, but it is not sufficient. The newly copied VHD, which is actually just a blob, needs to be published as an image, otherwise attempts to provision VM from the copied blob/vhd would give errors. This point unfortunately is also not documented very well anywhere till you stumble upon it through trial-and-error. The purpose of this blog post is to show the steps through a Powershell script for copying and publishing a new image in a storage account different from that where the image was originally created. Further, once a decision has been made to copy the image to a different storage account, then it actually works to our advantage in removing some of the restrictions faced during the initial capture of the image; i.e. better naming and ability to specify the container where it will be stored etc. During the copy process, using Powershell, one is able to specify the container where the blob will be copied as well as one gets an opportunity to name the VHD file according to the naming conventions of one&rsquo;s group. Finally, we are able to publish that image with a suitable name. The script below provides a walkthrough of the steps described above and also shows how to test the newly created image by provisioning a VM out of it.</span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/7848.create-image.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/7848.create_2D00_image.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/7848.create-image.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/7848.create_2D00_image.PNG" alt="" border="0" /></a></span></span></p>
<p><span style="font-size: small;"><span style="font-family: Calibri;">The Powershell script is attached for ease of use; see attachment.</span></span></p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/42/28/12/publish-vm-image.ps1" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-42-28-12/publish_2D00_vm_2D00_image.ps1">publish-vm-image.ps1</a></p>]]></content:encoded>
    </item>
    <item>
      <title>SWAP space in Linux VM’s on Windows Azure – Part 2</title>
      <link>https://docs.microsoft.com/archive/blogs/piyushranjan/swap-space-in-linux-vms-on-windows-azure-part-2</link>
      <pubDate>Fri, 31 May 2013 23:14:31 GMT</pubDate>
      <dc:creator><![CDATA[Piyush Ranjan (MSFT)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/piyushranjan/2013/05/31/swap-space-in-linux-vms-on-windows-azure-part-2/</guid>
      <description><![CDATA[In a previous post, I discussed how by default the Linux VM&rsquo;s provisioned in Azure IaaS from...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">In a <a href="https://blogs.msdn.com/b/piyushranjan/archive/2013/05/31/swap-space-in-linux-vm-s-on-windows-azure-part-1.aspx"><span style="color: #0563c1;">previous post</span></a>, I discussed how by default the Linux VM&rsquo;s provisioned in Azure IaaS from the gallery images do not have swap space configured. The post then provided a simple set of steps with which one could configure a file based swap space on the resource disk (<span style="font-family: courier new,courier;">/mnt/resource</span>). The key point to note, however, is that the steps described&nbsp;there are for a VM that has already been provisioned and is running. Ideally, one would want to have the swap space configured automatically right&nbsp;at the time of the VM provisioning itself, rather than having to wait for a later time and then running a bunch of commands manually.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">The trick to automating the swap space configuration at the time of VM provisioning is to use the Windows Azure Linux Agent (waagent). Most people are somewhat vaguely aware that there is an agent running in the Linux VM, but most people also find it a bit too obscure and ignore it, even though the Azure portal actually has a nice documentation on waagent, <a href="https://www.windowsazure.com/en-us/manage/linux/how-to-guides/linux-agent-guide/"><span style="color: #0563c1;">here</span></a>. There is one other point that needs to be mentioned before drilling down into the details of waagent and how it may be used for the task at hand. That point is that this approach works well if you have a customized Linux VM of your own and are exporting it as a reusable image for provisioning of Linux VM&rsquo;s in future. There is no way of tapping into the capabilities of the waagent when using a raw base image of Linux from the Azure gallery. This is not really a limitation since the use case scenario that I find most useful is one where I start out with a VM that is provisioned using a gallery image, and is&nbsp;then customized for things I like to have; for example, I like to have <a href="https://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html"><span style="color: #0563c1;">Standard Java</span></a> instead of the open-jdk Java; or I may want to install Hadoop binaries on the VM so that the image can then be used later on toward a multi-node cluster. In such a scenario, it is just as easy to configure the waagent to do a few of the additional things that I want done automatically through the provisioning process.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">As discussed in the <a href="https://www.windowsazure.com/en-us/manage/linux/how-to-guides/linux-agent-guide/"><span style="color: #0563c1;">Windows Azure Linux Agent</span></a> user&rsquo;s guide, the agent can be configured to do many things, among which are:</span></p>
<ul>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Resource disk management</span></li>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Formatting and mounting the resource disk</span></li>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Configuring swap space</span></li>
</ul>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;"></span><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">The waagent is already installed in the VM provisioned from a gallery image and one needs to simply edit its configuration file located at &ldquo;<span style="font-family: courier new,courier;">/etc/waagent.conf</span>&rdquo; where the configuration looks like the following:</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/1070.swap-2.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/1070.swap_2D00_2.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/1070.swap-2.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/1070.swap_2D00_2.PNG" alt="" border="0" /></a></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Change the two lines shown above in the configuration file to enable swap, by setting as follows:</span></p>
<ul>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Set <span style="font-family: courier new,courier;"><strong>ResourceDisk.EnableSwap=y</strong></span></span></li>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Set <span style="font-family: courier new,courier;"><strong>ResourceDisk.SwapSizeMB=5120</strong></span></span></li>
</ul>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">The overall process, therefore, is the following:</span></p>
<ul>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Provision a Linux VM in IaaS as usual using one of the images in the gallery.</span></li>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Customize the VM to your liking by installing or removing software components that you need.</span></li>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Edit the &ldquo;<span style="font-family: courier new,courier;">/etc/waagent.conf</span>&rdquo; file to set the swap related lines, as shown above. Adjust the size of the swap file (the above is setting it to 5 GB).</span></li>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Capture a reusable image of the VM using instructions described <a href="https://www.windowsazure.com/en-us/manage/linux/how-to-guides/capture-an-image/"><span style="color: #0563c1;">here</span></a>.</span></li>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Provision new Linux VM&rsquo;s using the image just exported. These VM&rsquo;s will have the swap space automatically enabled.</span></li>
</ul>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">While we are on the subject of Windows Azure Linux Agent, it turns out that it provides yet another interesting capability &ndash; that of executing an arbitrary, user-specified script through the <span style="font-family: courier new,courier;">Role.StateConsumer</span> property in the same configuration file &ldquo;<span style="font-family: courier new,courier;">/etc/waagent.conf</span>&rdquo;. For example, one can create a shell script &ldquo;<span style="font-family: courier new,courier;">do-cfg.sh</span>&rdquo; as follows:</span></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="623">
<p><span style="font-family: courier new,courier; font-size: small;">#!/bin/bash</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">if [ "$1" = "Ready" ] ; then</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp; echo -n "Executing at Ready signal" &gt;&gt; /mnt/resource/pr.log</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp; # do some initialization work at Ready</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">else</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp; echo -n "Executing at Shutdown signal" &gt;&gt; /mnt/resource/pr.log</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp; # do some cleanup work before shutdown</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">fi</span></p>
<p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></p>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Then, in the configuration file set <strong><span style="font-family: courier new,courier;">Role.StateConsumer=/home/scripts/do-cfg.sh</span></strong> or whatever is the path to your script. The waagent execute the script just before sending a &ldquo;Ready&rdquo; signal to Azure fabric when provisioning a VM. It passes a command-line argument &ldquo;Ready&rdquo; to the custom script which can be tested within the script, as shown above to do some custom initialization. Likewise, the waagent executes the same script at the time of VM shutdown and passes a command-line argument &ldquo;Shutdown&rdquo; to the script which can be tested for and some custom cleanup task can be run in the VM.</span></p>
<p><span style="font-family: Calibri; font-size: small;">&nbsp;</span></p>]]></content:encoded>
    </item>
    <item>
      <title>SWAP space in Linux VM’s on Windows Azure – Part 1</title>
      <link>https://docs.microsoft.com/archive/blogs/piyushranjan/swap-space-in-linux-vms-on-windows-azure-part-1</link>
      <pubDate>Fri, 31 May 2013 22:19:00 GMT</pubDate>
      <dc:creator><![CDATA[Piyush Ranjan (MSFT)]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/piyushranjan/2013/05/31/swap-space-in-linux-vms-on-windows-azure-part-1/</guid>
      <description><![CDATA[With the recent GA of IaaS on Windows Azure, many new scenarios are opening up. One such scenario...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">With the recent GA of IaaS on Windows Azure, many new scenarios are opening up. One such scenario was a recent project where I needed to deploy a multi-node Hadoop Cluster on Linux based machines in Azure. To get started, I used a CentOS 6.3 image from the Azure gallery to provision a medium sized VM and proceeded to deploy a single node core Hadoop. This seemed to work fine except that as I started testing slightly heavier workloads, I noticed that the VM would often freeze up or become unresponsive.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">It is not difficult to guess that this had something to do with the limited resources of a medium sized VM &ndash; after all it has only 2 CPU cores and 3.5 GB of memory. But, while I would have expected the workloads to run slow, I was not expecting the whole VM to become unresponsive or start dropping connections. After discussing this issue with my friends and colleagues, we determined that the VM did not have Swap (i.e. what is called a page file on Windows) configured at all. Thus, its virtual memory system could not swap to disk when the memory pressure increased.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">You can check how the system is doing memory wise by running the &ldquo;free&rdquo; command from the Linux shell prompt, and in particular, you can use &ldquo;<span style="font-family: courier new,courier; font-size: small;">cat /proc/swaps</span>&rdquo; to see the state of the swap space &ndash; how much is configured and how much is in use. See the screenshot, below.</span></p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/3108.swap-1.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/3108.swap_2D00_1.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/59/53/3108.swap-1.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-59-53/3108.swap_2D00_1.PNG" alt="" border="0" /></a></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">If the swap space is not configured at all, as is the default case with Linux VM&rsquo;s provisioned in Azure IaaS, the &ldquo;<span style="font-family: courier new,courier; font-size: small;">cat /proc/swaps</span>&rdquo; will return nothing, and likewise the &ldquo;free&rdquo; command will not show any activity in swap.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">An interesting question is why doesn&rsquo;t the VM provisioning using a Linux library image (i.e. from the Azure gallery) automatically configure swap space. Perhaps the thinking is that the user should decide on the size and location of the swap and do it post provisioning. However, this information is not documented anywhere, and it is quite possible that one continues to use the VM without the swap ever getting configured till processes begin to crash or the VM freezes up.</span></p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">That said, once the problem has been diagnosed, the solution is a simple set steps to configure a file based swap on the resource disk; a medium sized IaaS VM in Azure comes with 135 GB of resource disk mounted as &ldquo;/mnt/resource&rdquo;. Given below is a walkthrough of the steps for configuring a file based swap space on the VM.</span></p>
<ul>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Use the &ldquo;fallocate&rdquo; command to allocate a swap file of suitable size, say, 5GB on the resource disk. The syntax is: &ldquo;<span style="font-family: courier new,courier; font-size: small;">fallocate -l 5g /mnt/resource/swap5g</span>&rdquo; where &ldquo;swap5g&rdquo; is the name of the file</span></li>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Change the permissions on the file using &ldquo;chmod&rdquo; command so that only the root user has read/write permissions on the swap file. The syntax is: &ldquo;<span style="font-family: courier new,courier; font-size: small;">chmod 600 /mnt/resource/swap5g</span>&rdquo;</span></li>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Use the &ldquo;mkswap&rdquo; command to set up the file as swap area. The syntax is: &ldquo;<span style="font-family: courier new,courier; font-size: small;">mkswap /mnt/resource/swap5g</span>&rdquo;</span></li>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Enable the use of the swap file using &ldquo;swapon&rdquo; command. The syntax is: &ldquo;<span style="font-family: courier new,courier; font-size: small;">swapon /mnt/resource/swap5g</span>&rdquo;</span></li>
<li><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">The swap is ready for use now, and the &ldquo;cat /proc/swaps&rdquo; command should confirm it now. Add an entry to the &ldquo;/etc/fstab&rdquo; file so that even if the VM recycles in Azure, the swap settings are retained. The syntax is:&nbsp;<span style="font-family: courier new,courier; font-size: small;">echo &ldquo;/mnt/resource/swap5g&nbsp;&nbsp;&nbsp;none&nbsp;&nbsp;swap&nbsp;&nbsp;sw&nbsp;&nbsp;0 0&rdquo; &gt;&gt; /etc/fstab</span></span></li>
</ul>
<p>&nbsp;</p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: medium;">Here is a transcript of the above commands executed in my VM.</span></p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="623">
<p><span style="font-family: courier new,courier; font-size: small;">[root@mylinvm ~]# fallocate -l 5g /mnt/resource/swap5g</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">[root@mylinvm ~]# ll /mnt/resource/</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">total 5242904</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">drwxr-xr-x. 4 root root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4096 May 10 19:55 hadoop</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">drwx------. 2 root root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16384 May&nbsp; 1 17:08 lost+found</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">-rw-r--r--. 1 root root 5368709120 May 17 22:23 swap5g</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">[root@mylinvm ~]# chmod 600 /mnt/resource/swap5g</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">[root@mylinvm ~]# ll /mnt/resource/</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">total 5242904</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">drwxr-xr-x. 4 root root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4096 May 10 19:55 hadoop</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">drwx------. 2 root root&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16384 May&nbsp; 1 17:08 lost+found</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">-rw-------. 1 root root 5368709120 May 17 22:23 swap5g</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">[root@mylinvm ~]# mkswap /mnt/resource/swap5g</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">mkswap: /mnt/resource/swap5g: warning: don't erase bootbits sectors</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; on whole disk. Use -f to force.</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">Setting up swapspace version 1, size = 5242876 KiB</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">no label, UUID=564242e6-ac36-4a82-9766-7f9590b12369</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">[root@mylinvm ~]# swapon /mnt/resource/swap5g</span></p>
<p>&nbsp;</p>
<p><span style="font-family: courier new,courier; font-size: small;">[root@mylinvm ~]# free</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; total&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; used&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; free&nbsp;&nbsp;&nbsp;&nbsp; shared&nbsp;&nbsp;&nbsp; buffers&nbsp;&nbsp;&nbsp;&nbsp; cached</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">Mem:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3399192&nbsp;&nbsp;&nbsp; 2356524&nbsp;&nbsp;&nbsp; 1042668&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 17844&nbsp;&nbsp;&nbsp;&nbsp; 310620</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">-/+ buffers/cache:&nbsp;&nbsp;&nbsp; 2028060&nbsp;&nbsp;&nbsp; 1371132</span></p>
<p><span style="font-family: courier new,courier; font-size: small;">Swap:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5242872&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp; 5242872</span></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p><span style="font-family: tahoma,arial,helvetica,sans-serif; font-size: small;"><strong>Acknowledgement</strong>: Thanks to my colleague Amit Srivastava for help with troubleshooting and resolving the swap issue</span>.</p>]]></content:encoded>
    </item>
  </channel>
</rss>