oracle-terraform-modules / terraform-oci-compute-instance

Terraform Module for creating Oracle Cloud Infrastructure compute instances
https://registry.terraform.io/modules/oracle-terraform-modules/compute-instance/oci/latest
Other
46 stars 62 forks source link

Add support for "launch_options" block for VM shape performance and compatibility #109

Open silent-at-gh opened 1 year ago

silent-at-gh commented 1 year ago

Community Note

Description

New or Affected Resource(s)

Problem statement As of now oracle-terraform-modules/compute-instance/oci module doesn't support specification of launch_options.

Although launch_options block is optional for oci_core_instance resource in my use cases it is a kind of "must". In particular I'm working with an existing customized images and have to explicitly propagate network_type=PARAVIRTUALIZED upon instance creation otherwise OCI automatically chooses VFIO and so instance can't be booted (the boot process just ends up in the dracut emergency console).

Thus it would be useful (in the cases like mine it is absolutely necessary) to extend module with e.g instance_launch_options variable (optional) that would be used (if specified) as a source for launch_options block of underlying oci_core_instance resource.

Potential Terraform Configuration

module "instance" {
  source  = "oracle-terraform-modules/compute-instance/oci"
  version = "2.4.1"
  ...
  instance_launch_options = { 
    "network_type": "PARAVIRTUALIZED" 
  }
  ...
}

The example above just covers my use case. However complete usage example might look like below:

...
module "instance" {
  source  = "oracle-terraform-modules/compute-instance/oci"
  version = "2.4.1"
  ...
  instance_launch_options = {
    boot_volume_type                    = "ISCSI"
    firmware                            = "UEFI_64"
    network_type                        = "PARAVIRTUALIZED"
    remote_data_volume_type             = "VFIO"
    is_consistent_volume_naming_enabled = false
    is_pv_encryption_in_transit_enabled = false
  }
  ...
}

NB: I'd also like to work on the requested enhancement. Will submit a pull-request shortly.

References

jameskoo87 commented 1 month ago

@silent-at-gh hello, I was also looking for this feature, was wondering if this will be worked on or not, thanks