Azure磁盘问题 [英] Azure Disk issue
问题描述
您好,
我正在尝试从VHD创建一个新磁盘,如下所示:
$ resourceGroupName ='myresource'
$ diskName ='mydisk'
$ vhdUri ='https://storage.blob.core.windows.net/container/file.vhd'
$ storageId ='/ subscriptions / ****************************** / resourceGroups / ResourceGroupname / providers / Microsoft。存储/存储帐户/存储'
$ location ='北欧'
$ storageType ='PremiumLRS'
$ diskConfig = New-AzureRmDiskConfig - AccountType $ storageType -Location $ location -CreateOption Import -SourceUri $ vhdUri -StorageAccountId $ storageId -DiskSizeGB 128
$ osDisk = New-AzureRmDisk -DiskName $ diskName -Disk $ diskConfig -ResourceGroupName $ resourceGroupName
在New-AzureRmDisk上我收到下一个审核错误
New-AzureRmDisk:客户端'*************'对象ID'************无权执行操作
'Microsoft.Compute / disks / write'over scope'/subscriptions/**************/resourceGroups/myresource/providers/Microsoft.Compute/disks/mydisk'.
ErrorCode:AuthorizationFailed
ErrorMessage:客户端'*****************',对象ID为'f ******** ***************'无权执行操作'Microsoft.Compute / disks / write'
over scope'/ subscriptions / **** ********* / resourceGroups / myresource /提供商/ Microsoft.Compute /磁盘/ mydisk"。
我已经检查了我的权限,但我是资源组的所有者,我对Microsoft / compute / disks有读/写权限!!! / p>
你能帮忙吗?
您好xsx123,
感谢您在此发布!
您可以使用以下powershell脚本从VHD创建托管磁盘。
#Install lastest azure powershell
Install-Module -Name Az -AllowClobber
Login-azaccount
#提供将在其中创建托管磁盘的订阅ID
subscriptionId ='yourSubscriptionId'
#提供将在其中创建托管磁盘的资源组的名称。 / blockquote>
resourceGroupName ='yourResourceGroupName'
#提供托管磁盘的名称
Hello,
I'm trying to create a new disk from VHD as below:
$resourceGroupName ='myresource'
$diskName = 'mydisk'
$vhdUri = 'https://storage.blob.core.windows.net/container/file.vhd'
$storageId = '/subscriptions/******************************/resourceGroups/ResourceGroupname/providers/Microsoft.Storage/storageAccounts/storage'
$location = 'North Europe'
$storageType = 'PremiumLRS'
$diskConfig = New-AzureRmDiskConfig -AccountType $storageType -Location $location -CreateOption Import -SourceUri $vhdUri -StorageAccountId $storageId -DiskSizeGB 128
$osDisk = New-AzureRmDisk -DiskName $diskName -Disk $diskConfig -ResourceGroupName $resourceGroupNameAt New-AzureRmDisk i'm getting the next audhorization error
New-AzureRmDisk : The client '*************' with object id '************ does not have authorization to perform action
'Microsoft.Compute/disks/write' over scope '/subscriptions/**************/resourceGroups/myresource/providers/Microsoft.Compute/disks/mydisk'.
ErrorCode: AuthorizationFailed
ErrorMessage: The client '*****************' with object id 'f***********************' does not have authorization to perform action 'Microsoft.Compute/disks/write'
over scope '/subscriptions/*************/resourceGroups/myresource/providers/Microsoft.Compute/disks/mydisk'.I have checked my permissions but i'm owner on the resource group, and i have read/write permission on Microsoft/compute/disks !!!
Could you help please ?
解决方案Hello xsx123,
Thanks for posting here!
You can use below powershell script to create managed disk from VHD.
#Install lastest azure powershell Install-Module -Name Az -AllowClobber Login-azaccount #Provide the subscription Id where Managed Disks will be created
subscriptionId = 'yourSubscriptionId' #Provide the name of your resource group where Managed Disks will be created.
resourceGroupName ='yourResourceGroupName' #Provide the name of the Managed Disk
这篇关于Azure磁盘问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!