Skip to content
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

Unable to modify a VM with learned IP address (DHCP) fails with "IP address with type 'LEARNED' not allowed" #97

Closed
chandru-tkc opened this issue Mar 9, 2020 · 1 comment

Comments

@chandru-tkc
Copy link
Contributor

chandru-tkc commented Mar 9, 2020

Issue

After creating a new VM in terraform any modifications to the VM fails with "IP address with type 'LEARNED' not allowed".

Description:

A change introduced on Nutanix v3 APIs on 5.11 now does a validation of ip endpoint list sent in the request. The validation rejects if ip_endpoint_list contains an ip address of type LEARNED.

I have successfully tested this on Nutanix v3 APIs for a VM with DHCP ip address. This test is not via terraform but via regular curl request. When ip_endpoint_list is empty in my PUT request the change went through fine, but when i copy over the ip_endpoint_list from the status output of the corresponding GET request the call fails with ,

          "ip_endpoint_list": [
           {
              "ip": "xx.xx.xx.xx",
              "type": "LEARNED"
            }
],

in the API request fails with

{
  "api_version": "3.1",
  "code": 422,
  "message_list": [
    {
      "message": "IP address with type 'LEARNED' not allowed",
      "reason": "INVALID_REQUEST"
    }
  ],
  "state": "ERROR"
}

I believe we should check for ip type LEARNED and skip it here,

https://github.com/terraform-providers/terraform-provider-nutanix/blob/34a9c14c88956bce549deb60599602e2a5b224d2/nutanix/resource_nutanix_virtual_machine.go#L1617

Nutanix v3 APIs don't expect ip_endpoint_list to be populated for DHCP ip address so we can skip the ip_endpoint_list for all LEARNED type ip addresses.

@marinsalinas
Copy link
Contributor

could you run your configuration with TF_LOG=DEBUG and post the log here removing sensitive data?

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 a pull request may close this issue.

3 participants