Skip to content

Security group fields in the listVirtualmachines API call's response doesn't change #6999

Open
@soreana

Description

@soreana

In listVirtualMachines' response, we have a security group field. After further investigation, we noticed that this field doesn't change at all even if I add the ingress rule to the VM.

(local) > list virtualmachines id="152ee2cf-d9fb-4281-b222-1a9b1b73ef57" filter=id,name,displayname,securitygroup listall=true
{
  "count": 1,
  "virtualmachine": [
    {
      "displayname": "Sina-test-security-groups",
      "id": "152ee2cf-d9fb-4281-b222-1a9b1b73ef57",
      "name": "Sina-test-security-groups",
      "securitygroup": [
        {
          "account": "admin",
          "description": "",
          "egressrule": [],
          "id": "a2a75240-a7f2-42a4-9812-a9954b2d5ab2",
          "ingressrule": [],
          "name": "Sina-test",
          "tags": [],
          "virtualmachineids": []
        }
      ]
    }
  ]
}
(local) > list securitygroups virtualmachineid=152ee2cf-d9fb-4281-b222-1a9b1b73ef57
{
  "count": 1,
  "securitygroup": [
    {
      "account": "admin",
      "description": "",
      "domain": "ROOT",
      "domainid": "84c14489-6263-11e3-aa07-d89d6717918c",
      "egressrule": [],
      "id": "a2a75240-a7f2-42a4-9812-a9954b2d5ab2",
      "ingressrule": [
        {
          "cidr": "10.0.0.0/8",
          "endport": 20,
          "protocol": "tcp",
          "ruleid": "506815f8-1586-4353-ac70-8009cff65be8",
          "startport": 20,
          "tags": []
        }
      ],
      "name": "Sina-test",
      "tags": [],
      "virtualmachinecount": 1,
      "virtualmachineids": [
        "152ee2cf-d9fb-4281-b222-1a9b1b73ef57"
      ]
    }
  ]
}
ISSUE TYPE
  • Bug Report
COMPONENT NAME
API
CLOUDSTACK VERSION
4.17.2
CONFIGURATION
Basic network with security group
SUMMARY

When I was testing a firewall rules, I noticed that adding an ingress rules to a VM's security group doesn't have any affect on the listVirtualmachines api call output. The ingress rule is always empty. As a result our automation tools should call two APIs rather than one to get correct informations. One to get the informations about the VM and another one to get security groups.

STEPS TO REPRODUCE
1. Call list virtual machine api call using cmk and check `securitygroup` field, it is empty.
2. Add some ingress rules to the security group.
3. Call list virtual machine api call using cmk and check `securitygroup` field again, it is empty. 
EXPECTED RESULTS
The ingress rule added to the `securitygroup` field of the virtual machine API call.
ACTUAL RESULTS
The ingress rule in `securitygroup` is empty.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions