Skip to content

CLOUDSTACK-8530: KVM hosts without active agents should be in Disconnected state - #340

Closed
yadvr wants to merge 1 commit into
4.5from
CLOUDSTACK-8530
Closed

yadvr wants to merge 1 commit into
4.5from
CLOUDSTACK-8530

Conversation

@yadvr

@yadvr yadvr commented Jun 1, 2015

Copy link
Copy Markdown
Member

KVM hosts which are up but their agents are shutdown should be put
in disconnected state. This would avoid getting the VMs HA'd and other commands
such as deploying a VM will exclude that host and save us from errors.

The improvement is that, we first try to contact the KVM host itself. If it fails
we assume that it's disconnected, and then ask its KVM neighbours if they can
check its status. If all of the KVM neighbours tell us that it's Down and we're
unable to reach the KVM host, then the host is possibly down. In case any of the
KVM neighbours tell us that it's Up but we're unable to reach the KVM host then
we can be sure that the agent is offline but the host is running.

…ected state

KVM hosts which are actuall up, but if their agents are shutdown should be put
in disconnected state. This would avoid getting the VMs HA'd and other commands
such as deploying a VM will exclude that host and save us from errors.

The improvement is that, we first try to contact the KVM host itself. If it fails
we assume that it's disconnected, and then ask its KVM neighbours if they can
check its status. If all of the KVM neighbours tell us that it's Down and we're
unable to reach the KVM host, then the host is possibly down. In case any of the
KVM neighbours tell us that it's Up but we're unable to reach the KVM host then
we can be sure that the agent is offline but the host is running.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@yadvr

yadvr commented Jun 1, 2015

Copy link
Copy Markdown
Member Author

@asfbot

asfbot commented Jun 1, 2015

Copy link
Copy Markdown

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

@yadvr

yadvr commented Jun 1, 2015

Copy link
Copy Markdown
Member Author

pinging KVM and HA gurus to help review this @kishankavala @wilderrodrigues @remibergsma @mlsorensen @abhinandanprateek @devdeep and others
thanks :)

@mlsorensen

Copy link
Copy Markdown
Contributor

Looks fine to me.

On Mon, Jun 1, 2015 at 12:13 PM, Rohit Yadav notifications@github.com
wrote:

pinging KVM and HA gurus to help review this @kishankavala
https://github.com/kishankavala @wilderrodrigues
https://github.com/wilderrodrigues @remibergsma
https://github.com/remibergsma @mlsorensen
https://github.com/mlsorensen @abhinandanprateek
https://github.com/abhinandanprateek @devdeep
https://github.com/devdeep and others
thanks :)

—
Reply to this email directly or view it on GitHub
#340 (comment).

@wilderrodrigues

Copy link
Copy Markdown
Contributor

After running this on my KVM host:

[root@kvm1 ~]# systemctl stop cloudstack-agent
[root@kvm1 ~]#

The management server said:

image

Then I started it agains:

[root@kvm1 ~]# systemctl start cloudstack-agent
[root@kvm1 ~]# systemctl status cloudstack-agent
cloudstack-agent.service - SYSV: Cloud Agent
Loaded: loaded (/etc/rc.d/init.d/cloudstack-agent)
Active: active (running) since Tue 2015-06-02 07:20:10 EDT; 3s ago
Process: 20054 ExecStop=/etc/rc.d/init.d/cloudstack-agent stop (code=exited, status=0/SUCCESS)
Process: 20090 ExecStart=/etc/rc.d/init.d/cloudstack-agent start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/cloudstack-agent.service
├─20106 jsvc.exec -Xms256m -Xmx2048m -cp /usr/share/java/commons-daemon.jar:/usr/share/cloudstack-agent/lib/activation-1.1.jar:/usr/share/cloudstack-agent/lib/antisamy-1.4.3.jar:/usr/share/cloudstack-agent/lib/aopalliance-1.0.jar:/usr/share/cloudstack-agent/...
└─20107 jsvc.exec -Xms256m -Xmx2048m -cp /usr/share/java/commons-daemon.jar:/usr/share/cloudstack-agent/lib/activation-1.1.jar:/usr/share/cloudstack-agent/lib/antisamy-1.4.3.jar:/usr/share/cloudstack-agent/lib/aopalliance-1.0.jar:/usr/share/cloudstack-agent/...

Jun 02 07:20:10 kvm1 systemd[1]: Starting SYSV: Cloud Agent...
Jun 02 07:20:10 kvm1 cloudstack-agent[20090]: Starting Cloud Agent:
Jun 02 07:20:10 kvm1 systemd[1]: Started SYSV: Cloud Agent.
[root@kvm1 ~]#

And on the UI:

image

Thanks, Rohit!

I will merge.

@asfgit asfgit closed this in f341246 Jun 2, 2015
@yadvr

yadvr commented Jun 2, 2015

Copy link
Copy Markdown
Member Author

@wilderrodrigues thanks, but the test you did is perhaps not enough as it cleanly shutsdown the agent. In my test, I did these things:

  • kill -9 the agent to see what happens
  • add firewall rule to block mgmt server traffic to the kvm host, using something like: iptables -A INPUT -s 192.168.1.12 -j DROP
  • using a cluster of three nodes, add the firewall rules to see how it behaves when neighbours report it is Up/Down and host is not reachable

asfgit pushed a commit that referenced this pull request Jun 2, 2015
…ected state

KVM hosts which are actuall up, but if their agents are shutdown should be put
in disconnected state. This would avoid getting the VMs HA'd and other commands
such as deploying a VM will exclude that host and save us from errors.

The improvement is that, we first try to contact the KVM host itself. If it fails
we assume that it's disconnected, and then ask its KVM neighbours if they can
check its status. If all of the KVM neighbours tell us that it's Down and we're
unable to reach the KVM host, then the host is possibly down. In case any of the
KVM neighbours tell us that it's Up but we're unable to reach the KVM host then
we can be sure that the agent is offline but the host is running.

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>

This closes #340
@wilderrodrigues

Copy link
Copy Markdown
Contributor

Nice write up, @bhaisaab

I can still take some time, later this week, and go through the steps you have tested. Just quite busy right now.

Let's try to have template for PRs, so the "test steps" are also added.

Cheers,
Wilder

@rafaelweingartner
rafaelweingartner deleted the CLOUDSTACK-8530 branch April 3, 2018 21:42
yadvr pushed a commit that referenced this pull request Jan 20, 2021
Fixes #335

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
shwstppr pushed a commit to shapeblue/cloudstack that referenced this pull request Dec 27, 2023
Co-authored-by: Marcus Sorensen <mls@apple.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.

4 participants