SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
PowerShell DSC と Linux
System Center User Group Japan #15 (2016.09.10)
Kazuki Takai
自己紹介
 高井 一輝 (Takai Kazuki)
 某ISP勤務
 クラウドサービスの開発、設計、設備維持
 Windows Server / System Center / Linux / etc…
 System Center User Group Japan (SCUGJ)
 Twitter : @zhuky7 / Facebook : kazuki.takai
 Blog : http://operationslab.wordpress.com/
2
Agenda
 PowerShell DSC おさらい
 PowerShell DSC を使用した Linux の構成
 Azure Automation DSC を使用した Linux の構成
 おまけ
 PowerShell on Linux
3
はじめる前に
 本資料の内容は個人的な検証結果に基づきます
 所属する会社や組織、マイクロソフト社の公式な見解を記載するものではありま
せん
 表記や内容に誤りがあるなど、お気づきの点があれば、facebook 等でご連絡
いただけると幸いです
 この資料では Preview 版の製品、テクノロジーについて記載しています
 今後のリリースで機能や動作が変更、削除される可能性があります
4
Review
PowerShell DSC
PowerShell DSC おさらい
5
PowerShell DSC とは
Chef とか Puppet みたいなやつ
6
PowerShell DSC とは
 Desired State Configuration
 構成(Configuration)を特定の状態に保ち続けるための仕組み
 あるべき状態を定義
 定義に基づいて設定を変更
 定期的に設定をチェックし正しい状態を維持
 Configuration as Code を実現するもの
 コード化することで、管理・自動化が容易
 ソフトウェア開発のナレッジを適用可能
 PowerShell / WMF 4.0 以降で利用可能
7
Infrastructure as Code
 Infrastructure as Code (広義の): インフラのコード化は主に2種類
 Infrastructure as Code (狭義の)
 インフラ(ファブリック)の定義をコード化して、管理・自動構成する
 Azure Resource Manager, Chef Provision, etc…
 Configuration as Code
 ファブリック上で動作する環境(OS/OSE、ミドルウェア、アプリケーションなど)
の構成、設定をコード化して、管理・自動構成する
 PowerShell DSC, Azure Automation DSC, Chef, Puppet, etc…
8
PowerShell DSC のメリット
 構成が管理されている
 あるべき状態が定義されている
 定義が表現されている(頭の中ではなくコードとして)
 構成を担保できる
 あるべき状態に保つ(保ち続ける)
 必ず「定義された状態」になる(オペミスしない)
 構成状態をレポートできる
9
(例)PowerShell DSC でできること
 サーバーの役割と機能の有効化または無効化
 レジストリ設定の管理
 ファイルとディレクトリの管理
 プロセスとサービスの開始、停止、および管理
 グループおよびユーザー アカウントの管理
 新しいソフトウェアの展開
 環境変数の管理
 Windows PowerShell スクリプトの実行
 望ましい状態からずれた構成の修正
 特定のノードでの実際の構成状態の検出
10
DSC Resource を追加、作成することで
構成範囲を拡大可能
DSC の構成要素(1)
 Configuration (構成)
 「あるべき姿」を定義したもの
 Configuration キーワードによって定義が記述された PowerShell スクリプト
 Configuration をコンパイルした MOF ファイルをノードへ適用
 Resource (リソース)
 構成(操作)対象を実際に操作するために必要なもの
 Configuration に書かれた定義を、実際の操作(手続き)へ橋渡しする
 PowerShell スクリプトでも実装可能
11
DSC の構成要素(2)
 Local Configuration Manager (LCM; ローカル構成マネージャー)
 DSC エンジン
 MOF と Resource を使用して構成を実施
 DSC Pull サーバー
 Pull モデル(更新モード)の場合に使用
 DSC の Configuration や Resource をホストするサーバー
 各 DSC ノード(ターゲットノード)の LCM からの要求を受け付け、MOF およびリ
ソースを応答
 LCM からのレポートを受信(サポートサーバー)
12
DSC の構成要素
13
DSC Configuration MOF
ZIPDSC Resource
dll / ps1 / etc…
DSC Pull Server
WMF / PowerShell
Internet Information Services
DSC Service
+ Report Data
DSC Target Node
2種類の更新モード
 Push
 DSC ターゲットノードへ外部(またはローカル)から構成ファイルを送信(Push)し
て構成を実施
 ローカルに Push する場合も、PSRemoting の有効化が必要
 Pull
 DSC ターゲットノードの LCM が Pull サーバを定期的にポーリングし、構成ファイル
を取得(Pull)して構成を実施
 DSC Pull サーバー側へ状態レポートを送信(オプション)
14
ローカル構成マネージャー
 LCM : Local Configuration Manager
 ノード構成ファイル(MOF)を解釈して構成を変更する DSC のエンジン
 更新モードや構成モード、Pull サーバーのアドレスなどを設定
 構成モード
 ApplyOnly : 新しい構成は一度のみ適用し、構成の変更を追跡しない
 ApplyAndMonitor : 構成を適用後、変更を追跡する(自動修正はしない)(既定)
 ApplyAndAutoCorrect : 構成を適用後変更を追跡し、ずれが生じた場合は自動修正する
15
PowerShell DSC
for Linux
PowerShell DSC を使用した
Linux の構成
16
PowerShell DSC for Linux
 PowerShell DSC を使用して Linux の構成を管理・実行できる
 Windows と同様の仕組みで管理できる
 OS 上で動作する構成管理の仕組みであるため、ファブリックにあまり依存せず動く
 Azure でも、AWS でも、オンプレミスの物理でも、VM でも
 PowerShell DSC for Linux のパッケージには、大きく以下の二つが含まれる
 Linux 用 DSC Agent (LCM)
 Linux 用 DSC Resource (nx* DSC リソース)
17
PowerShell DSC for Linux の要件
 サポート OS
 RHEL および CentOS、Oracle Linux、Debian、Ubuntu、SuSE など
 詳細な対応バージョンは MSDN 参照
 必要なソフトウェア
 glibc, python, python-ctypes, openssl, lincurl
 omiserver
 (PowerShell DSC for Linux / Linux 用 DSC)
18
DSC for Linux のインストール
 glibc, python, python-ctypes, openssl, lincurl をインストールする
 ディストリビューションが提供するパッケージをインストール
 Ubuntu 16.04 LTS の場合は、デフォルトでほぼインストールされている
(Python が新しすぎるかも…)
 OMI Server のパッケージを GitHub からダウンロードしてインストール
 https://github.com/Microsoft/omi
 PowerShell DSC for Linux のパッケージを GitHub からダウンロードしてインストール
 https://github.com/Microsoft/PowerShell-DSC-for-Linux
 Microsoft ダウンロードセンターからダウンロードできるものは古いので使用しない
(2016.09.10 現在)
19
Linux 用 DSC リソース
 Linux 用の基本的な DSC リソースは nx モジュールにまとめられている
 一部、含まれないリソースがある
20
nxArchive
nxEnvironment
nxFile
nxFileLine
nxGroup
nxPackage
nxScript
nxService
nxSshAuthorizedKeys
nxUser
nxComputer nxIPAddress
nxDNSServerAddress
nxFirewall
Linux 用 DSC Configuration の作成
 Windows 上で作成(編集およびコンパイル)する場合(おすすめ)
 WMF / PowerShell 4.0 以降が必要
 Linux 用 DSC リソースをインストール
 PowerShellGet を使用して PowerShell Gallery から nx モジュールをインストール
 個別にダウンロードして、モジュールパスに配置
 Linux 上で作成する場合(現時点ではおすすめしません)
 PowerShell Core v6.0.0-alpha.9 以降をインストール
 PowerShell DSC for Linux version 1.1.1 以降をインストール
21
Demo
PowerShell DSC for Linux
22
Azure
Automation DSC
Azure Automation DSC を
使用した Linux の構成
23
Azure Automation DSC とは
 Azure Automation サービスの機能の一つ
 PowerShell DSC の Pull サーバー(のようなもの)としてふるまう
 DSC Pull サーバーを手元に用意しなくてもよい
 Azure VM との連携が容易
 OS 上で LCM を設定しなくても、ポータルからの操作のみで Pull サーバーとの連携が
可能(今のところ Windows のみ)
24
Azure Automation DSC の構成
25
DSC Configuration MOF
ZIPDSC Resource
dll / ps1 / etc…
Azure Automation
DSC Target Node
Azure Automation DSC を使うためには
 必要なもの
 Azure のサブスクリプション
 DSC Configuration スクリプト
 (必要なら)追加の DSC Resource
 Linux を構成する場合…
 ターゲットノードに PowerShell DSC for Linux version 1.1 以降が必要
(2016.0910 時点での最新版)
26
Azure Automation DSC + Linux
 構成 Step
1. Azure Automation アカウント作成
2. DSC Configuration を Azure Automation 構成へアップロード
3. 標準リソース以外を使用する場合は、Azure Automation へリソースを追加
4. アップロードした Configuration をコンパイル
5. ターゲットノード側で DSC を利用できるよう構成
6. ターゲットノードを DSC ノードとして Azure Automation DSC 上でオンボード
7. ターゲットノードと DSC ノード構成を紐づけ
27
Azure Automation アカウント作成
 新規 → 管理 → オートメーション
 名前、リソースグループ、
ロケーションを指定
28
Azure Automation メインパネル
29
DSC Resource
の追加
ノード追加
ノードに構成を紐づけ
Configuration の登録
コンパイル
コンパイル済
構成の一覧
Point! : ターゲットが Linux の場合
 PowerShell DSC for Linux version 1.1 以降をターゲットにインストール
 Register.py を使用して、ターゲットノードを Azure Automation DSC へ登録
 /opt/microsoft/dsc/Scripts/Register.py <key> <url>
 <key> : Automation account registration key
 <url> : Automation account registration url
 <key> と <url> は Azure ポータルから入手可能
 Register.py を使用せず、構成用の metaconfiguration MOF を使用する方法もある
 nx リソースをギャラリーから追加
30
Demo
Azure Automation DSC
31
PowerShell on
Linux
PowerShell for every system!
32
PowerShell on Linux
 PowerShell が Linux 上で動く
 Linux だけでなく、macOS でも Windows でも
 PowerShell for every system!
 GitHub 上で公開
 https://github.com/PowerShell/PowerShell
 インストール方法なども、上記 URL に記載されている
 お試し程度であれば、有志が公開しているコンテナーイメージを使用する方法もある
33
厳密には…
 PowerShell Core が動く(Core Edition)
 Desktop Edition
 Full .NET Framework 依存
 Windows クライアントおよび Windows Server のみ(Nano Server は除く)
 Core Edition
 .NET Core 依存
 Desktop Edition のサブセット的な位置付け
 Windows(Nano 含む)、Linux、macOS で動作
 Edition の判別は $PSVersionTable.PSEdition
34
現状
 まだ alpha 版 (v6.0.0-alpha.9)
 開発中のため、実装されていない機能が多数ある
 PSRP(PowerShell Remoting Protocol)によるネイティブ接続は未実装
 SSH 接続経由で PowerShell を Subsystem としてキックすることは可能(要設定)
 そもそも、OS 依存なコマンドは実装されていない
 .NET Core ベースで動作するよう再実装されている部分があり、今までの
(Desktop Edition の)コマンドレットと挙動が異なる箇所がある
 Nano Server (に実装されている PowerShell 5.1 Core Edition)も、従来の
(Desktop Edition の)PowerShell と(出力が)異なる場合があるため要注意
35
Demo
PowerShell on Linux
36
まとめ
 PowerShell DSC for Linux を使用することで、Windows と同様の手法で Linux
の構成管理が可能
 Azure Automation DSC を使用することで、DSC Pull サーバを手元に用意しな
くてもクラウド上で一元的な管理が可能
 構成管理ツールは DSC だけではないので、利用環境に適したツールを使うべき
37
参考資料
 Windows PowerShell Desired State Configuration の概要
 https://msdn.microsoft.com/ja-jp/powershell/dsc/overview
 Open Management Infrastructure
 https://github.com/Microsoft/omi
 PowerShell Desired State Configuration for Linux
 https://github.com/Microsoft/PowerShell-DSC-for-Linux
 PowerShell DSC for Linux version 1.1 is Now Available! And New Linux Resources!
 https://blogs.msdn.microsoft.com/powershell/2015/09/29/powershell-dsc-for-linux-version-1-
1-is-now-available-and-new-linux-resources/
 Azure Automation DSC の概要
 https://azure.microsoft.com/ja-jp/documentation/articles/automation-dsc-overview/
38

Contenu connexe

Tendances

IT Pro のための PowerShell スクリプティング
IT Pro のための PowerShell スクリプティングIT Pro のための PowerShell スクリプティング
IT Pro のための PowerShell スクリプティングKazuki Takai
 
Chef windows linux環境構築
Chef windows linux環境構築Chef windows linux環境構築
Chef windows linux環境構築靖 小田島
 
