apache / cloudstack

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

List Instances in Host lists all instances #6931

Closed alexandremattioli closed 1 year ago

alexandremattioli commented 1 year ago
ISSUE TYPE
COMPONENT NAME
UI
CLOUDSTACK VERSION
4.17.1
CONFIGURATION
OS / ENVIRONMENT

N/A

SUMMARY

When selecting to show all instances for a certain host, all instances are listed

STEPS TO REPRODUCE
In the UI navigate to:
Infrastructure -> Hosts
Select a host
Click on View Instances
EXPECTED RESULTS
List of instances running on the host
ACTUAL RESULTS
All instances are listed
nvazquez commented 1 year ago

@alexandremattioli I've posted a quick fix, its actually the API that's broken, the UI is passing the params correctly:

(localcloud) 🐱 > list virtualmachines hostid=ab815b86-a9ad-499c-a60f-4d85123d57c4 filter=id,name,hostid
{
  "count": 1,
  "virtualmachine": [
    {
      "hostid": "ab815b86-a9ad-499c-a60f-4d85123d57c4",
      "id": "f3621224-0f19-4e55-bf3b-8504bd5ce346",
      "name": "VM-f3621224-0f19-4e55-bf3b-8504bd5ce346"
    }
  ]
}
(localcloud) 🐱 > list virtualmachinesmetrics hostid=ab815b86-a9ad-499c-a60f-4d85123d57c4 filter=id,name,hostid
{
  "count": 2,
  "virtualmachine": [
    {
      "hostid": "734acbc4-80c9-44c0-aaab-75f276469fd4",
      "id": "35fef250-5c4d-4705-b707-069102a32991",
      "name": "VM-35fef250-5c4d-4705-b707-069102a32991"
    },
    {
      "hostid": "ab815b86-a9ad-499c-a60f-4d85123d57c4",
      "id": "f3621224-0f19-4e55-bf3b-8504bd5ce346",
      "name": "VM-f3621224-0f19-4e55-bf3b-8504bd5ce346"
    }
  ]
}
alexandremattioli commented 1 year ago

Thanks @nvazquez

rohityadavcloud commented 1 year ago

Duplicate of https://github.com/apache/cloudstack/issues/6786 closing this. @alexandremattioli @nvazquez we've another PR from Abhishek: https://github.com/apache/cloudstack/pull/6851