You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Terraform Version and Provider Version
Terraform v1.5.4
on linux_amd64
provider registry.terraform.io/oracle/oci v5.45.0
Affected Resource(s)
oci_core_instance
Terraform Configuration Files
# Copy-paste your Terraform configurations here - for large Terraform configs,# please use a service like Dropbox and share a link to the ZIP file. # Please remove any sensitive information from configuration files before sharing them. resource"oci_core_instance""vm" {
for_each=var.vm-infoavailability_domain=var.availability_domain_namecompartment_id=var.compute_compartment_ociddisplay_name=each.value.vm_display_nameshape=each.value.vm_compute_shapefault_domain=data.oci_identity_fault_domains.fds.fault_domains[each.value.fault_domain-1].namefreeform_tags=each.value.freeform_tagsdynamic"shape_config" {
for_each=reverse(split(".", each.value.vm_compute_shape))[0] =="Flex"? [each.value.vm_flex_shape_params] : []
content {
ocpus=shape_config.value.ocpumemory_in_gbs=shape_config.value.memory
}
}
create_vnic_details {
subnet_id=each.value.subnet_iddisplay_name=format("%s-%s", each.value.vm_display_name, "nic1")
assign_public_ip=each.value.assign_public_iphostname_label=lower(each.value.hostname_label)
private_ip=each.value.private_ipfreeform_tags=each.value.freeform_tagsnsg_ids=each.value.nsg_ids
}
source_details {
source_type="image"source_id=local.image_info[each.key].listing-resource-idboot_volume_size_in_gbs=each.value.boot_volume_size
}
metadata={
ssh_authorized_keys = each.value.ssh_public_key
user_data =try(base64encode(templatefile("${path.root}${each.value.user_data_file}", each.value.user_data_vars)), null)
}
timeouts {
create="60m"
}
lifecycle {
ignore_changes=[
metadata
]
}
}
Debug Output
Panic Output
Expected Behavior
When changing the "source_id" under "source_details" from a windows OS OCID to a linux OS OCID, instance should be destroyed and recreated.
Actual Behavior
When changing the "source_id" under "source_details" from a windows OS OCID to a linux OS OCID, terraform plan shows the action was "in-place" update. Then terraform apply failed.
Steps to Reproduce
create a windows vm using the oci_core_instance
update the source_id under "source_details" from a Windows OS OCID to a linux OS OCID
The problem seems to be related to this commit: f0edc48 - it seems that they wanted to support in-place replacement of the boot volume, but seem to have also broken without any bypass, image replacement.
Community Note
Terraform Version and Provider Version
Terraform v1.5.4
on linux_amd64
Affected Resource(s)
oci_core_instance
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
When changing the "source_id" under "source_details" from a windows OS OCID to a linux OS OCID, instance should be destroyed and recreated.
Actual Behavior
When changing the "source_id" under "source_details" from a windows OS OCID to a linux OS OCID, terraform plan shows the action was "in-place" update. Then terraform apply failed.
Steps to Reproduce
Error:
│ Error: 400-InvalidParameter, sourceDetails.kmsKeyId size must be between 1 and 255
│ Suggestion: Please update the parameter(s) in the Terraform config as per error message sourceDetails.kmsKeyId size must be between 1 and 255
│ Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_instance
│ API Reference: https://docs.oracle.com/iaas/api/#/en/iaas/20160918/Instance/UpdateInstance
│ Request Target: PUT https://iaas.ca-toronto-1.oraclecloud.com/20160918/instances/ocid1.instance.oc1.ca-toronto-1.an2g6ljr5xeuumqcftjnlo53qhjmj5itl32cjkh6dp2qakiz3g3gbi37y4ca
│ Provider version: 5.45.0, released on 2024-06-05.
│ Service: Core Instance
│ Operation Name: UpdateInstance
│ OPC request ID: 48eb77dc5e532530893008576ae02dd3/FA9861117E6117B45EFD917A903E3B9F/F3040076B4090E60147B679A97AAE6A6
│ with module.vms_toronto.oci_core_instance.vm["GcDs-PSPC-Spoke1-hr2paypoc-p1-db-vm1"],
│ on .terraform/modules/vms_toronto/main.tf line 103, in resource "oci_core_instance" "vm":
│ 103: resource "oci_core_instance" "vm" {
Important Factoids
References
The text was updated successfully, but these errors were encountered: