azure day belarus : windows server 2016 containerization by dzmitry durasau

44
Microsoft Containers in Windows Server 2016 Dzmitry Durasau

Upload: dzmitry-durasau

Post on 21-Feb-2017

349 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Microsoft Containers in Windows Server 2016Dzmitry Durasau

Page 2: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

HelloSpeaker: Dzmitry Durasau

Microsoft Certified Trainer, MCSA, MCTS, MCPSolution Architect at EPAM Systems

Main areas of expertise: Cloud Infrastructures, Enterprise Windows-based IT, Virtualization and PowerShell.

Page 3: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

• Containerization in Windows Server 2016• Windows Container Under the Hood• Hello, World!

Agenda

Page 4: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Containerization inWindows Server 2016

Page 5: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Containers – no magic insideJust another isolation technologyLike many others

• Remote Desktop Session• Application Virtualization• IIS Application Pool• Citrix• Thin Clients

Page 6: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Isolation Technologies

Page 7: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

• Multiple containers run on a host with isolation provided through namespace and process isolation technologies.

Windows Server Containers

Page 8: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

• Multiple containers run on a host, however each container is run inside of a utility virtual machine. This provides kernel level isolation between a Hyper-V container, the container host, and any other containers running on the container host.

Hyper-V Containers

Page 9: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Windows and Hyper-V Containers

Page 10: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Container Management Stack• PowerShe

ll• Docker

Page 11: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Compatibility• Windows Container can run only on

Windows Host• Windows Containers and Hyper-V

Containers are compatible • Docker Containers and PowerShell

Containers are not compatible• Docker Containert can be managed via

PowerShell in a restricted way (from TP4)

Page 12: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Containers Deployment

Operating System

Operating System

Physical System

VM

Container

Nested Virtualization in Windows Server 2016

Page 13: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Windows Containers in Azure

Page 14: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Windows Server 2012 || 14

Windows Container:Under the Hood

Page 15: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Installation• Containers• Hyper-V

Page 16: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Manage Containers with PowerShell

Page 17: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Windows Container Anatomy• Container Runtime• Container Image

Container RuntimeContainer Image (based on

WIM)

Page 18: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Windows Containers Image: WIM Package

Page 19: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Install WIM ImageInstall-ContainerOSImage

Page 20: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Container OS ImageC:\ProgramData\Microsoft\Windows\Images

Page 21: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Create ContainerNew-Container -Name <ContainerName> -ContainerImageName <ImageName>

Optional:-SwitchName <SwitchName>-MemoryStartupBytes

Page 22: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Containers

Page 23: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau
Page 24: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Containers Structure

Page 25: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Start Container

Start-Container –Name <ContainerName>

Page 26: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Container Start Procedure

Page 27: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Processes

Page 28: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

CPU and RAM• 1 CPU per Container (not verified)• Startup RAM amount can be defined within

the container properties.

Page 29: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Manage ResourcesMemoryNetwork BandwidthCPU (Relative Weight)Storage IO (IOPS and Bandwidth)

Page 30: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Network• Windows Containers use Hyper-V Virtual

Host Network Adapter• Because Firewall is shared between

Container and OS the FW configuration should be performed in OS

• MAC Address is the same as OS.

Page 31: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Hyper-V Containers Anatomy

Page 32: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau
Page 33: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Hello, World!

Page 34: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Windows Container Restrictions• Windows Server Containers created with PowerShell

can not currently be managed with Docker and visa versa – Docker containers can be managed via PowerShell in TP4 in a restricted way (discovery, stop)

• Commands sporadically fail -- try again• Currently it is not possible to create a file share

within a Container - Fixed in TP4.• ASP.NET 4.5 and 3.5 doesn't run in a container –

Fixed in TP4• ASP 5.0 does work.• Windows Server Containers can be

managed/interacted with through a RDP session – removed in TP4

Page 35: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

https://msdn.microsoft.com/en-us/virtualization/windowscontainers/about/work_in_progress

Page 36: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

DemoCreate new containerStart containerConnect to the container via PowerShellInstall IIS RoleCheck Web site via PowerShellCheck Web site via IE from hostExport container image

Page 37: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau
Page 38: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau
Page 39: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau
Page 40: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau
Page 41: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Demo Code#Review PowerShell cmdletsGet-Command -Module Containers

#Review Container ImagesGet-ContainerImage

#Because Containers use Hyper-V Virtual Switch we need to have at least one for network communicationsGet-VMSwitch

#Note: We can communicate with Containers even without network via PowerShell

#Let's create Container object $HelloWorld$HelloWorld = New-Container -Name "HelloWorld" -ContainerImageName WindowsServerCore -SwitchName Internal_Switch

#How they look:Get-Container

#Lets get the party started!Start-Container -Container $HelloWorld

#See container stateGet-Container

#Enter to the container with PowerShellEnter-PSSession -ContainerId $HelloWorld.ContainerId -RunAsAdministrator

#Install IISInstall-WindowsFeature -Name Web-Server

#Get Web SitesGet-IISSite

#Create Container ImageNew-ContainerImage -ContainerName $HelloWorld.Name -Publisher HDConf -Version 1.0 -Name HelloWorldHDConf

#Review our new containerGet-ContainerImage

#Export ContainerExport-ContainerImage -Name HelloWorldHDConf -Path c:\test\

Page 42: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Thank you!

Page 43: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

• http://www.creationline.com/lab/11385• http://

blog.engineer-memo.com/2015/08/21/windows-server-containers

• http://blogs.msdn.com/b/msgulfcommunity/archive/2015/09/08/why-windows-server-containers-and-why-you-need-to-look-at-containers-hands-on.aspx

• https://msdn.microsoft.com/en-us/virtualization/windowscontainers/about/work_in_progress

• http://blogs.technet.com/b/rutechnews/archive/2015/09/16/24-171-windows-server-2016-techincal-preview-3-187.aspx

• https://www.techdays.ru/videos/10093.html• https://

channel9.msdn.com/Blogs/TechDays-Russia/Containers-in-Windows-Server-2016

Links and credits

Page 44: Azure Day Belarus : Windows  Server 2016 Containerization by Dzmitry Durasau

Questions?Email: [email protected]:https://twitter.com/azuregeek Facebook:https://www.facebook.com/dzmitry.durasau

LinkedIn:https://www.linkedin.com/in/ddurasau

Dzmitry DurasauContainers in Windows Server

2016