apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
1.97k stars 1.09k forks source link

Show all the tier's name associated with the VPC Virtual router #8008

Closed kiranchavala closed 2 weeks ago

kiranchavala commented 11 months ago

ISSUE TYPE

COMPONENT NAME

Component: UI

CLOUDSTACK VERSION

Cloudstack version 4.18

SUMMARY

Show all the tier's name associated with the VPC Virtual router

Infrastructure > Virtual Routers

Steps to reproduce the issue

  1. Create a vpc

  2. Create some 2 tiers

  3. Launch some vm's in the tiers

  4. Navigate to Infrastructure > Virtual Routers

Currently, the Network Name column lists only one tier name's

Screenshot 2023-09-27 at 12 10 18 PM

Expected behavior

The Network Name column should list all the active tiers name

The listRouters api call contains all tiers name , Cloudstack needs to parse them correctly.

https://cloudstack.apache.org/api/apidocs-4.18/apis/listRouters.html

Actual behavior

The Network Name column is listing only one tier name which is the latest

weizhouapache commented 11 months ago

@kiranchavala do you think it makes sense to set the network name to empty ?

kiranchavala commented 11 months ago

@weizhouapache The issue is only with the vpc routers, for the isolated networks, the network name is displayed correctly.

Either we can mark the network name empty for vpc routers or list all the tier names, anything should be fine

since the api output contains the tier's name in the nic, we can filter by

traffictype: "Guest", "type": "Isolated"

Example


