How to Shutdown and Restart vSAN Cluster with vCenter

Understanding the correct procedure to shutg down a VSAN cluster with vCenter is crucial to prevent data loss and ensure that all systems remain stable.

Crystal

By Crystal / Updated on October 25, 2024

Share this: instagram reddit

What is VMware vSAN

VSAN, or VMware Virtual SAN, allows you to create a shared storage pool from the local disks of ESXi hosts, making it a cost-effective and efficient option for managing storage in virtualized environments.

Just like turning off your computer improperly can lead to data corruption, shutting down a VSAN cluster without following the right steps can result in serious issues.

This article will take the proper precautions to safeguard your data and ensure that all components are shut down and restart safely.

vSAN datastore

The use cases for vSAN

Besides ROBO (Remote and Branch Offices), vSAN is also often used in the following cases:

  • Virtual machine storage: The primary use case for vSAN is to provide storage for virtual machines running on the vSphere platform. By pooling the storage resources of the servers in the cluster, vSAN can provide scalable, high-performance storage for virtual machines.
  • Disaster recovery (DR): vSAN can be used to create a highly available storage infrastructure that is resilient to hardware failures. By replicating data across the nodes in the cluster, vSAN can ensure that virtual machine data is protected in the event of a hardware failure.
  • Virtual Desktop Infrastructure (VDI): vSAN can be used to provide scalable and cost-effective storage for virtual desktops running on the vSphere platform.
  • Private cloud: vSAN can be used as part of a private cloud infrastructure to provide scalable and flexible storage for virtual machines.

If you set up a vSAN cluster in your vSphere environment, and also run the vCenter Server Appliance (VCSA) in that vSAN cluster, you need to follow the proper procedures to shut down vSAN, or you may suffer data loss.

Next, this article will show you how to properly shutdown vSAN cluster with vCenter running on it.

How to properly shutdown vSAN cluster with vCenter hosted in it

Before you start, please note that once the server cluster is shutdown, its shared datastore is inaccessible to clients. Therefore, to shut down vSAN cluster with vCenter Server hosted in it, it is important to backup VMware ESXi VMs and follow the proper procedures to avoid any potential data loss or corruption.

Here are the steps to safely shut down vSAN cluster with vCenter hosted on it:

1. Log in to vSphere web client and check vSAN health service. Power off all virtual machines stored in the vSAN cluster, except for the vCenter Server VM, vCLS VMs and file service VMs.

Shut down Guest OS

2. Migrate vCenter to another ESXi host or to the first host (recommended by VMware) so that you can easily find it when restart the vSAN cluster.

Migrate VCSA

3. Select the vSAN cluster and navigate to Monitor > vSAN > Resyncing Components to verify no vSAN components are currently resyncing.

Resyncing components

4. Right-click the vCenter Server VM and select Power > Shut Down Guest OS. It will make the vSphere Web Client unavailable.

Shut down Guest OS

5. Run the following ESXCLI command to put the member ESXi hosts of the vSAN cluster into maintenance mode.

esxcli system maintenanceMode set -e true -m noAction

Then you can shut down the ESXi hosts.

How to restart the vSAN cluster step by step

1. Power on the ESXi hosts and the physical machine where ESXi is installed. The ESXi host will locate the VMs and operate normally. If any hosts fail to restart, manually recover them or remove them from the vSAN cluster.

2. Once all hosts are powered on, exit maintenance mode on each host. If the vCenter Server is off, use this command on the ESXi hosts:

esxcli system maintenanceMode set -e false

3. Log in to one of the cluster hosts (not the witness host) and run this command:

python /usr/lib/vmware/vsan/bin/reboot_helper.py recover

4. Confirm the cluster reboot is successful by checking:

esxcli vsan cluster get

5. Enable updates from vCenter Server on all hosts with:

esxcfg-advcfg -s 0 /VSAN/IgnoreClusterMemberListUpdates

6. If the vCenter Server VM is off, power it on and wait for it to run. Verify all hosts are in the vSAN cluster again with:

esxcli vsan cluster get

7. Restart the remaining VMs via vCenter Server and check the vSAN health service for any issues.

