Skip to content
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

Add support to create VM from image gallery #463

Closed
3 tasks
hriaz opened this issue May 25, 2021 · 5 comments
Closed
3 tasks

Add support to create VM from image gallery #463

hriaz opened this issue May 25, 2021 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@hriaz
Copy link
Contributor

hriaz commented May 25, 2021

REF: #4

As part of level 3 solution deployment, we have the ability to create a shared image gallery. I am unable to find any documentation or reference on how to deploy a virtual machine from a shared image gallery. We need to support deploying a virtual machine from a shared image gallery published with the following configurations:

  • Shared Image gallery in the same subscription as the virtual machine
  • Shared Image gallery in a different subscription but same tenant as the virtual machine
  • Shared Image gallery in a different tenant and subscription
@arnaudlh
Copy link
Member

hi @hriaz have you looked there?

source_image_id = try(each.value.custom_image_id, var.custom_image_ids[each.value.lz_key][each.value.custom_image_key].id, null)

So I look at this code, when you specify custom_image_id you should be able to create it.

As I'm looking at the shared image gallery module, we dont have the right output there: custom_image_ids, so it will require a bit of updating.

@arnaudlh arnaudlh added the bug Something isn't working label May 28, 2021
@hriaz
Copy link
Contributor Author

hriaz commented May 28, 2021

Hi @arnaudlh When trying to use custom_image_id and source_image_reference is removed, it throws an error of expected value of "Error: "source_image_reference.0.version": required field is not set". When prepending custom_image_id and still leaving source_image_reference value, the machine is not deployed using the approved image in the shared image gallary.

@arnaudlh arnaudlh self-assigned this Jun 3, 2021
@arnaudlh arnaudlh added this to To do in Milestone 2106 via automation Jun 3, 2021
@arnaudlh
Copy link
Member

arnaudlh commented Jun 3, 2021

OK will have a deeper look @hriaz

@hriaz
Copy link
Contributor Author

hriaz commented Jun 4, 2021

@arnaudlh Thanks for looking into this. I can confirm this worked for windows and Linux. This works in the latest modules after some tweaking.

@hriaz hriaz closed this as completed Jun 4, 2021
Milestone 2106 automation moved this from To do to Done Jun 4, 2021
@hmpargi
Copy link

hmpargi commented Sep 5, 2022

hi @hriaz have you looked there?

source_image_id = try(each.value.custom_image_id, var.custom_image_ids[each.value.lz_key][each.value.custom_image_key].id, null)

So I look at this code, when you specify custom_image_id you should be able to create it.

As I'm looking at the shared image gallery module, we dont have the right output there: custom_image_ids, so it will require a bit of updating.

well custom_image_id doesnt work with vmss. its in same subscription image gallery, same region, different resource group but connected through peering. please can you check this #1334

BerendvW pushed a commit to VolkerWessels/terraform-azurerm-caf that referenced this issue Jun 21, 2023
…riable

Enabling feature block for purge_soft_delete_on_destroy, recover_soft_deleted_key_vaults
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Development

No branches or pull requests

3 participants