Toggling maintenance mode from the UI can be tedious if the operation is to be performed for multiple hosts. Since maintenance mode for a host simply involves disabling the nova-compute service, this can be achieved via the OpenStack CLI.
- Platform9 Managed OpenStack - All Versions
- OpenStack CLI
- Source the admin RC file for your environment.
$ source <your_rc_filename>
- Get a list of available compute services.
$ openstack compute service list
- Disable the nova-compute binary on the host you want to put in maintenance mode.
$ openstack compute service set --disable --disable-reason <optional_reason> <host> nova-compute
- Verify that the service is disabled.
$ openstack compute service list | grep <host>
- To disable maintenance mode, simply enable the nova-compute binary/service again.
$ openstack compute service set --enable <host> nova-compute
- Optional: Verify the status of the host from the UI. Login as Admin -> Infrastructure Tab
Note: If The maintenance mode column is not showing on the UI, click on the 'Gear icon' next to the search bar and select 'Maintenance Mode'.