You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "ZhyliaievD (via GitHub)" <gi...@apache.org> on 2026/03/17 10:21:29 UTC
[PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
ZhyliaievD opened a new pull request, #12835:
URL: https://github.com/apache/cloudstack/pull/12835
### Description
- Avoid unnecessary NSX load balancer patch calls when the target resource already exists and does not need updating.
- Reuse existing LB active monitor profiles instead of patching them again, which prevents avoidable 404 API errors during LB creation.
- Skip server pool patching when the current NSX pool already has the same members, and skip virtual server patching when the virtual server already exists.
- Fix createAndAddNsxLbVirtualServer() to check for an existing virtual server using the virtual server name, so existing virtual servers are detected correctly and not patched again
<!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
<!-- For new features, provide link to FS, dev ML discussion etc. -->
<!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
<!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
<!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
<!-- Fixes: # -->
<!--- ******************************************************************************* -->
<!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
<!--- PLEASE PUT AN 'X' in only **ONE** box -->
<!--- ******************************************************************************* -->
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] Build/CI
- [ ] Test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Feature/Enhancement Scale
- [ ] Major
- [X] Minor
### Screenshots (if appropriate):
### How Has This Been Tested?
<!-- Please describe in detail how you tested your changes. -->
<!-- Include details of your testing environment, and the tests you ran to -->
#### How did you try to break this feature and the system with this change?
<!-- see how your change affects other areas of the code, etc. -->
<!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "ZhyliaievD (via GitHub)" <gi...@apache.org>.
ZhyliaievD commented on code in PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#discussion_r3056575277
##########
plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxApiClient.java:
##########
@@ -676,27 +689,62 @@ public void createNsxLbServerPool(List<NsxLoadBalancerMember> memberList, String
}
}
+ private Optional<LBPool> getNsxLbServerPool(LbPools lbPools, String lbServerPoolName) {
+ try {
+ return Optional.ofNullable(lbPools.get(lbServerPoolName));
+ } catch (NotFound e) {
+ logger.debug("Server Pool not found: {}", lbServerPoolName);
Review Comment:
Agree, changed to warn
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "ZhyliaievD (via GitHub)" <gi...@apache.org>.
ZhyliaievD commented on code in PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#discussion_r3056578166
##########
plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxApiClient.java:
##########
@@ -676,27 +689,62 @@ public void createNsxLbServerPool(List<NsxLoadBalancerMember> memberList, String
}
}
+ private Optional<LBPool> getNsxLbServerPool(LbPools lbPools, String lbServerPoolName) {
+ try {
+ return Optional.ofNullable(lbPools.get(lbServerPoolName));
+ } catch (NotFound e) {
+ logger.debug("Server Pool not found: {}", lbServerPoolName);
+ return Optional.empty();
+ }
+ }
+
+ private boolean hasSamePoolMembers(List<LBPoolMember> existingMembers, List<LBPoolMember> membersUpdate) {
+ Set<String> existingMembersSet = existingMembers.stream()
+ .map(this::buildPoolMemberKey)
+ .collect(toSet());
+ Set<String> updateMembersSet = membersUpdate.stream()
+ .map(this::buildPoolMemberKey)
+ .collect(toSet());
+
+ return existingMembersSet.size() == updateMembersSet.size()
+ && existingMembersSet.containsAll(updateMembersSet);
+ }
+
+ private String buildPoolMemberKey(LBPoolMember member) {
+ return member.getIpAddress() + ':' + member.getPort() + ':' + member.getDisplayName();
+ }
+
private String getLbActiveMonitorPath(String lbServerPoolName, String port, String protocol) {
LbMonitorProfiles lbActiveMonitor = (LbMonitorProfiles) nsxService.apply(LbMonitorProfiles.class);
String lbMonitorProfileId = getActiveMonitorProfileName(lbServerPoolName, port, protocol);
- if ("TCP".equals(protocol.toUpperCase(Locale.ROOT))) {
- LBTcpMonitorProfile lbTcpMonitorProfile = new LBTcpMonitorProfile.Builder(TCP_MONITOR_PROFILE)
- .setDisplayName(lbMonitorProfileId)
- .setMonitorPort(Long.parseLong(port))
- .build();
- lbActiveMonitor.patch(lbMonitorProfileId, lbTcpMonitorProfile);
- } else if ("UDP".equals(protocol.toUpperCase(Locale.ROOT))) {
- LBIcmpMonitorProfile icmpMonitorProfile = new LBIcmpMonitorProfile.Builder(ICMP_MONITOR_PROFILE)
- .setDisplayName(lbMonitorProfileId)
- .build();
- lbActiveMonitor.patch(lbMonitorProfileId, icmpMonitorProfile);
+ Optional<Structure> monitorProfile = getMonitorProfile(lbActiveMonitor, lbMonitorProfileId);
+ if (monitorProfile.isEmpty()) {
+ if ("TCP".equals(protocol.toUpperCase(Locale.ROOT))) {
+ LBTcpMonitorProfile lbTcpMonitorProfile = new LBTcpMonitorProfile.Builder(TCP_MONITOR_PROFILE)
+ .setDisplayName(lbMonitorProfileId)
+ .setMonitorPort(Long.parseLong(port))
+ .build();
+ lbActiveMonitor.patch(lbMonitorProfileId, lbTcpMonitorProfile);
+ } else if ("UDP".equals(protocol.toUpperCase(Locale.ROOT))) {
+ LBIcmpMonitorProfile icmpMonitorProfile = new LBIcmpMonitorProfile.Builder(ICMP_MONITOR_PROFILE)
+ .setDisplayName(lbMonitorProfileId)
+ .build();
+ lbActiveMonitor.patch(lbMonitorProfileId, icmpMonitorProfile);
+ }
+ monitorProfile = getMonitorProfile(lbActiveMonitor, lbMonitorProfileId);
Review Comment:
extracted to `patchMonitoringProfile`. Thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "ZhyliaievD (via GitHub)" <gi...@apache.org>.
ZhyliaievD commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4250856715
> @nvazquez @Pearl1594 @ZhyliaievD ccan you advise on testing?
Tested on 4.22.0.0 base, see https://github.com/apache/cloudstack/pull/12834#issuecomment-4250849029
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4258433942
<b>[SF] Trillian test result (tid-15890)</b>
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 52500 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12835-t15890-kvm-ol8.zip
Smoke tests completed. 149 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:
Test | Result | Time (s) | Test File
--- | --- | --- | ---
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4214527102
@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "nvazquez (via GitHub)" <gi...@apache.org>.
nvazquez commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4213800620
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "ZhyliaievD (via GitHub)" <gi...@apache.org>.
ZhyliaievD commented on code in PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#discussion_r3056574119
##########
plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxApiClient.java:
##########
@@ -656,9 +659,19 @@ List<LBPoolMember> getLbPoolMembers(List<NsxLoadBalancerMember> memberList, Stri
public void createNsxLbServerPool(List<NsxLoadBalancerMember> memberList, String tier1GatewayName, String lbServerPoolName,
String algorithm, String privatePort, String protocol) {
try {
- String activeMonitorPath = getLbActiveMonitorPath(lbServerPoolName, privatePort, protocol);
List<LBPoolMember> members = getLbPoolMembers(memberList, tier1GatewayName);
LbPools lbPools = (LbPools) nsxService.apply(LbPools.class);
+ Optional<LBPool> nsxLbServerPool = getNsxLbServerPool(lbPools, lbServerPoolName);
+ // Skip if pool exists and members unchanged
+ if (nsxLbServerPool.isPresent()) {
+ List<LBPoolMember> existingMembers = nsxLbServerPool
+ .map(LBPool::getMembers)
+ .orElseGet(List::of);
+ if (hasSamePoolMembers(existingMembers, members)) {
+ return;
Review Comment:
Debug log added, tnx
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4109011892
@blueorangutan test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "ZhyliaievD (via GitHub)" <gi...@apache.org>.
ZhyliaievD commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4252959180
@sureshanaparti Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "ZhyliaievD (via GitHub)" <gi...@apache.org>.
ZhyliaievD commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4108796391
@blueorangutan test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4252572155
same for this one
> > @nvazquez @Pearl1594 @ZhyliaievD ccan you advise on testing?
>
> Tested on 4.22.0.0 base, see [#12834 (comment)](https://github.com/apache/cloudstack/pull/12834#issuecomment-4250849029)
does it then make sense to base ofo of 22 and merge on that?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4253029237
@nvazquez a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "winterhazel (via GitHub)" <gi...@apache.org>.
winterhazel commented on code in PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#discussion_r3041220623
##########
plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxApiClient.java:
##########
@@ -656,9 +659,19 @@ List<LBPoolMember> getLbPoolMembers(List<NsxLoadBalancerMember> memberList, Stri
public void createNsxLbServerPool(List<NsxLoadBalancerMember> memberList, String tier1GatewayName, String lbServerPoolName,
String algorithm, String privatePort, String protocol) {
try {
- String activeMonitorPath = getLbActiveMonitorPath(lbServerPoolName, privatePort, protocol);
List<LBPoolMember> members = getLbPoolMembers(memberList, tier1GatewayName);
LbPools lbPools = (LbPools) nsxService.apply(LbPools.class);
+ Optional<LBPool> nsxLbServerPool = getNsxLbServerPool(lbPools, lbServerPoolName);
+ // Skip if pool exists and members unchanged
+ if (nsxLbServerPool.isPresent()) {
+ List<LBPoolMember> existingMembers = nsxLbServerPool
+ .map(LBPool::getMembers)
+ .orElseGet(List::of);
+ if (hasSamePoolMembers(existingMembers, members)) {
+ return;
Review Comment:
A debug log here informing that the patch will be skipped because there aren't changes may be nice to have.
##########
plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxApiClient.java:
##########
@@ -676,27 +689,62 @@ public void createNsxLbServerPool(List<NsxLoadBalancerMember> memberList, String
}
}
+ private Optional<LBPool> getNsxLbServerPool(LbPools lbPools, String lbServerPoolName) {
+ try {
+ return Optional.ofNullable(lbPools.get(lbServerPoolName));
+ } catch (NotFound e) {
+ logger.debug("Server Pool not found: {}", lbServerPoolName);
Review Comment:
Isn't this log better suited for `warn`?
##########
plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxApiClient.java:
##########
@@ -676,27 +689,62 @@ public void createNsxLbServerPool(List<NsxLoadBalancerMember> memberList, String
}
}
+ private Optional<LBPool> getNsxLbServerPool(LbPools lbPools, String lbServerPoolName) {
+ try {
+ return Optional.ofNullable(lbPools.get(lbServerPoolName));
+ } catch (NotFound e) {
+ logger.debug("Server Pool not found: {}", lbServerPoolName);
+ return Optional.empty();
+ }
+ }
+
+ private boolean hasSamePoolMembers(List<LBPoolMember> existingMembers, List<LBPoolMember> membersUpdate) {
+ Set<String> existingMembersSet = existingMembers.stream()
+ .map(this::buildPoolMemberKey)
+ .collect(toSet());
+ Set<String> updateMembersSet = membersUpdate.stream()
+ .map(this::buildPoolMemberKey)
+ .collect(toSet());
+
+ return existingMembersSet.size() == updateMembersSet.size()
+ && existingMembersSet.containsAll(updateMembersSet);
+ }
+
+ private String buildPoolMemberKey(LBPoolMember member) {
+ return member.getIpAddress() + ':' + member.getPort() + ':' + member.getDisplayName();
+ }
+
private String getLbActiveMonitorPath(String lbServerPoolName, String port, String protocol) {
LbMonitorProfiles lbActiveMonitor = (LbMonitorProfiles) nsxService.apply(LbMonitorProfiles.class);
String lbMonitorProfileId = getActiveMonitorProfileName(lbServerPoolName, port, protocol);
- if ("TCP".equals(protocol.toUpperCase(Locale.ROOT))) {
- LBTcpMonitorProfile lbTcpMonitorProfile = new LBTcpMonitorProfile.Builder(TCP_MONITOR_PROFILE)
- .setDisplayName(lbMonitorProfileId)
- .setMonitorPort(Long.parseLong(port))
- .build();
- lbActiveMonitor.patch(lbMonitorProfileId, lbTcpMonitorProfile);
- } else if ("UDP".equals(protocol.toUpperCase(Locale.ROOT))) {
- LBIcmpMonitorProfile icmpMonitorProfile = new LBIcmpMonitorProfile.Builder(ICMP_MONITOR_PROFILE)
- .setDisplayName(lbMonitorProfileId)
- .build();
- lbActiveMonitor.patch(lbMonitorProfileId, icmpMonitorProfile);
+ Optional<Structure> monitorProfile = getMonitorProfile(lbActiveMonitor, lbMonitorProfileId);
+ if (monitorProfile.isEmpty()) {
+ if ("TCP".equals(protocol.toUpperCase(Locale.ROOT))) {
+ LBTcpMonitorProfile lbTcpMonitorProfile = new LBTcpMonitorProfile.Builder(TCP_MONITOR_PROFILE)
+ .setDisplayName(lbMonitorProfileId)
+ .setMonitorPort(Long.parseLong(port))
+ .build();
+ lbActiveMonitor.patch(lbMonitorProfileId, lbTcpMonitorProfile);
+ } else if ("UDP".equals(protocol.toUpperCase(Locale.ROOT))) {
+ LBIcmpMonitorProfile icmpMonitorProfile = new LBIcmpMonitorProfile.Builder(ICMP_MONITOR_PROFILE)
+ .setDisplayName(lbMonitorProfileId)
+ .build();
+ lbActiveMonitor.patch(lbMonitorProfileId, icmpMonitorProfile);
+ }
+ monitorProfile = getMonitorProfile(lbActiveMonitor, lbMonitorProfileId);
Review Comment:
This patch section could be extracted into a separate method to reduce the indentation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4212945932
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4220200214
<b>[SF] Trillian test result (tid-15839)</b>
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 49642 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12835-t15839-kvm-ol8.zip
Smoke tests completed. 151 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:
Test | Result | Time (s) | Test File
--- | --- | --- | ---
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4252790380
> code lgtm
>
> better to fix into 4.22.1.0 cc @sureshanaparti @rajujith
@ZhyliaievD can re-target to 4.22?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti merged PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "winterhazel (via GitHub)" <gi...@apache.org>.
winterhazel commented on code in PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#discussion_r3041279302
##########
plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxApiClient.java:
##########
@@ -676,27 +689,62 @@ public void createNsxLbServerPool(List<NsxLoadBalancerMember> memberList, String
}
}
+ private Optional<LBPool> getNsxLbServerPool(LbPools lbPools, String lbServerPoolName) {
+ try {
+ return Optional.ofNullable(lbPools.get(lbServerPoolName));
+ } catch (NotFound e) {
+ logger.debug("Server Pool not found: {}", lbServerPoolName);
+ return Optional.empty();
+ }
+ }
+
+ private boolean hasSamePoolMembers(List<LBPoolMember> existingMembers, List<LBPoolMember> membersUpdate) {
+ Set<String> existingMembersSet = existingMembers.stream()
+ .map(this::buildPoolMemberKey)
+ .collect(toSet());
+ Set<String> updateMembersSet = membersUpdate.stream()
+ .map(this::buildPoolMemberKey)
+ .collect(toSet());
+
+ return existingMembersSet.size() == updateMembersSet.size()
+ && existingMembersSet.containsAll(updateMembersSet);
+ }
+
+ private String buildPoolMemberKey(LBPoolMember member) {
+ return member.getIpAddress() + ':' + member.getPort() + ':' + member.getDisplayName();
+ }
+
private String getLbActiveMonitorPath(String lbServerPoolName, String port, String protocol) {
LbMonitorProfiles lbActiveMonitor = (LbMonitorProfiles) nsxService.apply(LbMonitorProfiles.class);
String lbMonitorProfileId = getActiveMonitorProfileName(lbServerPoolName, port, protocol);
- if ("TCP".equals(protocol.toUpperCase(Locale.ROOT))) {
- LBTcpMonitorProfile lbTcpMonitorProfile = new LBTcpMonitorProfile.Builder(TCP_MONITOR_PROFILE)
- .setDisplayName(lbMonitorProfileId)
- .setMonitorPort(Long.parseLong(port))
- .build();
- lbActiveMonitor.patch(lbMonitorProfileId, lbTcpMonitorProfile);
- } else if ("UDP".equals(protocol.toUpperCase(Locale.ROOT))) {
- LBIcmpMonitorProfile icmpMonitorProfile = new LBIcmpMonitorProfile.Builder(ICMP_MONITOR_PROFILE)
- .setDisplayName(lbMonitorProfileId)
- .build();
- lbActiveMonitor.patch(lbMonitorProfileId, icmpMonitorProfile);
+ Optional<Structure> monitorProfile = getMonitorProfile(lbActiveMonitor, lbMonitorProfileId);
+ if (monitorProfile.isEmpty()) {
+ if ("TCP".equals(protocol.toUpperCase(Locale.ROOT))) {
+ LBTcpMonitorProfile lbTcpMonitorProfile = new LBTcpMonitorProfile.Builder(TCP_MONITOR_PROFILE)
+ .setDisplayName(lbMonitorProfileId)
+ .setMonitorPort(Long.parseLong(port))
+ .build();
+ lbActiveMonitor.patch(lbMonitorProfileId, lbTcpMonitorProfile);
+ } else if ("UDP".equals(protocol.toUpperCase(Locale.ROOT))) {
+ LBIcmpMonitorProfile icmpMonitorProfile = new LBIcmpMonitorProfile.Builder(ICMP_MONITOR_PROFILE)
+ .setDisplayName(lbMonitorProfileId)
+ .build();
+ lbActiveMonitor.patch(lbMonitorProfileId, icmpMonitorProfile);
+ }
+ monitorProfile = getMonitorProfile(lbActiveMonitor, lbMonitorProfileId);
}
-
- LBMonitorProfileListResult listResult = listLBActiveMonitors(lbActiveMonitor);
- Optional<Structure> monitorProfile = listResult.getResults().stream().filter(profile -> profile._getDataValue().getField("id").toString().equals(lbMonitorProfileId)).findFirst();
return monitorProfile.map(structure -> structure._getDataValue().getField("path").toString()).orElse(null);
}
+ private Optional<Structure> getMonitorProfile(LbMonitorProfiles lbActiveMonitor, String lbMonitorProfileId) {
+ try {
+ return Optional.ofNullable(lbActiveMonitor.get(lbMonitorProfileId));
+ } catch (NotFound e) {
+ logger.debug("LB Monitor Profile not found: {}", lbMonitorProfileId);
Review Comment:
Isn't this log better suited for `warn`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4114939044
<b>[SF] Trillian test result (tid-15714)</b>
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 59477 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr12835-t15714-kvm-ol8.zip
Smoke tests completed. 145 look OK, 6 have errors, 0 did not run
Only failed and skipped tests results shown below:
Test | Result | Time (s) | Test File
--- | --- | --- | ---
test_attach_and_distribute_multiple_volumes | `Failure` | 88.65 | test_attach_multiple_volumes.py
test_10_vpc_tier_kubernetes_cluster | `Failure` | 3752.85 | test_kubernetes_clusters.py
ContextSuite context=TestListIdsParams>:teardown | `Error` | 1.14 | test_list_ids_parameter.py
test_01_snapshot_root_disk | `Error` | 4.03 | test_snapshots.py
test_02_list_snapshots_with_removed_data_store | `Error` | 47.07 | test_snapshots.py
test_02_list_snapshots_with_removed_data_store | `Error` | 47.07 | test_snapshots.py
ContextSuite context=TestSnapshotStandaloneBackup>:teardown | `Error` | 29.85 | test_snapshots.py
test_01_snapshot_usage | `Error` | 20.89 | test_usage.py
test_01_vpn_usage | `Error` | 1.11 | test_usage.py
test_01_redundant_vpc_site2site_vpn | `Failure` | 367.37 | test_vpc_vpn.py
test_01_vpc_site2site_vpn_multiple_options | `Failure` | 416.16 | test_vpc_vpn.py
test_01_vpc_site2site_vpn | `Failure` | 248.58 | test_vpc_vpn.py
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4222248511
@nvazquez @Pearl1594 @ZhyliaievD ccan you advise on testing?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#discussion_r2945866225
##########
plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxApiClient.java:
##########
@@ -659,6 +662,13 @@ public void createNsxLbServerPool(List<NsxLoadBalancerMember> memberList, String
String activeMonitorPath = getLbActiveMonitorPath(lbServerPoolName, privatePort, protocol);
List<LBPoolMember> members = getLbPoolMembers(memberList, tier1GatewayName);
LbPools lbPools = (LbPools) nsxService.apply(LbPools.class);
+ List<LBPoolMember> existingMembers = getNsxLbServerPool(lbPools, lbServerPoolName)
+ .map(LBPool::getMembers)
+ .orElse(null);
+ // Skip if pool exists and members unchanged
+ if (existingMembers != null && hasSamePoolMembers(existingMembers, members)) {
+ return;
+ }
Review Comment:
`getLbActiveMonitorPath()` (line 662) is called before the pool-exists check (lines 665-671), which means an API call to NSX is made to fetch (or create) the monitor profile even when the pool already exists with identical members and we're about to return early. Consider moving the `getLbActiveMonitorPath` call to after the early-return check to avoid this unnecessary NSX API call — which is the stated goal of this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4213223758
Packaging result [SF]: ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 17419
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "ZhyliaievD (via GitHub)" <gi...@apache.org>.
ZhyliaievD commented on code in PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#discussion_r3056581343
##########
plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxApiClient.java:
##########
@@ -676,27 +689,62 @@ public void createNsxLbServerPool(List<NsxLoadBalancerMember> memberList, String
}
}
+ private Optional<LBPool> getNsxLbServerPool(LbPools lbPools, String lbServerPoolName) {
+ try {
+ return Optional.ofNullable(lbPools.get(lbServerPoolName));
+ } catch (NotFound e) {
+ logger.debug("Server Pool not found: {}", lbServerPoolName);
+ return Optional.empty();
+ }
+ }
+
+ private boolean hasSamePoolMembers(List<LBPoolMember> existingMembers, List<LBPoolMember> membersUpdate) {
+ Set<String> existingMembersSet = existingMembers.stream()
+ .map(this::buildPoolMemberKey)
+ .collect(toSet());
+ Set<String> updateMembersSet = membersUpdate.stream()
+ .map(this::buildPoolMemberKey)
+ .collect(toSet());
+
+ return existingMembersSet.size() == updateMembersSet.size()
+ && existingMembersSet.containsAll(updateMembersSet);
+ }
+
+ private String buildPoolMemberKey(LBPoolMember member) {
+ return member.getIpAddress() + ':' + member.getPort() + ':' + member.getDisplayName();
+ }
+
private String getLbActiveMonitorPath(String lbServerPoolName, String port, String protocol) {
LbMonitorProfiles lbActiveMonitor = (LbMonitorProfiles) nsxService.apply(LbMonitorProfiles.class);
String lbMonitorProfileId = getActiveMonitorProfileName(lbServerPoolName, port, protocol);
- if ("TCP".equals(protocol.toUpperCase(Locale.ROOT))) {
- LBTcpMonitorProfile lbTcpMonitorProfile = new LBTcpMonitorProfile.Builder(TCP_MONITOR_PROFILE)
- .setDisplayName(lbMonitorProfileId)
- .setMonitorPort(Long.parseLong(port))
- .build();
- lbActiveMonitor.patch(lbMonitorProfileId, lbTcpMonitorProfile);
- } else if ("UDP".equals(protocol.toUpperCase(Locale.ROOT))) {
- LBIcmpMonitorProfile icmpMonitorProfile = new LBIcmpMonitorProfile.Builder(ICMP_MONITOR_PROFILE)
- .setDisplayName(lbMonitorProfileId)
- .build();
- lbActiveMonitor.patch(lbMonitorProfileId, icmpMonitorProfile);
+ Optional<Structure> monitorProfile = getMonitorProfile(lbActiveMonitor, lbMonitorProfileId);
+ if (monitorProfile.isEmpty()) {
+ if ("TCP".equals(protocol.toUpperCase(Locale.ROOT))) {
+ LBTcpMonitorProfile lbTcpMonitorProfile = new LBTcpMonitorProfile.Builder(TCP_MONITOR_PROFILE)
+ .setDisplayName(lbMonitorProfileId)
+ .setMonitorPort(Long.parseLong(port))
+ .build();
+ lbActiveMonitor.patch(lbMonitorProfileId, lbTcpMonitorProfile);
+ } else if ("UDP".equals(protocol.toUpperCase(Locale.ROOT))) {
+ LBIcmpMonitorProfile icmpMonitorProfile = new LBIcmpMonitorProfile.Builder(ICMP_MONITOR_PROFILE)
+ .setDisplayName(lbMonitorProfileId)
+ .build();
+ lbActiveMonitor.patch(lbMonitorProfileId, icmpMonitorProfile);
+ }
+ monitorProfile = getMonitorProfile(lbActiveMonitor, lbMonitorProfileId);
}
-
- LBMonitorProfileListResult listResult = listLBActiveMonitors(lbActiveMonitor);
- Optional<Structure> monitorProfile = listResult.getResults().stream().filter(profile -> profile._getDataValue().getField("id").toString().equals(lbMonitorProfileId)).findFirst();
return monitorProfile.map(structure -> structure._getDataValue().getField("path").toString()).orElse(null);
}
+ private Optional<Structure> getMonitorProfile(LbMonitorProfiles lbActiveMonitor, String lbMonitorProfileId) {
+ try {
+ return Optional.ofNullable(lbActiveMonitor.get(lbMonitorProfileId));
+ } catch (NotFound e) {
+ logger.debug("LB Monitor Profile not found: {}", lbMonitorProfileId);
Review Comment:
Agree, changed to warn
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "ZhyliaievD (via GitHub)" <gi...@apache.org>.
ZhyliaievD commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4191476391
@weizhouapache @winterhazel a kind reminder about this PR 😅
PS: test failures are not related to suggested changes(not related to nsx at all as far as I see)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "nvazquez (via GitHub)" <gi...@apache.org>.
nvazquez commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4253023307
Thanks @ZhyliaievD
@blueorangutan package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4253880558
@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "nvazquez (via GitHub)" <gi...@apache.org>.
nvazquez commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4253875934
@blueorangutan test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4074013830
## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/12835?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 3.53%. Comparing base ([`93239e0`](https://app.codecov.io/gh/apache/cloudstack/commit/93239e09f198964f3b3a3155c124dac7fa3b9d89?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`9f079d8`](https://app.codecov.io/gh/apache/cloudstack/commit/9f079d8a78bf5df7760f3c354db86e3617ba9596?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on main.
> :exclamation: There is a different number of reports uploaded between BASE (93239e0) and HEAD (9f079d8). Click for more details.
>
> <details><summary>HEAD has 1 upload less than BASE</summary>
>
>| Flag | BASE (93239e0) | HEAD (9f079d8) |
>|------|------|------|
>|unittests|1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #12835 +/- ##
=============================================
- Coverage 17.95% 3.53% -14.42%
=============================================
Files 5954 464 -5490
Lines 534838 40020 -494818
Branches 65423 7530 -57893
=============================================
- Hits 96010 1414 -94596
+ Misses 428053 38418 -389635
+ Partials 10775 188 -10587
```
| [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/12835/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/12835/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `3.53% <ø> (-0.12%)` | :arrow_down: |
| [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/12835/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/12835?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4109024920
@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "nvazquez (via GitHub)" <gi...@apache.org>.
nvazquez commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4214512793
@blueorangutan test
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4214122102
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17422
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "nvazquez (via GitHub)" <gi...@apache.org>.
nvazquez commented on code in PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#discussion_r3053027084
##########
plugins/network-elements/nsx/src/main/java/org/apache/cloudstack/service/NsxApiClient.java:
##########
@@ -656,9 +659,19 @@ List<LBPoolMember> getLbPoolMembers(List<NsxLoadBalancerMember> memberList, Stri
public void createNsxLbServerPool(List<NsxLoadBalancerMember> memberList, String tier1GatewayName, String lbServerPoolName,
String algorithm, String privatePort, String protocol) {
try {
- String activeMonitorPath = getLbActiveMonitorPath(lbServerPoolName, privatePort, protocol);
List<LBPoolMember> members = getLbPoolMembers(memberList, tier1GatewayName);
LbPools lbPools = (LbPools) nsxService.apply(LbPools.class);
+ Optional<LBPool> nsxLbServerPool = getNsxLbServerPool(lbPools, lbServerPoolName);
+ // Skip if pool exists and members unchanged
+ if (nsxLbServerPool.isPresent()) {
+ List<LBPoolMember> existingMembers = nsxLbServerPool
+ .map(LBPool::getMembers)
+ .orElseGet(List::of);
+ if (hasSamePoolMembers(existingMembers, members)) {
+ return;
Review Comment:
+1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4253606772
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17508
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4213814942
@nvazquez a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "ZhyliaievD (via GitHub)" <gi...@apache.org>.
ZhyliaievD commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4212885269
> Thanks for the improvement @ZhyliaievD! Code LGTM - some minor remarks raised by @winterhazel, could be great if addressed
Covered all comments, thanks for review
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: LB Creation avoid 404 API errors due to non-needed patches [cloudstack]
Posted by "blueorangutan (via GitHub)" <gi...@apache.org>.
blueorangutan commented on PR #12835:
URL: https://github.com/apache/cloudstack/pull/12835#issuecomment-4212955529
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org