(CMK) > list routers id=23dd62eb-000a-4765-bb49-bdf6be949a0a
{
  "count": 1,
  "router": [
    {
      "account": "admin",
      "created": "2023-09-27T07:19:32+0000",
      "dns1": "10.0.32.1",
      "dns2": "8.8.8.8",
      "domain": "ROOT",
      "domainid": "c2e4ddb0-5127-11ee-b168-1e00af000354",
      "gateway": "10.0.48.1",
      "guestipaddress": "172.24.3.1",
      "guestmacaddress": "02:00:25:5c:00:02",
      "guestnetmask": "255.255.255.0",
      "guestnetworkid": "66bcfa56-c4ad-485a-8216-442b91e7d812",
      "guestnetworkname": "tier3",
      "hasannotations": false,
      "healthchecksfailed": false,
      "hostcontrolstate": "Enabled",
      "hostid": "d359fd16-e8b8-490f-8635-fd9bf5dac9c7",
      "hostname": "ref-trl-5653-k-M7-kiran-chavala-kvm1",
      "hypervisor": "KVM",
      "id": "23dd62eb-000a-4765-bb49-bdf6be949a0a",
      "isredundantrouter": false,
      "linklocalip": "169.254.41.253",
      "linklocalmacaddress": "0e:00:a9:fe:29:fd",
      "linklocalnetmask": "255.255.0.0",
      "linklocalnetworkid": "c6663d42-297c-4b2f-b046-d25d7e996bb6",
      "name": "r-46-VM",
      "networkdomain": "cs2cloud.internal",
      "nic": [
        {
          "gateway": "169.254.0.1",
          "id": "906c353a-a191-4cda-9fa1-8638cadaa76e",
          "ipaddress": "169.254.41.253",
          "isdefault": false,
          "macaddress": "0e:00:a9:fe:29:fd",
          "netmask": "255.255.0.0",
          "networkid": "c6663d42-297c-4b2f-b046-d25d7e996bb6",
          "traffictype": "Control"
        },
        {
          "broadcasturi": "vlan://51",
          "gateway": "10.0.48.1",
          "id": "8175db1a-ceaf-40ba-9ea6-df1e90a83946",
          "ipaddress": "10.0.53.225",
          "isdefault": true,
          "isolationuri": "vlan://51",
          "macaddress": "1e:00:29:00:00:05",
          "mtu": 1500,
          "netmask": "255.255.240.0",
          "networkid": "b8bd6301-8a5e-4554-80ab-b0d3642f8581",
          "traffictype": "Public"
        },
        {
          "broadcasturi": "vlan://1442",
          "gateway": "172.24.1.1",
          "id": "12188f1e-b5d0-4d84-9733-1318da2d3a1c",
          "ipaddress": "172.24.1.1",
          "isdefault": false,
          "isolationuri": "vlan://1442",
          "macaddress": "02:00:24:69:00:02",
          "mtu": 1500,
          "netmask": "255.255.255.0",
          "networkid": "421f2c0d-c06d-4cd4-a196-6620cd732a3c",
          "networkname": "tier1",
          "traffictype": "Guest",
          "type": "Isolated"
        },
        {
          "broadcasturi": "vlan://1444",
          "gateway": "172.24.2.1",
          "id": "3af897d5-8903-466b-a463-772df29dda91",
          "ipaddress": "172.24.2.1",
          "isdefault": false,
          "isolationuri": "vlan://1444",
          "macaddress": "02:00:31:79:00:02",
          "mtu": 1500,
          "netmask": "255.255.255.0",
          "networkid": "2c549723-5b23-4732-9db9-a5771ee264d5",
          "networkname": "tier2",
          "traffictype": "Guest",
          "type": "Isolated"
        },
        {
          "broadcasturi": "vlan://1449",
          "gateway": "172.24.3.1",
          "id": "9af7ad99-3bec-44b9-90b3-7678fb04e58c",
          "ipaddress": "172.24.3.1",
          "isdefault": false,
          "isolationuri": "vlan://1449",
          "macaddress": "02:00:25:5c:00:02",
          "mtu": 1500,
          "netmask": "255.255.255.0",
          "networkid": "66bcfa56-c4ad-485a-8216-442b91e7d812",
          "networkname": "tier3",
          "traffictype": "Guest",
          "type": "Isolated"
        }
      ],
      "podid": "7d3f020d-213f-47fc-a1d0-3f87d8bb075c",
      "podname": "Pod1",
      "publicip": "10.0.53.225",
      "publicmacaddress": "1e:00:29:00:00:05",
      "publicnetmask": "255.255.240.0",
      "publicnetworkid": "b8bd6301-8a5e-4554-80ab-b0d3642f8581",
      "redundantstate": "UNKNOWN",
      "requiresupgrade": false,
      "role": "VIRTUAL_ROUTER",
      "scriptsversion": "eed74cfafede6497047a34e5bf5fe0eb\n",
      "serviceofferingid": "b8f546fb-d814-429e-a05b-71ddb7d9b4d0",
      "serviceofferingname": "System Offering For Software Router",
      "softwareversion": "4.18.0.0",
      "state": "Running",
      "templateid": "c2e7c90b-5127-11ee-b168-1e00af000354",
      "templatename": "SystemVM Template (KVM)",
      "version": "4.18.0",
      "vpcid": "787efef7-2aec-4f76-98f3-a2be764016cd",
      "vpcname": "g1",
      "zoneid": "86d9a63a-3d0b-466f-8f32-81cefc39e31d",
      "zonename": "ref-trl-5653-k-M7-kiran-chavala"
    }
  ]
}
weizhouapache commented 11 months ago

@weizhouapache The issue is with the vpc routers, for the isolated networks, the network name is displayed correctly.

Either we can mark the network name empty for vpc routers or list all the tier names, anything should be fine

agree @kiranchavala since the api output contains the tier's name in the nic, we can filter by

traffictype: "Guest", "type": "Isolated"

soreana commented 11 months ago

It would be nice if it also shows all the associated IPs.

DaanHoogland commented 2 weeks ago

@weizhouapache @kiranchavala I had a look at @vishesh92 's implementation and discussed with him; I don't think we should clutter the list display with all this data. if you have more than 10 vpc with an avarage of 4 tier, the page is not looking as meant for humans anymore also more than four IP on a network is not looking good anymore. Anybody can find the data in the details views. So my proposal (in conjuction with @vishesh92 ): only show the default ip and "network" with a flag/check for isVPC.

How does that sound?