-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy Azure VM from custom image fail #13932
Comments
the same behaviour |
So as far as I can tell the Azure API itself just does not support this behavior at the moment. I was experimenting with some workarounds, like creating an explicit managed disk with an import of a vhd and then attaching that as the os disk, but then the Azure API complains that you can't specify anything for |
Also, are you able to accomplish this through the Azure portal? Or powershell? Or any other means outside of terraform? Those examples would be very helpful. Might be a piece of the API I'm not familiar with that we could use. |
Ok, I think I figured it out. There is an |
PR #13960 has been opened with a proposed fix. @bollicino @kevit @dobrerazvan if you could take a build off my branch and try out your use cases, that would be much appreciated. With the changes, the example given in this issue would become:
|
actually I found out a workaround for myself
|
@brandontosch thanks, I do testing. @kevit I will try your hack, haven't tried that solution. |
If you're trying to accomplish this without managed disks then couldn't you just use the |
Hi @brandontosch , When working on a workaround for issue #13985 , I encountered this bug. I built your branch and it fixes the problem for me (with managed disks). Many thanks. |
Hi @brandontosch, just a heads up that Microsoft put up a new Azure ARM Template docu page a few weeks ago if you aren't already aware: Here is the direct link to the Microsoft.Compute part: |
Beautiful @tobiaswi, thanks! |
@bollicino @brandontosch Works as designed. I was able to create a new vm image and spin up a vm with managed disk as os disk. Just be aware that at image creation the vhd must be stored on a non encrypted storage account. |
Hi, storage_image_reference { Terraform is throwing an error that storage_image_reference.0.offer , storage_image_reference.0.publisher ,storage_image_reference.0.sku are not set. Any workarounds for this |
@meher1993 you need to create a virtual machine image first. Id doesn't work with a vhd: https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource. |
@dobrerazvan Can't believe I missed that step. So, I have created an image and specified the id , still facing the same error, that the required fields are not set in the storage_image_reference. I am giving it like this storage_image_reference { |
@meher1993 I have something like and is working.
Make sure you use the terraform binary build from the branch. |
@dobrerazvan Thats interesting, I am specifying it the same way. |
@erikvdbergh @dobrerazvan I wasn't able to build from the branch you pointed to. Whenever I try "make" it fails with errors. Can you point me to your successful build for darwin-amd64 ? |
@dobrerazvan thanks. Works as expected |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
Terraform v0.9.3
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
None
Expected Behavior
terraform apply
failActual Behavior
terraform apply
no deploy the VM from an Azure Custom ImageSteps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids
None
References
None
The text was updated successfully, but these errors were encountered: