虚拟主机管理器和 Azure

您可以使用虚拟主机管理器 (VHM) 收集 Microsoft Azure 中的实例。

VHM 允许 SUSE Multi-Linux Manager 获取并报告有关您的虚拟机的信息。有关 VHM 的详细信息,请参见 虚拟主机管理器

1. 先决条件

要让您创建的 VHM 访问 Azure VM,需要为其指派正确的权限。

请以订阅管理员身份登录您的 Azure 帐户,并确保该 Azure 用户帐户和应用程序在正确的组中。应用程序所在的组决定了应用程序所拥有的角色,因而决定了其拥有的权限。

2. 创建 Azure VHM

虚拟主机管理器 (VHM) 在 SUSE Multi-Linux Manager 服务器上运行。

Ensure you have installed the virtual-host-gatherer-libcloud package on the SUSE Multi-Linux Manager Server.

过程:创建 Azure VHM
  1. 在 SUSE Multi-Linux Manager Web UI 中,导航到系统  虚拟主机管理器

  2. Click Create and select Azure from the drop-down menu.

  3. In the Add an Azure Virtual Host Manager section, use these parameters:

    • In the Label field, type a custom name for your VHM.

    • In the Subscription ID field, type the subscription ID found in Azure portal > Services > Subscriptions page.

    • In the Application ID field, type the application ID that you collected when you registered the application.

    • In the Tenant ID field, type the tenant ID provided by Azure that you collected when you registered the application.

    • In the Secret Key field, type the secret key associated with the Azure instance.

    • In the Zone field, type the zone your VM is located in. For example, for West Europe, enter westeurope. 要使订阅匹配功能正常工作,就必须提供此信息。

  4. 单击 创建 保存更改并创建 VHM。

  5. On the Virtual Host Managers page, select the new VHM.

  6. On the Properties page, click Refresh Data to inventory the new VHM.

要查看已清点的对象和资源,请导航到系统  系统列表  虚拟系统

3. 指派权限

If the permissions are not set correctly, you might receive an error like this when you run virtual-host-gatherer:

一般错误:[AuthorizationFailed] 对象 ID 为 'object_ID' 的客户端 'client_name' 无权在 '/subscriptions/not-very-secret-subscription-id' 范围执行操作 'Microsoft.Compute/virtualMachines/read',或该范围无效。如果访问权限是最近授予的,请刷新您的身份凭证。

要确定正确的身份凭证,请在 SUSE Multi-Linux Manager 服务器上的提示符处运行以下命令:

virtual-host-gatherer -i input_azure.json -o out_azure.json -vvv

The input_azure.json file should contain this information:

[
    {
        "id": "azure_vhm",
        "module": "Azure",
        "subscription_id": "subscription-id",
        "application_id": "application-id",
        "tenant_id": "tenant-id",
        "secret_key": "secret-key",
        "zone": "zone"
    }
]

4. Azure UUID

在 Azure 公有云上运行的实例会向 SUSE Multi-Linux Manager 服务器报告如下 UUID:

13f56399-bd52-4150-9748-7190aae1ff21