ArcBox のおさらいと最新情報

1K Views

June 18, 22

スライド概要

Windows Server & Cloud User Group Japan 第30回勉強会の資料です。
Azure Jumpstart ArcBox の概要と、最近追加された機能・フレーバーについて説明します。

profile-image

インフラエンジニア

シェア

埋め込む »CMSなどでJSが使えない場合

関連スライド

各ページのテキスト
1.

ArcBox の おさらいと 最新情報 SCUGJ (wSCUGJ) 勉強会 #30 2022-06-18 Kazuki Takai - Windows Server & Cloud User Group Japan

2.

お話しすること • ArcBox について • ArcBox を利用開始するまでの流れ • ArcBox に関する直近の変更点 • 以下はお話ししません • ArcBox をデプロイした後の細かい使い方 (シナリオ)

3.

自己紹介 • たかい (Kazuki Takai) • 会社員 (某ISP勤務) • サービス基盤開発、技術開発 • ライセンス関連 • wSCUGJ • 興味分野:統合管理、ID、自動化、セキュリティ、監視・運用 • 趣味:カメラ(風景写真)、ビデオゲーム、旅行(温泉) • Microsoft MVP for Cloud and Datacenter Management

4.

はじめる前に • Azure Arc さわってみたことがある • Azure Arc for servers • それ以外の Azure Arc for infrastructures (AzS HCI, vSphere, SCVMM, etc...) • Azure Arc for data services • それ以外の Azure Arc for services • Azure Arc を本番運用している

5.

ArcBox とは • Azure Arc Jumpstart ArcBox • https://azurearcjumpstart.io/azure_jumpstart_arcbox/ • Azure Arc のお試し環境を Azure 上に簡単に構築 する仕組みを提供 • Azure VM 上で Nested virtualization を使用して、 オンプレミス相当の環境を疑似的に構成 • PoC やデモ環境、ハンズオンなどでの利用を想定

6.

ArcBox の特徴 • Azure サブスクリプションの中で完結 • 単一のリソースグループ内にサンドボックス環境を構築 • お手軽 • 数分で準備して、1~2時間後には利用開始が可能 • あくまで一時的な検証用 • セキュリティの観点では、目を瞑っていることが多い

7.

ArcBox のフレーバー • ArcBox の構成セットの種類 • 全てを利用可能な環境を生成すると、リソース消費量 が膨大 • ロールごとに、ある程度まとまったシナリオを確認で きる環境を構成 • 現在のフレーバーは3種類 • Full • ITPro • DevOps New!!

8.

Flavor – Full • (概ね)全部入り • 展開される主な機能 • Azure Arc enabled servers • Azure Arc enabled Kubernetes • Azure Arc enabled data services • SQL Managed Instance • PostgreSQL Hyperscale • Hybrid Unified Operations

9.

Flavor – ITPro • ITPro を主なターゲットとした構成 • サーバー管理機能を中心に評価・検証が可能 • 展開される主な機能 • Azure Arc enabled servers • Hybrid Unified Operations

10.

Full / ITPro の構成 画像引用元 https://azurearcjumpstart.io/azure_jumpstart_arcbox/full/ ITPro

11.

Flavor – DevOps • Azure Arc enabled Kubernetes に特化した環境 • 展開される主な機能 • Azure Arc enabled Kubernetes • 複数のクラスターを展開 • クラスター上で動かすサンプルアプリケーションを展開 • Hybrid Unified Operations • Microsoft Defender for Cloud • DevOps に関する様々なシナリオの評価を想定 • Open Service Mesh 統合 • GitOps • Key Vault 統合

12.

DevOps 構成

13.

ArcBox の展開に必要なもの • Azure Subscription • Standard DSv4 Family の使用可能コア数が 16 – 52 以上 • テナントとサブスクリプションを操作可能なアカウント • Azure AD に対してサービスプリンシパルを作成可能 • サブスクリプションの IAM 設定を変更可能 • Az CLI と git コマンドが使用可能な環境 • Azure Cloud Shell • Windows Terminal • GitHub アカウント (DevOps の場合)

14.

East US 展開可能なリージョン East US 2 Central US West US 2 North Europe West Europe France Central UK South Australia East Japan East Korea Central Southeast Asia

15.

デプロイ パラメーター sshRSAPublicKey spnClientId spnClientSecret spnTenantId windowsAdminUsername windowsAdminPassword logAnalyticsWorkspaceName flavor deployBastion githubUser SSHログイン用の公開鍵 サービスプリンシパルのID サービスプリンシパルのシークレット サービスプリンシパルが属するAADのテナントID Windowsホストの管理者ユーザーアカウント名 上記のパスワード 本環境用に新規作成する Log Analytics Workspace 名 Full or ITPro or DevOps Bastion をデプロイするかどうか (true or false) GitHub のアカウント名

16.

展開の流れ 1. 前提条件の確認 2. リソースプロバイダーの登録 3. サービスプリンシパルの作成 4. SSH キーペアの作成 5. パラメーターファイルの修正 6. デプロイ 7. デプロイ後スクリプトの実行

17.

前提条件の確認 • Azure CLI のバージョンが 2.36.0 以上であること • az --version • Az CLI にログインしていること • az account list --query “[?isDefault]“ • デプロイ可能な DSv4-series vCPUs の空きがある こと • 16~52

18.
[beta]
リソースをデプロイ可能かどうか確認
$ az vm list-usage --location eastus --query
"[?(name.value == ¥`cores¥` || name.value ==
¥`virtualMachines¥` || name.value ==
¥`standardDSv4Family¥`)].{Name:localName,
Current:currentValue, Limit:limit}" --output table
Name

Current

Limit

--------------------------

---------

-------

Total Regional vCPUs

0

350

Virtual Machines

0

25000

Standard DSv4 Family vCPUs

0

350

19.

リソースをデプロイ可能かどうか確認 $ az vm list-skus --location eastus --size Standard_D2s --all --output table ResourceType Locations Name Zones Restrictions --------------- ----------- --------------- ------- -------------- virtualMachines eastus Standard_D2s_v3 1,2,3 None virtualMachines eastus Standard_D2s_v4 1,2,3 None virtualMachines eastus Standard_D2s_v5 1,2,3 None $ az vm list-skus --location eastus --size Standard_D4s --all --output table ResourceType Locations Name Zones Restrictions --------------- ----------- --------------- ------- -------------- virtualMachines eastus Standard_D4s_v3 1,2,3 None virtualMachines eastus Standard_D4s_v4 1,2,3 None virtualMachines eastus Standard_D4s_v5 1,2,3 None

20.

リソースプロバイダーの登録 • Full の場合 • • • • • • az az az az az az provider provider provider provider provider provider register register register register register register --namespace --namespace --namespace --namespace --namespace --namespace Microsoft.HybridCompute --wait Microsoft.GuestConfiguration --wait Microsoft.Kubernetes --wait Microsoft.KubernetesConfiguration --wait Microsoft.ExtendedLocation --wait Microsoft.AzureArcData --wait • ITPro の場合 • az provider register --namespace Microsoft.HybridCompute --wait • az provider register --namespace Microsoft.GuestConfiguration --wait • az provider register --namespace Microsoft.AzureArcData --wait • DevOps の場合 • 対応不要です(自動で登録されます)

21.

サンプルアプリをフォーク(DevOps のみ) • GitHub 上で、自分のリポジトリ(又は自分が Commit 可 能な場所)にサンプルアプリをフォークしておく • https://github.com/microsoft/azure-arc-jumpstart-apps

22.

サービスプリンシパルの作成 • 全てのフレーバーで必要なロール • Contributor • Security admin • Security reader • Full 及び ITPro の場合のみ必要なロール • Monitoring Metrics Publisher • User Access Administrator • 必須ではない • ロールを付与しない場合は、手動で追加対応が必要

23.

サービスプリンシパルの作成 $ az login $ subscriptionId=$(az account show --query id --output tsv) $ az ad sp create-for-rbac -n "<Unique SP Name>" ¥ --role "Contributor" --scopes /subscriptions/$subscriptionId $ az ad sp create-for-rbac -n "<Unique SP Name>" ¥ --role "Security admin" --scopes /subscriptions/$subscriptionId $ az ad sp create-for-rbac -n "<Unique SP Name>" ¥ --role "Security reader" --scopes /subscriptions/$subscriptionId $ az ad sp create-for-rbac -n "<Unique SP Name>" ¥ --role "Monitoring Metrics Publisher" --scopes /subscriptions/$subscriptionId $ az ad sp create-for-rbac -n "<Unique SP Name>" ¥ --role "User Access Administrator" --scopes /subscriptions/$subscriptionId

24.

サービスプリンシパルの作成 • az ad sp create-for-rbac コマンドを実行すると、以下が 表示されます • • • • appId – サービスプリンシパルのID displayName – 指定したサービスプリンシパルの名前 Password – サービスプリンシパルのシークレット Tenant – サービスプリンシパルが生成されたAADのテナントID • 複数回(異なるロールで)実行するとパスワードが上書き 再発行されます • つまり、最後の出力のみ必要・有効です

25.

SSH キーペアの作成 $ ssh-keygen -t rsa -b 4096 -C "takai@ArcBox" Generating public/private rsa key pair. Enter file in which to save the key (/home/k_takai/.ssh/id_rsa): Created directory '/home/k_takai/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/k_takai/.ssh/id_rsa. Your public key has been saved in /home/k_takai/.ssh/id_rsa.pub.

26.

パラメーターファイルの修正とデプロイ • 作成したサービスプリンシパルや SSH 公開鍵の情報を記載 • その他、必要に応じてパラメーターを修正 • git clone https://github.com/microsoft/azure_arc.git • az group create ¥ --name <Name of the Azure resource group> ¥ --location <Azure Region> • az deployment group create ¥ --resource-group <Name of the Azure resource group> ¥ --template-file azuredeploy.json ¥ --parameters azuredeploy.parameters.json • デプロイには20分(ITPro)~40分(他)程度かかる

27.

デプロイ後スクリプトの実行 • Azure リソースのデプロイが完了したら、ArcBox-Client と いう名前の Azure VM へログオン • Windows VM • アカウント名、パスワードはパラメーターファイルで指定したもの • グローバル IP 経由の場合は、NSG の設定変更が必要 • ログオンすると、自動でスクリプトが実行される • Nested Hyper-V の VM 作成、起動等が実行される • Full, ITPro の場合は40分程度、DevOpsの場合は20分程度 • デスクトップにロゴが表示されたら完了

28.

ハマるポイント • Az CLI のバージョン差異によるコマンド Syntax の変更 • 必須オプションが増えている、等 • Cloud Shell で az ad コマンドを実行するとエラーになる • Failed to connect to MSI. Please make sure MSI is configured correctly. Get Token request returned: <Response [400]> • おそらくバグです • (本来必要ないですが)明示的に az login してください • https://github.com/Azure/azurecli/issues/11749#issuecomment-570975762

29.

ハマりにくくする方法 • 展開先リージョンに East US を使用する • Azure Cloud Shell ではなく、手元の Az CLI を使用する • 検証専用の Azure Subscription を用意する • ユーザーアクセス管理者のロールを、サービスプリンシパルに付与する • 各種ロールについて、サブスクリプション スコープでサービスプリンシ パルに付与する • セキュリティの観点からは推奨されません! • Bastion は使わない • 設定完了時に壁紙が変更されるが、Bastion 経由だと認識しにくい • セキュリティの観点からは推奨されません!(2回目)

30.

コスト比較 • Full • East US • Japan East : 約 $3,015 : 約 $3,628 • ITPro • East US : 約 $1,754 • DevOps • East US : 約 $1,717

31.

コスト比較

32.

まとめ • ArcBox を使うとお手軽に PoC / デモ環境を作成 可能 • 新しい Flavor – DevOps • デプロイパラメーター myIpAddress は廃止 • グローバル IP アドレス経由で VM へ直接アクセス する場合は NSG 設定変更が必要 • Bastion を利用可能