共用方式為


管理 Azure Stack HCI 上的 Arc VM

適用於:Azure Stack HCI 版本 23H2

本文說明如何管理在 Azure Stack HCI 版本 23H2 上執行的 Arc 虛擬機(VM)。 如需啟用來賓管理、啟動、停止、重新啟動、暫停、儲存或刪除Arc VM的程序詳述。

必要條件

開始之前,請確定已符合下列先決條件:

  1. 請確定您可以存取已部署和註冊的 Azure Stack HCI 叢集。 在部署期間,也會建立Arc資源網橋和自定義位置。

    移至 Azure 中的資源群組。 您可以看到針對 Azure Stack HCI 叢集所建立的自定義位置和 Azure Arc 資源網橋。 記下您稍後在此案例中使用的訂用帳戶、資源群組和自定義位置。

  2. 請確定您有一或多個 Arc VM 在此 Azure Stack HCI 叢集上執行。 如需詳細資訊,請參閱 在 Azure Stack HCI 上建立 Arc VM。

啟用客體管理

建立 VM 之後,您會想要在該 VM 上啟用來賓管理。

在客體管理的內容中,有兩個代理程式很重要,也就是 VM 客體代理程式和 Azure 連線機器代理程式。 透過 Azure 入口網站 或 Azure CLI 建立的每個 Arc VM 都會以客體代理程式佈建(也稱為 mocguestagent的 )。

當您在 Arc VM 上啟用客體管理時,客體代理程式會 安裝 Azure 連線機器代理程式。 Azure Connected Machine 代理程式可讓您管理 Azure Stack HCI VM 上的 Azure Arc VM 擴充功能。

根據客體代理程式是否在您的Arc VM上執行,啟用客體管理的步驟不同。

重要

請確定您的 Azure Stack HCI 叢集正在執行 2311 或更新版本,以執行此程式。

確認客體代理程式是否正在執行

  1. 若要確認客體代理程式是否在 Arc VM 上執行,請連線到 Azure Stack HCI 伺服器。

  2. 執行以下命令:

    az stack-hci-vm show --name "<VM name>" --resource-group "<Resource group name>"
    

    以下是範例輸出的代碼段,指出客體代理程式正在執行。 在輸出的 下方vmAgent尋找 statuses

    "instanceView": {
      "vmAgent": {
        "statuses": [
          {
            "code": "ProvisioningState/succeeded",
            "displayStatus": "Connected",
            "level": "Info",
            "message": "Successfully established connection with mocguestagent",
            "time": "2024-01-13T00:57:39Z"
          },
          {
            "code": "ProvisioningState/succeeded",
            "displayStatus": "Connected",
            "level": "Info",
            "message": "New mocguestagent version detected 'v0.13.0-3-gd13b4794",
            "time": "2024-01-13T00:57:39Z"
          }
        ],
        "vmConfigAgentVersion": "v0.13.0-3-gd13b4794"
      }
    }
    

    客體代理程式正在執行:

    • 當表示 codeProvisioningState/succeededdisplayStatus Connectedstatuses
    • 如果執行舊版,則 statuses 表示 codeOKdisplayStatusActive

如果您的狀態不符合上述輸出,請遵循在客體代理程式未執行時啟用來賓管理中的步驟。

在執行客體代理程式的 VM 上啟用來賓管理

若要在執行客體代理程式的 Arc VM 上啟用客體管理,請執行下列命令:

az stack-hci-vm update --name "myhci-vm" --enable-agent true --resource-group "myhci-rg"

將 設定 enable-agent parametertrue,以啟用來賓管理。 來賓管理應該需要幾分鐘的時間才能啟用。

請遵循步驟,確認已在 Azure 入口網站 中啟用來賓管理。

在客體代理程式未執行時,在 VM 上啟用客體管理

客體代理程式未執行時有兩種情況 - 當狀態正在連線,以及狀態為空白時。 下列各節將說明上述每個案例和對應的步驟。

顯示為連線的狀態

您的狀態會顯示為連線。 以下是指出必要狀態的範例輸出代碼段。

"instanceView": {
      "vmAgent": {
        "statuses": [
          {
            "code": "ProvisioningState/InProgress",
            "displayStatus": "Connecting",
            "level": "Info",
            "message": "Waiting for connection with mocguestagent",
            "time": "2024-01-19T01:41:15Z"
          }
        ]
      }
    },

