cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

details not in listVirtualMachines response

Open resmo opened this issue 8 years ago • 14 comments

ISSUE TYPE

Bug Report

COMPONENT NAME
API
CLOUDSTACK VERSION
4.11
4.9
CONFIGURATION

N/A

OS / ENVIRONMENT

N/A

SUMMARY

listVirtualMachines does not return details as doc says.

STEPS TO REPRODUCE
cs listVirtualMachines id=d949e443-9bc8-4399-9e09-842bbb395cae --region simulator    
EXPECTED RESULTS

the resource details as below should be included in listVirtualMachines response, as the documentation of the API says or the API doc should be updated.

cs listResourceDetails resourcetype=uservm resourceid=d949e443-9bc8-4399-9e09-842bbb395cae --region=simulator     
{
  "count": 3, 
  "resourcedetail": [
    {
      "fordisplay": true, 
      "key": "foo", 
      "resourceid": "5", 
      "resourcetype": "UserVm", 
      "value": "bar"
    }, 
    {
      "fordisplay": true, 
      "key": "Message.ReservedCapacityFreed.Flag", 
      "resourceid": "5", 
      "resourcetype": "UserVm", 
      "value": "false"
    }, 
    {
      "fordisplay": true, 
      "key": "SSH.PublicKey", 
      "resourceid": "5", 
      "resourcetype": "UserVm", 
      "value": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCalaJdHI7bK4qsCMSqJ1iq7K4YuHyjlkahPuSsbMrZInN2Mo1ehjieILocEITo8ck+rFkC4NHc6mvUDF3gdUZmWKpWYfc5eKsymOHgk05Nv1e+1TjvKGWaZprisUFXD+52PkQ6DcAZUDYw1yufxGfufYuK3WWzDHriSBIiaDEcgw== \n"
    }
  ]
}
ACTUAL RESULTS
{
  "count": 1, 
  "virtualmachine": [
    {
      "account": "admin", 
      "affinitygroup": [
        {
          "account": "admin", 
          "id": "2d41d761-6d4e-400a-9f26-cc0d5ef6f884", 
          "name": "ansible-test-titan-10437836-ag"
        }
      ], 
      "cpunumber": 1, 
      "cpuspeed": 500, 
      "cpuused": "10%", 
      "created": "2018-03-31T18:07:13+0000", 
      "diskioread": 0, 
      "diskiowrite": 0, 
      "diskkbsread": 0, 
      "diskkbswrite": 0, 
      "displayname": "ansible-test-titan-10437836-display-1", 
      "displayvm": true, 
      "domain": "ROOT", 
      "domainid": "1f1d6aa1-4b9a-11e7-8fea-0242ac110003", 
      "guestosid": "1ef0010d-4b9a-11e7-8fea-0242ac110003", 
      "haenable": false, 
      "hostid": "41adc5d5-3b6a-4035-9913-7b14fa099c1f", 
      "hostname": "SimulatedAgent.db961dea-4e46-48c6-983e-566712333810", 
      "hypervisor": "Simulator", 
      "id": "d949e443-9bc8-4399-9e09-842bbb395cae", 
      "instancename": "i-2-5-VM", 
      "isdynamicallyscalable": false, 
      "keypair": "ansible-test-titan-10437836-sshkey", 
      "memory": 512, 
      "memoryintfreekbs": 0, 
      "memorykbs": 0, 
      "memorytargetkbs": 0, 
      "name": "ansible-test-titan-10437836-vm-1", 
      "networkkbsread": 148668416, 
      "networkkbswrite": 74334208, 
      "nic": [
        {
          "broadcasturi": "vlan://untagged", 
          "gateway": "60.147.41.1", 
          "id": "8bee0927-6506-4a18-93bc-ccce070714a2", 
          "ipaddress": "60.147.41.246", 
          "isdefault": true, 
          "macaddress": "06:ce:d4:00:01:f2", 
          "netmask": "255.255.255.0", 
          "networkid": "6f4007a0-ddba-4cdf-ac34-c9c0e5f049b8", 
          "networkname": "guestNetworkForBasicZone", 
          "secondaryip": [], 
          "traffictype": "Guest", 
          "type": "Shared"
        }
      ], 
      "ostypeid": 142, 
      "passwordenabled": false, 
      "rootdeviceid": 0, 
      "rootdevicetype": "ROOT", 
      "securitygroup": [
        {
          "account": "admin", 
          "egressrule": [], 
          "id": "abcdb1a7-4795-4aff-82a9-ca4347b017fd", 
          "ingressrule": [], 
          "name": "ansible-test-titan-10437836-sg", 
          "tags": [], 
          "virtualmachineids": []
        }
      ], 
      "serviceofferingid": "a9ad69ae-391d-43ba-97a8-5f33b78a955d", 
      "serviceofferingname": "Small Instance", 
      "state": "Running", 
      "tags": [], 
      "templatedisplaytext": "CentOS 5.6 (64-bit) no GUI (Simulator)", 
      "templateid": "4f4c3063-4b9a-11e7-8fea-0242ac110003", 
      "templatename": "CentOS 5.6 (64-bit) no GUI (Simulator)", 
      "userid": "1f1daf4d-4b9a-11e7-8fea-0242ac110003", 
      "username": "admin", 
      "zoneid": "ab54814a-b8b9-4889-ae76-cae19c0c843f", 
      "zonename": "Sandbox-simulator-basic"
    }
  ]
}

resmo avatar Apr 03 '18 21:04 resmo

@resmo did you try that as a normal user or root/domain admin?

yadvr avatar Apr 30 '18 06:04 yadvr

I used root

resmo avatar Apr 30 '18 16:04 resmo

is this to be fixed in documentation? It is tagged for 4.11.1 but no PR is out for it

DaanHoogland avatar Jun 04 '18 11:06 DaanHoogland

I am not aware of anyone working on this.

resmo avatar Jun 04 '18 11:06 resmo

Aren't the details in when root/admin call the api?

yadvr avatar Jun 04 '18 11:06 yadvr

the call in the "acutal result" is an root admin

resmo avatar Jun 04 '18 11:06 resmo

ok @resmo , I'll have a look tomorrow

DaanHoogland avatar Jun 04 '18 16:06 DaanHoogland

sorry to be late at looking at this @resmo. I can confirm list virtual machines does not show any resource details. Do we feel the API or the DOC must be updated?

DaanHoogland avatar Jul 03 '18 18:07 DaanHoogland

@resmo if I understand correctly, you would like the listVirtualMachines API to include the resource details tag in its response?

dhlaluku avatar Jul 03 '18 18:07 dhlaluku

yes, I would prefer the API to return the details as well.

resmo avatar Jul 03 '18 18:07 resmo

@resmo thanks, I will have a look and update the API response with this tag.

/CC @DaanHoogland @rhtyd

dhlaluku avatar Jul 03 '18 18:07 dhlaluku

sound cool @dhlaluku

DaanHoogland avatar Jul 03 '18 19:07 DaanHoogland

there is a flag: details=true

fmaximus avatar Sep 21 '18 14:09 fmaximus

can no longer reproduce. closing.

resmo avatar Sep 25 '18 10:09 resmo