Shutting down a cluster | Nutanix Community
Skip to main content
Solved

Shutting down a cluster

  • August 11, 2021
  • 5 replies
  • 2507 views

Forum|alt.badge.img

The instructions for shutting down a cluster are to use “sudo shutdown -P now” on the CVM’s in the cluster to shut each one down, but the command only works on the first CVM.   The command errors out the rest of the CVMs because they can’t reach the first CVM that was shut down.   Am I missing something?

Best answer by Nupur.Sakhalkar

@TimothyGray The commands - “sudo shutdown -P now”  or  “cvm_shutdown -P now” won’t work when you are trying to shut down multiple CVMs in the cluster because these commands check which CVM is currently having the shutdown token so that only that CVM can be powered down on the cluster.

When you run this command on the first CVM, the first CVM will successfully grab the shutdown token (since none of the other CVMs are currently holding this token as all CVMs are UP) and then power down the CVM. However, when you try to run the same command again on other CVMs when the first CVM is already down, the first CVM won't release the shutdown token while it is offline and so the above two commands won’t work in this case as you observed for your cluster as well. 

Since your end goal is to shut down multiple CVMs on the cluster at the same time, hence in this case, the standard Linux shutdown command must be used on each CVM to power it down: 

sudo shutdown -h now

The above linux command won’t check for any shutdown tokens and so multiple CVMs can be taken down at the same time.

An important point to note here is that this command should only be used on CVMs when the cluster is in stopped state (user VMs are powered down already) and you want to shutdown multiple CVMs at the same time. For any other case, always use “cvm_shutdown -P now” command to shutdown the CVM. 

Kindly let us know if the above command helped to resolve your issue. 

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

5 replies

Forum|alt.badge.img+3
  • Nutanix Employee
  • 30 replies
  • August 11, 2021

@TimothyGray  Please let me know if this documentation helps: Shutting Down an AHV Cluster The UVMs needs to be evacuated,  cluster services needs to be stopped and then you can shutdown the CVMs using “cvm_shutdown -P now”


Forum|alt.badge.img
  • Author
  • Voyager
  • 2 replies
  • August 12, 2021

I have done this dozen of times.   Only the first CVM shutdown down with that command.   The other CVMs won’t shut down because they can’t reach the first CVM that is shut down.


  • Adventurer
  • 3 replies
  • August 12, 2021

Forum|alt.badge.img+3
  • Nutanix Employee
  • 30 replies
  • August 12, 2021

Hi @TimothyGray Can you post the error you are seeing here?  


Forum|alt.badge.img+5
  • Nutanix Employee
  • 48 replies
  • Answer
  • August 17, 2021

@TimothyGray The commands - “sudo shutdown -P now”  or  “cvm_shutdown -P now” won’t work when you are trying to shut down multiple CVMs in the cluster because these commands check which CVM is currently having the shutdown token so that only that CVM can be powered down on the cluster.

When you run this command on the first CVM, the first CVM will successfully grab the shutdown token (since none of the other CVMs are currently holding this token as all CVMs are UP) and then power down the CVM. However, when you try to run the same command again on other CVMs when the first CVM is already down, the first CVM won't release the shutdown token while it is offline and so the above two commands won’t work in this case as you observed for your cluster as well. 

Since your end goal is to shut down multiple CVMs on the cluster at the same time, hence in this case, the standard Linux shutdown command must be used on each CVM to power it down: 

sudo shutdown -h now

The above linux command won’t check for any shutdown tokens and so multiple CVMs can be taken down at the same time.

An important point to note here is that this command should only be used on CVMs when the cluster is in stopped state (user VMs are powered down already) and you want to shutdown multiple CVMs at the same time. For any other case, always use “cvm_shutdown -P now” command to shutdown the CVM. 

Kindly let us know if the above command helped to resolve your issue.