gpt4 book ai didi

azure - 添加-AzureRmVhd : Resource group 'ResourceGroupName' could not be found

转载 作者:行者123 更新时间:2023-12-03 06:14:13 24 4
gpt4 key购买 nike

我尝试在虚拟机中通过PowerShell导入 VHD,但出现错误。

Add-AzureRmVhd : Resource group 'ResourceGroupName' could not be found.
At line:1 char:1
+ Add-AzureRmVhd -ResourceGroupName ResourceGroupName -destination
"https ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Add-AzureRmVhd], CloudException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.StorageServices.AddAzureVhdCommand

这些是我正在遵循的步骤:

  1. 安装模块 AzureRM -AllowClobber
  2. 连接-AzureRmAccount
  3. Add-AzureRmVhd -ResourceGroupName VMWinServerFtH -destination "https://vhdexternal.blob.core.windows.net/oldvhd/test.vhd"-LocalFilePath "C:\Users\administrador\Desktop\disk.vhd “

enter image description here

我已经验证了资源组名称的拼写是否正确。

最佳答案

Note that: AzureRM PowerShell modules will be depreacted on 29 February 2024. Refer this MsDoc.

我已从磁盘下载 VHD 文件。要在虚拟机中通过 PowerShell 导入 VHD,请检查以下解决方法。

Install-Module -Name az.compute -RequiredVersion 5.2.0
Get-Module

enter image description here

现在要将 VHD 文件从本地文件导入到存储帐户,您可以使用以下命令:

Add-AzVhd命令将本地虚拟硬盘上传到托管磁盘或 Blob 存储帐户。

Add-AzVhd -ResourceGroupName -<YourRGName> -Destination "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\WinImage.vhd"

enter image description here

在门户中确认:

enter image description here

关于azure - 添加-AzureRmVhd : Resource group 'ResourceGroupName' could not be found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76435699/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com