ESX Virtualization

VMware ESXi, vSphere, VMware Backup, Hyper-V... how-to, videos....

Nakivo Backup and Replication - #1 Backup solution for Virtual, physical, cloud, NAS and SaaS

Menu
  • Certification
      • VCP-DCV vSphere 8
          • vcp2024-125.
        • Close
    • Close
  • VMware
    • Configuration Maximums
    • vSphere
      • vSphere 8.0
      • vSphere 7.0
      • vSphere 6.7
      • vSphere 6.5
      • vSphere 6.0
      • Close
    • VMworld
      • VMware EXPLORE 2024
      • VMware EXPLORE 2023
      • VMware EXPLORE 2022
      • VMworld 2019
      • VMworld 2018
      • VMworld 2017
      • VMworld 2016
      • VMworld 2015
      • VMworld 2014
      • VMworld 2013
      • VMworld 2012
      • VMworld 2011
      • Close
    • Close
  • Microsoft
    • Windows Server 2012
    • Windows Server 2016
    • Windows Server 2019
    • Close
  • Categories
    • Tips – VMware, Microsoft and General IT tips and definitions, What is this?, How this works?
    • Server Virtualization – VMware ESXi, ESXi Free Hypervizor, VMware vSphere Server Virtualization, VMware Cloud and Datacenter Virtualization
    • Backup – Virtualization Backup Solutions, VMware vSphere Backup and ESXi backup solutions.
    • Desktop Virtualization – Desktop Virtualization, VMware Workstation, VMware Fusion, VMware Horizon View, tips and tutorials
    • How To – ESXi Tutorials, IT and virtualization tutorials, VMware ESXi 4.x, ESXi 5.x and VMware vSphere. VMware Workstation and other IT tutorials.
    • Free – Free virtualization utilities, ESXi Free, Monitoring and free backup utilities for ESXi and Hyper-V. Free IT tools.
    • Videos – VMware Virtualization Videos, VMware ESXi Videos, ESXi 4.x, ESXi 5.x tips and videos.
    • Home Lab
    • Reviews – Virtualization Software and reviews, Disaster and backup recovery software reviews. Virtual infrastructure monitoring software review.
    • Close
  • Partners
    • NAKIVO
    • StarWind
    • Zerto
    • Xorux
    • Close
  • This Web
    • News
    • ESXi Lab
    • About
    • Advertise
    • Archives
    • Disclaimer
    • PDFs and Books
    • Close
  • Free
  • Privacy policy

VMware ESXi Command List – Maintenance

By Vladan SEGET | Last Updated: July 1, 2016

Shares

Today another post of the series ESXi Command List. The title says it all. We'll have a look at different options to reboot ESXi from a command line and we'll talk a bit about maintenance mode. You should always put hosts into maintenance mode when you do reboots, firmware updates, apply ESXi updates (most patches require the host to be in maintenance mode) or anything like that.

This will make sure all processes on the host are properly prepared, no VM will be (accidentally/DRS) migrated onto the host again. During maintenance state the HA agent is disabled as well. This command is to know for sure.

After invoking the command, the host will start to enter maintenance mode, but waits until all VMs are suspended or migrated. Always put the host into maintenance mode.

When a host is in maintenance mode, no VMs can be powered On, and also you cannot put this host as a destination host if doing some vMotions, so the host cannot “receive” the VM in case of vMotion. Always put the host into maintenance mode.

VMware ESXi commands - Maintenance mode

To enter and exit maintenance mode:

connect via Putty and enter this: (case sensitive)

esxcli system maintenanceMode set –enable true

the view…

VMware ESXi commands - Maintenance mode

You can easily explore a bit further…

VMware ESXi commands - Maintenance mode

So the get command returns the actual state when checking if the host is in maintenance mode or not.

And also you can show the whole esxcli system tree vie esxcli system …

VMware ESXi commands - Maintenance mode

Now, as you can see in the image above, I underlined another command – shutdown. This is obviously for shutting down the host completely. So once your host is in maintenance mode, it's safe to shut down.

We can shut down an ESXi host with this command, which however needs another two parameters:

  • Time –delay=<long> (minimum 10 sec) (note it is double dash –  – )
  • Reason –reason=<long>

short would be:

  • Time -d
  • Reason -r

So to show direct example:

esxcli system shutdown powerof -d 10 -r maintenance

The view…

ESXi Maintenance mode and shutdown commands

Done. Today you have learned another two commands.

As you can see, with just a few commands you can safely put a host into maintenance mode and shut down. Then you can do hardware upgrade or whatever you need to do. You learned another two commands to became a master of ESXi -:).

Few other posts:

  • ESXi CLI Networking commands
  • ESXi Commands List – Getting Started
  • ESXi Commands List – Snapshot Deletion Monitoring
  • ESXi Commands List – Storage
  • ESXi Command List – Maintenance – (This post)

Hard Reboot option!

You have a host that has hung iSCSI storage device and

You can “hard reboot the host” – with some extra parameters from an SSH command-line.

reboot -n -f

The VMware server will immediately reboot. This is equivalent to a “hard reboot”, meaning you could lose data the same as if you had turned the power off on the server.

Shares
5/5 - (1 vote)

| Filed Under: How To, Server Virtualization Tagged With: VMware ESXi Command List - Maintenance

About Vladan SEGET

This website is maintained by Vladan SEGET. Vladan is as an Independent consultant, professional blogger, vExpert x16, Veeam Vanguard x9, VCAP-DCA/DCD, ESX Virtualization site has started as a simple bookmarking site, but quickly found a large following of readers and subscribers.

Connect on: Facebook. Feel free to network via Twitter @vladan.

Comments

  1. Decky says

    July 20, 2017 at 2:59 pm

    If using VSAN you will need to now set

    esxcli system maintenanceMode set -e true -m [ensureObjectAccessibility | evacuateAllData | noAction]

  2. JEYA ANAND says

    June 7, 2019 at 3:21 pm

    Do we have any esxcli command or any other cmd to enter the maintenance mode forcefully whn there is active vms present in the esxi host

Private Sponsors

Featured

  • Thinking about HCI? G2, an independent tech solutions peer review platform, has published its Winter 2023 Reports on Hyperconverged Infrastructure (HCI) Solutions.
  • Zerto: One Platform for Disaster Recovery, Backup & Cloud Mobility: Try FREE Hands-On Labs Today!
Click to Become a Sponsor

Most Recent

  • Veeam Backup & Replication v13 Beta: A Game-Changer with Linux
  • What is Veeam Data Cloud Vault and how it can help SMBs
  • Nakivo Backup and Replication – Malware Scan Feature
  • Zerto 10 U7 released with VMware NSX 4.2 Support
  • XorMon NG 1.9.0 Infrastructure Monitoring – now also with Veeam Backup Support
  • Heartbeat vs Node Majority StarWind VSAN Failover Strategy
  • Vulnerability in your VMs – VMware Tools Update
  • FREE version of StarWind VSAN vs Trial of Full version
  • Commvault’s Innovations at RSA Conference 2025 San Francisco
  • VMware ESXi FREE is FREE again!

Get new posts by email:

 

 

 

 

Support us on Ko-Fi

 

 

Buy Me a Coffee at ko-fi.com

Sponsors

Free Trials

  • DC Scope for VMware vSphere – optimization, capacity planning, and cost management. Download FREE Trial Here.
  • Augmented Inline Deduplication, Altaro VM Backup v9 For #VMware and #Hyper-V – Grab your copy now download TRIAL.

VMware Engineer Jobs

VMware Engineer Jobs

YouTube

…

Find us on Facebook

ESX Virtualization

…

Copyright © 2025 ·Dynamik-Gen · Genesis Framework · Log in