Chefで始めるWindows Server構築
Chefで始めるWindows Server構築Chefで始めるWindows Server構築
Chefで始めるWindows Server構築Takashi Kanai
 
それでも僕はユニットテストを書きたい - Pester powered by PowerShell
それでも僕はユニットテストを書きたい - Pester powered by PowerShellそれでも僕はユニットテストを書きたい - Pester powered by PowerShell
それでも僕はユニットテストを書きたい - Pester powered by PowerShellHidari Ikw
 
Windows PowerShell によるWindows Server 管理の自動化 v4.0 2014.03.13 更新版
Windows PowerShell によるWindows Server 管理の自動化 v4.0 2014.03.13 更新版Windows PowerShell によるWindows Server 管理の自動化 v4.0 2014.03.13 更新版
Windows PowerShell によるWindows Server 管理の自動化 v4.0 2014.03.13 更新版junichi anno
 
Windows PowerShell 2.0 の基礎知識
Windows PowerShell 2.0 の基礎知識Windows PowerShell 2.0 の基礎知識
Windows PowerShell 2.0 の基礎知識shigeya
 
Past and Future of PowerShell
Past and Future of PowerShellPast and Future of PowerShell
Past and Future of PowerShellKazuki Takai
 
PowerShell の基本操作とリモーティング&v3のご紹介 junichia
PowerShell の基本操作とリモーティング&v3のご紹介 junichiaPowerShell の基本操作とリモーティング&v3のご紹介 junichia
PowerShell の基本操作とリモーティング&v3のご紹介 junichiajunichi anno
 
PowerShell and Release Management Server
PowerShell and  Release Management ServerPowerShell and  Release Management Server
PowerShell and Release Management ServerKazushi Kamegawa
 
AWSとAnsibleで実践!プロビジョニング入門‐Lamp+Laravel-
AWSとAnsibleで実践!プロビジョニング入門‐Lamp+Laravel-AWSとAnsibleで実践!プロビジョニング入門‐Lamp+Laravel-
AWSとAnsibleで実践!プロビジョニング入門‐Lamp+Laravel-靖 小田島
 
[MW01] ご注文は Linux + Docker ですか? Windows だけじゃない App Service を使い切る
[MW01] ご注文は Linux + Docker ですか? Windows だけじゃない App Service を使い切る[MW01] ご注文は Linux + Docker ですか? Windows だけじゃない App Service を使い切る
[MW01] ご注文は Linux + Docker ですか? Windows だけじゃない App Service を使い切るde:code 2017
 
[TL10] Azure IaaS 構築・運用・管理の専門家が語る DevTest Labs ~高速・費用無駄ナシ・簡単管理を実現する開発・テスト環境の構築~
[TL10] Azure IaaS 構築・運用・管理の専門家が語る DevTest Labs ~高速・費用無駄ナシ・簡単管理を実現する開発・テスト環境の構築~[TL10] Azure IaaS 構築・運用・管理の専門家が語る DevTest Labs ~高速・費用無駄ナシ・簡単管理を実現する開発・テスト環境の構築~
[TL10] Azure IaaS 構築・運用・管理の専門家が語る DevTest Labs ~高速・費用無駄ナシ・簡単管理を実現する開発・テスト環境の構築~de:code 2017
 
PowerShell を使用した Hyper-V の管理
PowerShell を使用した Hyper-V の管理PowerShell を使用した Hyper-V の管理
PowerShell を使用した Hyper-V の管理Kazuki Takai
 
Chef社内勉強会(第1回)
Chef社内勉強会(第1回)Chef社内勉強会(第1回)
Chef社内勉強会(第1回)Yoshinori Nakanishi
 
[SC03] Active Directory の DR 対策~天災/人災/サイバー攻撃、その時あなたの IT 基盤は利用継続できますか?
[SC03] Active Directory の DR 対策~天災/人災/サイバー攻撃、その時あなたの IT 基盤は利用継続できますか? [SC03] Active Directory の DR 対策~天災/人災/サイバー攻撃、その時あなたの IT 基盤は利用継続できますか?
[SC03] Active Directory の DR 対策~天災/人災/サイバー攻撃、その時あなたの IT 基盤は利用継続できますか? de:code 2017
 
明日から始める Chef 入門 #bpstudy
明日から始める Chef 入門 #bpstudy明日から始める Chef 入門 #bpstudy
明日から始める Chef 入門 #bpstudyTakeshi Komiya
 
Team Foundation Server入門
Team Foundation Server入門Team Foundation Server入門
Team Foundation Server入門Akihiro Nakajima
 

Tendances (19)

IT Pro のための PowerShell スクリプティング
IT Pro のための PowerShell スクリプティングIT Pro のための PowerShell スクリプティング
IT Pro のための PowerShell スクリプティング
 
Chef windows linux環境構築
Chef windows linux環境構築Chef windows linux環境構築
Chef windows linux環境構築
 
Chefで始めるWindows Server構築
Chefで始めるWindows Server構築Chefで始めるWindows Server構築
Chefで始めるWindows Server構築
 
それでも僕はユニットテストを書きたい - Pester powered by PowerShell
それでも僕はユニットテストを書きたい - Pester powered by PowerShellそれでも僕はユニットテストを書きたい - Pester powered by PowerShell
それでも僕はユニットテストを書きたい - Pester powered by PowerShell
 
Windows PowerShell によるWindows Server 管理の自動化 v4.0 2014.03.13 更新版
Windows PowerShell によるWindows Server 管理の自動化 v4.0 2014.03.13 更新版Windows PowerShell によるWindows Server 管理の自動化 v4.0 2014.03.13 更新版
Windows PowerShell によるWindows Server 管理の自動化 v4.0 2014.03.13 更新版
 
Windows PowerShell 2.0 の基礎知識
Windows PowerShell 2.0 の基礎知識Windows PowerShell 2.0 の基礎知識
Windows PowerShell 2.0 の基礎知識
 
Past and Future of PowerShell
Past and Future of PowerShellPast and Future of PowerShell
Past and Future of PowerShell
 
PowerShell の基本操作とリモーティング&v3のご紹介 junichia
PowerShell の基本操作とリモーティング&v3のご紹介 junichiaPowerShell の基本操作とリモーティング&v3のご紹介 junichia
PowerShell の基本操作とリモーティング&v3のご紹介 junichia
 
PowerShell and Release Management Server
PowerShell and  Release Management ServerPowerShell and  Release Management Server
PowerShell and Release Management Server
 
Windows Azure PHP Tips
Windows Azure PHP Tips Windows Azure PHP Tips
Windows Azure PHP Tips
 
