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-10060:ListUsage API always displays the Virtual size as '0' for Usage type=9 (snapshot) #2257

Merged
merged 1 commit into from Oct 12, 2017

Conversation

PranaliM
Copy link
Contributor

@PranaliM PranaliM commented Sep 1, 2017

Bug Description:
In the listUsage API, the Virtual Size of Snapshot is always displayed as '0'.

Root Cause:
In case of snapshots, the usage is accounted for depending on the value of the global parameter, 'usage.snapshot.virtualsize.select'. If set to 'true', the usage calculation is done based on the Virtual Size, and if set to false, it is done based on the Physical size. In the Usage API, this value, (i.e. virtual or physical) is displayed as 'Size' field correctly, but the field 'VirtualSize' is always displayed as 0. This is misleading.

Expected Output:
Since this is a Usage API, ideally only that size should be displayed which is used for billing, depending on the value of 'usage.snapshot.virtualsize.select'.
There is another API - the ListSnapshot API that displays both, the physical as well as Virtual size and can be used to know both the sizes.

Fix Implemented:
Skipped showing the 'VirtualSize' Field for type=snapshot

@PranaliM PranaliM changed the title CLOUDSTACK-10060:ListUsage API always displays the Virtual size as '0 for Usage type=9 (snapshot) CLOUDSTACK-10060:ListUsage API always displays the Virtual size as '0' for Usage type=9 (snapshot) Sep 1, 2017
@PranaliM
Copy link
Contributor Author

PranaliM commented Sep 1, 2017

After Fix: Only 1 field displayed as 'Size'

after_fix

@SowjanyaPatha
Copy link
Contributor

LGTM for Testing.
Created an instance.
Took a snapshot of root volume.
Executed the API command http://localhost:8080/client/api?command=listUsageRecords&startdate=2017-09-06&enddate=2017-09-06&type=9 it is showing Physical size when 'usage.snapshot.virtualsize.select' is false.
Changed the 'usage.snapshot.virtualsize.select' to true and took another snapshot and executed the API Command http://localhost:8080/client/api?command=listUsageRecords&startdate=2017-09-06&enddate=2017-09-06&type=9 it is showing the virtual size.

@yvsubhash
Copy link

LGTM for code

@PranaliM
Copy link
Contributor Author

tag:mergeready

@rohityadavcloud
Copy link
Member

@blueorangutan package

usageDesc += "Id:" + storageId + " Size:" + size + "VirtualSize:" + virtualSize;
usageDesc += "Id:" + storageId + " Size:" + size;
if(type != StorageTypes.SNAPSHOT) {
usageDesc += " VirtualSize:" + virtualSize;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PranaliM fix indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhtyd - Fixed indentation

@rohityadavcloud
Copy link
Member

@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-1102

@rohityadavcloud
Copy link
Member

@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-1127

@rohityadavcloud
Copy link
Member

@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-1139

@rohityadavcloud
Copy link
Member

@blueorangutan test

@blueorangutan
Copy link

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link

Trillian test result (tid-1566)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 40630 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2257-t1566-kvm-centos7.zip
Intermitten failure detected: /marvin/tests/smoke/test_deploy_virtio_scsi_vm.py
Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermitten failure detected: /marvin/tests/smoke/test_routers_network_ops.py
Intermitten failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Intermitten failure detected: /marvin/tests/smoke/test_vpc_vpn.py
Test completed. 59 look OK, 3 have error(s)

Test Result Time (s) Test File
test_01_vpc_remote_access_vpn Failure 55.96 test_vpc_vpn.py
test_05_rvpc_multi_tiers Failure 255.88 test_vpc_redundant.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Failure 358.66 test_vpc_redundant.py
test_04_rvpc_privategw_static_routes Failure 356.21 test_privategw_acl.py
test_change_service_offering_for_vm_with_snapshots Skipped 0.00 test_vm_snapshots.py
test_09_copy_delete_template Skipped 0.02 test_templates.py
test_06_copy_template Skipped 0.00 test_templates.py
test_static_role_account_acls Skipped 0.02 test_staticroles.py
test_11_ss_nfs_version_on_ssvm Skipped 0.02 test_ssvm.py
test_01_scale_vm Skipped 0.00 test_scale_vm.py
test_01_primary_storage_iscsi Skipped 0.11 test_primary_storage.py
test_vm_nic_adapter_vmxnet3 Skipped 0.00 test_nic_adapter_type.py
test_nested_virtualization_vmware Skipped 0.00 test_nested_virtualization.py
test_06_copy_iso Skipped 0.00 test_iso.py
test_list_ha_for_host_valid Skipped 0.02 test_hostha_simulator.py
test_list_ha_for_host_invalid Skipped 0.02 test_hostha_simulator.py
test_list_ha_for_host Skipped 0.02 test_hostha_simulator.py
test_hostha_enable_feature_without_setting_provider Skipped 0.02 test_hostha_simulator.py
test_hostha_enable_feature_valid Skipped 0.02 test_hostha_simulator.py
test_hostha_disable_feature_valid Skipped 0.02 test_hostha_simulator.py
test_hostha_configure_invalid_provider Skipped 0.02 test_hostha_simulator.py
test_hostha_configure_default_driver Skipped 0.02 test_hostha_simulator.py
test_ha_verify_fsm_recovering Skipped 0.02 test_hostha_simulator.py
test_ha_verify_fsm_fenced Skipped 0.02 test_hostha_simulator.py
test_ha_verify_fsm_degraded Skipped 0.02 test_hostha_simulator.py
test_ha_verify_fsm_available Skipped 0.02 test_hostha_simulator.py
test_ha_multiple_mgmt_server_ownership Skipped 0.02 test_hostha_simulator.py
test_ha_list_providers Skipped 0.02 test_hostha_simulator.py
test_ha_enable_feature_invalid Skipped 0.02 test_hostha_simulator.py
test_ha_disable_feature_invalid Skipped 0.02 test_hostha_simulator.py
test_ha_configure_enabledisable_across_clusterzones Skipped 0.02 test_hostha_simulator.py
test_configure_ha_provider_valid Skipped 0.02 test_hostha_simulator.py
test_configure_ha_provider_invalid Skipped 0.02 test_hostha_simulator.py
test_deploy_vgpu_enabled_vm Skipped 0.03 test_deploy_vgpu_enabled_vm.py
test_3d_gpu_support Skipped 0.03 test_deploy_vgpu_enabled_vm.py

@rohityadavcloud rohityadavcloud merged commit 189b0e4 into apache:master Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants