Add-AzureRmVhd:找不到资源组 ‘ResourceGroupName’

huangapple go评论72阅读模式
英文:

Add-AzureRmVhd : Resource group 'ResourceGroupName' could not be found

问题

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

Add-AzureRmVhd: 找不到资源组 'ResourceGroupName'。
在第 1 行的位置:1

  • Add-AzureRmVhd -ResourceGroupName ResourceGroupName -destination
  • CategoryInfo : CloseError: (:) [Add-AzureRmVhd], CloudException
  • FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.StorageServices.AddAzureVhdCommand

以下是我正在执行的步骤:

  1. Install-Module AzureRM -AllowClobber
  2. Connect-AzureRmAccount
  3. Add-AzureRmVhd -ResourceGroupName VMWinServerFtH -destination "https://vhdexternal.blob.core.windows.net/oldvhd/test.vhd" -LocalFilePath "C:\Users\administrador\Desktop\disk.vhd"

Add-AzureRmVhd:找不到资源组 ‘ResourceGroupName’

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

英文:

I'm trying to import VHD via PowerShell in a Virtual Machine but am getting errors.

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

These are the steps I am following:

  1. Install-Module AzureRM -AllowClobber
  2. Connect-AzureRmAccount
  3. Add-AzureRmVhd -ResourceGroupName VMWinServerFtH -destination "https://vhdexternal.blob.core.windows.net/oldvhd/test.vhd" -LocalFilePath "C:\Users\administrador\Desktop\disk.vhd"

Add-AzureRmVhd:找不到资源组 ‘ResourceGroupName’

I've already verified the correct spelling of the resource group name.

答案1

得分: 1

注意:AzureRM PowerShell 模块将于2024年2月29日停用。请参阅此MsDoc

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

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

Add-AzureRmVhd:找不到资源组 ‘ResourceGroupName’

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

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

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

Add-AzureRmVhd:找不到资源组 ‘ResourceGroupName’

在门户中确认:

Add-AzureRmVhd:找不到资源组 ‘ResourceGroupName’

英文:

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

I have download VHD file from disk. To import VHD via PowerShell in a Virtual Machine check the below workaround.

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

Add-AzureRmVhd:找不到资源组 ‘ResourceGroupName’

Now to import VHD file from local file to storage account you can make use of below commands:

The Add-AzVhd command uploads an on-premises virtual hard disk to a managed disk or a blob storage account.

Add-AzVhd -ResourceGroupName -&lt;YourRGName&gt; -Destination &quot;http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd&quot; -LocalFilePath &quot;C:\vhd\WinImage.vhd&quot;

Add-AzureRmVhd:找不到资源组 ‘ResourceGroupName’

To confirm in portal:

Add-AzureRmVhd:找不到资源组 ‘ResourceGroupName’

huangapple
  • 本文由 发表于 2023年6月9日 05:07:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/76435699.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定