Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Fixing bug in New-NsxLoadBalancerPool #611

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Nick-Andreev
Copy link

Fixing a bug in New-NsxLoadBalancerPool, where it fails to create a new pool on the Edge, when Edge already has one existing pool and one existing VIP.

This is the error message you get:

WebException: The remote server returned an error: (500) Internal Server Error.
        InternalNsxApiException: Invoke-NsxWebRequest : The NSX API response received indicates a failure. 500 : Internal Server Error : Response Body: {"errorCode":100,"details":null,"rootCauseString":null,"moduleName":null,"errorData":null}
        at Invoke-NsxWebRequest, PowerNSX.psm1: line 4354
        at New-NsxLoadBalancerPool<Process>, PowerNSX.psm1: line 31115
        at Get-NsxLoadBalancer<Process>, PowerNSX.psm1: line 30094
        at Get-NsxEdge, PowerNSX.psm1: line 13527

All credit goes to @neoxinth who fixed this in pull request #435. I just added a Pester test for this bug for regression testing purposes.

There is a full explanation of why this issue happens in the first place, which you can find in the discussion thread for #435.

@@ -107,6 +107,37 @@ Describe "Edge Load Balancer" {

}

# Test to cover a bug where New-NsxLoadBalancerPool fails to create a new pool on the Edge,
# when Edge already has one existing pool and one existing VIP.
Context "Load Balancer Pool (Extended)" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Load Balancer Pool (Add Multiple Pool) ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this bug happens only under certain circumstances, when:

  1. You already have one pool
  2. You already have one VIP
  3. And you trying to add a second pool - that's when the bug manifests itself

I had a long post under #434 explaining why this happens.

This test is more for demonstration purposes and for confirming that the issue is fixed by the submitted commits. It's up to you if you want to keep this test moving forward, to make sure this bug never get reintroduced into the code again in future versions.

From pure testing purposes, it doesn't test anything more than the already existing "Load Balancer Pool" test.

Hope that makes sense.

@alagoutte
Copy link
Contributor

LGTM @dcoghlan can you launch test suite ?

@dcoghlan
Copy link
Contributor

jenkins test this please

@powernsxbot
Copy link

Tests Successful

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants