Azure Stack HCI の Azure 登録解除

1 minute read

Azure Stack HCI のライセンスは、1 物理コア に対して US$10 が月額課金されます。登録し続けている限り課金が発生しますので、不要になった Azure Stack HCI は登録を解除し、リソースを削除する必要があります。

Azure Stack HCI の登録解除は Azure CLI か Azure Powershell から実施可能です。今回は Azure Powershell から試してみます。

Azure Stack HCI の登録状況確認

Azure Stack HCI の登録状況は Windows Admin Center や Powershell から確認ができます。

WAC から確認する場合は、クラスターマネージャーのダッシュボードから確認できます。

また、Powershell で確認する場合は、下記のコマンドを実行します。

Get-AzureStackHCI

Azure Stack HCI の登録解除

Azure Powershell をインストールします。

if ($PSVersionTable.PSEdition -eq 'Desktop' -and (Get-Module -Name AzureRM -ListAvailable)) {
    Write-Warning -Message ('Az module not installed. Having both the AzureRM and ' +
      'Az modules installed at the same time is not supported.')
} else {
    Install-Module -Name Az -AllowClobber -Scope CurrentUser
}

Az.StackHCI モジュールのインストール

Install-Module -Name Az.StackHCI

Azure に接続

Powershell から Azure に接続します。

Connect-AzAccount

登録解除コマンドの実行

WAC などの管理サーバーからリモートで AZSHCI ノードの登録削除コマンドを実行します。

Unregister-AzStackHCI -SubscriptionId 12345678-abcd-1234-abcd-1234567890 -ResourceName azshcicl -ResourceGroupName AZSHCI-RG -ComputerName azshci01

コマンドの実行結果が下記の用に表示されれば登録削除が完了です。

Result Details
Success Azure Stack HCI is successfully unregistered. The Azure resource representing Azure Stack HCI has been deleted. Azure Stack HCI can’t sync with Azure until you…

登録解除されたことを確認します。

icm -ComputerName azshci01 -ScriptBlock { get-azurestackhci }

WAC から確認もできます。

まとめ

Azure Stack HCI を Azure に登録することで、Azure 経由でライセンスを支払いでき便利ですが、利用終了後は登録の削除を忘れずに実施して、無駄な課金を発生させないように気を付けたいですね。