Skip to content

CLOUDSTACK-8704: Schedule restart of router VMs ahead of user VMs as … - #656

Merged
asfgit merged 1 commit into
apache:masterfrom
koushik-das:CLOUDSTACK-8704
Aug 10, 2015
Merged

asfgit merged 1 commit into
apache:masterfrom
koushik-das:CLOUDSTACK-8704

Conversation

@koushik-das

Copy link
Copy Markdown
Contributor

…part of HA

VRs are scheduled for HA ahead of user VMs.

Refer to the bug for more details.

@asfbot

asfbot commented Aug 4, 2015

Copy link
Copy Markdown

cloudstack-pull-rats #199 ABORTED

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.

no biggy for this PR, but why is this chack needed? The vms are retrieved by the host id of the host being down in the first place (see line 240).

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.

@DaanHoogland The host check you are referring to existed even before this PR. One reason for the check is to ensure that the VM has not moved to another host since the time it was fetched using listByHostId(). If it has moved to another host (and vmsync has updated the host id) then no need to perform restart/HA.

@asfbot

asfbot commented Aug 4, 2015

Copy link
Copy Markdown

cloudstack-pull-requests #896 ABORTED

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.

I suppose this is needed for the extra tests. Can you explain?

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.

Yes. "_workers" is the set of worker threads that perform HA related tasks in HighAvaiabilityManagerImpl class. As part of the test wakeupWorkers() methods get invoked which needs _workers to be initialized.

@DaanHoogland

Copy link
Copy Markdown
Contributor

code LGTM.

@asfbot

asfbot commented Aug 4, 2015

Copy link
Copy Markdown

cloudstack-pull-analysis #132 ABORTED

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.

@koushik-das To identify VRs in this list, vm.getType().equals(VirtualMachine.Type.DomainRouter) would be better, instead of relying on the Vm name. Also, in the mentioned code SSVM and CPVM get higher priority than UserVms.

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.

@kishankavala Although the issue was seen only with VR, the fix is to schedule restart of system VMs ahead of user VMs.

@remibergsma

Copy link
Copy Markdown
Contributor

@koushik-das Thanks for the fix! I was testing this on KVM tonight but run into an unrelated issue. Will try to verify your fix tomorrow so we can merge it soon.

@asfbot

asfbot commented Aug 7, 2015

Copy link
Copy Markdown

cloudstack-pull-requests #925 FAILURE
Looks like there's a problem with this pull request

@asfbot

asfbot commented Aug 7, 2015

Copy link
Copy Markdown

cloudstack-pull-rats #228 SUCCESS
This pull request looks good

@koushik-das

Copy link
Copy Markdown
Contributor Author

@kishankavala Made the change to use VM type instead of name to distinguish between user and system VMs

@asfbot

asfbot commented Aug 7, 2015

Copy link
Copy Markdown

cloudstack-pull-analysis #161 SUCCESS
This pull request looks good

@remibergsma

Copy link
Copy Markdown
Contributor

@koushik-das I'll be testing this tonight and will merge if it's OK. Before I proceed, could you please squash the 3 commits into 1. I cannot merge it like this (because of the merge of master into your branch).
Will have a look on how to handle this.

@remibergsma

Copy link
Copy Markdown
Contributor

@koushik-das you can solve it like this:

  • start with a new branch from your first commit
  • then cherry-pick the second one in
  • consider if you want to squash them together
  • force push this to your fork (koushik-das) on branch (CLOUDSTACK-8704)
    The PR should then have two commits. Let me know if you need any help!

@koushik-das

Copy link
Copy Markdown
Contributor Author

@remibergsma Will the following work?

  • do git pull on master
  • then do a git pull --rebase, this will make the commits appear on top
  • then do the squash
  • push them to master after editing the message

@miguelaferreira

Copy link
Copy Markdown
Contributor

Hi @koushik-das

Sorry to step in like this, but I talked to @remibergsma and I think you can fix your branch by doing this:

git checkout 032a335
git cherry-pick cabc9ea
git reset --hard

If you do this, please double-check the result (it should be your two commits together at the top), and then do

git push -f origin HEAD:CLOUDSTACK-8704

to update this PR.

I hope this helps.

@remibergsma

Copy link
Copy Markdown
Contributor

Thanks @miguelaferreira :-)

@remibergsma

Copy link
Copy Markdown
Contributor

Hi @koushik-das I was able to test your PR and it seems to do what you said: start the system VMs before the other instances. However, it doesn't solve the problem completely. In my case, I had two routers and a bunch of VMs. The routers started first, but when the first instance was started the router was not yet ready. CloudStack then destroyed the router, and on the next HA run about 5-10 minutes later everything was started properly. If you want my full logs, let me know and I'll put them somewhere.

@koushik-das

Copy link
Copy Markdown
Contributor Author

@remibergsma Thanks for testing the PR. This is a best-effort fix. The change just schedules the restart of the system VMs ahead of the user VMs. Now if there are fewer VMs for restart, there is a higher probability of all restart jobs getting executed at the same time by the HA-worker thread pool. In this case the fix won't be effective. If there are more VMs then the effectiveness of the fix increases.

@remibergsma

Copy link
Copy Markdown
Contributor

@koushik-das Check. If you fix the commits, I'll LGTM and merge. Let me know if you need help.

@koushik-das

Copy link
Copy Markdown
Contributor Author

@remibergsma I have fixed the commits, please check.

@asfbot

asfbot commented Aug 10, 2015

Copy link
Copy Markdown

cloudstack-pull-rats #242 SUCCESS
This pull request looks good

@asfbot

asfbot commented Aug 10, 2015

Copy link
Copy Markdown

cloudstack-pull-requests #939 SUCCESS
This pull request looks good

@remibergsma

Copy link
Copy Markdown
Contributor

Travis failure is due to timeout.

@asfbot

asfbot commented Aug 10, 2015

Copy link
Copy Markdown

cloudstack-pull-analysis #175 SUCCESS
This pull request looks good

@remibergsma

Copy link
Copy Markdown
Contributor

@koushik-das Thanks, glad the merge commit is gone now. Do you want to keep two commits? I'd say squash them together. From the subject line I cannot tell the difference. Let me know and I'll proceed.

@koushik-das

Copy link
Copy Markdown
Contributor Author

@remibergsma Yes the commits can be squashed.

@remibergsma

Copy link
Copy Markdown
Contributor

@koushik-das Check, please squash and then force push again. After that I'll merge it.

…part of HA

VRs are scheduled for HA ahead of user VMs
@asfbot

asfbot commented Aug 10, 2015

Copy link
Copy Markdown

cloudstack-pull-rats #247 SUCCESS
This pull request looks good

@asfbot

asfbot commented Aug 10, 2015

Copy link
Copy Markdown

cloudstack-pull-requests #944 ABORTED

@remibergsma

Copy link
Copy Markdown
Contributor

@koushik-das Thank you!
LGTM, merging.

@asfgit
asfgit merged commit 44c1ef0 into apache:master Aug 10, 2015
asfgit pushed a commit that referenced this pull request Aug 10, 2015
CLOUDSTACK-8704: Schedule restart of router VMs ahead of user VMs as part of HA

VRs are scheduled for HA ahead of user VMs.

Refer to the bug for more details.

* pr/656:
  CLOUDSTACK-8704: Schedule restart of router VMs ahead of user VMs as part of HA VRs are scheduled for HA ahead of user VMs

Signed-off-by: Remi Bergsma <github@remi.nl>
@koushik-das
koushik-das deleted the CLOUDSTACK-8704 branch August 10, 2015 10:44
@DaanHoogland

Copy link
Copy Markdown
Contributor

@remibergsma ahum,... LGTM

@asfbot

asfbot commented Aug 10, 2015

Copy link
Copy Markdown

cloudstack-pull-analysis #180 SUCCESS
This pull request looks good

@remibergsma

Copy link
Copy Markdown
Contributor

@DaanHoogland You already gave your LGTM? See here: #656 (comment)

yadvr pushed a commit that referenced this pull request Jan 20, 2021
Fixes #644

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants