apache / cloudstack

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

VM search by IP does not work after the update #9486

Closed 0sorkon closed 2 weeks ago

0sorkon commented 3 months ago
ISSUE TYPE
COMPONENT NAME
UI
API?
CLOUDSTACK VERSION
4.19.1.0
SUMMARY

Searching for VMs by IP does not work after upgrading from 4.18.2.1 to 4.19.1.0. Attempting to search by IP gives empty results

STEPS TO REPRODUCE
* Update to 4.19.1.0
* Try to search instance based on IP address
EXPECTED RESULTS
The search result displays the VM with the searched IP
ACTUAL RESULTS
Search result is empty.
adietrich-ussignal commented 3 months ago

Can you be a bit more descriptive as to which menu you are attempting to search? Is this from the instance screen where you are attempting to search?

I've tested on 4.19.1.0 and 4.19.0.2 and in both cases this does not work when done from the Compute > Instances search bar.

0sorkon commented 3 months ago

Yes. I try to search VM from Compute -> Instances page. And it work on 4.18

0sorkon commented 3 months ago

Is there another way to search VMs by IP that works in 4.19?

kiranchavala commented 2 months ago

@0sorkon

You can use cloudmonkey tool to filter the vm and IP address

https://github.com/apache/cloudstack-cloudmonkey

for example

cmk list virtualmachines filter=name,ipaddress
{
  "count": 2,
  "virtualmachine": [
    {
      "ipaddress": "10.1.1.141",
      "name": "VM-28780e23-5ab5-455e-a0be-43caa22f16a1"
    },
    {
      "ipaddress": "10.1.1.19",
      "name": "VM-26eaa7cd-3a76-4a2a-a11a-7719db3dff65"
    }
  ]
}

Also you can use the jq tool to filter somemore

 cmk list virtualmachines filter=name,ipaddress | jq '.virtualmachine[]'
{
  "ipaddress": "10.1.1.141",
  "name": "VM-28780e23-5ab5-455e-a0be-43caa22f16a1"
}
{
  "ipaddress": "10.1.1.19",
  "name": "VM-26eaa7cd-3a76-4a2a-a11a-7719db3dff65"
}

 cmk list virtualmachines filter=name,ipaddress | jq '.virtualmachine[].ipaddress'
"10.1.1.141"
"10.1.1.19"
DaanHoogland commented 2 months ago

@0sorkon have you seen this working in older versions? It doesn't sound as familiar functionality to me.

0sorkon commented 1 month ago

Yeah, I'm pretty sure it worked in latest 4.18.

0sorkon commented 1 month ago

@0sorkon

You can use cloudmonkey tool to filter the vm and IP address

https://github.com/apache/cloudstack-cloudmonkey

for example

cmk list virtualmachines filter=name,ipaddress
{
  "count": 2,
  "virtualmachine": [
    {
      "ipaddress": "10.1.1.141",
      "name": "VM-28780e23-5ab5-455e-a0be-43caa22f16a1"
    },
    {
      "ipaddress": "10.1.1.19",
      "name": "VM-26eaa7cd-3a76-4a2a-a11a-7719db3dff65"
    }
  ]
}

Also you can use the jq tool to filter somemore

 cmk list virtualmachines filter=name,ipaddress | jq '.virtualmachine[]'
{
  "ipaddress": "10.1.1.141",
  "name": "VM-28780e23-5ab5-455e-a0be-43caa22f16a1"
}
{
  "ipaddress": "10.1.1.19",
  "name": "VM-26eaa7cd-3a76-4a2a-a11a-7719db3dff65"
}

 cmk list virtualmachines filter=name,ipaddress | jq '.virtualmachine[].ipaddress'
"10.1.1.141"
"10.1.1.19"

Yeah, I know cmk can do that. But not everyone has access to the MS console and most people use the web interface and are used to it working.

weizhouapache commented 2 weeks ago

this has been fixed by #9547