AWSとAnsibleで実践!プロビジョニング入門‐Lamp+Laravel-
AWSとAnsibleで実践!プロビジョニング入門‐Lamp+Laravel-AWSとAnsibleで実践!プロビジョニング入門‐Lamp+Laravel-
AWSとAnsibleで実践!プロビジョニング入門‐Lamp+Laravel-
 
[MW01] ご注文は Linux + Docker ですか? Windows だけじゃない App Service を使い切る
[MW01] ご注文は Linux + Docker ですか? Windows だけじゃない App Service を使い切る[MW01] ご注文は Linux + Docker ですか? Windows だけじゃない App Service を使い切る
[MW01] ご注文は Linux + Docker ですか? Windows だけじゃない App Service を使い切る
 
[TL10] Azure IaaS 構築・運用・管理の専門家が語る DevTest Labs ~高速・費用無駄ナシ・簡単管理を実現する開発・テスト環境の構築~
[TL10] Azure IaaS 構築・運用・管理の専門家が語る DevTest Labs ~高速・費用無駄ナシ・簡単管理を実現する開発・テスト環境の構築~[TL10] Azure IaaS 構築・運用・管理の専門家が語る DevTest Labs ~高速・費用無駄ナシ・簡単管理を実現する開発・テスト環境の構築~
[TL10] Azure IaaS 構築・運用・管理の専門家が語る DevTest Labs ~高速・費用無駄ナシ・簡単管理を実現する開発・テスト環境の構築~
 
PowerShell を使用した Hyper-V の管理
PowerShell を使用した Hyper-V の管理PowerShell を使用した Hyper-V の管理
PowerShell を使用した Hyper-V の管理
 
Chef社内勉強会(第1回)
Chef社内勉強会(第1回)Chef社内勉強会(第1回)
Chef社内勉強会(第1回)
 
[SC03] Active Directory の DR 対策~天災/人災/サイバー攻撃、その時あなたの IT 基盤は利用継続できますか?
[SC03] Active Directory の DR 対策~天災/人災/サイバー攻撃、その時あなたの IT 基盤は利用継続できますか? [SC03] Active Directory の DR 対策~天災/人災/サイバー攻撃、その時あなたの IT 基盤は利用継続できますか?
[SC03] Active Directory の DR 対策~天災/人災/サイバー攻撃、その時あなたの IT 基盤は利用継続できますか?
 
TFSを支える技術
TFSを支える技術TFSを支える技術
TFSを支える技術
 
明日から始める Chef 入門 #bpstudy
明日から始める Chef 入門 #bpstudy明日から始める Chef 入門 #bpstudy
明日から始める Chef 入門 #bpstudy
 
Team Foundation Server入門
Team Foundation Server入門Team Foundation Server入門
Team Foundation Server入門
 

Similaire à PowerShell DSC と Linux

Azure Arc Automanage Machine Configuration による構成の管理と適用
Azure Arc Automanage Machine Configuration による構成の管理と適用Azure Arc Automanage Machine Configuration による構成の管理と適用
Azure Arc Automanage Machine Configuration による構成の管理と適用Kazuki Takai
 
App controllerとwindows azure packで作る大規模プライベートクラウド
App controllerとwindows azure packで作る大規模プライベートクラウドApp controllerとwindows azure packで作る大規模プライベートクラウド
App controllerとwindows azure packで作る大規模プライベートクラウドTakashi Kanai
 
Recap: PowerShell Core
Recap: PowerShell CoreRecap: PowerShell Core
Recap: PowerShell CoreKazuki Takai
 
Dep006 クラウド的オンプ
Dep006 クラウド的オンプDep006 クラウド的オンプ
Dep006 クラウド的オンプTech Summit 2016
 
Cloud OS Tech Day 2014:Windows Azure Pack プライベートクラウドとセルフポータル(仮)
Cloud OS Tech Day 2014:Windows Azure Pack プライベートクラウドとセルフポータル(仮)Cloud OS Tech Day 2014:Windows Azure Pack プライベートクラウドとセルフポータル(仮)
Cloud OS Tech Day 2014:Windows Azure Pack プライベートクラウドとセルフポータル(仮)wind06106
 
[20171019 三木会] データベース・マイグレーションについて by 株式会社シー・エス・イー 藤井 元雄 氏
[20171019 三木会] データベース・マイグレーションについて by 株式会社シー・エス・イー 藤井 元雄 氏[20171019 三木会] データベース・マイグレーションについて by 株式会社シー・エス・イー 藤井 元雄 氏
[20171019 三木会] データベース・マイグレーションについて by 株式会社シー・エス・イー 藤井 元雄 氏Insight Technology, Inc.
 
Windows Server 2016 Essentials TP4の強化ポイントと PowerShellの使いどころ
Windows Server 2016 Essentials TP4の強化ポイントとPowerShellの使いどころWindows Server 2016 Essentials TP4の強化ポイントとPowerShellの使いどころ
Windows Server 2016 Essentials TP4の強化ポイントと PowerShellの使いどころSatoru Nasu
 
SC2012 VMM SP1 Update ヒーロー島 版
SC2012 VMM SP1 Update ヒーロー島 版SC2012 VMM SP1 Update ヒーロー島 版
SC2012 VMM SP1 Update ヒーロー島 版Kishima Masakazu
 
de:code 2018 DA06 SQL Server 管理者におくる SQL Server on Linux Tips
de:code 2018 DA06 SQL Server 管理者におくる SQL Server on Linux Tipsde:code 2018 DA06 SQL Server 管理者におくる SQL Server on Linux Tips
de:code 2018 DA06 SQL Server 管理者におくる SQL Server on Linux TipsMasayuki Ozawa
 
Sql server 構築 運用 tips
Sql server 構築 運用 tipsSql server 構築 運用 tips
Sql server 構築 運用 tipsMasayuki Ozawa
 
Azure IaaS update (2018年6月~7月 発表版)
Azure IaaS update (2018年6月~7月 発表版) Azure IaaS update (2018年6月~7月 発表版)
Azure IaaS update (2018年6月~7月 発表版) Takamasa Maejima
 
Sql server 2016 ctp 3.0 新機能
Sql server 2016 ctp 3.0 新機能Sql server 2016 ctp 3.0 新機能
Sql server 2016 ctp 3.0 新機能Masayuki Ozawa
 
IT エンジニアのための 流し読み Windows 10 - 入門!System Center Configration Manager
IT エンジニアのための 流し読み Windows 10 - 入門!System Center Configration ManagerIT エンジニアのための 流し読み Windows 10 - 入門!System Center Configration Manager
IT エンジニアのための 流し読み Windows 10 - 入門!System Center Configration ManagerTAKUYA OHTA
 
System centerを中心とした統合管理-オンプレミスからクラウドまで
System centerを中心とした統合管理-オンプレミスからクラウドまでSystem centerを中心とした統合管理-オンプレミスからクラウドまで
System centerを中心とした統合管理-オンプレミスからクラウドまでMasahiko Ebisuda
 
Solaris 11 ディープダイブセミナー インストール編
Solaris 11 ディープダイブセミナー インストール編Solaris 11 ディープダイブセミナー インストール編
Solaris 11 ディープダイブセミナー インストール編SolarisJP
 
Aws elastic beanstalk-handson-summit2012
Aws elastic beanstalk-handson-summit2012Aws elastic beanstalk-handson-summit2012
Aws elastic beanstalk-handson-summit2012Akio Katayama
 

Similaire à PowerShell DSC と Linux (20)

DSC 再入門
DSC 再入門DSC 再入門
DSC 再入門
 
Azure Arc Automanage Machine Configuration による構成の管理と適用
Azure Arc Automanage Machine Configuration による構成の管理と適用Azure Arc Automanage Machine Configuration による構成の管理と適用
Azure Arc Automanage Machine Configuration による構成の管理と適用
 
App controllerとwindows azure packで作る大規模プライベートクラウド
App controllerとwindows azure packで作る大規模プライベートクラウドApp controllerとwindows azure packで作る大規模プライベートクラウド
App controllerとwindows azure packで作る大規模プライベートクラウド
 
Recap: PowerShell Core
Recap: PowerShell CoreRecap: PowerShell Core
Recap: PowerShell Core
 
20180216 sapporo techbar_db_migration
20180216 sapporo techbar_db_migration20180216 sapporo techbar_db_migration
20180216 sapporo techbar_db_migration
 
Monitoring あれこれ
Monitoring あれこれMonitoring あれこれ
Monitoring あれこれ
 
Dep006 クラウド的オンプ
Dep006 クラウド的オンプDep006 クラウド的オンプ
Dep006 クラウド的オンプ
 
Cloud OS Tech Day 2014:Windows Azure Pack プライベートクラウドとセルフポータル(仮)
Cloud OS Tech Day 2014:Windows Azure Pack プライベートクラウドとセルフポータル(仮)Cloud OS Tech Day 2014:Windows Azure Pack プライベートクラウドとセルフポータル(仮)
Cloud OS Tech Day 2014:Windows Azure Pack プライベートクラウドとセルフポータル(仮)
 
[20171019 三木会] データベース・マイグレーションについて by 株式会社シー・エス・イー 藤井 元雄 氏
[20171019 三木会] データベース・マイグレーションについて by 株式会社シー・エス・イー 藤井 元雄 氏[20171019 三木会] データベース・マイグレーションについて by 株式会社シー・エス・イー 藤井 元雄 氏
[20171019 三木会] データベース・マイグレーションについて by 株式会社シー・エス・イー 藤井 元雄 氏
 
Windows Server 2016 Essentials TP4の強化ポイントと PowerShellの使いどころ
Windows Server 2016 Essentials TP4の強化ポイントとPowerShellの使いどころWindows Server 2016 Essentials TP4の強化ポイントとPowerShellの使いどころ
Windows Server 2016 Essentials TP4の強化ポイントと PowerShellの使いどころ
 
SC2012 VMM SP1 Update ヒーロー島 版
SC2012 VMM SP1 Update ヒーロー島 版SC2012 VMM SP1 Update ヒーロー島 版
SC2012 VMM SP1 Update ヒーロー島 版
 
PHP on Cloud
PHP on CloudPHP on Cloud
PHP on Cloud
 
de:code 2018 DA06 SQL Server 管理者におくる SQL Server on Linux Tips
de:code 2018 DA06 SQL Server 管理者におくる SQL Server on Linux Tipsde:code 2018 DA06 SQL Server 管理者におくる SQL Server on Linux Tips
de:code 2018 DA06 SQL Server 管理者におくる SQL Server on Linux Tips
 
Sql server 構築 運用 tips
Sql server 構築 運用 tipsSql server 構築 運用 tips
Sql server 構築 運用 tips
 
Azure IaaS update (2018年6月~7月 発表版)
Azure IaaS update (2018年6月~7月 発表版) Azure IaaS update (2018年6月~7月 発表版)
Azure IaaS update (2018年6月~7月 発表版)
 
Sql server 2016 ctp 3.0 新機能
Sql server 2016 ctp 3.0 新機能Sql server 2016 ctp 3.0 新機能
Sql server 2016 ctp 3.0 新機能
 
IT エンジニアのための 流し読み Windows 10 - 入門!System Center Configration Manager
IT エンジニアのための 流し読み Windows 10 - 入門!System Center Configration ManagerIT エンジニアのための 流し読み Windows 10 - 入門!System Center Configration Manager
IT エンジニアのための 流し読み Windows 10 - 入門!System Center Configration Manager
 
System centerを中心とした統合管理-オンプレミスからクラウドまで
System centerを中心とした統合管理-オンプレミスからクラウドまでSystem centerを中心とした統合管理-オンプレミスからクラウドまで
System centerを中心とした統合管理-オンプレミスからクラウドまで
 
Solaris 11 ディープダイブセミナー インストール編
Solaris 11 ディープダイブセミナー インストール編Solaris 11 ディープダイブセミナー インストール編
Solaris 11 ディープダイブセミナー インストール編
 
Aws elastic beanstalk-handson-summit2012
Aws elastic beanstalk-handson-summit2012Aws elastic beanstalk-handson-summit2012
Aws elastic beanstalk-handson-summit2012
 

Plus de Kazuki Takai

Azure Arc Jumpstart - Azure ArcBox を使った Azure Arc 対応 SQL MI 学習環境の構築
Azure Arc Jumpstart - Azure ArcBox を使った Azure Arc 対応 SQL MI 学習環境の構築Azure Arc Jumpstart - Azure ArcBox を使った Azure Arc 対応 SQL MI 学習環境の構築
Azure Arc Jumpstart - Azure ArcBox を使った Azure Arc 対応 SQL MI 学習環境の構築Kazuki Takai
 
Azure Arc Jumpstart Update - HCIBox Edition
Azure Arc Jumpstart Update - HCIBox EditionAzure Arc Jumpstart Update - HCIBox Edition
Azure Arc Jumpstart Update - HCIBox EditionKazuki Takai
 
ArcBox のおさらいと最新情報
ArcBox のおさらいと最新情報ArcBox のおさらいと最新情報
ArcBox のおさらいと最新情報Kazuki Takai
 
