L3out OSPF Interface Profile auth limitation #179
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There is existing limitation on both APIC and REST API for OSPF auth key value:
<error code="1" text="Invalid Configuration OSPF md5 Authentication key size limited to 16 Characters"/>
<error code="1" text="Invalid Configuration OSPF Authentication key size limited to 8 Characters"/>
This limitation is not mentioned in our ACI documentation, nor apic-mim-ref-api. However, OSPF RFC uses 16 bytes md5 authKey, so I think the limitation comes from there.
We do not have this validation on terraform side - this allows user to input long password for:
If OSPF auth key is not valid and in case of updating OSPF parameters, then error occurs leading into uncanny behavior/infinite loop where terraform for each "terraform apply" tries to configure object with "success" that generates an error in debug log without configuring any of ospfIfP parameters on ACI fabric.
authKey is added into rest call (via terraform) if authKey or InterfacePolicy are provided. If authKey is wrong, it leads to REST failure and no update is happening together for other parameters with authKey like authKeyId, InterfacePolicyName and authType.
Also worth to mention since lifecycle limitation exists, once user missconfigures authKey then user locks itself from modyfing OSPF values until authKey is removed from tfstate -> thus raising this PR
If auth Type is simple max char is 8, if md5/none max char is 16
Behavior for aci releases is slightly different but it's not relevenat:
-aci 4.x (object do not exist on the apic) terraform fails to create OSPF interface profile with authKey that is too long
-aci 4.x (objects exists on APIC) allows to update OSPF interface profile with authKey that is too long, but in principle it doesn't make sense, it shouldn't be allowed
-aci 5.x and 6.x do not allow too long authKey - neither creation(terraform error) neither update (REST failure in debug).
There is also 2nd blind spot not addressed in this PR:
Since we create resource when authKey is defined or OSPF interface Policy is defined we have a blind spot case when we don't provide auth_key and we have auth_type md5 or simple:
In such a case authKey is default (empty), which leads to ospfIfP call fail and only OSPF policy is updated as this is part of another API call. Terraform will reply with successful result and will try endlessly update auth_key, auth_type, auth_key_id and ospf_interface_profile_name without success.
However this behavior is not consistent when running terraform against ACI 4.x and 5.x:
-aci 5.x and 6.x do not allow empty authKey -> new validation rule on APIC "Invalid Configuration OSPF Authentication key cannot be empty" which is raised in terraform debug
-aci 4.x allows to modify and create OSPF interface profile with empty authKey -> thus no fix in this PR. Maybe its something to fix after ACI 4.x EoL?