Forum Discussion
Creating VM from automation script results in 'Provisioning failed...TargetDiskBlobAlreadyExists'
Hi Ronald,
This is due to the in storage account VM creating has the same name as the VMs VHD. I assume you have create a VM before and delete it but didnot delete the VHD. Go to the VM storage account click blob then go to the VHDS container then you will see the "OSDISK.vhd" Move it to another container if you want it or delete it. Re run the PS script.
Thanks
Hi Kasun, I'm not sure what you mean by this:
kasunsjc wrote:
This is due to the in storage account VM creating has the same name as the VMs VHD.
I deleted a test VM, without deleting the associated OS VHD. I connected the orphaned VHD as a data disk for a second VM, for troubleshooting purposes. After completing troubleshooting, I removed the data disk VHD from the second VM. I tried running deploy.ps1 from the automation script archive I had downloaded for the deleted VM. That's where I'm stuck. The VM is re-created, but in the failed state, TargetDiskBlobAlreadyExists.
I also tried deleting the failed VM--without deleting the VHD, creating a new storage account and container, and copying the orphaned VHD to the new storage account / container, as described in the post http://www.azurefieldnotes.com/2016/07/23/moving-vhds-from-one-storage-account-to-another-part-1/, on http://www.azurefieldnotes.com. Updating template.json for the new storage account / container and copied VHD, and running deploy.ps1 produces the same result. The VM is re-created in the failed state, TargetDiskBlobAlreadyExists.
Thank you,
--
Ron