客體代理程式未在下列情況下執行:

  • 當 以 和表示 ConnectingcodedisplayStatus ProvisioningState/InProgress 為時statuses,客體代理程式未執行。
  • 如果執行舊版,會statusescode OKdisplayStatusActivemessage 表示為 Successfully started HyperV listener

執行下列步驟:

  1. 使用OS特定步驟連線到VM。 以系統管理員身分執行 PowerShell。

  2. 執行下列其中一個命令,以根據您的 OS 類型在您的 VM 上啟用客體代理程式:

    Linux:

    sudo -- sh -c 'mkdir /mociso && mount -L mocguestagentprov /mociso && bash /mociso/install.sh && umount /mociso && rm -df /mociso && eject LABEL=mocguestagentprov'
    

    Windows:

    $d=Get-Volume -FileSystemLabel mocguestagentprov;$p=Join-Path ($d.DriveLetter+':\') 'install.ps1';powershell $p
    

    以下是顯示客體代理程式已成功安裝的Linux VM範例輸出。

    此螢幕快照顯示 VM 上已成功啟用客體代理程式。

  3. 線上到其中一部 Azure Stack HCI 伺服器。 執行下列命令以啟用來賓管理。

    az stack-hci-vm update --name "myhci-vm" --enable-agent true --resource-group "myhci-rg"
    

請遵循步驟,確認已在 Azure 入口網站 中啟用來賓管理。

顯示為 null 的狀態

您的狀態會顯示為 null。 這表示客體代理程式缺少必要的 iso 。 以下是指出 Null 狀態的範例輸出代碼段。

"instanceView": {
      "vmAgent": {
        "statuses": []
      }
    },

執行下列步驟:

  1. 連線到 Azure Stack HCI 伺服器。

  2. 執行以下命令:

    az stack-hci-vm update --name "<VM Name>" --resource-group "<Resource group name>" --enable-vm-config-agent true
    

    參數 enable-vm-config-agent 會掛接客體代理程式所需的 iso

  3. 請稍候幾分鐘,然後重新執行 az stack-hci-vm show 命令。 當狀態顯示為 connecting時,請遵循 [狀態] 中顯示為 [連線] 中的步驟。

確認已在 Azure 入口網站 中啟用來賓管理

  1. 前往 Azure 入口網站。

  2. 流覽至 您的 Azure Stack HCI 叢集 > 虛擬機 ,然後選取您啟用客體管理的 VM。

  3. 在 [概 觀] 頁面上,於 右窗格中的 [屬性] 索引卷標上,移至 [ 組態]。 來賓管理應該會顯示為 [已啟用] [已連線]。

    顯示如何使用 Windows VM 映像建立 VM 的螢幕快照。

檢視 VM 屬性

請遵循 Azure Stack HCI 系統 Azure 入口網站 中的下列步驟來檢視 VM 屬性。

  1. 移至 Azure Stack HCI 叢集資源,然後移至 [虛擬機]。

  2. 在右窗格中,從虛擬機清單中,選取您想要檢視其屬性的 VM 名稱。

    從 VM 清單中選取的 VM 螢幕快照。

  3. 在 [概 觀] 頁面上,移至右窗格,然後移至 [ 屬性 ] 索引標籤。您可以檢視 VM 的屬性。

    所選Arc VM屬性的螢幕快照。

開始 VM

請遵循 Azure Stack HCI 系統 Azure 入口網站 中的下列步驟來啟動 VM。

  1. 移至 Azure Stack HCI 叢集資源,然後移至 [虛擬機]。

  2. 在右窗格中,從虛擬機清單中,選取未執行且您想要啟動的 VM。

  3. 在 VM 的 [ 概觀 ] 頁面上,從右窗格中的頂端命令行選取 [ 開始],然後選取 [ ]。

  4. 確認 VM 已啟動。

    選取 [+ 啟動 VM] 的螢幕快照。

停止 VM

請遵循 Azure Stack HCI 系統 Azure 入口網站 中的這些步驟來停止 VM。

  1. 移至 Azure Stack HCI 叢集資源,然後移至 [虛擬機]。

  2. 在右窗格中,從虛擬機清單中,選取正在執行的 VM,而且您想要停止。

  3. 在 VM 的 [ 概觀 ] 頁面上,從右窗格中頂端命令行選取 [ 停止],然後選取 [ ]。

  4. 確認 VM 已停止。

    選取 [+ 停止 VM] 的螢幕快照。

重新啟動 VM

請遵循 Azure Stack HCI 系統 Azure 入口網站 中的下列步驟,重新啟動 VM。

  1. 移至 Azure Stack HCI 叢集資源,然後移至 [虛擬機]。

  2. 在右窗格中,從虛擬機清單中,選取已停止且您想要重新啟動的 VM。

  3. 在 VM 的 [ 概觀 ] 頁面上,從右窗格中頂端命令行選取 [重新啟動],然後選取 [ ]。

  4. 確認 VM 已重新啟動。

    選取 [+ 重新啟動 VM] 的螢幕快照。

暫停 VM

當您不使用 VM 時,暫停 VM 有助於儲存計算資源。 暫停 VM 會停止任何 CPU 活動。 您只能暫停執行中的 VM。 暫停之後,您可以稍後繼續 VM。

  1. 聯機到 Azure Stack HCI 系統的伺服器節點。

  2. 若要暫停 VM,請執行下列 PowerShell Cmdlet:

    #Set input parameters
    
    $rg = "<Resource group name>"
    $vmName = "<VM name>"
    
    #Pause the VM
    
    az stack-hci-vm pause --name $vmName --resource-group $rg
    

    此 Cmdlet 所使用的參數如下所示:

    參數 描述
    name 虛擬機器的名稱。
    resource-group 資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。
    subscription 訂用帳戶的名稱或識別碼。 您可以使用 az account set -s NAME_OR_ID 設定預設訂用帳戶。
  3. 檢查 VM 狀態以確認 VM 已暫停。

    #Check the VM status
    
    az stack-hci-vm show --name $vmName --resource-group $rg
    
  4. 啟動 VM 以從暫停狀態繼續 VM。 確認 VM 正在執行中。

    #Start the VM
    
    az stack-hci-vm start --name $vmName --resource-group $rg
    

    範例輸出

    展開本節以查看範例輸出。
    
    #Set parameters
    
    [v-host1]: PS C:\Users\HCIDeploymentUser> $rg = "<Resource group name>"    
    [v-host1]: PS C:\Users\HCIDeploymentUser> $vmName = "<VM name>"
    
    #Pause the VM
    
    [v-host1]: PS C:\Users\HCIDeploymentUser> az stack-hci-vm pause --name $vmName --resource-group $rg
    
    #Show the current state of the VM
    [v-host1]: PS C:\Users\HCIDeploymentUser> az stack-hci-vm show -g $rg --name $vmName
    {
      "attestationStatus": null,
      "virtualmachineinstance": {
        "extendedLocation": {
          "name": "/subscriptions/<Subscription ID>/resourcegroups/<Resource group name>/providers/Microsoft.ExtendedLocation/customLocations/s-cluster-customlocation",
          "type": "CustomLocation"
        },
        "id": "/subscriptions/<Subscription ID>/resourceGroups/<Resource group name>/providers/Microsoft.HybridCompute/machines/testvm001/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default",
        "identity": null,
        "name": "default",
        "properties": {
          "guestAgentInstallStatus": null,
          "hardwareProfile": {
            "dynamicMemoryConfig": {
              "maximumMemoryMb": null,
              "minimumMemoryMb": null,
              "targetMemoryBuffer": null
            },
            "memoryMb": 2000,
            "processors": 2,
            "vmSize": "Custom"
          },
          "httpProxyConfig": null,
          "instanceView": {
            "vmAgent": {
              "statuses": [
                {
                  "code": "ProvisioningState/succeeded",
                  "displayStatus": "Connected",
                  "level": "Info",
                  "message": "Connection with mocguestagent was successfully reestablished",
                  "time": "2024-06-24T16:30:05+00:00"
                },
              ],
              "vmConfigAgentVersion": "v0.18.0-4-gd54376b0"
            }
          },
          "networkProfile": {
            "networkInterfaces": []
          },
          "osProfile": {
            "adminPassword": null,
            "adminUsername": "azureuser",
            "computerName": "testvm001",
            "linuxConfiguration": {
              "disablePasswordAuthentication": false,
              "provisionVmAgent": false,
              "provisionVmConfigAgent": true,
              "ssh": {
                "publicKeys": null
              }
            },
            "windowsConfiguration": {
              "enableAutomaticUpdates": null,
              "provisionVmAgent": false,
              "provisionVmConfigAgent": true,
              "ssh": {
                "publicKeys": null
              },
              "timeZone": null
            }
          },
          "provisioningState": "Succeeded",
          "resourceUid": null,
          "securityProfile": {
            "enableTpm": false,
            "securityType": null,
            "uefiSettings": {
              "secureBootEnabled": true
            }
          },
          "status": {
            "errorCode": "",
            "errorMessage": "",
            "powerState": "Paused",
            "provisioningStatus": null
          },
          "storageProfile": {
            "dataDisks": [],
            "imageReference": {
              "id": "/subscriptions/<Subscription ID>/resourceGroups/<Resource group name>/providers/Microsoft.AzureStackHCI/galleryImages/WinImage-26tdJUIS",
              "resourceGroup": "<Resource group name>"
            },
            "osDisk": {
              "id": null,
              "osType": "Windows"
            },
            "vmConfigStoragePathId": "/subscriptions/<Subscription ID>/resourceGroups/<Resource group name>/providers/Microsoft.AzureStackHCI/storageContainers/UserStorage2-guid"
          },
          "vmId": "<guid>"
        },
        "resourceGroup": "<Resource group name>",
        "systemData": {
          "createdAt": "2024-06-24T01:29:06.594266+00:00",
          "createdBy": "7d6ffe2f-dac5-4e74-9bf2-4830cf7f4668",
          "createdByType": "Application",
          "lastModifiedAt": "2024-06-24T16:41:27.166668+00:00",
          "lastModifiedBy": "319f651f-7ddb-4fc6-9857-7aef9250bd05",
          "lastModifiedByType": "Application"
        },
        "type": "microsoft.azurestackhci/virtualmachineinstances"
      }
    }
    
    #Start the VM after it was paused. 
    
    [v-host1]: PS C:\Users\HCIDeploymentUser> az stack-hci-vm start --name $vmName --resource-group $rg
    Inside _start_initial/subscriptions/<Subscription ID>/resourceGroups/<Resource group name>/providers/Microsoft.HybridCompute/machines/testvm0012024-02-01-preview/https://management.azure.com/subscriptions/<Subscription ID>/resourceGroups/<Resource group name>/providers/Microsoft.HybridCompute/machines/testvm001/providers/Microsoft.AzureStackHCI/virtualMachineInstances/d
    efault/start?api-version=2024-02-01-preview
    
    #Show the current state of the VM. The VM should be running.
    
    [v-host1]: PS C:\Users\HCIDeploymentUser> az stack-hci-vm show -g $rg --name $vmName
    {
      "attestationStatus": null,
      "virtualmachineinstance": {
        "extendedLocation": {
          "name": "/subscriptions/<Subscription ID>/resourcegroups/<Resource group name>/providers/Microsoft.ExtendedLocation/customLocations/s-cluster-customlocation",
          "type": "CustomLocation"
        },
        "id": "/subscriptions/<Subscription ID>/resourceGroups/<Resource group name>/providers/Microsoft.HybridCompute/machines/testvm001/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default",
        "identity": null,
        "name": "default",
        "properties": {
          "guestAgentInstallStatus": null,
          "hardwareProfile": {
            "dynamicMemoryConfig": {
              "maximumMemoryMb": null,
              "minimumMemoryMb": null,
              "targetMemoryBuffer": null
            },
            "memoryMb": 2000,
            "processors": 2,
            "vmSize": "Custom"
          },
          "httpProxyConfig": null,
          "instanceView": {
            "vmAgent": {
              "statuses": [
                {
                  "code": "ProvisioningState/succeeded",
                  "displayStatus": "Connected",
                  "level": "Info",
                  "message": "Connection with mocguestagent was succesfully reestablished",
                  "time": "2024-06-24T17:25:19+00:00"
                }
              ],
              "vmConfigAgentVersion": "v0.18.0-4-gd54376b0"
            }
          },
          "networkProfile": {
            "networkInterfaces": []
          },
          "osProfile": {
            "adminPassword": null,
            "adminUsername": "azureuser",
            "computerName": "testvm001",
            "linuxConfiguration": {
              "disablePasswordAuthentication": false,
              "provisionVmAgent": false,
              "provisionVmConfigAgent": true,
              "ssh": {
                "publicKeys": null
              }
            },
            "windowsConfiguration": {
              "enableAutomaticUpdates": null,
              "provisionVmAgent": false,
              "provisionVmConfigAgent": true,
              "ssh": {
                "publicKeys": null
              },
              "timeZone": null
            }
          },
          "provisioningState": "Succeeded",
          "resourceUid": null,
          "securityProfile": {
            "enableTpm": false,
            "securityType": null,
            "uefiSettings": {
              "secureBootEnabled": true
            }
          },
          "status": {
            "errorCode": "",
            "errorMessage": "",
            "powerState": "Running",
            "provisioningStatus": null
          },
          "storageProfile": {
            "dataDisks": [],
            "imageReference": {
              "id": "/subscriptions/<Subscription ID>/resourceGroups/<Resource group name>/providers/Microsoft.AzureStackHCI/galleryImages/WinImage-26tdJUIS",
              "resourceGroup": "<Resource group name>"
            },
            "osDisk": {
              "id": null,
              "osType": "Windows"
            },
            "vmConfigStoragePathId": "/subscriptions/<Subscription ID>/resourceGroups/<Resource group name>/providers/Microsoft.AzureStackHCI/storageContainers/UserStorage2-guid"
          },
          "vmId": "<guid>"
        },
        "resourceGroup": "<Resource group name>",
        "systemData": {
          "createdAt": "2024-06-24T01:29:06.594266+00:00",
          "createdBy": "<guid>",
          "createdByType": "Application",
          "lastModifiedAt": "2024-06-24T17:28:13.206935+00:00",
          "lastModifiedBy": "<guid>",
          "lastModifiedByType": "Application"
        },
        "type": "microsoft.azurestackhci/virtualmachineinstances"
      }
    }
    
    

儲存 VM

儲存 VM 會將 VM 的目前狀態儲存至磁碟,並停止 VM。 儲存 VM 可釋放記憶體和 CPU 資源。 您只能儲存執行中的 VM。

  1. 聯機到 Azure Stack HCI 系統的伺服器節點。

  2. 若要儲存 VM,請執行下列 PowerShell Cmdlet:

    #Set input parameters
    
    $rg = "<Resource group name>"
    $vmName = "<VM name>"
    
    #Save the VM
    
    az stack-hci-vm save --name $vmName --resource-group $rg
    

    此 Cmdlet 所使用的參數如下所示:

    參數 描述
    name 虛擬機器的名稱。
    resource-group 資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。
    subscription 訂用帳戶的名稱或識別碼。 您可以使用 az account set -s <Subscription name or Subscription ID> 設定預設訂用帳戶。
  3. 檢查 VM 狀態以確認 VM 是否已儲存。

    #Check the VM status
    
    az stack-hci-vm show --name $vmName --resource-group $rg
    
  4. 啟動 VM 以從儲存的狀態繼續 VM。 確認 VM 正在執行中。

    #Start the VM
    
    az stack-hci-vm start --name $vmName --resource-group $rg
    

    範例輸出

    展開本節以查看範例輸出。
    #Set parameters
    
    [v-host1]: PS C:\Users\HCIDeploymentUser> $rg = "<Resource group name>"    
    [v-host1]: PS C:\Users\HCIDeploymentUser> $vmName = "<VM name>"
    
    #Save the VM
    
    [v-host1]: PS C:\Users\HCIDeploymentUser> az stack-hci-vm save --name $vmName --resource-group $rg
    
    #Show the current state of the VM
    
    [v-host1]: PS C:\Users\HCIDeploymentUser> az stack-hci-vm show -g $rg --name $vmName
    {
      "attestationStatus": null,
      "virtualmachineinstance": {
        "extendedLocation": {
          "name": "/subscriptions/<Subscription ID>/resourcegroups/<Resource group name>/providers/Microsoft.ExtendedLocation/customLocations/s-cluster-customlocation",
          "type": "CustomLocation"
        },
        "id": "/subscriptions/<Subscription ID>/resourceGroups/<Resource group name>/providers/Microsoft.HybridCompute/machines/testvm001/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default",
        "identity": null,
        "name": "default",
        "properties": {
          "guestAgentInstallStatus": null,
          "hardwareProfile": {
            "dynamicMemoryConfig": {
              "maximumMemoryMb": null,
              "minimumMemoryMb": null,
              "targetMemoryBuffer": null
            },
            "memoryMb": 2000,
            "processors": 2,
            "vmSize": "Custom"
          },
          "httpProxyConfig": null,
          "instanceView": {
            "vmAgent": {
              "statuses": [
                {
                  "code": "ProvisioningState/succeeded",
                  "displayStatus": "Connected",
                  "level": "Info",
                  "message": "Connection with mocguestagent was succesfully reestablished",
                  "time": "2024-06-24T17:25:19+00:00"
                },
              ],
              "vmConfigAgentVersion": "v0.18.0-4-gd54376b0"
            }
          },
          "networkProfile": {
            "networkInterfaces": []
          },
          "osProfile": {
            "adminPassword": null,
            "adminUsername": "azureuser",
            "computerName": "testvm001",
            "linuxConfiguration": {
              "disablePasswordAuthentication": false,
              "provisionVmAgent": false,
              "provisionVmConfigAgent": true,
              "ssh": {
                "publicKeys": null
              }
            },
            "windowsConfiguration": {
              "enableAutomaticUpdates": null,
              "provisionVmAgent": false,
              "provisionVmConfigAgent": true,
              "ssh": {
                "publicKeys": null
              },
              "timeZone": null
            }
          },
          "provisioningState": "Succeeded",
          "resourceUid": null,
          "securityProfile": {
            "enableTpm": false,
            "securityType": null,
            "uefiSettings": {
              "secureBootEnabled": true
            }
          },
          "status": {
            "errorCode": "",
            "errorMessage": "",
            "powerState": "Saved",
            "provisioningStatus": null
          },
          "storageProfile": {
            "dataDisks": [],
            "imageReference": {
              "id": "/subscriptions/<Subscription ID>/resourceGroups/<Resource group name>/providers/Microsoft.AzureStackHCI/galleryImages/WinImage-26tdJUIS",
              "resourceGroup": "<Resource group name>"
            },
            "osDisk": {
              "id": null,
              "osType": "Windows"
            },
            "vmConfigStoragePathId": "/subscriptions/<Subscription ID>/resourceGroups/<Resource group name>/providers/Microsoft.AzureStackHCI/storageContainers/UserStorage2-345d968fa1e74e99a9509ab7f3d259fd"
          },
          "vmId": "<guid>"
        },
        "resourceGroup": "<Resource group name>",
        "systemData": {
          "createdAt": "2024-06-24T01:29:06.594266+00:00",
          "createdBy": "<guid>",
          "createdByType": "Application",
          "lastModifiedAt": "2024-06-24T18:29:02.794305+00:00",
          "lastModifiedBy": "<guid>",
          "lastModifiedByType": "Application"
        },
        "type": "microsoft.azurestackhci/virtualmachineinstances"
      }
    }
    
    #Start the VM after it was saved
    
    [v-host1]: PS C:\Users\HCIDeploymentUser> az stack-hci-vm start --name $vmName --resource-group $rg
    Inside _start_initial/subscriptions/<Subscription ID>/resourceGroups/<Resource group name>/providers/Microsoft.HybridCompute/machines/testvm0012024-02-01-previewhttps://management.azure.com/subscriptions/<Subscription ID>/resourceGroups/<Resource group name>/providers/Microsoft.HybridCompute/machines/testvm001/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/start?api-version=2024-02-01-preview
    
    #Show the current state of the VM. The VM should be running.
    
    [v-host1]: PS C:\Users\HCIDeploymentUser> az stack-hci-vm show -g $rg --name $vmName
    {
      "attestationStatus": null,
      "virtualmachineinstance": {
        "extendedLocation": {
          "name": "/subscriptions/<Subscription ID>/resourcegroups/<Resource group name>/providers/Microsoft.ExtendedLocation/customLocations/s-cluster-customlocation",
          "type": "CustomLocation"
        },
        "id": "/subscriptions/<Subscription ID>/resourceGroups/<Resource group name>/providers/Microsoft.HybridCompute/machines/testvm001/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default",
        "identity": null,
        "name": "default",
        "properties": {
          "guestAgentInstallStatus": null,
          "hardwareProfile": {
            "dynamicMemoryConfig": {
              "maximumMemoryMb": null,
              "minimumMemoryMb": null,
              "targetMemoryBuffer": null
            },
            "memoryMb": 2000,
            "processors": 2,
            "vmSize": "Custom"
          },
          "httpProxyConfig": null,
          "instanceView": {
            "vmAgent": {
              "statuses": [
                {
                  "code": "ProvisioningState/succeeded",
                  "displayStatus": "Connected",
                  "level": "Info",
                  "message": "Connection with mocguestagent was succesfully reestablished",
                  "time": "2024-06-24T18:32:41+00:00"
                }
              ],
              "vmConfigAgentVersion": "v0.18.0-4-gd54376b0"
            }
          },
          "networkProfile": {
            "networkInterfaces": []
          },
          "osProfile": {
            "adminPassword": null,
            "adminUsername": "azureuser",
            "computerName": "testvm001",
            "linuxConfiguration": {
              "disablePasswordAuthentication": false,
              "provisionVmAgent": false,
              "provisionVmConfigAgent": true,
              "ssh": {
                "publicKeys": null
              }
            },
            "windowsConfiguration": {
              "enableAutomaticUpdates": null,
              "provisionVmAgent": false,
              "provisionVmConfigAgent": true,
              "ssh": {
                "publicKeys": null
              },
              "timeZone": null
            }
          },
          "provisioningState": "Succeeded",
          "resourceUid": null,
          "securityProfile": {
            "enableTpm": false,
            "securityType": null,
            "uefiSettings": {
              "secureBootEnabled": true
            }
          },
          "status": {
            "errorCode": "",
            "errorMessage": "",
            "powerState": "Running",
            "provisioningStatus": null
          },
          "storageProfile": {
            "dataDisks": [],
            "imageReference": {
              "id": "/subscriptions/<Subscription ID>/resourceGroups/<Resource group name>/providers/Microsoft.AzureStackHCI/galleryImages/WinImage-26tdJUIS",
              "resourceGroup": "<Resource group name>"
            },
            "osDisk": {
              "id": null,
              "osType": "Windows"
            },
            "vmConfigStoragePathId": "/subscriptions/<Subscription ID>/resourceGroups/<Resource group name>/providers/Microsoft.AzureStackHCI/storageContainers/UserStorage2-guid"
          },
          "vmId": "<guid>"
        },
        "resourceGroup": "<Resource group name>",
        "systemData": {
          "createdAt": "2024-06-24T01:29:06.594266+00:00",
          "createdBy": "<guid>",
          "createdByType": "Application",
          "lastModifiedAt": "2024-06-24T18:35:18.206280+00:00",
          "lastModifiedBy": "<guid>",
          "lastModifiedByType": "Application"
        },
        "type": "microsoft.azurestackhci/virtualmachineinstances"
      }
    }
    

刪除 VM

請遵循 Azure Stack HCI 系統 Azure 入口網站 中的下列步驟來移除 VM。

  1. 移至 Azure Stack HCI 叢集資源,然後移至 [虛擬機]。

  2. 在右窗格中,從虛擬機清單中,選取您想要從系統移除的 VM。

  3. 在 VM 的 [ 概觀 ] 頁面上,從右窗格中頂端命令行選取 [ 刪除],然後選取 [ ]。

    現在系統會提示您確認刪除。 選取 [是]。 確認 VM 已移除。

    請注意,刪除 VM 時,不會刪除與 VM 相關聯的所有資源。 例如,不會刪除與 VM 相關聯的數據磁碟或網路介面。 您必須分別找出和刪除這些資源。

    刪除 VM 時警告的螢幕快照。

  4. 您現在可以移至部署此 VM 的資源群組。 您可以看到 VM 已從資源群組中的資源清單中移除。 您可能需要選取 [顯示隱藏類型] 選項,以檢視未刪除此 VM 相關聯的資源。

    與虛擬機相關聯的隱藏類型資源的螢幕快照。

找出相關聯的資源,例如網路介面和數據磁碟,並加以刪除。

變更核心和記憶體

請遵循 Azure Stack HCI 系統 Azure 入口網站 中的下列步驟來變更核心和記憶體。

  1. 移至您的 Azure Stack HCI 叢集資源,然後移至 [虛擬機]。

  2. 從右窗格中的 VM 清單中,選取並移至您要修改其核心和記憶體的 VM。

  3. 在 [設定] 下方,選取 [大小]。 編輯虛擬處理器計數記憶體 (MB) 以變更 VM 的核心和記憶體大小。 只能變更記憶體大小。 建立 VM 之後,就無法變更記憶體類型。

    VM 的 [大小] 頁面螢幕快照。

下一步