<?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>Just Cloud</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/wasimbloch/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/wasimbloch/feed.xml</link>
    <description>Just Cloud</description>
    <lastBuildDate>Tue, 16 Apr 2019 06:21:09 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Setting up Kubernetes on Windows10 Laptop with Minikube</title>
      <link>https://docs.microsoft.com/archive/blogs/wasimbloch/setting-up-kubernetes-on-windows10-laptop-with-minikube</link>
      <pubDate>Mon, 23 Jan 2017 16:56:27 GMT</pubDate>
      <dc:creator><![CDATA[Wasim Bloch]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wasimbloch/?p=95</guid>
      <description><![CDATA[On February 21, 2017, Microsoft announced support for Kubernetes on Azure Container Service (GA)....]]></description>
      <content:encoded><![CDATA[On February 21, 2017, Microsoft <a href="https://azure.microsoft.com/en-us/blog/kubernetes-now-generally-available-on-azure-container-service/">announced</a> support for Kubernetes on Azure Container Service (GA). The integration of Kubernetes with Azure Container Service, consumer will be able to create a fully functional Kubernetes cluster that is integrated with the rest of your Azure resources.
To understand and develop capabilities of Kubernetes with ACS for development, I had to setup Kubernetes on my local windows 10 laptop. In this blog post, I am going to take you through setting up Minikube on your Windows 10 development machine and along the way I will share my experience. I would strongly recommend you go through some basic materials on <a href="https://docs.microsoft.com/en-us/azure/container-service/container-service-intro">ACS</a>, <a href="https://docs.docker.com/docker-for-windows/">Docker for Windows</a> and <a href="https://kubernetes.io/docs/tutorials/kubernetes-basics/">Kubernetes</a> concepts.
In general, solution like Kubernetes requires bit of efforts to setup the environment locally. Ideally, you need development environment which is like QA/staging and allow you to do your development on your laptop. This was the goal of <a href="https://github.com/kubernetes/minikube">Minikube</a> project which helps you run Kubernetes on your development machine.
<strong>Pre-requisites for Development Machine Environment:</strong>
• VT-x/AMD-v virtualization must be enabled in BIOS (requires machine restart)
• Enable Hyper-V – go to Windows features On or Off, you will see dialog box with a list of Windows features as shown below. Navigate to the Hyper-V section and enable it (requires machine restart).
<img src="https://msdnshared.blob.core.windows.net/media/2017/01/Setup-Minikube-1.png" alt="setup-minikube-1" width="413" height="299" class="alignnone size-full wp-image-105" />

<strong>Minikube Installation:</strong>
I prefer to use Hyper-V over VirtualBox to setup Kubernetes on my Windows machine because of its native windows support. In this blog, I am installing docker and then <span>Kubernetes</span> but you can install <span>Kubernetes without Docker. </span>

<strong>(Optional)</strong> The first step is to download Beta Channel Docker for Windows from <a href="https://docs.docker.com/docker-for-windows/">here</a>. Run Setup default configuration to Install Docker on your machine. Refer <a href="https://docs.microsoft.com/en-us/virtualization/windowscontainers/quick-start/quick-start-windows-10">here</a> if you need details about how to setup Docker on Windows 10 machine. Once you have successfully installed Docker, confirm deployment by typing “docker info” command in Command window as shown below.
<img src="https://msdnshared.blob.core.windows.net/media/2017/01/Setup-Minikube-4.png" alt="setup-minikube-4" width="1099" height="632" class="alignnone size-full wp-image-135" />
Now, we will setup a new external network switch which will be used by our Hyper-V to setup the Kubernetes on local machine as described below.
o Make sure you have Ethernet connectivity while you are setting this.
o Open the Hyper-V manager.
o Select the Virtual Switch Manager on the left-side Actions panel.
<img src="https://msdnshared.blob.core.windows.net/media/2017/01/Setup-Minikube-2.png" alt="setup-minikube-2" width="1142" height="218" class="alignnone size-full wp-image-115" />
o Set up a new external network switch to use instead of Docker NAT network switch (for Moby), which is set up by default when you install Docker for Windows.
o For this example, we created a virtual switch called “My Virtual Switch”.
<img src="https://msdnshared.blob.core.windows.net/media/2017/01/Setup-Minikube-3.png" alt="setup-minikube-3" width="722" height="687" class="alignnone size-full wp-image-116" />

I would prefer to create one default Docker machine by using command <code><strong>docker-machine create --driver hyperv default</strong></code>
<img src="https://msdnshared.blob.core.windows.net/media/2017/01/Setup-Minikube-4.1.png" alt="setup-minikube-4-1" width="1066" height="544" class="alignnone size-full wp-image-126" />

The next step is to download the latest Minikube binary from <a href="https://github.com/kubernetes/minikube/releases">here</a> and place that in the root folder of C drive. You may think why do you want to place binary in OS drive. This is because there is a bug in the Minikube which does not allow to install the local cluster if it is place anywhere other than C drive or in OS drive. Refer <a href="https://github.com/kubernetes/minikube/issues/459">here</a> for more details about bug. The file name is minikube-windows-amd64.exe. Rename this exe as “minikube” (just for simplicity).
Download the Kubectl command line utility from <a href="https://storage.googleapis.com/kubernetes-release/release/v1.4.0/bin/windows/amd64/kubectl.exe">here</a> and copy this alongside the kubectl.exe file from the previous section. We are all set now to launch a local Kubernetes one node cluster. Launch the PowerShell in Administrator mode and navigate to the drive where you have copied kubectl.exe and minikube.exe.
Let’s do standard testing to validate Minikube deployment by finding the version of Minikube and supported Kubernetes version as shown below. Go to <strong>%HOMEPATH%\.minikube</strong> folder and you will notice several folders are created. Have a look!

<code>PS C:\&gt; .\minikube.exe version</code>
minikube version: v0.14.0
<table></table>
<code>PS C:\&gt; .\minikube get-k8s-versions</code>
The following Kubernetes versions are available:
- v1.6.0-alpha.0
- v1.5.2
- v1.5.1
- v1.4.5
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.7
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.0
<table></table>
There are multiple commands that Minikube supports. You can use ‘--help’ option to see the list of commands.

<strong>Start Kubernetes Cluster locally</strong>
We are now ready to launch our Kubernetes cluster locally and we use start command for it. Before we start the cluster, we will check available flags/options via the help options and will use few of them. We want to use <strong>Kubernetes version v1.5.2</strong> and <strong>VM driver is hyperv</strong>. If you would like to add more memory to local Kubernetes cluster, I would recommend using <strong>memory flag</strong>. Make sure you define <strong>hyperv-virtual-switch flag</strong> which should point to the external network switch you have created previously. We are also going to use couple of global flags like <strong>--v=7</strong> and <strong>--alsologtostderr</strong> to see what is going on under the hood.

<code>PS C:\&gt; .\minikube.exe start --help</code> Usage: minikube start [flags] Flags: --container-runtime string The container runtime to be used --cpus int Number of CPUs allocated to the minikube VM (default 2) --disk-size string Disk size allocated to the minikube VM (format: [], where unit = b, k, m or g) (default "20g") --docker-env stringArray Environment variables to pass to the Docker daemon. (format: key=value) --extra-config ExtraOption A set of key=value pairs that describe configuration that may be passed to different components. The key should be '.' separated, and the first part before the dot is the component to apply the configuration to. Valid components are: kubelet, apiserver, controller-manager, etcd, proxy, scheduler. --host-only-cidr string The CIDR to be used for the minikube VM (only supported with Virtualbox driver) (default "192.168.99.1/24") --hyperv-virtual-switch string The hyperv virtual switch name. Defaults to first found. (only supported with HyperV driver) --insecure-registry stringSlice Insecure Docker registries to pass to the Docker daemon --iso-url string Location of the minikube iso (default "https://storage.googleapis.com/minikube/minikube-0.7.iso") --kubernetes-version string The kubernetes version that the minikube VM will use (ex: v1.2.3) OR a URI which contains a localkube binary (ex: https://storage.googleapis.com/minikube/k8sReleases/v1.3.0/localkube-linux-amd64) (default "v1.5.1") --kvm-network string The KVM network name. (only supported with KVM driver) (default "default") --memory int Amount of RAM allocated to the minikube VM (default 2048) --network-plugin string The name of the network plugin --registry-mirror stringSlice Registry mirrors to pass to the Docker daemon --vm-driver string VM driver is one of: [virtualbox hyperv] (default "virtualbox")Global Flags:
<strong>--alsologtostderr log to standard error as well as files</strong>
--log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files in this directory (default "")
--logtostderr log to standard error instead of files
--show-libmachine-logs Whether or not to show logs from libmachine.
--stderrthreshold severity logs at or above this threshold go to stderr (default 2)
--test.bench string regular expression per path component to select benchmarks to run
--test.benchmem print memory allocations for benchmarks
--test.benchtime duration approximate run time for each benchmark (default 1s)
--test.blockprofile string write a goroutine blocking profile to the named file after execution
--test.blockprofilerate int if &gt;= 0, calls runtime.SetBlockProfileRate() (default 1)
--test.count n run tests and benchmarks n times (default 1)
--test.coverprofile string write a coverage profile to the named file after execution
--test.cpu string comma-separated list of number of CPUs to use for each test
--test.cpuprofile string write a cpu profile to the named file during execution
--test.memprofile string write a memory profile to the named file after execution
--test.memprofilerate int if &gt;=0, sets runtime.MemProfileRate
--test.outputdir string directory in which to write profiles
--test.parallel int maximum test parallelism (default 4)
--test.run string regular expression to select tests and examples to run
--test.short run smaller test suite to save time
--test.timeout duration if positive, sets an aggregate time limit for all tests (default 0s)
--test.trace string write an execution trace to the named file after execution
--test.v verbose: print additional output
<strong> -v, --v Level log level for V logs</strong>
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
<table></table>
Here is the command which we will execute to start the local Kuberenetes cluster.
<code><strong>.\minikube.exe start --kubernetes-version="v1.5.2" --vm-driver="hyperv" --memory=1024 --hyperv-virtual-switch="My Virtual Switch" --v=7 --alsologtostderr</strong></code>
On success, you will get the messaging stating <strong>“Kubectl is now configured to use the cluster.”</strong>
<img src="https://msdnshared.blob.core.windows.net/media/2017/01/Setup-Minikube-7.png" alt="setup-minikube-7" width="712" height="88" class="alignnone size-full wp-image-155" />

Let us understand what it is doing behind the scene.
o It generates the certificates and provision local Docker host which creates VM inside the Hyper-V.
o The host is provisioned with the boot2docker.iso and setup it up.
o At the end, it configures the Kubectl to use the local Kubernetes cluster.

You can check the status of the local cluster using status command.

<code>PS C:\&gt; .\minikube.exe status</code>
minikubeVM: Running
localkube: Running
<table></table>
Use the kubectl CLI to get the cluster information. In case you see the error like <strong>“.\kubectl : error: couldn't read version from server:”</strong>, then you need to probably set the context again. The command for that is <strong>.\kubectl config set-context minikube</strong>

<strong>PS C:\&gt; .\kubectl cluster-info</strong> Kubernetes master is running at https://192.168.1.101:8443 KubeDNS is running at https://192.168.1.101:8443/api/v1/proxy/namespaces/kube-sy stem/services/kube-dns kubernetes-dashboard is running at https://192.168.1.101:8443/api/v1/proxy/names paces/kube-system/services/kubernetes-dashboard
<table></table>
<img src="https://msdnshared.blob.core.windows.net/media/2017/01/Setup-Minikube-10.png" alt="setup-minikube-10" width="1088" height="280" class="alignnone size-full wp-image-185" />

<strong>Conclusion</strong>
Minikube is a work in progress at this moment and it does not support all the features of Kubernetes. Refer <a href="https://github.com/kubernetes/minikube">here</a> to know what is supported today. Hope this blog post gets you started with Kubernetes on your Windows development machine by using minikube. Please let me know your experience.

If you are interested in Kubernetes in Azure, please see Azure Container Service: <a href="https://docs.microsoft.com/en-us/azure/container-service/container-service-kubernetes-walkthrough">https://docs.microsoft.com/en-us/azure/container-service/container-service-kubernetes-walkthrough</a>

<strong>In next post, we’ll look at how to deploy container application in Kubernetes development machine</strong>.]]></content:encoded>
    </item>
    <item>
      <title>Azure Virtual Machine Unique ID</title>
      <link>https://docs.microsoft.com/archive/blogs/wasimbloch/azure-virtual-machine-unique-id</link>
      <pubDate>Thu, 20 Oct 2016 10:11:49 GMT</pubDate>
      <dc:creator><![CDATA[Wasim Bloch]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wasimbloch/?p=75</guid>
      <description><![CDATA[As many organisations are moving their workload to the Azure, It is important for an organisation...]]></description>
      <content:encoded><![CDATA[<font size="3">
As many organisations are moving their workload to the Azure, It is important for an organisation to keep track of their Azure IaaS deployments. Azure provides support to identify each virtual machine with a unique identifier. This VM identifier can be used for licensing, reporting or general tracking purpose for Azure IaaS deployments. This unique identifier can’t be modified and can only be queried.

If you want to take advantage of this capability, you can access VM unique Identifier for Azure Virtual Machine using <a href="https://resources.azure.com/">Azure Resource Explorer</a> as follows.

Step 1 – Access and log in to the Azure Resource Explorer @ <a href="https://resources.azure.com">https://resources.azure.com</a>

Step 2 – Navigate to your Windows or Linux virtual machine.

Step 3 – Click on name of virtual machine and you will find all properties of the virtual machine on right side including VM unique identifier VmId.

<img width="639" height="370" class="alignnone size-full wp-image-85" alt="Azure VmId for Windows" src="https://msdnshared.blob.core.windows.net/media/2016/09/AzureVMIdWindow.png" />

Here is the PowerShell script to get virtual machine VmId.

<code>$vm = Get-AzureRmVM -ResourceGroupName 'rg' -Name 'vm'
$vmResource = Get-AzureRmResource -ResourceName $vm.Name -ResourceGroupName $vm.ResourceGroupName -ResourceType 'Microsoft.Compute/virtualMachines'
$vmId = $vmResource.Properties.VmId
Write-Output $vmId</code>

<strong>It is important to note that all the virtual machines which are created before September/2014 will get VmId upon restart.</strong>
</font>]]></content:encoded>
    </item>
  </channel>
</rss>