Skip to content

UI: Fix VPC network offerings listing on VPC tier creation#9557

Merged
DaanHoogland merged 4 commits intoapache:4.19from
shapeblue:ui-vpc-visibility-issue
Sep 18, 2024
Merged

UI: Fix VPC network offerings listing on VPC tier creation#9557
DaanHoogland merged 4 commits intoapache:4.19from
shapeblue:ui-vpc-visibility-issue

Conversation

@nvazquez
Copy link
Copy Markdown
Contributor

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)
  • 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
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • 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?

@nvazquez
Copy link
Copy Markdown
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link
Copy Markdown

@nvazquez a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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%) ⬇️
unittests 15.80% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@blueorangutan
Copy link
Copy Markdown

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/9557 (QA-JID-428)

@DaanHoogland
Copy link
Copy Markdown
Contributor

@nvazquez , as discussed off-line; I still see both types
image
not sure what the functional solution should be (let alone the implementation) but can you expand on how you solved it and why ?

thanks

@nvazquez
Copy link
Copy Markdown
Contributor Author

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?

@weizhouapache
Copy link
Copy Markdown
Member

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?

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).

@nvazquez
Copy link
Copy Markdown
Contributor Author

@DaanHoogland @weizhouapache I've revisited the logic and got the following results:

For Public LB VPC:
Screenshot 2024-08-22 at 01 17 44

For Internal LB VPC:
Screenshot 2024-08-22 at 01 18 43

Can you please review the latest changes?

@nvazquez
Copy link
Copy Markdown
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link
Copy Markdown

@nvazquez a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/9557 (QA-JID-430)

@weizhouapache
Copy link
Copy Markdown
Member

@DaanHoogland @weizhouapache I've revisited the logic and got the following results:

For Public LB VPC: Screenshot 2024-08-22 at 01 17 44

For Internal LB VPC: Screenshot 2024-08-22 at 01 18 43

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.

@kiranchavala
Copy link
Copy Markdown
Member

@DaanHoogland @weizhouapache I've revisited the logic and got the following results:
For Public LB VPC: Screenshot 2024-08-22 at 01 17 44
For Internal LB VPC: Screenshot 2024-08-22 at 01 18 43
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

Screenshot 2024-08-22 at 3 57 12 PM

so i believe "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB" should not be displayed

Copy link
Copy Markdown
Member

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

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

LGTM

Tested manually

  1. Create a 2 vpc offerings ,

Vpc Offering 1 > with LB as VpcVirtualRouter
Vpc Offering 2 > with LB as InternalLBVM

Screenshot 2024-08-22 at 3 57 12 PM
  1. Create 2 vpc networks

VPC network 1 > with Vpc Offering 1
VPC network 2 > with Vpc Offering 2

  1. Create 2 Network offering

Network offering 1 > with Loadbalancer type as public IP

Screenshot 2024-08-22 at 4 05 10 PM

Network offering 2 > with Loadbalancer type as internalLB

Screenshot 2024-08-22 at 4 05 20 PM
  1. Navigate to VPC network 1 and create a tier > the correct network offering is displayed
vpc1
  1. Navigate to VPC network 2 and create a tier > the correct network offering is displayed
vpc2

@weizhouapache
Copy link
Copy Markdown
Member

so i believe "DefaultIsolatedNetworkOfferingForVpcNetworksNoLB" should not be displayed

@kiranchavala @nvazquez
You can try to create a vpc tier without LB using the network offering

@nvazquez
Copy link
Copy Markdown
Contributor Author

nvazquez commented Aug 22, 2024

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

@weizhouapache
Copy link
Copy Markdown
Member

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 ?

@nvazquez
Copy link
Copy Markdown
Contributor Author

@weizhouapache you are right, it got created properly. Sorry I wasn't aware of this behavior, will refactor accordingly

@nvazquez
Copy link
Copy Markdown
Contributor Author

@weizhouapache @kiranchavala I've refactored the logic, can you have a final review? Many thanks

@blueorangutan ui

@blueorangutan
Copy link
Copy Markdown

@nvazquez a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/9557 (QA-JID-431)

@DaanHoogland
Copy link
Copy Markdown
Contributor

@weizhouapache does this lgty now?

@weizhouapache
Copy link
Copy Markdown
Member

@DaanHoogland
code lgtm. not tested yet

this needs re-testing as there are some changes after last testing by @kiranchavala

@nvazquez
Copy link
Copy Markdown
Contributor Author

@DaanHoogland @kiranchavala could you if its looking good after the latest changes?

@kiranchavala
Copy link
Copy Markdown
Member

@blueorangutan ui

@blueorangutan
Copy link
Copy Markdown

@kiranchavala a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/9557 (QA-JID-447)

Copy link
Copy Markdown
Member

@kiranchavala kiranchavala left a comment

Choose a reason for hiding this comment

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

LGTM

With vpc1 > Public LB

Screenshot 2024-09-13 at 6 20 47 PM

With vpc 2> Internal LB

Screenshot 2024-09-13 at 6 21 03 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Visibility of inappropriate VPC Offerings and Network Offerings

6 participants