cloudstack
cloudstack copied to clipboard
UI: Fix VPC network offerings listing on VPC tier creation
Description
This PR fixes the VPC network offerings listing on VPC tiers creation Fixes: #8023
Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] 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
Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [x] Minor
- [ ] Trivial
Screenshots (if appropriate):
How Has This Been Tested?
Create VPC offering with Lb as supported service and VpcVirtualRouter as provider Create VPC with the selected VPC offering VPC -> Add new network tier -> verify available network offerings
How did you try to break this feature and the system with this change?
@blueorangutan ui
@nvazquez a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 15.08%. Comparing base (
3d8d487) to head (f07c7df). Report is 31 commits behind head on 4.19.
Additional details and impacted files
@@ Coverage Diff @@
## 4.19 #9557 +/- ##
============================================
- Coverage 15.08% 15.08% -0.01%
Complexity 11184 11184
============================================
Files 5406 5406
Lines 472908 472921 +13
Branches 60405 61613 +1208
============================================
- Hits 71345 71342 -3
- Misses 393619 393635 +16
Partials 7944 7944
| Flag | Coverage Δ | |
|---|---|---|
| uitests | 4.30% <ø> (-0.01%) |
:arrow_down: |
| unittests | 15.80% <ø> (-0.01%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
UI build: :heavy_check_mark: Live QA URL: https://qa.cloudstack.cloud/simulator/pr/9557 (QA-JID-428)
@nvazquez , as discussed off-line; I still see both types
not sure what the functional solution should be (let alone the implementation) but can you expand on how you solved it and why ?
thanks
Thanks for reviewing @DaanHoogland @weizhouapache - before the fix the network offerings listing was passing supportedServices=SourceNat, and the solution I found was passing supportedServices=SourceNat,Lb in case the VPC offering supports the Lb service. Maybe this is the wrong approach, what do you think/suggest?
Thanks for reviewing @DaanHoogland @weizhouapache - before the fix the network offerings listing was passing
supportedServices=SourceNat, and the solution I found was passingsupportedServices=SourceNat,Lbin case the VPC offering supports the Lb service. Maybe this is the wrong approach, what do you think/suggest?
as I understand
- good: VPC uses public LB (it supports internal LB as well), network uses internal LB
- good: VPC uses public LB (it supports internal LB as well), network uses public LB
- good: VPC uses public LB (it supports internal LB as well), network does not use LB
- not good: VPC uses internal LB, network uses public LB
- good: VPC uses internal LB, network uses internal LB
- good: VPC uses internal LB, network does not use LB
I think network offerings should be filtered by the LB service provider (VpcVirtualRouter or InternalLbVm) instead of service (Lb).
@DaanHoogland @weizhouapache I've revisited the logic and got the following results:
For Public LB VPC:
For Internal LB VPC:
Can you please review the latest changes?
@blueorangutan ui
@nvazquez a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.
UI build: :heavy_check_mark: Live QA URL: https://qa.cloudstack.cloud/simulator/pr/9557 (QA-JID-430)
@DaanHoogland @weizhouapache I've revisited the logic and got the following results:
For Public LB VPC:
For Internal LB VPC:
Can you please review the latest changes?
@nvazquez
does the env have the network offering DefaultIsolatedNetworkOfferingForVpcNetworksNoLB (Offering for Isolated Vpc networks with Source Nat service enabled and LB service Disabled) ?
if yes, I think it should be in the list as well.
@DaanHoogland @weizhouapache I've revisited the logic and got the following results: For Public LB VPC:
For Internal LB VPC:
Can you please review the latest changes?
@nvazquez does the env have the network offering
DefaultIsolatedNetworkOfferingForVpcNetworksNoLB(Offering for Isolated Vpc networks with Source Nat service enabled and LB service Disabled) ?if yes, I think it should be in the list as well.
@weizhouapache
The vpc networks are created from vpc offerings which have LB of either vpcvrouter and internalLBVM
so i believe "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB" should not be displayed
so i believe "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB" should not be displayed
@kiranchavala @nvazquez You can try to create a vpc tier without LB using the network offering
Thanks @weizhouapache I tried it from the API and it fails for public LB VPC but works for the internal LB VPC:
(localcloud) 🐱 > list networkofferings name=DefaultIsolatedNetworkOfferingForVpcNetworksNoLB filter=id,name
{
"count": 1,
"networkoffering": [
{
"id": "34af5716-09e9-44d9-8cc5-c84d8478be2a",
"name": "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB"
}
]
}
For public LB VPC:
(localcloud) 🐱 > create network vpcid=6f4d9f18-4e02-4cca-a981-6b2580e9db20 networkofferingid=34af5716-09e9-44d9-8cc5-c84d8478be2a name=testNoLB zoneid=16220919-8e96-48e2-bfb0-b9fc63bc3efc gateway=10.20.1.1 netmask=255.255.255.240
🙈 Error: (HTTP 431, error code 4350) Service/provider combination Dhcp/VpcVirtualRouter is not supported by VPC [VPC [6-VPC-PublicLB]
For internal LB VPC:
(localcloud) 🐱 > create network vpcid=89ebb044-a2ea-46db-9f4c-9dc0b39a0091 networkofferingid=34af5716-09e9-44d9-8cc5-c84d8478be2a name=testilb-newtier zoneid=16220919-8e96-48e2-bfb0-b9fc63bc3efc gateway=10.30.1.33 netmask=255.255.255.240
{
"network": {
....
"networkofferingdisplaytext": "Offering for Isolated Vpc networks with Source Nat service enabled and LB service Disabled",
"networkofferingid": "34af5716-09e9-44d9-8cc5-c84d8478be2a",
"networkofferingname": "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB",
....
"service": [
{
"capability": [
{
"canchooseservicecapability": false,
"name": "SupportedVpnTypes",
"value": "pptp,l2tp,ipsec"
},
{
"canchooseservicecapability": false,
"name": "VpnTypes",
"value": "s2svpn"
}
],
"name": "Vpn",
"provider": [
{
"name": "VpcVirtualRouter"
}
]
},
{
"capability": [
{
"canchooseservicecapability": false,
"name": "SupportedProtocols",
"value": "tcp,udp,icmp"
}
],
"name": "NetworkACL",
"provider": [
{
"name": "VpcVirtualRouter"
}
]
},
{
"capability": [
{
"canchooseservicecapability": true,
"name": "SupportedSourceNatTypes",
"value": "peraccount"
},
{
"canchooseservicecapability": true,
"name": "RedundantRouter",
"value": "false"
}
],
"name": "SourceNat",
"provider": [
{
"name": "VpcVirtualRouter"
}
]
},
{
"capability": [],
"name": "UserData",
"provider": [
{
"name": "VpcVirtualRouter"
}
]
},
{
"capability": [
{
"canchooseservicecapability": false,
"name": "DhcpAccrossMultipleSubnets",
"value": "true"
}
],
"name": "Dhcp",
"provider": [
{
"name": "VpcVirtualRouter"
}
]
},
{
"capability": [
{
"canchooseservicecapability": false,
"name": "AllowDnsSuffixModification",
"value": "true"
}
],
"name": "Dns",
"provider": [
{
"name": "VpcVirtualRouter"
}
]
},
{
"capability": [
{
"canchooseservicecapability": false,
"name": "SupportedProtocols",
"value": "tcp,udp"
}
],
"name": "PortForwarding",
"provider": [
{
"name": "VpcVirtualRouter"
}
]
},
{
"capability": [
{
"canchooseservicecapability": false,
"name": "ElasticIp",
"value": "false"
},
{
"canchooseservicecapability": false,
"name": "AssociatePublicIP",
"value": "true"
}
],
"name": "StaticNat",
"provider": [
{
"name": "VpcVirtualRouter"
}
]
}
],
....
}
}
I didn't find this intuitive, will refactor the logic to support this case also
For public LB VPC:
(localcloud) 🐱 > create network vpcid=6f4d9f18-4e02-4cca-a981-6b2580e9db20 networkofferingid=34af5716-09e9-44d9-8cc5-c84d8478be2a name=testNoLB zoneid=16220919-8e96-48e2-bfb0-b9fc63bc3efc gateway=10.20.1.1 netmask=255.255.255.240 🙈 Error: (HTTP 431, error code 4350) Service/provider combination Dhcp/VpcVirtualRouter is not supported by VPC [VPC [6-VPC-PublicLB]
thanks @nvazquez for the testing
regarding the error above, it seems to be caused by Dhcp of the VPC offering, not LB. Can you create a new VPC offering with Dhcp/Dns (and other serivces) with Public LB, and retry ?
@weizhouapache you are right, it got created properly. Sorry I wasn't aware of this behavior, will refactor accordingly
@weizhouapache @kiranchavala I've refactored the logic, can you have a final review? Many thanks
@blueorangutan ui
@nvazquez a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.
UI build: :heavy_check_mark: Live QA URL: https://qa.cloudstack.cloud/simulator/pr/9557 (QA-JID-431)
@weizhouapache does this lgty now?
@DaanHoogland code lgtm. not tested yet
this needs re-testing as there are some changes after last testing by @kiranchavala
@DaanHoogland @kiranchavala could you if its looking good after the latest changes?
@blueorangutan ui
@kiranchavala a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.
UI build: :heavy_check_mark: Live QA URL: https://qa.cloudstack.cloud/simulator/pr/9557 (QA-JID-447)

