Skip to content

fix: set instance_options at launch time for IMDSv2 support - #84

Merged
justintsteele merged 2 commits into
stephenpearson:masterfrom
warisshaikh1:fix-imdsv2-at-launch
Mar 3, 2026
Merged

fix: set instance_options at launch time for IMDSv2 support#84
justintsteele merged 2 commits into
stephenpearson:masterfrom
warisshaikh1:fix-imdsv2-at-launch

Conversation

@warisshaikh1

Copy link
Copy Markdown
Contributor

OCI security policies can deny instance creation when areLegacyEndpointsDisabled='false' at launch time. The current implementation sets instance_options via update_instance AFTER launch, which fails when such policies are in place.

This change adds launch_instance_options to ComputeLaunchDetails to set instance_options in LaunchInstanceDetails, ensuring IMDSv2 is enabled from instance creation.

OCI security policies can deny instance creation when
areLegacyEndpointsDisabled='false' at launch time. The current
implementation sets instance_options via update_instance AFTER
launch, which fails when such policies are in place.

This change adds launch_instance_options to ComputeLaunchDetails
to set instance_options in LaunchInstanceDetails, ensuring IMDSv2
is enabled from instance creation.
@justintsteele

Copy link
Copy Markdown
Collaborator

This feature was originally coded this way, but I switched to the current implementation because some older images would not launch with this instance option set. Setting it after creation was a backward compatibility compromise.

Thank you for this submission. I will review it and test it again. Maybe things have changed on the oci side since the last time I looked at it that will make it less of a breaking change.

Aligns test expectations with the IMDSv2 launch-time fix by adding
instance_options to launch_instance_request and launch_instance_from_bv_request.
@warisshaikh1

Copy link
Copy Markdown
Contributor Author

Added test fix to align expectations with the IMDSv2 launch-time change. The launch_instance_request and launch_instance_from_bv_request now include instance_options with are_legacy_imds_endpoints_disabled: true to match the updated implementation.

@justintsteele

Copy link
Copy Markdown
Collaborator

i have confirmed that the the issue with older images persists and am trying to see if there is a reasonable workaround or documentable new fork we can send users down.

@justintsteele

Copy link
Copy Markdown
Collaborator

@warisshaikh1 - thank you for your contribution! i agree that this is the right way forward for the plugin. i am going to follow up this PR with one of my own that enables a bit of a softer landing for the legacy issues i have described in this conversation.

@justintsteele
justintsteele merged commit 9ddfded into stephenpearson:master Mar 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants