Open mpjtaylor opened 1 year ago
Seems I found the some help here : https://github.com/hashicorp/terraform-provider-azurerm/pull/3598 az disk show -g rg -n disk --query creationData
Set "sourceResourceId": "/subscriptions/xx/resourceGroups/AzureBackupRG_northeurope_1/providers/Microsoft.Compute/restorePointCollections/AzureBackup_xxx/restoreP oints/AzureBackup_20230606_034345/disks/vm_osdisk?id=5f2418b2-643e-43cb-8299-47ba47871050" Changing property 'dataDisk.managedDisk.id' is not allowed.", "target": "dataDisk.managedDisk.id
But what Id am i mean to use ?
can someone provide a restore example as i cannot get this to work at all !
@mpjtaylor the disk created by the Restore option is a new disk, thus you are not able to update the managed disk resource. Instead, you would need to use a new azurerm_managed_disk
resource and import the new disk.
returning to this as I still have an issue with azurerm_windows_virtual_machine or azurerm_linux_virtual_machine and OS Disks, should i raise this as a new feature request the ability to change the create_option from Empty to Restore and specify source_resource_id
I also have an issue with this resource. The error I get is complaining that the source_resource_id
is not in the format of subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/restorePointCollections/{restorePointCollectionName}/restorePoints/{restorePointName}/disks/{sourceDiskName}?id={restorePointId}
However I don't believe this format is in use any more as either PS command Get-AzRecoveryServicesBackupRecoveryPoint
or Azure CLI command az backup recoverypoint list
both come back with a recovery point ID of something like "8562018518480576656" or longer ID format but that also doesn't match the format required.
Is it simply out of date and needs updating in the resource?
Is there an existing issue for this?
Community Note
Terraform Version
1.4.4
AzureRM Provider Version
3.5.8
Affected Resource(s)/Data Source(s)
azurerm_managed_disk
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Deploy a disk using a snapshot with create option copy and source_resource_id of the snapshot backup the disk azure recovery services vault restore the disk using azure recovery services vault this gives the VM new disks with new names Re-Deploy the disk using the Restore option and setting the source_resource_id to the id of the recovered disk.
Actual Behaviour
Error applying, is this possible? how can Restore option be used..
Steps to Reproduce
terraform apply Deploy a disk using a snapshot with create option copy and source_resource_id of the snapshot
Important Factoids
No response
References
(https://github.com/hashicorp/terraform-provider-azurerm/pull/3598)