Tag: PowerShell

Last updated by at .

Azure Stack Development Kit PowerShell Install

Developing Azure Stack compatible services in Microsoft Azure using Azure Policies

As mentioned Azure Stack brings a true hybrid Cloud experience by bringing an consistent platform from the public cloud to the private cloud. There is a little bit of a catch, Microsoft Azure Stack of course only offers some of the Azure Public Cloud services, since for some of them you need to have a specific scale or specialized hardware, and they often they are behind in feature and functionality, since Azure gets updated daily and Azure Stack gets a slower updated cycle.

But what if you want to develop services on Azure, which should be compatible with Azure Stack, how can you make sure that these services also work on Azure Stack? The anwser to that is the Azure Stack Policy Module. The Azure Stack Policy module allows you to configure an Azure subscription with the same versioning and service availability as Azure Stack using Azure Policy.  The module uses the New-AzureRMPolicyAssignment PowerShell cmdlet to create an Azure policy, which limits the resource types and services available in a subscription. You can then use your Azure subscription to develop apps targeted for Azure Stack.

You can find the Azure Stack Policy Module in Azure Stack tools on GitHub.

Install the Azure Stack Policy Module

  1. Install the required version of the AzureRM PowerShell module, as described in Step1 of Install PowerShell for Azure Stack.
  2. Download the Azure Stack tools from GitHub
  3. Configure PowerShell for use with Azure Stack
  4. Import the AzureStack.Policy.psm1 module:

Apply policy to subscription

The following command can be used to apply a default Azure Stack policy against your Azure subscription.

Apply policy to a resource group

You may want to apply policies in a more granular method. As an example, you may have other resources running in the same subscription. You can scope the policy application to a specific resource group, which lets you test your apps for Azure Stack using Azure resources.

You can find more information about this on the official documentation page: https://docs.microsoft.com/en-us/azure/azure-stack/user/azure-stack-policy-module



OpenSSH Windows 10

Install SSH on Windows 10 as Optional Feature

On Windows 10 you have already a couple of options to run SSH commands. You can use for example the PowerShell Module Posh-SSH or use the Windows Subsystem for Linux (WSL) or use third party tools like PuTTY.

Today my colleague Raphael Burri from itnetX mentioned that with the latest Windows 10 release, the Fall Creators Update (10.0.16299), there is another option to use SSH on Windows 10. It looks like you can now install a beta version of OpenSSH on Windows 10 as an optional feature.

Just go to the Settings App > Apps > Settings & Apps > Manage Optional Features > Add Feature and select the OpenSSH Client Beta and as you can see, you also have OpenSSH Server (Beta) available.

Add a feature OpenSSH Windows 10

After installing the optional feature OpenSSH Client, you can now use the SSH client from PowerShell or the Command Prompt

OpenSSH Windows 10

It is great to see Microsoft integrating even more options for SSH on Windows 10.



Windows Server 1709 Server Core Sconfig

How to install Windows Server 1709

Microsoft just released the new Windows Server version 1709 in the Semi-Annual Channel. This blog post is for beginners which want to do their first step setting up Windows Server Core.

First you boot your server or virtual machine form the Windows Server 1709 ISO file. and select which Operating System you want to install. You can choose between Windows Server Standard or Windows Server Datacenter. As you might see, there is only Server Core available. The Server with Desktop Experience or Full Server is only available in the LTSC (Long-Term Servicing Channel) in Windows Server 2016.

Windows Server 1709 Operating System

After accepting the license terms, you can choose the installation type. Even there is an upgrade option, you should choose Custom which will be a new install. Since an in-place upgrade from older Windows Server versions is not supported.

Windows Server 1709 Installation Type

Choose which drive you want to install and the partitioning you want to use

Windows Server 1709 Choose Disk

After that Windows Server will install itself, and reboot for a couple of times.

Windows Server 1709 Installation

After the installation is finished you have to set the default Administrator password.

Windows Server 1709 Admin Password

When you login for the first time, it runs the Windows command prompt with the common Windows commands, or you can run PowerShell, or if you need the magic key to the server core configuration you can run “sconfig” which allows you quickly to do configuration changes, install updates and more.

Windows Server 1709 Server Core Sconfig



Docker for Windows Update Linux Containers

How to run Docker Linux Container on Windows 10 Fall Creator Update

I just blogged about how to run a Docker Linux Container natively on the new Windows Server version 1709. Docker today released a new update for Docker on Windows which also enables this scenario a little bit easier on your Windows 10 machine. It will ask you if you want to use the new feature to run Linux Containers natively on a Hyper-V Container running on Windows 10 (without the Moby VM).

As you can see the only thing right now you have to turn the feature on and off, since in this technical preview it is not yet possible to run Linux and Windows containers in parallel. But I guess soon that will be the case.

What you need is:

  • Windows 10 Fall Creators Update (Build 16299, Version 1709, RS3)
  • Docker for Windows 17.10.0-ce-win36 (13788) or higher

Enable Linux Containers on Windows

You can change the settings in the Docker Settings:

Docker for Windows Settings Enable Linux contianers on Windows

With hat setting on you can now run Linux Containers such as ubuntu on Windows directly, without having a Linux Virutal Machine running in the background to host the Linux containers.

Docker Run Ubuntu on Windows 10 Verions

Now you can also do some other fancy things like run the Azure CLI in a Linux Container on Windows 10.

Docker Azure CLI on Linux on Windows 10 Container

Simple and effective, and it will be even more powerful when you can run Linux and Windows Container in parallel on Windows Sever and on Windows 10.



How to run Docker Linux Container on Windows Server 1709

As mentioned Microsoft released the final version of Windows Server 1709 in the last week. Windows Server 1709 brings a couple of new improvements, especially in the container space. Microsoft and Docker are working on bringing Linux Container support to Windows Server, so you can now run Windows and Linux Container at the same time on a Windows Server Container Host running Windows Server 1709 or Windows 10 with the Fall Creators Update (1709).

In this post I want to show you how you setup up a Container Host to run Windows and Linux Containers at the same time using Docker.

Create Container Host Virtual Machine

Enable Nested Virtualization

If you run Docker on a physical server you can skip this step. If you want to run Docker Containers using Linux inside a Virtual Machine running on Hyper-V you should enable Nested Virtualization for the Container Host Virtual Machine. You can do this by running the following command:

if you want to do this on a Hyper-V Server in Azure, check out this post: How to setup Nested Virtualization in Microsoft Azure

Install Docker Enterprise Edition Preview on Windows Server 1709

First you have to install Docker Enterprise Edition Preview on your Windows Server 1709 container host. You can install the Docker EE preview using PowerShell package management, using the following commands:

As mentioned this is a preview version of Docker EE which enables a bunch of new features, to run Docker in production environments please use Docker EE 17.06.

Enable Docker Linux Containers on Windows

The preview Docker EE package includes a full LinuxKit system (13MB) for use when running Docker Linux containers. To enable this use the following command:

to disable it again use the following:

Run Linux Docker Container on Windows Server

Docker Ubuntu Container on Windows Server

Now you are able to run Linux Containers on Windows Server 1709.

for fun you can also run Nyancat!

Docker Nyan Cat on Windows Server

Things are still in preview, so don’t expect to work 100% 🙂



Surface Pro Storage Spaces Boot

Boot from Storage Spaces Virtual Disk in Windows 10

A couple of weeks ago I got my new Microsoft Surface Pro, I decided to go with the 1TB version to have enough space.

Surface Pro Storage

After the first minutes of setup I quickly wanted to run disk optimization, which for SSDs usually does quick trim operations. In my case this was running way longer then on my Surface Book, so I checked what was going on, and I realized that it was running Optimization on a Storage Spaces Virtual Disk, which is kind of strange.

Surface Pro PowerShell Storage Spaces Boot

