曹祖聖 台灣微軟資深講師 jimycao@syset.com...

Post on 10-Jul-2020

2 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1/106

曹祖聖

台灣微軟資深講師

jimycao@syset.com

http://teacher.syset.com

MCP, MCP+I, MCSA, MCSE, MCDBA, MCAD, MCSD, MCTS, MCITP, MCPD, MCT, MVP

2/106

3/106

Microsoft Azure

Microsoft Azure

IT 管理員

租用者

4/106

Windows Azure Pack

租用者

IT 管理員

資料中心

5/106

R2 + Service Provider Foundation

未來的服務

服務匯流排

SQLVM網站

服務

規劃

使用者提供者

管理網站

租用者自助服務網站

網站

應用程式

資料庫

虛擬機器

服務提供者 租用者

私有雲專用自助服務網站

一致的管理經驗

可動態移轉的工作負載

雲服務逐步移轉到私有雲資料中心

一致的開發經驗

其它服務,

CDN.

Media,…

快取服務匯流排

SQLVM 角色

網站工作者角色

網站

應用程式

資料庫

虛擬機器

租用者自助服務網站

Windows Azure

6/106

建立

私有雲

訂閱建立方案

所需服務

提出需求

從雲端配置資源

配額功能限制

包含

租用戶IT 管理員

7/106

8/106

私有雲提供客戶服務

9/106

Service BusVirtual MachinesWeb Sites

Service Bus

Gateway

Windows Server

Message Broker Service

Virtual Machines

Service Provider Foundation API

System Center(Virtual Machine Manager)

Windows Server

Web Sites

Controller(Web farm framework)

Web Farm

Front-end/Workers(Application Request Routing/Dynamic

Windows Process Activation Service )

Windows Server

服務管理 API

服務管理入口網站

10/106

建構大規模的 Web 應用程式

整合部署整合開發工具

整合原始碼制軟體,例如 TFS

即時 / 遠端監控

單鍵擴充規模

支援 .Net, Node.js, PHP, Python

http://technet.microsoft.com/en-us/library/dn499801.aspx

11/106

12/106

13/106

身份識別- Active Directory

- ADFS 聯邦式驗證

- 多重管理員

資料庫服務- SQL Server

- MySQL

其它提供者提供的服務

使用程式存取雲端資源- Windows Azure Consistent REST APIs

14/106

15/106

服務提供者

16/106

管理

17/106

自動化

18/106

使用量與報表

19/106

20/106

21/106

22/106

23/106

服務管理入口網站租用戶入口網站

服務管理 API

Service Provider Foundation (租用戶、管理、使用量)

Virtual Machine Manager

OrchestratorOperations Manager

Windows Server Hyper-V

24/106

SCVMM 部署架構

VMM 伺服器 SQL Server

VMM 主控台

程式庫伺服器

WSUS 伺服器

WDS 伺服器Hyper-V 主機

Citrix

XenServer

主機

ESX 主機

VMware

vCenter

伺服器

Microsoft Azure

App Controller

分公司 VMM 伺服器

25/106

VMM 邏輯網路

IP 子網路10.0.0.0/ 24

VLAN 3

IP 子網路10 .0.2.0/ 24

VLAN 5

IP 位址集區"Pool_1"

10 .0.0.2-10 .0.0.150

IP 位址集區"Pool_2"

10 .0.2.2-10 .0.2.150

其它站台

主機群組

邏輯網路"公司網路"

站台"總公伺辦公大樓"

26/106

VMM 網路架構

虛擬機器 • 虛擬網路卡

虛擬機器網路 • 網路隔離

邏輯網路 • 網路站台、IP 子網路、IP 集區、VLANs

邏輯交換器• 擴充、上行通訊埠設定檔、虛擬網路卡設定檔、通訊埠分類

實體網路• 實體網路卡、top-of-rack (TOR) 交換器、閘道、網路管理員、負載平衡器

27/106

Hyper-V 主機 #1

虛擬交換器邏輯交換器

交換器設定

通訊埠設定檔(上行)

通訊埠設定檔(虛擬)

管理

管理

公司

叢集

邏輯交換器強制所有虛擬交換器符合規定

Hyper-V 主機 #2

虛擬交換器

管理

28/106

29/106

30/106

31/106美東主機群組

美西主機群組

倫敦主機群組

程式庫伺服器

32/106

33/106

34/106

35/106

36/106

37/106

38/106

39/106

分公司

Windows Server Gateway

藍色虛擬網路 紅色虛擬網路

Hyper-V 基礎架構

網際網路

實體網路

ADFS ADDS

40/106

41/106

獨立虛擬機器

具控擴充性的虛擬機器角色

網路連線

42/106

http://blogs.technet.com/b/networking/archive/2013/10/11/border-gateway-protocol-bgp-with-windows-server-2012-r2.aspx

43/106

實體主機 實體網路

藍色虛擬機器 黃色虛擬機器 藍色網路 黃色網路

VIRTUALIZATION

44/106

45/106

瀏覽器

遠端桌面用戶端(RDP 8.1)

Windows Azure Pack

入口網站System Center 2012 R2

Windows Server 2012 R2

遠端桌面閘道

RDP 檔案

RDP 檔案Tokens (主機, VM)

主控台連線要求

Windows Server 2012 R2

Hyper-V

46/106

47/106

48/106

主機庫項目(虛擬機器角色範本)

應用程式擴充(應用程式組態設定與安裝檔案)

VMM

虛擬機器角色

VM VM VMSPF

主機庫精靈

服務管理員管理主機庫

提供項目給租用戶

租用戶建立新的虛擬機器角色管理概有的虛擬機器角色

Powershell

入口網站

2

1

3

4

5

1. 匯入應用程式擴充到 VMM

2. 匯入主機庫項目到 SPF

3. 公開給租用戶4. 租用戶建立新的虛擬機器角色5. 租用戶管理概有的虛擬機器角色

49/106

50/106

主機庫

• 給租用戶使用的虛擬機器

角色清單,租用戶可以透

過入口網站、PowerShell

或 API 進行存取

主機庫項目

• 主機庫中的單一虛擬機器

角色

虛擬機器角色

• 定義可變動規模的虛擬機

器層

虛擬機器角色View Definition(VIEWDEF)

• 定義租用戶在申請時看到

的介面 (輸入欄位、順

序、…)

虛擬機器角色Resource Definition(RESDEF)

• 虛擬機器角色範本定義,

包含硬體、網路、作業系

統與應用程式組態

虛擬機器角色Resource Extension(RESEXT)

• 應用程式範本與安裝檔案

(MSI, 腳本檔, SQL DAC, …)

用來部署應用程式到虛擬

機器角色上

51/106

Cloud Service 1

Virtual Machine Role 1

VM1.1

Virtual Machine Role Resource Definition (RESDEF)

VM Container Specification

Extension (RESEXT)Application

Configuration

Application, Network, VM

Settings

VM1.2

UI Wizard

(VIEWDEF)

52/106

應用程式

(RESEXT)

• 角色與功能

• 安裝程式與腳

• 作業系統映像

• 網路 IP 位址與

負載平衡

• RESEXT 參數

虛擬機器角色

(RESDEF)

• 虛擬機器設定 (大

小)

• 作業系統設定

• 作業系統映像參考

• RESEXT 參考

• RESEXT 參數繫結

• RESDEF 參數

介面精靈

(VIEWDEF)

• RESDEF 參數的

介面

• 群組

• 排序

• 驗證

• 地區化

部署組態

(RESCONFIG)

• RESDEF 參數值

• 單一部署

• 版本

53/106

OPC

