Setting a cluster into maintenance mode with PowerCLI

Maintenance is inevitable. vSphere's DRS features do a lot to help administrators when maintenance is required. vSphere has a maintenance mode feature for hosts in a cluster that prevents any virtual machines from being started or moved onto the host while maintenance is occurring. Hosts need to be placed into maintenance mode for changes and patching to occur.

For a cluster running in a fully automated mode, putting a host into maintenance mode will kick off a set of automated steps that will use vMotion to move all of the running virtual machines to other hosts. Using the vSphere Client, you can optionally move any powered off virtual machines to other hosts. In a partially automated mode, ...

Get PowerCLI Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.