8. (Optional) Enable vSAN file service.

9. If vSphere Availability is enabled, manually restart it to prevent the "Cannot find vSphere HA master agent" error:

  • Go to: Configure > Services > vSphere Availability > EDIT > Disable vSphere HA
  • Then re-enable it.

Note: If there are unhealthy or disconnected hosts in the cluster, either recover or remove them from the vSAN cluster. For service VMs like DNS or Active Directory used by vCenter Server, mark them as exceptions in the Shutdown cluster wizard. Retry the commands only after the vSAN health service indicates that all hosts are healthy (green state).

A dedicated VMware backup software – AOMEI Cyber Backup

You may need an effective backup software for VMware vSphere to protect your virtual environment and gain the ability to quickly recover your virtual machines when needed.

The efficient VMware backup software - AOMEI Cyber Backup, enables you to backup multiple VMs either managed by vCenter Server, or on a standalone ESXi host. It simplifies the backup process and present the steps with intuitive GUI interface.

In addition, it offers you the following benefits.

Agentless Backup: create complete and independent image-level backup for VMware ESXi and Hyper-V VMs.
Flexible vSphere Backup: batch backup large numbers of VMs managed by vCenter Server, or multiple VMs on a standalone ESXi host.
Multiple Storage Destinations: backup to local drive, or network destinations like Windows share or NAS.
Automated Execution: create backup schedules to automate backups daily, weekly, monthly.
Role Assignment: allows one administrator to create sub-accounts with limited privileges.

AOMEI Cyber Backup

AOMEI Cyber Backup supports both paid and free versions of VMware ESXi 6.0 and later versions. Next, I will show you how to perform vSphere VM backup and restore via AOMEI Cyber Backup. You can click the following button to download the free trial.

Download Free TrialVMware ESXi and Hyper-V
Secure Download

*You can choose to install this VM backup software on either Windows or Linux system.

Steps to perform ESXi backup and restore via AOMEI Cyber Backup

▶ Backup multiple VMs:

1. Bind Devices: Access to AOMEI Cyber Backup web client, navigate to Source Device > VMware > + Add VMware Device to Add vCenter or Standalone ESXi host. And then click > Bind Device.

Add VMware ESXi host

2. Create Backup Task: Navigate to Backup Task > + Create New Task, and select VMware ESXi Backup as the Backup Type.

3. Set the Task Name, Device, Target, Schedule and Cleanup as needed.

  • Task Name: you can change the task name or use the default name with an ordinal.
  • Device: batch backup multiple VMs on vCenter or standalone host within one backup task.

Select virtual machines vCenter

  • Target: select to back up to a local path, or to a network path like NAS.
  • Archive (optional): check "Archiving backup versions to Amazon S3" and click "Select" to choose the added Amazon S3.
  • Schedule (optional): perform full, differential, or incremental backup, and automate execution according to the frequency you specified
  • Cleanup (optional): automatically delete the old backup copies that exceed the retention period you specified.

4. Run Backup: Now you can click Start Backup and select Add the schedule and start backup now, or Add the schedule only.

Start Backup

Created backup tasks will be listed and monitored separately for restoring, progress checking and schedule changing.

▶ Restore virtual machine from backup:

  • Right-click the VM backup task, choose Restore.
  • Select Restore to new location option, you can create a new VM in the same or another datastore/host directly from the backup to perform out-of-spacre recovery, saves the trouble of re-configuring the new VM.

Restore to new location

Summary

Shutting down a cluster will make its shared datastore inaccessible to clients. Therefore, to avoid accidental data loss, you need to backup VMs and follow the proper procedures to shut down a vSAN cluster, especially when the vCenter Server is hosted on this cluster. This article showed you how to properly shutdown vSAN cluster with vCenter hosted in it.

To backup your VMs, you can try AOMEI Cyber Backup, it allows you to backup ESXi VMs and restore them to another host at an affordable price.

Crystal
Crystal · Editor
Crystal is an editor from AOMEI Technology. She mainly writes articles about virtual machine. She is a positive young lady likes to share articles with peolpe. Off work she loves travelling and cooking which is wonderful for life.