mirror of https://github.com/apache/cloudstack.git
add lb removal logic
This commit is contained in:
parent
829d50c58c
commit
fca1df4ce7
|
|
@ -308,7 +308,9 @@ public class NsxResource implements ServerResource {
|
|||
|
||||
private Answer executeRequest(DeleteNsxTier1GatewayCommand cmd) {
|
||||
String tier1Id = NsxControllerUtils.getTier1GatewayName(cmd.getDomainId(), cmd.getAccountId(), cmd.getZoneId(), cmd.getNetworkResourceId(), cmd.isResourceVpc());
|
||||
String lbName = NsxControllerUtils.getLoadBalancerName(tier1Id);
|
||||
try {
|
||||
nsxApiClient.deleteLoadBalancer(lbName);
|
||||
nsxApiClient.deleteTier1Gateway(tier1Id);
|
||||
} catch (Exception e) {
|
||||
return new NsxAnswer(cmd, new CloudRuntimeException(e.getMessage()));
|
||||
|
|
|
|||
|
|
@ -707,8 +707,7 @@ public class NsxApiClient {
|
|||
LBPoolListResult lbPoolListResult = lbPools.list(null, null, null, null, null, null);
|
||||
if (CollectionUtils.isEmpty(lbVsListResult.getResults()) && CollectionUtils.isEmpty(lbPoolListResult.getResults())) {
|
||||
String lbName = getLoadBalancerName(tier1GatewayName);
|
||||
LbServices lbServices = (LbServices) nsxService.apply(LbServices.class);
|
||||
lbServices.delete(lbName, true);
|
||||
deleteLoadBalancer(lbName);
|
||||
}
|
||||
|
||||
} catch (Error error) {
|
||||
|
|
@ -719,6 +718,11 @@ public class NsxApiClient {
|
|||
}
|
||||
}
|
||||
|
||||
public void deleteLoadBalancer(String lbName) {
|
||||
LbServices lbServices = (LbServices) nsxService.apply(LbServices.class);
|
||||
lbServices.delete(lbName, true);
|
||||
}
|
||||
|
||||
private String getLbPoolPath(String lbPoolName) {
|
||||
try {
|
||||
LbPools lbPools = (LbPools) nsxService.apply(LbPools.class);
|
||||
|
|
|
|||
|
|
@ -463,7 +463,8 @@ export default {
|
|||
},
|
||||
async showIlb (network) {
|
||||
const networkOffering = await this.getNetworkOffering(network.networkofferingid)
|
||||
return ((networkOffering.supportsinternallb && network.service.filter(s => (s.name === 'Lb') && (s.capability.filter(c => c.name === 'LbSchemes' && c.value.split(',').includes('Internal')).length > 0)).length > 0))
|
||||
console.log((networkOffering.supportsinternallb && network.service.filter(s => (s.name === 'Lb') && (s.capability.filter(c => c.name === 'LbSchemes' && c.value.split(',').includes('Internal')).length > 0)).length > 0))
|
||||
return ((networkOffering.supportsinternallb && network.service.filter(s => (s.name === 'Lb') && (s.capability.filter(c => c.name === 'LbSchemes' && c.value.split(',').includes('Internal')).length > 0)).length > 0)) || false
|
||||
},
|
||||
updateMtu () {
|
||||
if (this.form.privatemtu > this.privateMtuMax) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue