Skip to content

Conversation

@Pearl1594
Copy link
Contributor

@Pearl1594 Pearl1594 commented Sep 10, 2024

Description

This PR fixes small issues and adds minor improvements to the NAS B&R Plugin

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)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@Pearl1594 a [SL] 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.

@codecov
Copy link

codecov bot commented Sep 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 58 lines in your changes missing coverage. Please review.

Project coverage is 15.98%. Comparing base (5aa79a6) to head (9714aae).
Report is 69 commits behind head on 4.20.

Files with missing lines Patch % Lines
...rg/apache/cloudstack/backup/BackupManagerImpl.java 0.00% 24 Missing ⚠️
...ce/wrapper/LibvirtRestoreBackupCommandWrapper.java 0.00% 13 Missing ⚠️
...bernetes/cluster/KubernetesClusterManagerImpl.java 0.00% 10 Missing ⚠️
...rg/apache/cloudstack/backup/NASBackupProvider.java 0.00% 6 Missing ⚠️
.../actionworkers/KubernetesClusterDestroyWorker.java 0.00% 3 Missing ⚠️
...i/command/user/backup/DeleteBackupScheduleCmd.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.20    #9666      +/-   ##
============================================
- Coverage     15.99%   15.98%   -0.02%     
- Complexity    13060    13084      +24     
============================================
  Files          5644     5649       +5     
  Lines        494915   495747     +832     
  Branches      59960    60029      +69     
============================================
+ Hits          79173    79254      +81     
- Misses       406910   407640     +730     
- Partials       8832     8853      +21     
Flag Coverage Δ
uitests 4.01% <ø> (-0.01%) ⬇️
unittests 16.82% <0.00%> (-0.02%) ⬇️

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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11085

@DaanHoogland
Copy link
Contributor

This looks like a bug fix on a new feature @Pearl1594 , should it go in 4.20? cc @JoaoJandre

@Pearl1594
Copy link
Contributor Author

This isn't targeted for 4.20 @DaanHoogland. This PR is to improve aspects of the recently merged changes. There will be more changes added to this PR.

@rohityadavcloud rohityadavcloud modified the milestones: 4.20.0.0, 4.20.1.0 Sep 19, 2024
@github-actions
Copy link

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

@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@Pearl1594 a [SL] 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
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 11180

@rohityadavcloud
Copy link
Member

@Pearl1594 can you address conflicts and advise if this is ready for reviewing and testing.

@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@Pearl1594 a [SL] 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
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12412

@Pearl1594
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-12376)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 57260 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9666-t12376-kvm-ol8.zip
Smoke tests completed. 138 look OK, 3 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_11_isolated_network_with_dynamic_routed_mode Error 1.29 test_ipv4_routing.py
test_12_vpc_and_tier_with_dynamic_routed_mode Error 2.35 test_ipv4_routing.py
test_12_vpc_and_tier_with_dynamic_routed_mode Error 2.35 test_ipv4_routing.py
test_06_purge_expunged_vm_background_task Failure 391.36 test_purge_expunged_vms.py
test_12_start_vm_multiple_volumes_allocated Error 14.90 test_vm_life_cycle.py

@abh1sar
Copy link
Collaborator

abh1sar commented Feb 19, 2025

@Pearl1594 added some minor comments. Please check.

@rajujith rajujith removed their assignment Feb 19, 2025
@Pearl1594
Copy link
Contributor Author

@abh1sar sorry I don't see your review comments.

Copy link
Collaborator

@abh1sar abh1sar left a comment

Choose a reason for hiding this comment

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

Added some minor comments

accountManager.checkAccess(CallContext.current().getCallingAccount(), null, true, vm);
public boolean deleteBackupSchedule(DeleteBackupScheduleCmd cmd) {
Long vmId = cmd.getVmId();
Long id = cmd.getId();
Copy link
Collaborator

Choose a reason for hiding this comment

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

In DeleteBackupScheduleCmd, both vmId and id parameters are declared with required = true, but here it looks like either of them could be null.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're are right. I've addressed it.

for (final Backup backup: backupDao.listByVmId(null, vm.getId())) {
vmBackupSize += backup.getSize();
vmBackupProtectedSize += backup.getProtectedSize();
if (Objects.nonNull(backup.getSize())) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can these be null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure - but just added a defensive check

dest="$mount_point/${BACKUP_DIR}"
mount -t ${NAS_TYPE} ${NAS_ADDRESS} ${mount_point} $([[ ! -z "${MOUNT_OPTS}" ]] && echo -o ${MOUNT_OPTS})
if [ ${NAS_TYPE} == "cifs" ]; then
MOUNT_OPTS="${MOUNT_OPTS},nobrl"
Copy link
Collaborator

Choose a reason for hiding this comment

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

nobrl is added in mountBackupDirectory. Is it required here as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had faced the following issue while backing up the VM:

# virsh -c qemu:///system backup-begin --domain i-2-10-VM --backupxml /tmp/csbackup.HEGID/i-2-10-VM/2024.10.07.02.44.28/backup.xml
error: operation failed: failed to format image: 'Could not write qcow2 header: Permission denied'

As per https://unix.stackexchange.com/questions/622194/how-to-use-qemu-kvm-virtual-machine-disk-image-on-smb-cifs-network-share-permis adding nobrl solved it - so I used that fix.

@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@Pearl1594 a [SL] 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
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12602

@Pearl1594
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-12505)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 52930 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9666-t12505-kvm-ol8.zip
Smoke tests completed. 140 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_06_purge_expunged_vm_background_task Failure 391.44 test_purge_expunged_vms.py

Copy link
Collaborator

@abh1sar abh1sar left a comment

Choose a reason for hiding this comment

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

LGTM. didn't test.

@Pearl1594
Copy link
Contributor Author

Tested by @rajujith.

@Pearl1594 Pearl1594 merged commit 7f4e6a9 into apache:4.20 Mar 4, 2025
24 of 26 checks passed
@Pearl1594 Pearl1594 deleted the nas-br-partb branch March 4, 2025 16:32
@Pearl1594 Pearl1594 moved this to Done in ACS 4.20.1 Mar 17, 2025
dhslove pushed a commit to ablecloud-team/ablestack-cloud that referenced this pull request Jun 19, 2025
* NAS B&R Plugin enhancements

* Prevent printing mount opts which may include password by removing from response

* revert marvin change

* add sanity checks to validate minimum qemu and libvirt versions

* check is user running script is part of libvirt group

* revert changes of retore expunged VM

* add code coverage ignore file

* remove check

* issue with listing schedules and add defensive checks

* redirect logs to agent log file

* add some more debugging

* remove test file

* prevent deletion of cks cluster when vms associated to a backup offering

* delete all snapshot policies when bkp offering is disassociated from a VM

* Fix `updateTemplatePermission` when the UI is set to a language other than English (apache#9766)

* Fix updateTemplatePermission UI in non-english language

* Improve fix

---------

* Add nobrl in the mountopts for cifs file system

* Fix restoration of VM / volumes with cifs

* add cifs utils for el8

* add cifs-utils for ubuntu cloudstack-agent

* syntax error

* remove required constraint on both vmid and id params for the delete bkp schedule command
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.

7 participants