Skip to content

[Veeam] Restore only a specified volume - #7221

Closed
SadiJr wants to merge 16 commits into
apache:mainfrom
scclouds:veeam-restore-only-specified-volume
Closed

SadiJr wants to merge 16 commits into
apache:mainfrom
scclouds:veeam-restore-only-specified-volume

Conversation

@SadiJr

@SadiJr SadiJr commented Feb 14, 2023

Copy link
Copy Markdown
Contributor

Description

Using VMWare with Veeam on ACS, when restoring a volume from a backup, ACS creates a new VM from the backup, detaches all volumes, and attaches the selected volume to the original VM.

Veeam allows restoring only the selected volume, which is faster and more performant than the current approach. This PR aims to improve the volume restore process using this native option of Veeam.

Also, when restoring and attaching one volume to one VM, the target VM needs to be stopped and then started. However, the entire process is manual; even Veeam allows the VM to be started automatically if the restore is successful. A new parameter, startvm, has been added to the API restoreVolumeFromBackupAndAttachToVM, allowing operators to specify whether or not the VM should be started automatically when volume restoration is complete.

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)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

How Has This Been Tested?

It was tested in a local lab:

  1. I created a new VM and attached this VM to a Backup Offering;
  2. I made some manual backups;
  3. I restore some volume of this backups, without using the parameter startvm, and check if, in Veeam and vCenter, only the selected volume are restored, which results in success, but i had to start the VM manually;
  4. Via cmk, I indicate the parameter startvm as true, and the VM is automatically started by Veeam when restore finishes.

@codecov

codecov Bot commented Feb 14, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 4.18%. Comparing base (8806e44) to head (5120402).
Report is 58 commits behind head on main.

Current head 5120402 differs from pull request most recent head cda1c45

Please upload reports for the commit cda1c45 to get more accurate results.

❗ There is a different number of reports uploaded between BASE (8806e44) and HEAD (5120402). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (8806e44) HEAD (5120402)
unittests 1 0
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #7221       +/-   ##
============================================
- Coverage     15.42%   4.18%   -11.24%     
============================================
  Files          5469     369     -5100     
  Lines        478292   30284   -448008     
  Branches      58134    5359    -52775     
============================================
- Hits          73775    1268    -72507     
+ Misses       396389   28872   -367517     
+ Partials       8128     144     -7984     
Flag Coverage Δ
uitests 4.18% <ø> (ø)
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sonarqubecloud

Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 6 Code Smells

16.7% 16.7% Coverage
0.0% 0.0% Duplication

@github-actions

github-actions Bot commented Apr 4, 2023

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

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

@DaanHoogland DaanHoogland added this to the 4.19.0.0 milestone Jun 22, 2023

@harikrishna-patnala harikrishna-patnala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @SadiJr, except the suggested few changes, the remaining code LGTM.

Comment on lines +77 to +80
@Parameter(name = ApiConstants.START_VM,
type = CommandType.BOOLEAN,
required = false,
description = "start VM after the restore is finished")

@DaanHoogland DaanHoogland Jul 3, 2023

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.

Suggested change
@Parameter(name = ApiConstants.START_VM,
type = CommandType.BOOLEAN,
required = false,
description = "start VM after the restore is finished")
@Parameter(name = ApiConstants.START_VM,
type = CommandType.BOOLEAN,
required = false,
description = "start VM after the restore is finished",
since = "4.19.0")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this will power on the vm from veeam, looks like a out-of-band operation (the power state, host_id, etc are not managed by cloudstack).

@SadiJr
I think we should avoid it. cc @DaanHoogland

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.

@weizhouapache when using the option to power on VM from Veeam, it will only start the VM in the last host the VM was allocated to. Also, there is a process in ACS that updates the VM state from time to time, according to what is collected from vCenter. Additionally, the HA process in VMWare is also not managed by ACS. Having said all that, I believe that if Veeam has this option, we should leave it up to the user to decide, not us.

@weizhouapache weizhouapache Dec 15, 2023

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@SadiJr
You can do lots of operations on vcenter or veeam, but cloudstack does not support OOB operations perfectly.

We should avoid the OOB operations as much as possible, unless it is really neccessary.
I think it is unnecessary to add the option. If you insist to support, I would rather starting the vm by invoking cloudstack methods/API (as cloudstack will check the proper host by available resources, affinity groups, and apply network rules, etc), than starting the vm via veeam.

Let me give you an example, if you stop a vm, and the network is shutdown (VR is stopped), when you start the vm in vcenter or veeam, the vm has no internet connection as the VR is still stopped.
We have actually faced several issues caused by OOB operations (start/migration), or DRS.

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.

@weizhouapache I have removed this feature from this PR as it is not in the core of it. In the future I might open a PR to add it separately and we can discuss it further on that PR.

@shwstppr

shwstppr commented Oct 9, 2023

Copy link
Copy Markdown
Contributor

@SadiJr can you please check the review comments?

@DaanHoogland

Copy link
Copy Markdown
Contributor

@SadiJr are you still looking to get this merged?

@SadiJr

SadiJr commented Nov 21, 2023

Copy link
Copy Markdown
Contributor Author

@shwstppr @DaanHoogland Sorry for the delay, I will check the suggestions and respond/work on this PR

@weizhouapache

weizhouapache commented Jun 20, 2024

Copy link
Copy Markdown
Member

@weizhouapache could we run the integration tests here so I can take a look at the errors you reported?

@JoaoJandre
#8241 requires a vmware/veeam environment. It will be skipped in the trillian test

@blueorangutan

Copy link
Copy Markdown

@weizhouapache a [SL] Trillian-Jenkins test job (rocky8 mgmt + vmware-80) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-10542)
Environment: vmware-80 (x2), Advanced Networking with Mgmt server r8
Total time taken: 50658 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7221-t10542-vmware-80.zip
Smoke tests completed. 118 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_02_balanced_drs_algorithm Error 422.24 test_cluster_drs.py
test_01_browser_migrate_template Failure 5.47 test_image_store_object_migration.py
test_01_unmanage_vm_cycle Error 128.04 test_vm_lifecycle_unmanage_import.py

@JoaoJandre

Copy link
Copy Markdown
Contributor

@weizhouapache could we run the integration tests here so I can take a look at the errors you reported?

@JoaoJandre #8241 requires a vmware/veeam environment. It will be skipped in the trillian test

@weizhouapache Ok, I'll try to test this and see if everything still looks good after merging with main.

@sureshanaparti sureshanaparti modified the milestones: 4.19.1.0, 4.19.2, 4.20.0.0 Jun 24, 2024
@github-actions

Copy link
Copy Markdown

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

@sureshanaparti

Copy link
Copy Markdown
Contributor

hi @SadiJr please check and resolve any conflicts in the branch.

@DaanHoogland

Copy link
Copy Markdown
Contributor

@weizhouapache @hsato03 addressing you , as you seem the only ones involved in veeam atm. I’m closing this one as it has conflicts and is old. please update and reopen if you think it is still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

9 participants