Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLOUDSTACK-9507: ListVM response's guest_os id should be a UUID #1686

Closed
wants to merge 1 commit into from

Conversation

rohityadavcloud
Copy link
Member

@rohityadavcloud rohityadavcloud commented Sep 23, 2016

The listVirtualMachines API response contains a guest os_type field which
is an integer, and therefore not useful or easily consumable. This fixes and
migrates the returned type from an id (integer) to a uuid (string). It makes
the response consistent with other API responses such as those of listTemplates
and allow end users to consume this uuid.

/cc @jburwell @karuturi -- this is a minor change. It may be debatable if this break api response compatibility, please advise.

@blueorangutan package

The listVirtualMachines API response contains a guest os_type_id field which
is an integer, and therefore not useful or easily consumable. This fixes and
migrates the returned type from an id (integer) to a uuid (string). It makes
the response consistent with other API responses such as those of listTemplates
and allow end users to consume this uuid.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-22

@serg38
Copy link

serg38 commented Sep 23, 2016

@rhtyd Somehow it works fine without this patch
curl "http://localhost:8096//client/api?command=listVirtualMachines&listall=true&response=json"
{"listvirtualmachinesresponse":{"count":1,"virtualmachine":[{"id":"beb85d73-17cd-4de5-8c35-61f70d88e5e1","name":"TEST-3DGPU-NICO","displayname":"TEST-3DGPU-NICO","account":"admin","userid":"d557133a-3fcc-11e5-9c45-005056ad45b7","username":"admin","domainid":"5a7ffa07-3fca-11e5-9c45-005056ad45b7","domain":"ROOT","created":"2016-08-30T16:21:45-0700","state":"Stopped","haenable":false,"zoneid":"0d074f25-ed31-482f-8bc5-44c9314fc417","zonename":"ECS-NSX","templateid":"d6584e60-d500-40cd-9a33-1700a59c464c","templatename":"VMXNET3 template-287NCX","templatedisplaytext":"VMXNET3 Template","passwordenabled":false,"serviceofferingid":"0b9dab64-60ec-4c19-8a36-8725660d37d1","serviceofferingname":"Tiny Instance","cpunumber":1,"cpuspeed":100,"memory":128,"## guestosid":"5aadaacc-3fca-11e5-9c45-005056ad45b7","rootdeviceid":0,"rootdevicetype":"ROOT","securitygroup":[],"nic":[{"id":"08e0b3fe-219f-46bb-a766-70717a15a7fd","networkid":"c05a5c09-eb29-49bc-9cfd-705becc7a909","networkname":"VLAN13","netmask":"255.255.255.0","gateway":"10.140.13.1","ipaddress":"10.140.13.81","isolationuri":"vlan://13","broadcasturi":"vlan://13","traffictype":"Guest","type":"Shared","isdefault":true,"macaddress":"06:0a:d0:00:36:d9","secondaryip":[]}],"hypervisor":"VMware","instancename":"i-2-9253-VM","affinitygroup":[],"displayvm":true,"isdynamicallyscalable":false,"ostypeid":12,"tags":[]}]}}

@serg38
Copy link

serg38 commented Sep 23, 2016

@rhtyd I think you meant guest_os_type not guest_os_id. In this case the issue is not only that it returns ID instead of UUID but also that it doesn't return ID of os type. In the sample output ostypeid":12 is not correct OS type which is supposed to be 1 ( CentOs). The right response seems to be
userVmResponse.setOsTypeId(userVm.getGuestType().toString());
vs
userVmResponse.setOsTypeId(userVm.getGuestOsUuid());

@rohityadavcloud
Copy link
Member Author

@serg38 I mean the os_type_id, which was previously returned as an integer but should be returned as a uuid. The uuid would be consumeable by the listGuestOsMapping API.

@serg38
Copy link

serg38 commented Sep 27, 2016

@rhytd Current implementation has a bug as well that returns GuestOsId in place of GuestOsTypeId. I am for not only switching to UUID but also for fixing it and returning correct output.

@jburwell
Copy link
Contributor

@rhtyd @serg38 while I agree that this change makes logical sense, it breaks the API compatibility which we guarantee for major releases. 5.0.0 is scheduled to open on 5 December 2016. I suggest that we hold this PR until that time when we will be accepting changes that break API backwards compatibility.

@rohityadavcloud
Copy link
Member Author

Instead of changing the response type, another way is additive -- to introduce a new key (guestosuuid) in the response that returns the uuid for the expected key.

@serg38
Copy link

serg38 commented Oct 21, 2016

@rhtyd This clearly a bug. os_type_id was always supposed to be a OS type as per:

@SerializedName(ApiConstants.OS_TYPE_ID)
@param(description = "OS type id of the vm", since = "4.4")
private String osTypeId;

Currently it returns an OS Id. Guest OS UUID is already part of response as guestosid .

Basically there are 3 options:

  1. Fix current bug and correctly return OS type ID as os_type_id
  2. Fix current bug but return OS type UUID as os_type_id
  3. Fix current bug and correctly return OS type ID as os_type_id plus add a new response os_type_uuid that would be returning UUID of the guest Os category.

I think #3 is overkill. I am for #2.

@rohityadavcloud
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-199

@serg38
Copy link

serg38 commented Nov 23, 2016

I am -1 in the current form

@rohityadavcloud
Copy link
Member Author

This PR will be on hold until next set of 4.8.x, 4.9.x, 4.10.x releases.

@cloudmonger
Copy link

ACS CI BVT Run

Sumarry:
Build Number 442
Hypervisor xenserver
NetworkType Advanced
Passed=104
Failed=1
Skipped=7

Link to logs Folder (search by build_no): https://www.dropbox.com/sh/yj3wnzbceo9uef2/AAB6u-Iap-xztdm6jHX9SjPja?dl=0

Failed tests:

  • test_routers_network_ops.py

  • test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true Failed

Skipped tests:
test_01_test_vm_volume_snapshot
test_vm_nic_adapter_vmxnet3
test_static_role_account_acls
test_11_ss_nfs_version_on_ssvm
test_nested_virtualization_vmware
test_3d_gpu_support
test_deploy_vgpu_enabled_vm

Passed test suits:
test_deploy_vm_with_userdata.py
test_affinity_groups_projects.py
test_portable_publicip.py
test_over_provisioning.py
test_global_settings.py
test_scale_vm.py
test_service_offerings.py
test_routers_iptables_default_policy.py
test_loadbalance.py
test_routers.py
test_reset_vm_on_reboot.py
test_deploy_vms_with_varied_deploymentplanners.py
test_network.py
test_router_dns.py
test_non_contigiousvlan.py
test_login.py
test_deploy_vm_iso.py
test_list_ids_parameter.py
test_public_ip_range.py
test_multipleips_per_nic.py
test_regions.py
test_affinity_groups.py
test_network_acl.py
test_pvlan.py
test_volumes.py
test_nic.py
test_deploy_vm_root_resize.py
test_resource_detail.py
test_secondary_storage.py
test_vm_life_cycle.py
test_disk_offerings.py

@rohityadavcloud
Copy link
Member Author

Break api response, closing for now

@blueorangutan
Copy link

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result: ✖centos6 ✖centos7 ✖debian. JID-830

lucas-a-martins pushed a commit to scclouds/cloudstack that referenced this pull request Jan 29, 2024
…to '4.18.0.0-scclouds'

Permitir que contas com o _plugin_ Quota desabilitado continuem acessando as APIs do Quota

Closes apache#1686

See merge request scclouds/scclouds!710
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants