Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

Performing Host Maintenance

shoenisch edited this page Jan 12, 2017 · 1 revision

Here's how to perform maintenance on an ESXi host in a Photon Controller cluster by using the Photon command-line interface.

If the maintenance could affect the version of software, you should first remove the host from the Photon Controller cluster with photon host delete. After the maintenance is complete, you can add the host back into the cluster, which reinstalls the Photon Controller agent on the host.

Photon Controller holds an ESXi host in a state, usually a ready state. To perform maintenance, you must first place an ESXi host in a suspended state, remove all the VMs on it, and then place the host into a maintenance state.

Host States

  1. CREATING Host is being created.
  2. NOT_PROVISIONED Host added, but no agent installed yet
  3. READY Host is ready.
  4. MAINTENANCE Host is in maintenance. No VM is running on the host.
  5. SUSPENDED Host suspended. Existing VMs are still running but won't allow to add new VMs.
  6. ERROR Host Error states. Such as provisioning failed, etc.
  7. DELETED Infrastructure use only.

Suspending the Host and Entering Maintenance Mode

First, suspend the host. You can only suspend a host if it's in the READY state, and you can enter maintenance mode for a host only if it's in the suspended state and there are no VMs on it. Here's an example of how to suspend a host:

photon host suspend 40778c18-570b-479e-a92e-5801395376b9
SUSPEND_HOST completed for host entity 40778c18-570b-479e-a92e-5801395376b9

Second, remove all the VMs from the host.

photon host list-vms 40778c18-570b-479e-a92e-5801395376b9
ID                                    Name  State
4f2fe2d3-7c2a-4f35-b70a-a1d6fec90600  vm-1  READY

photon vm delete 4f2fe2d3-7c2a-4f35-b70a-a1d6fec90600
DELETE_VM completed for 'vm' entity 4f2fe2d3-7c2a-4f35-b70a-a1d6fec90600  

Third, place the host in maintenance mode. A host cannot be put into maintenance mode if it contains VMs.

photon host enter-maintenance 40778c18-570b-479e-a92e-5801395376b9
ENTER_MAINTENANCE_MODE completed for host entity 40778c18-570b-479e-a92e-5801395376b9

Fourth, perform your maintenance and then exit maintenance mode:

photon host exit-maintenance 40778c18-570b-479e-a92e-5801395376b9
EXIT_MAINTENANCE_MODE completed for host entity 40778c18-570b-479e-a92e-5801395376b9
Clone this wiki locally