cloudstack-cloudmonkey icon indicating copy to clipboard operation
cloudstack-cloudmonkey copied to clipboard

autocomplete: allow searching for VMs belonging to projects

Open bernardodemarco opened this issue 4 months ago • 9 comments

Currently, when searching for VMs through the CloudMonkey's autocomplete, VMs belonging to projects are not listed. For instance, below are listed all existing VMs of the cloud environment:

(localcloud) 🌵 > list virtualmachines listall=true projectid=-1 filter=id,name,account,project
{
  "count": 4,
  "virtualmachine": [
    {
      "id": "2b7f0fe7-c114-4b01-93ab-dd31758b456a",
      "name": "project-1-vm-01",
      "project": "project-1"
    },
    {
      "id": "79c21a0f-1d5c-46b1-bd9b-691e09c8b7a5",
      "name": "project-1-vm-2",
      "project": "project-1"
    },
    {
      "account": "admin",
      "id": "f69735ac-2bc9-4847-a25f-fc21f27b6cb0",
      "name": "admin-vm-1"
    },
    {
      "account": "admin",
      "id": "bd29bd06-a186-4470-a1ec-8eb5cbec37c7",
      "name": "admin-vm-2"
    }
  ]
}

However, the projects' VMs are not listed as available options in the autocomplete.

image image

This PR, therefore, adds the projectid=-1 parameter to the listVirtualMachines API call that is performed by CloudMonkey when fetching the existing VMs. With that, it is possible to select VMs that belong to projects:

image image

bernardodemarco avatar Aug 22 '25 17:08 bernardodemarco