Skip to content

CLOUDSTACK-9907 Physical size of snapshot is considered for usage - #2100

Merged
karuturi merged 1 commit into
masterfrom
unknown repository
Jun 7, 2017
Merged

karuturi merged 1 commit into
masterfrom
unknown repository

Conversation

@SowjanyaPatha

Copy link
Copy Markdown
Contributor

Physical size of the snapshot is considered for the usage generation. This will have a huge impact on customer billiing after the FIX(https://issues.apache.org/jira/browse/CLOUDSTACK-7825).
As part of the above fix size column now has the physical size of the snapshot and the virtual_size column has the virtual size of the volume.
Now when the usage is processed it is taking the size ( which is physical size of the snapshot). But It should take Virtual size for existing customers.
So as part of fix providing option for customers to choose between virtual and physical size.

@jayakarteek

Copy link
Copy Markdown
Contributor

Code LGTM

@vedulasantosh

Copy link
Copy Markdown
Contributor

Test LGTM

In my observation when we give the global configuration (usage.snapshot.virtualsize.select) value as true virtual size of the snapshot is considered(10th row in table1, 4th row in table2).
In second case when we give the global configuration (usage.snapshot.virtualsize.select) value as false physical size of the snapshot is considered(11th row in table1, 6th row in table2).

mysql> select * from cloud_usage.usage_event where id in (10,11);
+----+-----------------+------------+---------------------+---------+-------------+-------------------+-------------+-------------+-------+---------------+-----------+--------------+
| id | type | account_id | created | zone_id | resource_id | resource_name | offering_id | template_id | size | resource_type | processed | virtual_size |
+----+-----------------+------------+---------------------+---------+-------------+-------------------+-------------+-------------+-------+---------------+-----------+--------------+
| 10 | SNAPSHOT.CREATE | 2 | 2017-05-22 06:51:50 | 1 | 4 | Snapshot-root-3 | NULL | NULL | 45056 | NULL | 1 | 21474836480 |
| 11 | SNAPSHOT.CREATE | 2 | 2017-05-22 07:09:35 | 1 | 6 | Snapshot-root-3-2 | NULL | NULL | 45056 | NULL | 1 | 21474836480 |
+----+-----------------+------------+---------------------+---------+-------------+-------------------+-------------+-------------+-------+---------------+-----------+--------------+
2 rows in set (0.00 sec)

mysql> select * from usage_storage where id in (4,6);
+----+---------+------------+-----------+--------------+-----------+-------------+---------------------+---------+--------------+
| id | zone_id | account_id | domain_id | storage_type | source_id | size | created | deleted | virtual_size |
+----+---------+------------+-----------+--------------+-----------+-------------+---------------------+---------+--------------+
| 4 | 1 | 2 | 1 | 3 | NULL | 21474836480 | 2017-05-22 06:51:50 | NULL | NULL |
| 6 | 1 | 2 | 1 | 3 | NULL | 45056 | 2017-05-22 07:09:35 | NULL | NULL |
+----+---------+------------+-----------+--------------+-----------+-------------+---------------------+---------+--------------+
2 rows in set (0.00 sec)

@SowjanyaPatha

Copy link
Copy Markdown
Contributor Author

tag:MergeReady

String sanityCheckInterval = configs.get("usage.sanity.check.interval");
String quotaEnable = configs.get("quota.enable.service");
_runQuota = Boolean.valueOf(quotaEnable == null ? "false" : quotaEnable );
usageSnapshotSelection = Boolean.valueOf(configs.get("usage.snapshot.virtualsize.select"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use usageSnapshotSelection.value() instead of configs.get

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jayapalu It is effecting existing implementations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ok

@jayapalu

Copy link
Copy Markdown
Contributor

LGTM

@karuturi

karuturi commented Jun 6, 2017

Copy link
Copy Markdown
Member

BVT results are required

@cloudmonger

Copy link
Copy Markdown

ACS CI BVT Run

Sumarry:
Build Number 803
Hypervisor xenserver
NetworkType Advanced
Passed=107
Failed=5
Skipped=12

Link to logs Folder (search by build_no): https://www.dropbox.com/sh/r2si930m8xxzavs/AAAzNrnoF1fC3auFrvsKo_8-a?dl=0

Failed tests:

  • test_volumes.py

  • test_06_download_detached_volume Failing since 6 runs

  • test_routers_network_ops.py

  • test_01_isolate_network_FW_PF_default_routes_egress_true Failing since 2 runs

  • test_02_isolate_network_FW_PF_default_routes_egress_false Failing since 2 runs

  • test_01_RVR_Network_FW_PF_SSH_default_routes_egress_true Failing since 2 runs

  • test_02_RVR_Network_FW_PF_SSH_default_routes_egress_false Failing since 2 runs

Skipped tests:
test_vm_nic_adapter_vmxnet3
test_01_verify_libvirt
test_02_verify_libvirt_after_restart
test_03_verify_libvirt_attach_disk
test_04_verify_guest_lspci
test_05_change_vm_ostype_restart
test_06_verify_guest_lspci_again
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_vm_snapshots.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_metrics_api.py
test_regions.py
test_affinity_groups.py
test_network_acl.py
test_pvlan.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

@karuturi

karuturi commented Jun 7, 2017

Copy link
Copy Markdown
Member

failures aren't related. merging.

@karuturi
karuturi merged commit ccd623f into apache:master Jun 7, 2017
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.

7 participants