将 Azure Stack HCI 连接到 AzureConnect Azure Stack HCI to Azure

适用于:Azure Stack HCI v20H2Applies to: Azure Stack HCI v20H2

根据 Azure 在线服务条款,Azure Stack HCI 作为 Azure 服务提供,需要在安装后 30 天内进行注册。Azure Stack HCI is delivered as an Azure service and needs to register within 30 days of installation per the Azure Online Services Terms. 本主题介绍如何向 Azure Arc 注册 Azure Stack HCI 群集,以实现监视、支持、计费和混合服务。This topic explains how to register your Azure Stack HCI cluster with Azure Arc for monitoring, support, billing, and hybrid services. 注册后,将创建一个 Azure 资源管理器资源来表示每个本地 Azure Stack HCI 群集,从而有效地将 Azure 管理平面扩展到 Azure Stack HCI。Upon registration, an Azure Resource Manager resource is created to represent each on-premises Azure Stack HCI cluster, effectively extending the Azure management plane to Azure Stack HCI. 信息会定期在 Azure 资源和本地群集之间进行同步。Information is periodically synced between the Azure resource and the on-premises cluster.

注册的先决条件Prerequisites for registration

在创建 Azure Stack HCI 群集之前,将无法向 Azure 注册。You won't be able to register with Azure until you've created an Azure Stack HCI cluster. 节点可以是物理计算机或虚拟机,但是它们必须具有统一可扩展固件接口 (UEFI),这意味着不能使用 Hyper-V 第 1 代虚拟机。The nodes can be physical machines or virtual machines, but they must have Unified Extensible Firmware Interface (UEFI), meaning you can't use Hyper-V Generation 1 virtual machines. Azure Arc 注册是 Azure Stack HCI 的本机功能,因此不需要代理。Azure Arc registration is a native capability of Azure Stack HCI, so there is no agent required.

Internet 访问权限Internet access

Azure Stack HCI 节点需要连接到云才能连接到 Azure。The Azure Stack HCI nodes need connectivity to the cloud in order to connect to Azure. 例如,出站 ping 应成功:For example, an outbound ping should succeed:

C:\> ping bing.com

Azure 订阅Azure subscription

如果还没有 Azure 帐户,请创建一个If you don't already have an Azure account, create one.

可以使用任何类型的现有订阅:You can use an existing subscription of any type:

  • 提前支付订阅Pay-in-advance subscription
  • 通过企业协议 (EA) 获取的订阅Subscription obtained through an Enterprise Agreement (EA)
  • 通过云解决方案提供商 (CSP) 计划获取的订阅Subscription obtained through the Cloud Solution Provider (CSP) program

Azure Active Directory 权限Azure Active Directory permissions

需要具有 Azure Active Directory 权限才能完成注册过程。You'll need Azure Active Directory permissions to complete the registration process. 如果还没有这些权限,请让 Azure AD 管理员向你授予或委托这些权限。If you don't already have them, ask your Azure AD administrator to grant permissions or delegate them to you. 有关详细信息,请参阅管理 Azure 注册See Manage Azure registration for more information.

使用 PowerShell 注册Register using PowerShell

使用以下过程在 Azure 中注册 Azure Stack HCI 群集:Use the following procedure to register an Azure Stack HCI cluster with Azure:

  1. 连接到群集节点之一,具体方式为打开 PowerShell 会话并输入以下命令:Connect to one of the cluster nodes by opening a PowerShell session and entering the following command:

    Enter-PSSession <server-name>
    
  2. 安装适用于 Azure Stack HCI 的 PowerShell 模块:Install the PowerShell Module for Azure Stack HCI:

    Install-WindowsFeature RSAT-Azure-Stack-HCI
    
  3. 安装所需的 cmdlet:Install the required cmdlets:

    Install-Module Az.StackHCI
    

    备注

    1. 你可能会看到一条提示,例如“是否希望 PowerShellGet 立即安装并导入 NuGet 提供程序?”,You may see a prompt such as "Do you want PowerShellGet to install and import the NuGet provider now?" 你应该回答“是(Y)”。to which you should answer Yes (Y).
    2. 系统可能还会提示“是否确定要从 'PSGallery' 安装模块?”,你应该回答“是(Y)”。You may further be prompted "Are you sure you want to install the modules from 'PSGallery'?" to which you should answer Yes (Y).
    3. 最后,你可能会假定安装整个 Az 模块将包括 StackHCI 子模块,但情况并非是这样 。Finally, you may assume that installing the entire Az module would include the StackHCI sub-module but that is not the case. 根据标准 Azure PowerShell 约定,不会自动包括预览版中的子模块,因此你需要显式请求 Az.StackHCI,如上所示。Sub-modules in Preview aren't included automatically according to the standard Azure PowerShell convention so you need to explicitly request for Az.StackHCI as shown above.
  4. 执行实际注册:Perform the actual registration:

    Register-AzStackHCI  -SubscriptionId "<subscription_ID>" [-ResourceName] [-ResourceGroupName]
    

    如果使用了此语法,则会以当前用户的身份在默认的 Azure 区域和云环境中使用 Azure 资源和资源组的智能默认名称注册本地群集(本地服务器是该群集的成员),不过你可以根据需要为此命令添加参数来指定这些值。This syntax registers the local cluster (of which the local server is a member), as the current user, with the default Azure region and cloud environment, and using smart default names for the Azure resource and resource group, but you can add parameters to this command to specify these values if you want.

    请记住,运行 Register-AzStackHCI cmdlet 的用户必须具有 Azure Active Directory 权限,否则注册过程将不会完成;相反,它将退出并使注册挂起以等待管理员同意。Remember that the user running the Register-AzStackHCI cmdlet must have Azure Active Directory permissions, or the registration process will not complete; instead, it will exit and leave the registration pending admin consent. 授权后,只需重新运行 Register-AzStackHCI 即可完成注册。Once permissions have been granted, simply re-run Register-AzStackHCI to complete registration.

  5. 使用 Azure 进行身份验证Authenticate with Azure

    若要完成注册过程,需要使用 Azure 帐户进行身份验证(登录)。To complete the registration process, you need to authenticate (sign in) using your Azure account. 帐户需要有权访问在上述第 4 步中指定的 Azure 订阅才能继续进行注册。Your account needs to have access to the Azure subscription that was specified in step 4 above in order for registration to proceed. 复制所提供的代码,在另一台设备(如电脑或手机)上导航到 microsoft.com/devicelogin,输入该代码,然后在那里登录。Copy the code provided, navigate to microsoft.com/devicelogin on another device (like your PC or phone), enter the code, and sign in there. 这与 Microsoft 用于输入方式受限的其他设备(例如 Xbox)的体验是相同的。This is the same experience Microsoft uses for other devices with limited input modalities, like Xbox.

注册工作流将检测到你的登录并继续完成注册。The registration workflow will detect when you've logged in and proceed to completion. 然后,你应该能够在 Azure 门户中看到你的群集。You should then be able to see your cluster in the Azure portal.

后续步骤Next steps

现在可以执行以下操作:You are now ready to: