#Register PSGallery as a trusted repo
Register-PSRepository -Default -InstallationPolicy Trusted
#Install Arc registration script from PSGallery
Install-Module AzsHCI.ARCinstaller
#Install required PowerShell modules in your node for registration
Install-Module Az.Accounts -Force
Install-Module Az.ConnectedMachine -Force
Install-Module Az.Resources -Force
설치의 샘플 출력은 다음과 같습니다.
PS C:\Users\SetupUser> Install-Module -Name AzSHCI.ARCInstaller
NuGet provider is required to continue
PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or
'C:\Users\SetupUser\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by
running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install
and import the NuGet provider now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): Y
PS C:\Users\SetupUser>
PS C:\Users\SetupUser> Install-Module Az.Accounts -Force
PS C:\Users\SetupUser> Install-Module Az.ConnectedMachine -Force
PS C:\Users\SetupUser> Install-Module Az.Resources -Force
매개 변수를 설정합니다. 스크립트는 다음 매개 변수를 사용합니다.
매개 변수
Description
SubscriptionID
Azure Arc에 서버를 등록하는 데 사용되는 구독의 ID입니다.
TenantID
Azure Arc에 서버를 등록하는 데 사용되는 테넌트 ID입니다. Microsoft Entra ID 이동하여 테넌트 ID 속성을 복사합니다.
ResourceGroup
서버의 Arc 등록을 위해 미리 생성된 리소스 그룹입니다. 리소스 그룹이 없는 경우 만들어집니다.
#Define the subscription where you want to register your server as Arc device
$Subscription = "YourSubscriptionID"
#Define the resource group where you want to register your server as Arc device
$RG = "YourResourceGroupName"
#Define the region you will use to register your server as Arc device
$Region = "eastus"
#Define the tenant you will use to register your server as Arc device
$Tenant = "YourTenantID"
Azure 계정에 연결하고 구독을 설정합니다. 서버에 연결하는 데 사용하는 클라이언트에서 브라우저를 열고 이 페이지를 https://microsoft.com/devicelogin 열어서 Azure CLI 출력에 제공된 코드를 입력하여 인증해야 합니다. 등록에 대한 액세스 토큰 및 계정 ID를 가져옵니다.
#Connect to your Azure account and Subscription
Connect-AzAccount -SubscriptionId $Subscription -TenantId $Tenant -DeviceCode
#Get the Access Token for the registration
$ARMtoken = (Get-AzAccessToken).Token
#Get the Account ID for the registration
$id = (Get-AzContext).Account.Id
구독 및 인증 설정의 샘플 출력은 다음과 같습니다.
PS C:\Users\SetupUser> Connect-AzAccount -SubscriptionId $Subscription -TenantId $Tenant -DeviceCode
WARNING: To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code A44KHK5B5
to authenticate.
Account SubscriptionName TenantId Environment
------- ---------------- -------- -----------
guspinto@contoso.com AzureStackHCI_Content <Tenant ID> AzureCloud
PS C:\Users\SetupUser> $ARMtoken = (Get-AzAccessToken).Token
PS C:\Users\SetupUser> $id = (Get-AzContext).Account.Id
마지막으로 Arc 등록 스크립트를 실행합니다. 이 스크립트를 실행하는 데 몇 분 정도 걸립니다.
#Invoke the registration script. Use a supported region.
Invoke-AzStackHciArcInitialization -SubscriptionID $Subscription -ResourceGroup $RG -TenantID $Tenant -Region $Region -Cloud "AzureCloud" -ArmAccessToken $ARMtoken -AccountID $id
프록시 서버를 통해 인터넷에 액세스하는 경우 매개 변수를 전달 -proxy 하고 스크립트를 실행할 때와 같이 http://<Proxy server FQDN or IP address>:Port 프록시 서버를 제공해야 합니다.
다음은 서버 등록 성공의 샘플 출력입니다.
PS C:\DeploymentPackage> Invoke-AzStackHciArcInitialization -SubscriptionID $Subscription -ResourceGroup $RG -TenantID $Tenant -Region $Region -Cloud "AzureCloud" -ArmAccessToken $ARMtoken -AccountID $id -Force
Installing and Running Azure Stack HCI Environment Checker
All the environment validation checks succeeded
Installing Hyper-V Management Tools
Starting AzStackHci ArcIntegration Initialization
Installing Azure Connected Machine Agent
Total Physical Memory: 588,419 MB
PowerShell version: 5.1.25398.469
.NET Framework version: 4.8.9032
Downloading agent package from https://aka.ms/AzureConnectedMachineAgent to C:\Users\AzureConnectedMachineAgent.msi
Installing agent package
Installation of azcmagent completed successfully
0
Connecting to Azure using ARM Access Token
Connected to Azure successfully
Microsoft.HybridCompute RP already registered, skipping registration
Microsoft.GuestConfiguration RP already registered, skipping registration
Microsoft.HybridConnectivity RP already registered, skipping registration
Microsoft.AzureStackHCI RP already registered, skipping registration
INFO Connecting machine to Azure... This might take a few minutes.
INFO Testing connectivity to endpoints that are needed to connect to Azure... This might take a few minutes.
20% [==> ]
30% [===> ]
INFO Creating resource in Azure...
Correlation ID=<Correlation ID>=/subscriptions/<Subscription ID>/resourceGroups/myashci-rg/providers/Microsoft.HybridCompute/machines/ms309
60% [========> ]
80% [===========> ]
100% [===============]
INFO Connected machine to Azure
INFO Machine overview page: https://portal.azure.com/
Connected Azure ARC agent successfully
Successfully got the content from IMDS endpoint
Successfully got Object Id for Arc Installation <Object ID>
$Checking if Azure Stack HCI Device Management Role is assigned already for SPN with Object ID: <Object ID>
Assigning Azure Stack HCI Device Management Role to Object : <Object ID>
$Successfully assigned Azure Stack HCI Device Management Role to Object Id <Object ID>
Successfully assigned permission Azure Stack HCI Device Management Service Role to create or update Edge Devices on the resource group
$Checking if Azure Connected Machine Resource Manager is assigned already for SPN with Object ID: <Object ID>
Assigning Azure Connected Machine Resource Manager to Object : <Object ID>
$Successfully assigned Azure Connected Machine Resource Manager to Object Id <Object ID>
Successfully assigned the Azure Connected Machine Resource Manager role on the resource group
$Checking if Reader is assigned already for SPN with Object ID: <Object ID>
Assigning Reader to Object : <Object ID>
$Successfully assigned Reader to Object Id <Object ID>
Successfully assigned the reader Resource Manager role on the resource group
Installing TelemetryAndDiagnostics Extension
Successfully triggered TelemetryAndDiagnostics Extension installation
Installing DeviceManagement Extension
Successfully triggered DeviceManagementExtension installation
Installing LcmController Extension
Successfully triggered LCMController Extension installation
Please verify that the extensions are successfully installed before continuing...
Log location: C:\Users\Administrator\.AzStackHci\AzStackHciEnvironmentChecker.log
Report location: C:\Users\Administrator\.AzStackHci\AzStackHciEnvironmentReport.json
Use -Passthru parameter to return results as a PSObject.
스크립트가 모든 서버에서 성공적으로 완료되면 다음을 확인합니다.
서버가 Arc에 등록됩니다. Azure Portal 이동한 다음 등록과 연결된 리소스 그룹으로 이동합니다. 서버는 지정된 리소스 그룹 내에 Machine - Azure Arc 형식 리소스로 표시됩니다.
필수 Azure Stack HCI 확장은 서버에 설치됩니다. 리소스 그룹에서 등록된 서버를 선택합니다. 확장으로 이동합니다. 필수 확장이 오른쪽 창에 표시됩니다.
배포에 필요한 권한 할당
이 섹션에서는 Azure Portal 배포에 대한 Azure 권한을 할당하는 방법을 설명합니다.
Azure Portal 서버를 등록하는 데 사용되는 구독으로 이동합니다. 왼쪽 창에서 액세스 제어(IAM) 를 선택합니다. 오른쪽 창에서 + 추가 를 선택하고 드롭다운 목록에서 역할 할당 추가를 선택합니다.
탭을 살펴보고 클러스터를 배포하는 사용자에게 다음 역할 권한을 할당합니다.
Azure Stack HCI 관리자
클라우드 애플리케이션 관리자
판독기
참고
서비스 주체를 만들려면 클라우드 애플리케이션 관리자 권한이 일시적으로 필요합니다. 배포 후 이 권한을 제거할 수 있습니다.
Azure Portal 구독에 서버를 등록하는 데 사용되는 리소스 그룹으로 이동합니다. 왼쪽 창에서 액세스 제어(IAM) 를 선택합니다. 오른쪽 창에서 + 추가 를 선택하고 드롭다운 목록에서 역할 할당 추가를 선택합니다.
탭을 살펴보고 클러스터를 배포하는 사용자에게 다음 권한을 할당합니다.
Key Vault 데이터 액세스 관리자: 배포에 사용되는 키 자격 증명 모음에 대한 데이터 평면 권한을 관리하려면 이 권한이 필요합니다.
Key Vault 비밀 책임자: 배포에 사용되는 키 자격 증명 모음에서 비밀을 읽고 쓰는 데 이 권한이 필요합니다.
Key Vault 기여자: 배포에 사용되는 키 자격 증명 모음을 만들려면 이 권한이 필요합니다.
스토리지 계정 기여자: 배포에 사용되는 스토리지 계정을 만들려면 이 권한이 필요합니다.
오른쪽 창에서 역할 할당으로 이동합니다. 배포 사용자에게 구성된 모든 역할이 있는지 확인합니다.
다음 단계
클러스터에서 첫 번째 서버를 설정한 후 Azure Portal 사용하여 배포할 준비가 된 것입니다.