cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Fix backup dates

Open JoaoJandre opened this issue 2 years ago • 23 comments

Description

Currently, the backup date in Veeam is collected as a String and saved as VARCHAR(255) in the database, which can lead to errors and inconsistencies.

We are proposing with this PR to persist the backup dates as a DATETIME object, which will enable us to properly manipulate it, regardless of the date format used in the environment. The UI was also changed to display the complete data format.

When upgrading the DB schema, we delete all backup entries in the DB; these backups are synchronized with Veeam backups by ACS afterwards. In the end, no Veeam backups should be lost. Only dummy backups will be permanently deleted, and since they are not relevant in production, no harm will be caused.

Types of changes

  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] New feature (non-breaking change which adds functionality)
  • [X] 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)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • [ ] Major
  • [ ] Minor

Bug Severity

  • [ ] BLOCKER
  • [ ] Critical
  • [ ] Major
  • [X] Minor
  • [ ] Trivial

Screenshots (if appropriate):

Storage->Backups image

Instances->VM->Backups image

How Has This Been Tested?

This was tested in a local lab, by upgrading the DB schema and then checking if ACS would correctly synchronize with Veeam. After that, the UI was checked to see if everything was as expected. New backups were created and checked. The same tests were made using the dummy provider.

JoaoJandre avatar Jun 17 '22 15:06 JoaoJandre

@blueorangutan package

GutoVeronezi avatar Jun 21 '22 16:06 GutoVeronezi

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

blueorangutan avatar Jun 21 '22 16:06 blueorangutan

@GutoVeronezi a Jenkins job has been kicked to build packages. It will be bundled with SystemVM template(s). I'll keep you posted as I make progress.

blueorangutan avatar Jun 21 '22 16:06 blueorangutan

Found UI changes, kicking a new UI QA build @blueorangutan ui

acs-robot avatar Jun 21 '22 16:06 acs-robot

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Jun 21 '22 16:06 blueorangutan

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Jun 21 '22 16:06 blueorangutan

UI build: :heavy_multiplication_x: (SL-JID-1799)

blueorangutan avatar Jun 21 '22 16:06 blueorangutan

UI build: :heavy_multiplication_x: (SL-JID-3)

blueorangutan avatar Jun 21 '22 16:06 blueorangutan

Packaging result: :heavy_multiplication_x: el7 :heavy_multiplication_x: el8 :heavy_multiplication_x: debian :heavy_multiplication_x: suse15. SL-JID 1

blueorangutan avatar Jun 21 '22 17:06 blueorangutan

Packaging result: :heavy_multiplication_x: el7 :heavy_multiplication_x: el8 :heavy_multiplication_x: debian :heavy_multiplication_x: suse15. SL-JID 3617

blueorangutan avatar Jun 21 '22 17:06 blueorangutan

Found UI changes, kicking a new UI QA build @blueorangutan ui

acs-robot avatar Jun 22 '22 11:06 acs-robot

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Jun 22 '22 11:06 blueorangutan

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Jun 22 '22 11:06 blueorangutan

UI build: :heavy_multiplication_x: (SL-JID-1810)

blueorangutan avatar Jun 22 '22 11:06 blueorangutan

Found UI changes, kicking a new UI QA build @blueorangutan ui

acs-robot avatar Jun 24 '22 13:06 acs-robot

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

blueorangutan avatar Jun 24 '22 13:06 blueorangutan

UI build: :heavy_multiplication_x: (SL-JID-1837)

blueorangutan avatar Jun 24 '22 13:06 blueorangutan

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar Jun 27 '22 04:06 github-actions[bot]

@JoaoJandre which versions of Veeam was this tested with?

rohityadavcloud avatar Jun 28 '22 17:06 rohityadavcloud

@JoaoJandre which versions of Veeam was this tested with?

Hello @rohityadavcloud, no changes were made in the way the data is being collected. Only in the way the data is processed and stored in the DB. Therefore, this will work with the same versions of Veeam as it has been working until now.

JoaoJandre avatar Jun 29 '22 12:06 JoaoJandre

This PR breaks compatibility for existing users with backups on upgrade as the upgrade path runs DELETE FROM `cloud`.`backups` . So, it can't be accepted unless the PR handles upgrades in a more smoother way, or at least we make an attempt to consult and build support with users (on users@ perhaps?).

rohityadavcloud avatar Aug 03 '22 10:08 rohityadavcloud

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

github-actions[bot] avatar Aug 08 '22 12:08 github-actions[bot]

@JoaoJandre can you look at the conflicts here, please?

DaanHoogland avatar Dec 13 '22 08:12 DaanHoogland

@rohityadavcloud @harikrishna-patnala @sureshanaparti I finally got around addressing your reviews, now the data migration is done in the Upgrade41810to41900.java file.

JoaoJandre avatar Apr 27 '23 16:04 JoaoJandre

Codecov Report

Merging #6473 (8c4be18) into main (e166f96) will increase coverage by 0.00%. The diff coverage is 0.63%.

@@            Coverage Diff             @@
##               main    #6473    +/-   ##
==========================================
  Coverage     12.70%   12.71%            
- Complexity     8673     8703    +30     
==========================================
  Files          2715     2727    +12     
  Lines        256071   256580   +509     
  Branches      39926    39991    +65     
==========================================
+ Hits          32541    32628    +87     
- Misses       219391   219802   +411     
- Partials       4139     4150    +11     
Impacted Files Coverage Δ
...ck/engine/subsystem/api/storage/VolumeService.java 0.00% <ø> (ø)
...ine/subsystem/api/storage/type/VolumeTypeBase.java 10.00% <ø> (ø)
...e/subsystem/api/storage/type/VolumeTypeHelper.java 100.00% <ø> (ø)
.../main/java/com/cloud/network/IpAddressManager.java 100.00% <ø> (ø)
...java/com/cloud/agent/manager/AgentManagerImpl.java 4.77% <0.00%> (-0.17%) :arrow_down:
...cloud/agent/manager/ClusteredAgentManagerImpl.java 0.00% <0.00%> (ø)
...n/java/com/cloud/vm/VmWorkJobWakeupDispatcher.java 0.00% <ø> (ø)
.../cloud/configuration/dao/ResourceCountDaoImpl.java 8.84% <ø> (ø)
...in/java/com/cloud/dc/dao/ClusterVSMMapDaoImpl.java 0.00% <ø> (ø)
...in/java/com/cloud/dc/dao/DomainVlanMapDaoImpl.java 54.54% <ø> (ø)
... and 48 more

... and 27 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Apr 28 '23 10:04 codecov[bot]

@blueorangutan package

rohityadavcloud avatar May 23 '23 05:05 rohityadavcloud

@rohityadavcloud a [SF] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

blueorangutan avatar May 23 '23 05:05 blueorangutan

Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: el9 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 6106

blueorangutan avatar May 23 '23 08:05 blueorangutan

@blueorangutan test rocky-8 vmware-72

DaanHoogland avatar May 23 '23 16:05 DaanHoogland