管理 Azure 本地上的 Arc VM
适用于:Azure Local 2311.2 及更高版本
本文介绍如何管理 Azure 本地版本 23H2 上运行的 Arc 虚拟机(VM)。 详细介绍了启用来宾管理、启动、停止、重启、暂停、保存或删除 Arc VM 的过程。
先决条件
在开始之前,请确保满足以下先决条件:
请确保有权访问已部署和注册的 Azure 本地实例。 在部署期间,还会创建 Arc 资源桥和自定义位置。
转到 Azure 中的资源组。 可以看到为 Azure 本地创建的自定义位置和 Azure Arc 资源桥。 请记下订阅、资源组和自定义位置,稍后你会在本方案中使用这些信息。
请确保在 Azure 本地服务器上运行一个或多个 Arc VM。 有关详细信息,请参阅 在 Azure 本地创建 Arc VM。
启用来宾管理
创建 VM 后,需要在该 VM 上启用来宾管理。
在来宾管理(VM 来宾代理和 Azure Connected Machine 代理)上下文中,有两个代理非常重要。 通过Azure 门户或 Azure CLI 创建的每个 Arc VM 都使用来宾代理(也称为mocguestagent
该代理)对其进行预配。
在 Arc VM 上启用来宾管理时,来宾代理将安装 Azure Connected Machine 代理。 使用 Azure Connected Machine 代理可以在 VM 上管理 Azure Arc VM 扩展。
下面是预配 VM 后在 VM 上启用来宾管理的一些重要注意事项:
- 确保 Azure Local 正在运行 2311 或更高版本。
- Windows Server 2012 和 Windows Server 2012 R2 不支持在 VM 预配后启用来宾管理。
- 启用来宾管理的步骤因来宾代理是否在 Arc VM 上运行而有所不同。
验证来宾代理是否正在运行
若要验证来宾代理是否在 Arc VM 上运行,请连接到计算机。
运行下面的命令:
az stack-hci-vm show --name "<VM name>" --resource-group "<Resource group name>"
下面是一个示例输出片段,指示来宾代理正在运行。 在输出中
statuses
查找vmAgent
。"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" } }
来宾代理正在运行:
- 当
statuses
指示code
为ProvisioningState/succeeded
和displayStatus
asConnected
时。 - 如果运行旧版本,则
statuses
表示code
原样OK
和displayStatus
原样Active
- 当
如果状态与上述输出不匹配,请在来宾代理未运行时执行“启用来宾管理”中的步骤。
在运行来宾代理的 VM 上启用来宾管理
若要在运行来宾代理的 Arc VM 上启用来宾管理,请运行以下命令:
az stack-hci-vm update --name "mylocal-vm" --enable-agent true --resource-group "mylocal-rg"
通过将来宾enable-agent parameter
true
管理设置为 .. 来宾管理需要几分钟才能启用。
按照步骤验证是否在Azure 门户中启用了来宾管理。
在来宾代理未运行时在 VM 上启用来宾管理
来宾代理未运行时有两种情况 - 状态正在连接时和状态为空时。 以下各部分介绍了上述每个方案和相应的步骤。
显示为连接的状态
状态显示为“正在连接”。 下面是指示必要状态的示例输出代码片段。
"instanceView": {
"vmAgent": {
"statuses": [
{
"code": "ProvisioningState/InProgress",
"displayStatus": "Connecting",
"level": "Info",
"message": "Waiting for connection with mocguestagent",
"time": "2024-01-19T01:41:15Z"
}
]
}
},
来宾代理在以下情况下未运行:
- 当指示
statuses
为 ascode
和ProvisioningState/InProgress
asdisplayStatus
时Connecting
,来宾代理未运行。 - 如果运行较旧版本,则表示为 as 和
statuses
code
OK
as。displayStatus
Active
message
Successfully started HyperV listener
执行以下步骤:
使用特定于 OS 的步骤连接到 VM。 以管理员身份运行 PowerShell。
运行以下命令之一,以基于 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 的示例输出。
连接到其中一台计算机。 运行以下命令以启用来宾管理。
az stack-hci-vm update --name "mylocal-vm" --enable-agent true --resource-group "mylocal-rg"
按照步骤验证是否在Azure 门户中启用了来宾管理。
状态显示为 null
状态显示为 null。 这表示缺少来宾代理所需的 iso 。 下面是一个指示 null 状态的示例输出片段。
"instanceView": {
"vmAgent": {
"statuses": []
}
},
执行以下步骤:
连接到计算机。
运行下面的命令:
az stack-hci-vm update --name "<VM Name>" --resource-group "<Resource group name>" --enable-vm-config-agent true
该
enable-vm-config-agent
参数装载来宾代理所需的 iso 。等待几分钟,然后重新运行
az stack-hci-vm show
命令。 当状态显示为connecting
“状态”时,请按照状态中显示的 步骤进行连接。
验证是否在Azure 门户中启用了来宾管理
转到 Azure 门户。
导航到 Azure 本地 > 虚拟机 ,然后选择在其中启用来宾管理的 VM。
在 “概述 ”页的 右窗格中的“属性 ”选项卡上,转到 “配置”。 来宾管理应显示为“已启用”(已连接)。
查看 VM 属性
按照 Azure 本地Azure 门户中的这些步骤查看 VM 属性。
启动 VM
按照 Azure 本地Azure 门户中的这些步骤启动 VM。
转到 Azure 本地资源,然后转到 虚拟机。
在右窗格中,从虚拟机列表中选择未运行的 VM,并想要启动。
在 VM 的“概述”页上,从右窗格中的顶部命令栏中,选择“开始”,然后选择“是”。
验证 VM 是否已启动。
停止 VM
按照 Azure 本地Azure 门户中的以下步骤停止 VM。
转到 Azure 本地资源,然后转到 虚拟机。
在右窗格中,从虚拟机列表中选择正在运行的 VM,并想要停止。
在 VM 的“概述”页上,从右窗格中的顶部命令栏中,选择“停止”,然后选择“是”。
验证 VM 是否已停止。
重新启动 VM
按照 Azure 本地Azure 门户中的这些步骤重启 VM。
转到 Azure 本地资源,然后转到 虚拟机。
在右窗格中,从虚拟机列表中,选择一个已停止且要重启的 VM。
在 VM 的“概述”页上,从右窗格中的顶部命令栏中,选择“重启”,然后选择“是”。
验证 VM 是否已重启。
暂停 VM
暂停 VM 对于不使用 VM 时保存计算资源非常有用。 暂停 VM 会停止任何 CPU 活动。 只能暂停正在运行的 VM。 暂停后,可以稍后恢复 VM。
连接到系统上的计算机。
若要暂停 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
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。检查 VM 状态以验证 VM 是否已暂停。
#Check the VM status az stack-hci-vm show --name $vmName --resource-group $rg
启动 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。
连接到系统上的计算机。
若要保存 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
订阅的名称或 ID。 可以使用 az account set -s <Subscription name or Subscription ID>
配置默认订阅。检查 VM 状态以验证 VM 是否已保存。
#Check the VM status az stack-hci-vm show --name $vmName --resource-group $rg
启动 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" } }
更改本地帐户密码
按照以下步骤更改部署在 Azure 本地上的 Arc VM 的本地帐户密码。 Windows 和 Linux VM 的步骤不同。
登录到 Arc VM。
运行以下 PowerShell 命令:
# Define the username $username = "AccountName" # Prompt the user to enter the new password securely $newPassword = Read-Host -AsSecureString "Enter the new password for $username" # Prompt the user to re-enter the new password securely for verification $verifyPassword = Read-Host -AsSecureString "Re-enter the new password for verification" # Convert the secure strings to plain text for comparison $plainPassword = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($newPassword)) $plainVerifyPassword = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($verifyPassword)) # Check if the passwords match and change the password if they match. Fail if the passwords don’t match. if ($plainPassword -eq $plainVerifyPassword) { $account = [ADSI]"WinNT://./$username,user" $account.SetPassword($plainPassword) $account.SetInfo() Write-Host "Password for user $username has been reset successfully." -ForegroundColor Green } else { Write-Host "The passwords do not match. Please try again." -ForegroundColor Red }
删除 VM
按照 Azure 本地Azure 门户中的这些步骤删除 VM。
转到 Azure 本地资源,然后转到 虚拟机。
在右窗格中,从虚拟机列表中,选择要从系统中删除的 VM。
在 VM 的“概述”页上,从右窗格中的顶部命令栏中,选择“删除”,然后选择“是”。
现在系统会提示确认删除。 选择是。 验证 VM 是否已删除。
请注意,删除 VM 时,不会删除与 VM 关联的所有资源。 例如,不会删除与 VM 关联的数据磁盘或网络接口。 需要单独查找和删除这些资源。
现在可以转到部署此 VM 的资源组。 可以看到 VM 已从资源组中的资源列表中删除。 可能需要选择“显示隐藏类型”选项以查看与此 VM 关联的资源(未删除)。
找到关联的资源(如网络接口和数据磁盘),并删除它们。
已启用 Arc 的虚拟机的实时迁移
通过本地工具(例如 故障转移群集管理器 或 Windows Admin Center)支持跨 Azure 本地节点实时迁移 Arc VM。 不支持实时迁移 VM 存储。
更改核心和内存
按照 Azure 本地Azure 门户中的这些步骤更改核心和内存。
转到 Azure 本地资源,然后转到 虚拟机。
从右窗格中的 VM 列表中,选择并转到要修改其核心和内存的 VM。
在“设置”下,选择“大小” 。 编辑虚拟处理器计数或内存(MB),以更改 VM 的核心和内存大小。 只能更改内存大小。 创建 VM 后,无法更改内存类型。