I checked the disk configuration and really, my Surface Pro (2017) does have a Storage Spaces Virtual Disk which it boots from. The Storage Spaces Pool does include two physical 512GB NVMe drives with one Virtual Disk on top configured as simple (striped) volume. Right now I don’t know how they did it, but it seems now possible to boot Windows from a Storage Spaces Virtual Disk with the Windows 10 Creators Update or some Surface team magic. Then when Storage Spaces was introduced with Windows 8, boot from Storage Spaces was not possible.

 



Project Honolulu Server Overview

Microsoft Project Honolulu – The new Windows Server Management Experience

Last week Microsoft introduced the world to Project Honolulu, which is the codename for a new Windows Server management experience. Project “Honolulu” is a flexible, locally-deployed, browser-based management platform and tools to manage Windows Server locally and remote.

Microsoft today launched the Hololulu Technical Preview for the world, I had the chance to already work with Microsoft during the last couple of months in a private preview. Project Honolulu helps you to managed your servers remotely as a new kind of Server Manager. This is especially handy if you run Windows Server Core, which I think is the new black, after Microsoft announced that Nano Server is only gonna live as a Container Image with the next version of Windows Server.

Project Honolulu took many features for the Azure Server Management Tools which were hosted in Azure, and allowed you to manage your servers in the cloud and on-premise. But the Feedback was simple, People wanted to install the Management expierence on-prem, without the dependency to Microsoft Azure. Microsoft listened to the feedback and delivered the with Project Honolulu a web-based management solution, which you can install on your own servers.

Honolulu Management Experience

Project Honolulu Server Overview

Project Honolulu has different solutions which give you different functionality. In the technical preview there are three solutions available, Server Manager, Failover Cluster Manager and Hyper-Converged Cluster Manager.

Server Manager

The server manager lets you is kind of like the Server Manager you know from Windows Server, but it also replaces some local only tools like Network Management, Process, Device Manger, Certificate and User Management, Windows Update and so on. The Server Manager Solution also adds management of Virtual Machines, Virtual Switches and Storage Replica.

Failover Cluster Manager

As you might think, this allows you to manage Failover Clusters.

Hyper-Converged Cluster Manager

The Hyper-Converged Cluster Manager is very interesting if you are running Storage Spaces Direct clusters in a Hyper-Converged design, where Hyper-V Virtual Machines run on the same hosts. This allows you to do management of the S2D cluster as well as some performance metrics.

Honolulu Topology

Project Honolulu On-Premise Architecture

Project Honolulu leverages a three-tier architecture, a web server displaying web UI using HTML, a gateway service and the managed nodes. The web interface talks to the gateway service using REST APIs and the gateway connected to the managed nodes using WinRM and PowerShell remoting (Similar like the Azure Management Tools).

Project Honolulu On-Premise and Public Cloud Architecture

You can basically access the Web UI from every machine running modern browsers like Microsoft Edge or Google Chrome. If you publish the webserver to the internet, you can also manage it remotely from everywhere. The installation and configuration of Project Honolulu is straight forward, but If you want to know more about the installation check out, my friend and Microsoft MVP colleague, Charbel Nemnom’s blog post about Project Honolulu.

Project Honolulu Gateways Service can be installed on:

  • Windows Server 2012 R2
  • Windows Server 2016

You can manage:

  • Windows Server 2012
  • Windows Server 2012 R2
  • Windows Server 2016 and higher

Conclusion

In my opinion Microsoft Project Honolulu provides us with the Windows Server Management Tool we need so much. It helps us to manage our servers from a centralized HTML5 web application, and really makes management of GUI less servers easy. Deployment and configuration is very easy and simple and doesn’t take a lot of effort, while drastically removing the need to locally logon to a server for management reasons. I hope with that we will see a higher deployment of Windows Server Core installations, since we don’t need the GUI on every single server anymore.

You can download the Project Honolulu Technical Preview here: Project Honolulu Technical Preview

You can give feedback to Project Honolulu here: User Voice Project Honolulu