Arc 対応サーバーへの SSH アクセス
Arc 対応サーバーへの SSH アクセスArc 対応サーバーへの SSH アクセス
Arc 対応サーバーへの SSH アクセスKazuki Takai
 
Insight into Azure Active Directory #02 - Azure AD B2B Collaboration New Feat...
Insight into Azure Active Directory #02 - Azure AD B2B Collaboration New Feat...Insight into Azure Active Directory #02 - Azure AD B2B Collaboration New Feat...
Insight into Azure Active Directory #02 - Azure AD B2B Collaboration New Feat...Kazuki Takai
 
Insight into Azure Active Directory - Azure AD Custom Role & Scope
Insight into Azure Active Directory - Azure AD Custom Role & ScopeInsight into Azure Active Directory - Azure AD Custom Role & Scope
Insight into Azure Active Directory - Azure AD Custom Role & ScopeKazuki Takai
 
最近の PowerShell について
最近の PowerShell について最近の PowerShell について
最近の PowerShell についてKazuki Takai
 
Windows Server 2022 Datacenter Azure Edition Overview
Windows Server 2022 Datacenter Azure Edition OverviewWindows Server 2022 Datacenter Azure Edition Overview
Windows Server 2022 Datacenter Azure Edition OverviewKazuki Takai
 
Introducing Windows Terminal
Introducing Windows TerminalIntroducing Windows Terminal
Introducing Windows TerminalKazuki Takai
 
Recap: Windows Server 2019 Failover Clustering
Recap: Windows Server 2019 Failover ClusteringRecap: Windows Server 2019 Failover Clustering
Recap: Windows Server 2019 Failover ClusteringKazuki Takai
 
使ってみよう PowerShell
使ってみよう PowerShell使ってみよう PowerShell
使ってみよう PowerShellKazuki Takai
 
5分で分かる Windows Server 2019 HCI 超概要
5分で分かる Windows Server 2019 HCI 超概要5分で分かる Windows Server 2019 HCI 超概要
5分で分かる Windows Server 2019 HCI 超概要Kazuki Takai
 
Application Platform としての Windows Server 2019
Application Platform としての Windows Server 2019Application Platform としての Windows Server 2019
Application Platform としての Windows Server 2019Kazuki Takai
 
Windows Server 2019 で Container を使ってみる
Windows Server 2019 で Container を使ってみるWindows Server 2019 で Container を使ってみる
Windows Server 2019 で Container を使ってみるKazuki Takai
 
Getting started with Windows Containers
Getting started with Windows ContainersGetting started with Windows Containers
Getting started with Windows ContainersKazuki Takai
 
Windows とコンテナの話
Windows とコンテナの話Windows とコンテナの話
Windows とコンテナの話Kazuki Takai
 
Azure Stack の使い道 - 2017年11月版 -
Azure Stack の使い道 - 2017年11月版 -Azure Stack の使い道 - 2017年11月版 -
Azure Stack の使い道 - 2017年11月版 -Kazuki Takai
 
Nano Server First Step
Nano Server First StepNano Server First Step
Nano Server First StepKazuki Takai
 
Windows Azure and PowerShell DSC
Windows Azure and PowerShell DSCWindows Azure and PowerShell DSC
Windows Azure and PowerShell DSCKazuki Takai
 

Plus de Kazuki Takai (20)

Azure Arc Jumpstart - Azure ArcBox を使った Azure Arc 対応 SQL MI 学習環境の構築
Azure Arc Jumpstart - Azure ArcBox を使った Azure Arc 対応 SQL MI 学習環境の構築Azure Arc Jumpstart - Azure ArcBox を使った Azure Arc 対応 SQL MI 学習環境の構築
Azure Arc Jumpstart - Azure ArcBox を使った Azure Arc 対応 SQL MI 学習環境の構築
 
Azure Arc Jumpstart Update - HCIBox Edition
Azure Arc Jumpstart Update - HCIBox EditionAzure Arc Jumpstart Update - HCIBox Edition
Azure Arc Jumpstart Update - HCIBox Edition
 
ArcBox のおさらいと最新情報
ArcBox のおさらいと最新情報ArcBox のおさらいと最新情報
ArcBox のおさらいと最新情報
 
Arc 対応サーバーへの SSH アクセス
Arc 対応サーバーへの SSH アクセスArc 対応サーバーへの SSH アクセス
Arc 対応サーバーへの SSH アクセス
 
Insight into Azure Active Directory #02 - Azure AD B2B Collaboration New Feat...
Insight into Azure Active Directory #02 - Azure AD B2B Collaboration New Feat...Insight into Azure Active Directory #02 - Azure AD B2B Collaboration New Feat...
Insight into Azure Active Directory #02 - Azure AD B2B Collaboration New Feat...
 
Insight into Azure Active Directory - Azure AD Custom Role & Scope
Insight into Azure Active Directory - Azure AD Custom Role & ScopeInsight into Azure Active Directory - Azure AD Custom Role & Scope
Insight into Azure Active Directory - Azure AD Custom Role & Scope
 
最近の PowerShell について
最近の PowerShell について最近の PowerShell について
最近の PowerShell について
 
Windows Server 2022 Datacenter Azure Edition Overview
Windows Server 2022 Datacenter Azure Edition OverviewWindows Server 2022 Datacenter Azure Edition Overview
Windows Server 2022 Datacenter Azure Edition Overview
 
Azure Arc 概要
Azure Arc 概要Azure Arc 概要
Azure Arc 概要
 
Introducing Windows Terminal
Introducing Windows TerminalIntroducing Windows Terminal
Introducing Windows Terminal
 
Recap: Windows Server 2019 Failover Clustering
Recap: Windows Server 2019 Failover ClusteringRecap: Windows Server 2019 Failover Clustering
Recap: Windows Server 2019 Failover Clustering
 
使ってみよう PowerShell
使ってみよう PowerShell使ってみよう PowerShell
使ってみよう PowerShell
 
5分で分かる Windows Server 2019 HCI 超概要
5分で分かる Windows Server 2019 HCI 超概要5分で分かる Windows Server 2019 HCI 超概要
5分で分かる Windows Server 2019 HCI 超概要
 
Application Platform としての Windows Server 2019
Application Platform としての Windows Server 2019Application Platform としての Windows Server 2019
Application Platform としての Windows Server 2019
 
Windows Server 2019 で Container を使ってみる
Windows Server 2019 で Container を使ってみるWindows Server 2019 で Container を使ってみる
Windows Server 2019 で Container を使ってみる
 
Getting started with Windows Containers
Getting started with Windows ContainersGetting started with Windows Containers
Getting started with Windows Containers
 
Windows とコンテナの話
Windows とコンテナの話Windows とコンテナの話
Windows とコンテナの話
 
Azure Stack の使い道 - 2017年11月版 -
Azure Stack の使い道 - 2017年11月版 -Azure Stack の使い道 - 2017年11月版 -
Azure Stack の使い道 - 2017年11月版 -
 
Nano Server First Step
Nano Server First StepNano Server First Step
Nano Server First Step
 
Windows Azure and PowerShell DSC
Windows Azure and PowerShell DSCWindows Azure and PowerShell DSC
Windows Azure and PowerShell DSC
 

Dernier

Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)Hiroki Ichikura
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 

Dernier (9)

Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 

PowerShell DSC と Linux

  • 1. PowerShell DSC と Linux System Center User Group Japan #15 (2016.09.10) Kazuki Takai
  • 2. 自己紹介  高井 一輝 (Takai Kazuki)  某ISP勤務  クラウドサービスの開発、設計、設備維持  Windows Server / System Center / Linux / etc…  System Center User Group Japan (SCUGJ)  Twitter : @zhuky7 / Facebook : kazuki.takai  Blog : http://operationslab.wordpress.com/ 2
  • 3. Agenda  PowerShell DSC おさらい  PowerShell DSC を使用した Linux の構成  Azure Automation DSC を使用した Linux の構成  おまけ  PowerShell on Linux 3
  • 4. はじめる前に  本資料の内容は個人的な検証結果に基づきます  所属する会社や組織、マイクロソフト社の公式な見解を記載するものではありま せん  表記や内容に誤りがあるなど、お気づきの点があれば、facebook 等でご連絡 いただけると幸いです  この資料では Preview 版の製品、テクノロジーについて記載しています  今後のリリースで機能や動作が変更、削除される可能性があります 4
  • 6. PowerShell DSC とは Chef とか Puppet みたいなやつ 6
  • 7. PowerShell DSC とは  Desired State Configuration  構成(Configuration)を特定の状態に保ち続けるための仕組み  あるべき状態を定義  定義に基づいて設定を変更  定期的に設定をチェックし正しい状態を維持  Configuration as Code を実現するもの  コード化することで、管理・自動化が容易  ソフトウェア開発のナレッジを適用可能  PowerShell / WMF 4.0 以降で利用可能 7
  • 8. Infrastructure as Code  Infrastructure as Code (広義の): インフラのコード化は主に2種類  Infrastructure as Code (狭義の)  インフラ(ファブリック)の定義をコード化して、管理・自動構成する  Azure Resource Manager, Chef Provision, etc…  Configuration as Code  ファブリック上で動作する環境(OS/OSE、ミドルウェア、アプリケーションなど) の構成、設定をコード化して、管理・自動構成する  PowerShell DSC, Azure Automation DSC, Chef, Puppet, etc… 8
  • 9. PowerShell DSC のメリット  構成が管理されている  あるべき状態が定義されている  定義が表現されている(頭の中ではなくコードとして)  構成を担保できる  あるべき状態に保つ(保ち続ける)  必ず「定義された状態」になる(オペミスしない)  構成状態をレポートできる 9
  • 10. (例)PowerShell DSC でできること  サーバーの役割と機能の有効化または無効化  レジストリ設定の管理  ファイルとディレクトリの管理  プロセスとサービスの開始、停止、および管理  グループおよびユーザー アカウントの管理  新しいソフトウェアの展開  環境変数の管理  Windows PowerShell スクリプトの実行  望ましい状態からずれた構成の修正  特定のノードでの実際の構成状態の検出 10 DSC Resource を追加、作成することで 構成範囲を拡大可能
  • 11. DSC の構成要素(1)  Configuration (構成)  「あるべき姿」を定義したもの  Configuration キーワードによって定義が記述された PowerShell スクリプト  Configuration をコンパイルした MOF ファイルをノードへ適用  Resource (リソース)  構成(操作)対象を実際に操作するために必要なもの  Configuration に書かれた定義を、実際の操作(手続き)へ橋渡しする  PowerShell スクリプトでも実装可能 11
  • 12. DSC の構成要素(2)  Local Configuration Manager (LCM; ローカル構成マネージャー)  DSC エンジン  MOF と Resource を使用して構成を実施  DSC Pull サーバー  Pull モデル(更新モード)の場合に使用  DSC の Configuration や Resource をホストするサーバー  各 DSC ノード(ターゲットノード)の LCM からの要求を受け付け、MOF およびリ ソースを応答  LCM からのレポートを受信(サポートサーバー) 12
  • 13. DSC の構成要素 13 DSC Configuration MOF ZIPDSC Resource dll / ps1 / etc… DSC Pull Server WMF / PowerShell Internet Information Services DSC Service + Report Data DSC Target Node
  • 14. 2種類の更新モード  Push  DSC ターゲットノードへ外部(またはローカル)から構成ファイルを送信(Push)し て構成を実施  ローカルに Push する場合も、PSRemoting の有効化が必要  Pull  DSC ターゲットノードの LCM が Pull サーバを定期的にポーリングし、構成ファイル を取得(Pull)して構成を実施  DSC Pull サーバー側へ状態レポートを送信(オプション) 14
  • 15. ローカル構成マネージャー  LCM : Local Configuration Manager  ノード構成ファイル(MOF)を解釈して構成を変更する DSC のエンジン  更新モードや構成モード、Pull サーバーのアドレスなどを設定  構成モード  ApplyOnly : 新しい構成は一度のみ適用し、構成の変更を追跡しない  ApplyAndMonitor : 構成を適用後、変更を追跡する(自動修正はしない)(既定)  ApplyAndAutoCorrect : 構成を適用後変更を追跡し、ずれが生じた場合は自動修正する 15
  • 16. PowerShell DSC for Linux PowerShell DSC を使用した Linux の構成 16
  • 17. PowerShell DSC for Linux  PowerShell DSC を使用して Linux の構成を管理・実行できる  Windows と同様の仕組みで管理できる  OS 上で動作する構成管理の仕組みであるため、ファブリックにあまり依存せず動く  Azure でも、AWS でも、オンプレミスの物理でも、VM でも  PowerShell DSC for Linux のパッケージには、大きく以下の二つが含まれる  Linux 用 DSC Agent (LCM)  Linux 用 DSC Resource (nx* DSC リソース) 17
  • 18. PowerShell DSC for Linux の要件  サポート OS  RHEL および CentOS、Oracle Linux、Debian、Ubuntu、SuSE など  詳細な対応バージョンは MSDN 参照  必要なソフトウェア  glibc, python, python-ctypes, openssl, lincurl  omiserver  (PowerShell DSC for Linux / Linux 用 DSC) 18
  • 19. DSC for Linux のインストール  glibc, python, python-ctypes, openssl, lincurl をインストールする  ディストリビューションが提供するパッケージをインストール  Ubuntu 16.04 LTS の場合は、デフォルトでほぼインストールされている (Python が新しすぎるかも…)  OMI Server のパッケージを GitHub からダウンロードしてインストール  https://github.com/Microsoft/omi  PowerShell DSC for Linux のパッケージを GitHub からダウンロードしてインストール  https://github.com/Microsoft/PowerShell-DSC-for-Linux  Microsoft ダウンロードセンターからダウンロードできるものは古いので使用しない (2016.09.10 現在) 19
  • 20. Linux 用 DSC リソース  Linux 用の基本的な DSC リソースは nx モジュールにまとめられている  一部、含まれないリソースがある 20 nxArchive nxEnvironment nxFile nxFileLine nxGroup nxPackage nxScript nxService nxSshAuthorizedKeys nxUser nxComputer nxIPAddress nxDNSServerAddress nxFirewall
  • 21. Linux 用 DSC Configuration の作成  Windows 上で作成(編集およびコンパイル)する場合(おすすめ)  WMF / PowerShell 4.0 以降が必要  Linux 用 DSC リソースをインストール  PowerShellGet を使用して PowerShell Gallery から nx モジュールをインストール  個別にダウンロードして、モジュールパスに配置  Linux 上で作成する場合(現時点ではおすすめしません)  PowerShell Core v6.0.0-alpha.9 以降をインストール  PowerShell DSC for Linux version 1.1.1 以降をインストール 21
  • 23. Azure Automation DSC Azure Automation DSC を 使用した Linux の構成 23
  • 24. Azure Automation DSC とは  Azure Automation サービスの機能の一つ  PowerShell DSC の Pull サーバー(のようなもの)としてふるまう  DSC Pull サーバーを手元に用意しなくてもよい  Azure VM との連携が容易  OS 上で LCM を設定しなくても、ポータルからの操作のみで Pull サーバーとの連携が 可能(今のところ Windows のみ) 24
  • 25. Azure Automation DSC の構成 25 DSC Configuration MOF ZIPDSC Resource dll / ps1 / etc… Azure Automation DSC Target Node
  • 26. Azure Automation DSC を使うためには  必要なもの  Azure のサブスクリプション  DSC Configuration スクリプト  (必要なら)追加の DSC Resource  Linux を構成する場合…  ターゲットノードに PowerShell DSC for Linux version 1.1 以降が必要 (2016.0910 時点での最新版) 26
  • 27. Azure Automation DSC + Linux  構成 Step 1. Azure Automation アカウント作成 2. DSC Configuration を Azure Automation 構成へアップロード 3. 標準リソース以外を使用する場合は、Azure Automation へリソースを追加 4. アップロードした Configuration をコンパイル 5. ターゲットノード側で DSC を利用できるよう構成 6. ターゲットノードを DSC ノードとして Azure Automation DSC 上でオンボード 7. ターゲットノードと DSC ノード構成を紐づけ 27
  • 28. Azure Automation アカウント作成  新規 → 管理 → オートメーション  名前、リソースグループ、 ロケーションを指定 28
  • 29. Azure Automation メインパネル 29 DSC Resource の追加 ノード追加 ノードに構成を紐づけ Configuration の登録 コンパイル コンパイル済 構成の一覧
  • 30. Point! : ターゲットが Linux の場合  PowerShell DSC for Linux version 1.1 以降をターゲットにインストール  Register.py を使用して、ターゲットノードを Azure Automation DSC へ登録  /opt/microsoft/dsc/Scripts/Register.py <key> <url>  <key> : Automation account registration key  <url> : Automation account registration url  <key> と <url> は Azure ポータルから入手可能  Register.py を使用せず、構成用の metaconfiguration MOF を使用する方法もある  nx リソースをギャラリーから追加 30
  • 33. PowerShell on Linux  PowerShell が Linux 上で動く  Linux だけでなく、macOS でも Windows でも  PowerShell for every system!  GitHub 上で公開  https://github.com/PowerShell/PowerShell  インストール方法なども、上記 URL に記載されている  お試し程度であれば、有志が公開しているコンテナーイメージを使用する方法もある 33
  • 34. 厳密には…  PowerShell Core が動く(Core Edition)  Desktop Edition  Full .NET Framework 依存  Windows クライアントおよび Windows Server のみ(Nano Server は除く)  Core Edition  .NET Core 依存  Desktop Edition のサブセット的な位置付け  Windows(Nano 含む)、Linux、macOS で動作  Edition の判別は $PSVersionTable.PSEdition 34
  • 35. 現状  まだ alpha 版 (v6.0.0-alpha.9)  開発中のため、実装されていない機能が多数ある  PSRP(PowerShell Remoting Protocol)によるネイティブ接続は未実装  SSH 接続経由で PowerShell を Subsystem としてキックすることは可能(要設定)  そもそも、OS 依存なコマンドは実装されていない  .NET Core ベースで動作するよう再実装されている部分があり、今までの (Desktop Edition の)コマンドレットと挙動が異なる箇所がある  Nano Server (に実装されている PowerShell 5.1 Core Edition)も、従来の (Desktop Edition の)PowerShell と(出力が)異なる場合があるため要注意 35
  • 37. まとめ  PowerShell DSC for Linux を使用することで、Windows と同様の手法で Linux の構成管理が可能  Azure Automation DSC を使用することで、DSC Pull サーバを手元に用意しな くてもクラウド上で一元的な管理が可能  構成管理ツールは DSC だけではないので、利用環境に適したツールを使うべき 37
  • 38. 参考資料  Windows PowerShell Desired State Configuration の概要  https://msdn.microsoft.com/ja-jp/powershell/dsc/overview  Open Management Infrastructure  https://github.com/Microsoft/omi  PowerShell Desired State Configuration for Linux  https://github.com/Microsoft/PowerShell-DSC-for-Linux  PowerShell DSC for Linux version 1.1 is Now Available! And New Linux Resources!  https://blogs.msdn.microsoft.com/powershell/2015/09/29/powershell-dsc-for-linux-version-1- 1-is-now-available-and-new-linux-resources/  Azure Automation DSC の概要  https://azure.microsoft.com/ja-jp/documentation/articles/automation-dsc-overview/ 38