-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add check on host's status while deleting config drive on host cache #7584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add check on host's status while deleting config drive on host cache #7584
Conversation
|
@blueorangutan package |
|
Thanks @weizhouapache for helping in debugging this issue. |
weizhouapache
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code lgtm
I think it is safe to leave the configdrive ISO on the host cache.
It would be good if it can be cleaned when cloudstack agent is back to normal
| return false; | ||
| } | ||
| if (!Arrays.asList(Status.Up, Status.Connecting).contains(hostVO.getStatus())) { | ||
| LOG.warn(String.format("Host status %s is not Up or Connecting, skipping deletion of config-drive ISO on host cache", hostId)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@weizhouapache @vishesh92 Would connecting be included, asking as what if the host isn't up to take the command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rohityadavcloud This returns false if the status is NOT Up or Connecting..
I matching the checks which are present here: https://github.com/apache/cloudstack/blob/4.18/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java#L970
rohityadavcloud
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but left one remark. I haven't tested it but this may require manual testing if it's not covered by an integration test. cc @vishesh92 @borisstoyanov @kiranchavala @vladimirpetrov
|
@blueorangutan package |
|
@vishesh92 a [LL] 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. |
|
Packaging result [LL]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6071 |
kiranchavala
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Tested the steps manually and was able to expunge the vm
-
Enable vm.configdrive.force.host.cache.use in Global Configuration. -
Create a L2 network with config drive -
Deploy a vm with the L2 network created in previous step -
Stop the vm and destroy vm (not expunge it) -
Stop the cloudstack-agent on the VM's host -
Expunge the vm
|
@blueorangutan package |
|
@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. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6307 |
|
@blueorangutan test |
|
@kiranchavala a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-6807)
|
|
Review smoketests LGTM, other PRs have the same intermittent issue. |
Description
This PR adds a check on host's status. Without this if the agent is not in Up or Connecting state, expunging of a VM fails.
Steps to reproduce:
vm.configdrive.force.host.cache.useinGlobal Configuration.Fixes: #7428
Types of changes
Bug Severity
How Has This Been Tested?
Setup an environment using mbx and following the steps above to reproduce it.