apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
1.83k stars 1.07k forks source link

Restart agent when host comes out of maintenance #9298

Closed abh1sar closed 6 days ago

abh1sar commented 6 days ago

Description

This PR...

Fixes #9295

New storage pools are not added to a host which is in maintenance. This change will restart the agent when host is taken out of maintenance mode. StoragePoolMonitor.processConnect() will then get called which will add/mount the new storage pool to the host.

One more related issue was that storage pool was not getting unmounted from a host in maintenance mode. Even when the host is taken out of maintenance mode, it will still have the pool mounted. Only reboot will unmount the pool. So, as fix have added DeleteStoragePoolCommand to be able to run in maintenance mode similar to ModifyStoragePoolCommand.

Types of changes

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

Bug Severity

Screenshots (if appropriate):

How Has This Been Tested?

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

abh1sar commented 6 days ago

@blueorangutan package

blueorangutan commented 6 days ago

@abh1sar 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[bot] commented 6 days ago

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 14.95%. Comparing base (42e7117) to head (7843b9f).

Files Patch % Lines
...n/java/com/cloud/resource/ResourceManagerImpl.java 33.33% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## 4.19 #9298 +/- ## =========================================== Coverage 14.95% 14.95% - Complexity 11011 11014 +3 =========================================== Files 5382 5382 Lines 470193 470193 Branches 57502 60465 +2963 =========================================== + Hits 70314 70331 +17 + Misses 392091 392072 -19 - Partials 7788 7790 +2 ``` | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/9298/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/9298/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.28% <ø> (ø)` | | | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/9298/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `15.66% <60.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

blueorangutan commented 6 days ago

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

abh1sar commented 6 days ago

@blueorangutan test

blueorangutan commented 6 days ago

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

blueorangutan commented 5 days ago

[SF] Trillian test result (tid-10607) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 42752 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9298-t10607-kvm-centos7.zip Smoke tests completed. 129 look OK, 2 have errors, 0 did not run Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_05_vmschedule_test_e2e Failure 361.96 test_vm_schedule.py
test_hostha_enable_ha_when_host_disabled Error 3.71 test_hostha_kvm.py
test_hostha_enable_ha_when_host_in_maintenance Error 302.90 test_hostha_kvm.py