-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable MP Resources from NSX 9.0.0 onwards #1384
Conversation
/test-all |
nsxt/provider.go
Outdated
@@ -1090,6 +1090,12 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) { | |||
return nil, err | |||
} | |||
|
|||
initNSXVersion(getPolicyConnector(clients)) | |||
if util.NsxVersionHigherOrEqual("9.0.0") { | |||
// Disable MP client from 9.0.0 onwards |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine for now, but ideally we should not invoke configureNsxtClient
when NSX is 9.0.0 and above.
This would require us to rewrite the session create API which is currently handle fired from inside configureNsxtClient
. We should do this regardless, because it paves the way of removing the old SDK when the time comes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this code. I will handle the change in session create API with a new commit in this PR or a new PR
Food for thought: imagine a user has MP resources in their state, and they upgrade to 9.0.0. They understand that those are no longer supported and try to delete them from the config and apply. With current PR, apply will fail on delete. |
9311b93
to
c33dba4
Compare
All MP resources should now fail on create, delete or import, and do a no-op on read and update. |
This change disables deperecate NSX MP resources and data sources when NSX manager version is higher or equal to 9.0.0 For MP resources, with NSX >= 9.0.0: - terraform apply and import operations will fail with an error like the following one: "MP resource <name> was deprecated and has been removed in NSX 9.0.0"; - terraform plan and delete operations for MP resources already in the state will not be impacted as read and delete operations are no-op when the NSX version is 9.0.0 or higher. This will allow users to easily remove these resources from the terraform state; - all terraform operations involving MP data sources will fail with the error above; - terraform plan operations for resource not yet in the Terraform state will succeed, but will then fail at the apply stage. This because Terraform won't perform a read from the backend if the resource is not present at all in the state. Signed-off-by: Salvatore Orlando <[email protected]>
c33dba4
to
607d90c
Compare
/test-all |
This change removes support for NSX MP API client when the NSX manager version is higher or equal to 9.0.0
For MP resources, with NSX >= 9.0.0: