Azure / terraform-azurerm-avm-res-compute-virtualmachine

Terraform AVM module for virtual machines
MIT License
17 stars 25 forks source link

[AVM Module Issue]: Using 'plan' variable for marketplace image still requires 'source_image_reference' to get a value. #62

Closed pieterjangoemandevoteam closed 5 months ago

pieterjangoemandevoteam commented 6 months ago

Check for previous/existing GitHub issues

Issue Type?

Bug

(Optional) Module Version

No response

(Optional) Correlation Id

No response

Description

I want to create a vm from an image from the marketplace. For doing this, I populated the name, product and publisher parameters of the plan object. Now I'm getting the error that the parameters for the source_image_reference object are not filled in, which is true. I've got the feeling that it should be the one or the other, and so in this case, the source_image_reference shouldn't be filled in. This happens both for a Windows vm ( noticed this one first as the OS_type parameter is default set on windows) as for a Linux vm.

jchancellor-ms commented 6 months ago

@pieterjangoemandevoteam - Generally I've seen that marketplace images require both the plan and source_image_reference for a successful install. As an example, I used this AVM module to deploy a Cisco 8000v virtual appliance marketplace image in another module here (https://github.com/Azure/terraform-azurerm-avm-res-network-routeserver/blob/main/examples/full/main.tf). If you can please provide which marketplace offering you're having issues with, I can try to produce a working sample using this AVM module.

pieterjangoemandevoteam commented 5 months ago

@pieterjangoemandevoteam - Generally I've seen that marketplace images require both the plan and source_image_reference for a successful install. As an example, I used this AVM module to deploy a Cisco 8000v virtual appliance marketplace image in another module here (https://github.com/Azure/terraform-azurerm-avm-res-network-routeserver/blob/main/examples/full/main.tf). If you can please provide which marketplace offering you're having issues with, I can try to produce a working sample using this AVM module.

HI,

I'm trying to use this one: OpenVPN Access Server

pieterjangoemandevoteam commented 5 months ago

@pieterjangoemandevoteam - Generally I've seen that marketplace images require both the plan and source_image_reference for a successful install. As an example, I used this AVM module to deploy a Cisco 8000v virtual appliance marketplace image in another module here (https://github.com/Azure/terraform-azurerm-avm-res-network-routeserver/blob/main/examples/full/main.tf). If you can please provide which marketplace offering you're having issues with, I can try to produce a working sample using this AVM module.

It does seem that you're right, but that doesn't make it logic :)

jchancellor-ms commented 5 months ago

@pieterjangoemandevoteam - I believe the image is about the build and the plan data is about the billing. I agree that it appears to be duplicated.

I was finally able to look at the openVpn template and here is the configuration you'll likely require for the two values.:

  source_image_reference = {
    publisher = "openvpn"
    offer     = "openvpnas"
    sku       = "openvpnas"
    version   = "latest"
  }

and

plan = {
  name      = "openvpnas"
  product   = "openvpnas"
  publisher = "openvpn"
}

I'll leave this open for a few more days for comments and then close it. If you determine this gets you the answer required feel free to close the issue or provide additional comments if not.

pieter-jangoeman commented 5 months ago

Hi, yes I got it working like this indeed, thanks for the explanation on why this is the case, feel free to close this issue!