Skip to content

storage: publish delete usage event for snapshot deletion#3212

Merged
yadvr merged 1 commit intoapache:masterfrom
shapeblue:usage-delete-vmsnapshot
Apr 10, 2019
Merged

storage: publish delete usage event for snapshot deletion#3212
yadvr merged 1 commit intoapache:masterfrom
shapeblue:usage-delete-vmsnapshot

Conversation

@yadvr
Copy link
Member

@yadvr yadvr commented Mar 12, 2019

Problem: Users are billed for destroyed VMs with VM snapshots because usage records don't get that the VM and VM snapshots are removed.
Root Cause: The destroyVirtualMachine and expungeVirtualMachine APIs were removing VM snapshots but not generating VMSNAPSHOT.DELETE usage event due to which the VM snapshots were not marked as removed in the usage_vmsnapshot table.
Solution: The issue was fixed by emitting the proper usage event for all the VM snapshots of a VM that is destroyed.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

This publishes VM snapshot delete event after a snapshot is removed,
this will ensure that usage records are not generated for deleted
snapshots.

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

@blueorangutan package

@blueorangutan
Copy link

@borisstoyanov 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-2655

@yadvr yadvr requested a review from borisstoyanov March 29, 2019 06:43
@yadvr yadvr changed the title storage: publish delete usage event for snapshot deletion [WIP DO NOT MERGE] storage: publish delete usage event for snapshot deletion Mar 29, 2019
Copy link
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

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

LGTM, passed manual verification

@borisstoyanov
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Trillian test result (tid-3452)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 31491 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr3212-t3452-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Smoke tests completed. 70 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@DagSonsteboSB
Copy link

LGTM

@yadvr yadvr changed the title [WIP DO NOT MERGE] storage: publish delete usage event for snapshot deletion storage: publish delete usage event for snapshot deletion Apr 10, 2019
@yadvr yadvr merged commit 491a10b into apache:master Apr 10, 2019
pbankonier pushed a commit to pbankonier/cloudstack that referenced this pull request Apr 24, 2019
Problem: Users are billed for destroyed VMs with VM snapshots because usage records don't get that the VM and VM snapshots are removed.
Root Cause: The destroyVirtualMachine and expungeVirtualMachine APIs were removing VM snapshots but not generating VMSNAPSHOT.DELETE usage event due to which the VM snapshots were not marked as removed in the usage_vmsnapshot table.
Solution: The issue was fixed by emitting the proper usage event for all the VM snapshots of a VM that is destroyed.
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.

4 participants