{

"Name": "IIS_Demo_2", "Publisher": "Microsoft, "Version": "1.0.0.0",

"ExtensionHostingContract": "MicrosoftCompute/VMRole/1.0.0.0", ", "SchemaVersion": "1.0.0.0",

"DataPackage" : { "Location" : "IISWS2012", "Version" : "1.0.0.0" },

"ResourceExtensionParameters": [ {

"Name" : "IISPort", “Type" : "String", "Description" : "IIS Port" } ],

"ResourceRequirements": {

"OSVirtualHardDiskRequirements": ["WindowsServer2012", "Datacenter" ] },

"ExtensionSettings": { "SchemaVersion": "1.0.0.0",

"WindowsServerRolesAndFeatures": [

"Web-Server", "Web-WebServer", "Web-Common-Http", "Web-Default-Doc", "Web-Dir-Browsing", "Web-Http-Errors“ ]

"ApplicationProfile": {

"ApplicationPayload": [ { "ID" : "123dbce1-8ccd-4fb1-af39-a2a3b69b4123", "RelativePath" : "IISConfiguration.cr" } ],

"Name": "389cb52d-a950-46d3-b021-48b7fe67267e",

"WindowsApplicationProfile": {

"ProvisioningScripts": [ {

"AlwaysReboot" : faalse, "ApplicationPayloadId" : "123dbce1-8ccd-4fb1-af39-a2a3b69b4123",

"DeploymentOrder" : 1, "ErrorPolicy" : "FailOnMatch",

"ExecutableAndParams" : {

"Executable" : "cmd.exe", "Parameters" : "/q /c iisconfig.cmd [Param.IISPort]"

},

"ExitCodeRegex" : "[[1-9][[0-9]*", "RebootExitCodeRegex" : null, "RestartOnRetry" : false, "ScriptBlock" : null, "ScriptCredential" : null,

"ScriptType" : "PreInstall", "StandardErrorPath" : "C:\\iisconfig-gceerr.txt", "StandardErrorRegex" : null, "StandardInput" : null,

"StandardOutputPath" : "C:\\iisconfig-gceout.txt", "StandardOutputRegex" : null, "TimeoutInSeconds" : 1200, "WorkingDirectory" : null

54/106

{

"Name": "IIS_Demo", "Publisher": "Microsoft", "Version": "1.0.0.0",

"Type": "MicrosoftCompute/VMRole", "SchemaVersion": "1.0.0.0",

"ResourceParameters": [

{

"Name": "RoleVMSize", "Type": "String",

"Description": "Platform-specific VM size (for Blue: XS | S | M | L | XL)"

},

{

"Name": "IISPort", "Type": "String", "Description": "IISPort desc."

}

],

"ResourceExtensionReferences": [

{

"ReferenceName": "IIS_Demo_2",

"Name": "IIS_Demo_2", "Publisher": Microsoft", "Version": "1.0.0.0",

"ResourceExtensionParameterValues" : '{

"IISPort" : "[Param.IISPort]"}'

}

],

"IntrinsicSettings": {

"SchemaVersion": "1.0.0.0",

"HardwareProfile": {

"VMSize": "[Param.RoleVMSize]"

}, "ScaleOutSettings": {

"InitialInstanceCount": "[Param.RoleInitialInstanceCount]",

55/106

{

"Label": "{{IISWS2012Label}}", "PublisherLabel": "Microsoft", "Description": "{{WS2012IISDescription}}",

"DefaultLanguageCode": "en-US",

"Sections": [

{ "Title": "{{WS2012IISVMSettings}}",

"Categories": [

{ "CategoryName": "{{ScaleOutSettingGroup}}",

"Parameters": [

{ "Name": "RoleVMSize", "Label": "VM Size",

"Type": "VMSize", "DefaultValue": "ExtraSmall", "Description": "{{RoleSizeDesc}}",

"Validation": {

"Required": true,

"Messages": { "Required": {{RoleSizeRequiredMessage}}“ } } },

{ "Name": "RoleOSVHDImageNameVersion", "Label": "OS Virtual Hard disk",

"Type": "OSVirtualHardDisk", "Description": "{{OSDisk}}",

"ImageTags": [ "WindowsServer2012", "Datacenter“ ],

"Validation": {"Required": true,

"Messages": {"Required": "OS Disk is Required" } } },

{ "Name": "RoleInitialInstanceCount", "Label": "Initial Instance Count",

"Type": "Number", "DefaultValue": "1", "Description": "{{RoleInitialInstanceCountDescription}}",

"Validation": {

"Required": true, "MinRange": 1, "MaxRange": 5, }

56/106

{

"Version": "1.0.0.0",

“ParameterValues” : ‘ { “IISPort": “80", “RoleVMSize” : “Small”, “ComputerNamePattern” : null, "NetworkName" : "corp" }’

}

57/106

58/106

.ResdefPkg

• Resdef 檔

• Viewdef 檔

• 圖示

• 語言資料夾與檔案

.ResextPkg

• Resext 檔

• 腳本檔

• 應用程式安裝檔

59/106

下載或自行撰寫

資源與擴充包定義檔匯入 .ResextPkg 到 VMM

檢查部署相依性

•VHD 符合要求

•網路

•負載平衡器

匯入 .ResdefPkg 到

Azure Pack入口網站發佈主機庫項目到方案

60/106

61/106

62/106

Get-SCVirtualHardDisk

Set-SCVirtualHardDisk

63/106

入口網站讀取主機庫項目

的 VIEWDEF,繪製出介面

讓使用者輸入

入口網站產生出

RESCONFIG

• 繫結介面上使用者的輸入

入口網站建立一個新的雲

端服務或使用概有的

入口網站使用 RESCONFIG

中的設定,呼叫 SPF 進行

主機庫項目部署

SPF 讀取 RESDEF,呼叫

VMM (送出 RESDEF,

RESCONFIG 與雲端服務)

VMM 合併 RESCONFIG 與

RESDEF (參考 RESEXT),

以產生部署所需的組態設

VMM 使用 RESCONFIG 的

設定部署虛擬機器角色到

指定雲端服務

64/106

65/106

傳統主機式模型分散式模型

應用程式內容

應用程式資料庫

組態設定

IIS 伺服器

Web 伺服器雲

66/106

ASP.NET

Python

ASP

Node.js

PHP

SQL

MySQL

NoSQL

67/106

自助服務gallery

熱門的Web 應用程式套件

資料庫整合

68/106

使用熟悉的工具

上傳應用程式

整合各種原始碼控制系統

Visual Studio Team Foundation Server

FTP/HTTP

WebDeployNode.js, PHP,

ASP.NET

69/106

70/106

訊息接收者

Web 應用程式

服務匯流排名稱空間

佇列

訊息接收者

服務或應用程式

行動裝置 APP

服務

71/106

Service Bus

訊息接收者

Web 應用程式

服務匯流排名稱空間 訊息接收者

行動裝置 APP

服務

訂閱 #1

訂閱 #N

主題

商業邏輯

稽核

72/106

73/106

Reliable

messaging

Infrastructure

Services (IaaS)

Web Platform

application

Services (PaaS)

Virtual

Networking

SQL Server and

MySQL

database

Your custom

service

?

74/106

75/106

76/106

77/106

虛擬機器Virtual Machine

Manager

功能

• 虛擬機器管理

• 虛擬機器角色

• 虛擬機器網路

• 自助服務管理

• 透過 API 擴充

Service Management API / Service Provider Foundation

Microsoft System Center 2012 R2

Windows Server 2012 R2

78/106

Azure

監控系統

變動控制系統

其它

開發適用於 Azure 的 Runbook:建立 Runbook 來自動化所有雲端的操作,例如部署、監控、最佳化、…

具備高可用性的引擎:支援各種規模與高可用性以 PowerShell 工作流程為基礎獨立隔離的 Runbook工作

整合其它系統:匯入 PowerShell 模組、建立其它模組與 Runbook

連接到 Azure 服務或其它第三方系統

自動化

79/106

http://gallery.technet.microsoft.com/systemcenter/Service-Management-fcd75828

80/106

PowerShell 工

作流程

• 使用Windows PowerShell 語法

• 使用單一工作完成複雜、需要面對面的

人工作業

• 自動化錯誤復原

• 連線與活動重試

集中式

儲存區

• 身份資訊 / 憑證

• 全域變數與連線

• 模組

• Runbooks (草稿與發佈)

• 排程

高可用性

• 多部 Runbook伺服器

• OData Web Service

• SQL Server 叢集 / Always On

歷程分析

• Runbook執行歷程

• Excel PowerPivot 報表

• Runbook使用狀況

PowerShell 工作流程

集中式儲存區

高可用性

歷程分析

Service Management Automation

(SMA)

81/106

ODATA REST Web Service

Runbooks

Jobs

Modules & Activies

Submit requests

Return results

Http RequestHttp Response

Persist State

Pick up Jobs

SQL DatabaseRunbook Workers

Service Management Portal

• 撰寫

• 操作

Service Management Portal

• PowerShell 工作流程

• PowerShell 模組

Runbook Workers

• REST OData

• 授權

Web Service

• 管理

• 操作

Powershell Cmdlets

• Runbook資源

• Runbook工作狀況

SMA Database

PowerShell

Module

HTTP

82/106

整合

http://blogs.technet.com/b/orchestrator/archive/2014/02/09/service-management-automation-integration-with-orchestrator.aspx

83/106

84/106

85/106

• Script Workflow Activities

• CheckPoint-Workflow

• Cmdlet Activities

• SMA 會自動以 InlineScript執行的指令

• 參考: http://technet.microsoft.com/en-us/library/jj574194.aspx

86/106

• Excluded Cmdlet

• 沒有被實作成Workflow Activities 的指令

• 不會自動以 InlineScript執行,

• 如果硬要執行 (不建議):

• 參考: http://technet.microsoft.com/en-us/library/jj574194.aspx#BKMK_Excluded

87/106

$con = Get-AutomationConnection -Name 'MyConnection'

$securepassword = ConvertTo-SecureString-AsPlainText -String $con.Password –Force

$cred = New-Object -TypeName System.Management.Automation.PSCredential-ArgumentList $con.Username, $securepassword

InlineScript

{

<Commands>

} –PSComputer $con.ComputerName –PSCredential $cred

88/106

• http://gallery.technet.microsoft.com/scriptcenter

• 搜尋 "SMA"

• SMA Runbook: Update A SharePoint 2013 List Item

• Monitor AWS & VMware from SMA

• SMA Runbook - Start SCOM Maintenance Mode

• Calling an Orchestrator Runbook from a Service Management Automation (SMA)

• Using DSC to keep SMA Runbook Workers up-to-date

• …

89/106

讓你的應用程式整合 SMA 的兩種方式1.連接 SMA OData Web 服務

2. 使用 SMA PowerShell 模組提供的指令

90/106

-

-

https://o:9090/00000000-0000-0000-0000-000000000000/$metadata

https://o:9090/00000000-0000-0000-0000-000000000000/

91/106

92/106

•-

•http://blogs.technet.com/b/orchestrator/archive/2014/06/12/authoring-integration-modules-for-sma.aspx

93/106

<模組名稱>-Automation.json

94/106

• 只是標準模組的 stub

• 參考:

• http://blogs.technet.com/b/orchestrator/archive/2013/11/04/service-management-automation-portable-modules-what-why-and-how.aspx

95/106

• 標準模組可能使用到外部的 DLL

• 所以需要

96/106

97/106

目前是預覽版https://account.windowsazure.com/PreviewFeatures

98/106

1. 建立 Automation 帳戶

2. 建立憑證,並匯出 .pfx與 .cer檔

3. 匯入憑證到 Microsoft Azure (*.cer)

4. 建立Windows PowerShell Credential

5. 建立 Automation Connection

6. 上傳 Runbook (*.ps1) 或建立新的 Runbook

7. 測試、發佈、執行

99/106

100/106

101/106

102/106

103/106

104/106

• 匯出所有 Runbook

• 保留所有整合模組 (*.zip)

• 記錄所有 Automation 設定• CONNECTION

• CREDENTIAL

• VARIABLE

• SCHEDULE

• 備份所有憑證

• 記錄所有密碼• 可以在 Runbook 中用 Get-AutomationPSCredential 查詢

105/106

106/106

http://www.microsoft.com/en-au/download/details.aspx?id=6346

http://download.microsoft.com/download/0/1/C/01C728DF-B1DD-4A9E-AC5A-2C565AA37730/Windows_Azure_Pack_White_Paper.pdf

top related