# Shutdown (poweroff) procedure for CubeCOS cluster

> Safely shut down a CubeCOS cluster with a step-by-step power-off procedure, including pre-shutdown checks to prevent data loss and service disruption.

This procedure describes how to safely power off an entire CubeCOS cluster for maintenance or operational purposes. The shutdown process stops all services, powers off all virtual machines, and then powers off all physical hosts.

## Pre-shutdown checklist {#pre-shutdown-checklist}

Before initiating a cluster shutdown, verify the following conditions to reduce the risk of data loss or service disruption:

- All cluster services report a `Healthy` status in the UI or CLI.
- No ongoing maintenance, upgrades, or recovery tasks are ongoing.
- All user workloads and scheduled jobs have been stopped or completed.
- All virtual machines have been shut down properly.
- There are no active backup, snapshot, or data replication operations are in progress.

## Cluster shutdown prerequisites {#cluster-shutdown-prerequisites}

Before shutting down the cluster, complete the following steps:

1. Run a cluster check repair operation.

   Verify that all services report a `Healthy` status.

2. Gracefully shut down all instances (virtual machines) running in the CubeCOS cluster.

   :::warning

   Data loss or service disruption can occur if you do not shut down all virtual machines before powering off the cluster.

   :::

## Initiate a cluster shutdown (poweroff) operation {#initiate-a-cluster-shutdown-poweroff-operation}

1. Open a terminal or console session.
2. Log in to the cluster VIP or any control node as the `admin` user via SSH.

   ```bash
   ssh admin@<your-cluster-vip>
   Password:
   Welcome to the Cube Appliance
   Enter "help" for a list of available commands
   host-name>
   ```

3. To begin the automatic cluster poweroff process, enter `cluster poweroff`.

   ```bash
   host-name> cluster poweroff
           role  map
   ------------------------------------------------------------
           all  172.16.0.1,172.16.0.2,172.16.0.3
       control  172.16.0.1,172.16.0.2,172.16.0.3
       compute  172.16.0.1,172.16.0.2,172.16.0.3
       storage  172.16.0.1,172.16.0.2,172.16.0.3
   ------------------------------------------------------------
   Enter 'YES' to confirm:
   ```

   This command lists all nodes that will be shut down. Review the cluster and host information carefully.

4. To confirm and start the shutdown process, enter `YES` in uppercase when prompted.

   :::warning

   This operation cannot be reversed once the cluster shutdown begins and will be completed.

   :::

   ```bash
   Enter 'YES' to confirm: YES
   ```

5. The system marks all hosts as down and powers them off gracefully.
6. Verify that all hosts are powered off:
   1. Pinging each host IP address, or
   2. Check the power status of each host through IPMI or your hardware management interface.
