英文:
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
以下是我正在执行的步骤:
- Install-Module AzureRM -AllowClobber
- Connect-AzureRmAccount
Add-AzureRmVhd -ResourceGroupName VMWinServerFtH -destination "https://vhdexternal.blob.core.windows.net/oldvhd/test.vhd" -LocalFilePath "C:\Users\administrador\Desktop\disk.vhd"
我已经验证了资源组名称的拼写是否正确。
英文:
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:
- Install-Module AzureRM -AllowClobber
- Connect-AzureRmAccount
Add-AzureRmVhd -ResourceGroupName VMWinServerFtH -destination "https://vhdexternal.blob.core.windows.net/oldvhd/test.vhd" -LocalFilePath "C:\Users\administrador\Desktop\disk.vhd"
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
现在,要将本地文件中的VHD文件导入到存储帐户,您可以使用以下命令:
Add-AzVhd命令将本地虚拟硬盘上传到托管磁盘或Blob存储帐户。
Add-AzVhd -ResourceGroupName -<YourRGName> -Destination "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\WinImage.vhd"
在门户中确认:
英文:
> 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
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 -<YourRGName> -Destination "http://contosoaccount.blob.core.windows.net/vhdstore/win7baseimage.vhd" -LocalFilePath "C:\vhd\WinImage.vhd"
To confirm in portal:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论