How to Put CVMs and hosts in maintenance mode

Advertisements

HOW TO PUT CVMS AND HOSTS IN MAINTENANCE MODE

We must know how to place cvms and hosts in maintenance mode for any network or cluster related activity such as ram upgrade, firmware upgrade of single nodes.

For CVMS and Nutanix AHV, VMware ESXi, Citrix Xen we can place with SSH and for Microsoft Hyper-V Use PowerShell or failover cluster manager.

Nutanix CVM (Controller Virtual Machine)

Determine ID to get CVM-host on the node that you would like to bring down for maintenance

  • Connect to any CVM in the cluster with SSH.
  • Run the command to get the CVM host ID
nutanix@prod-cvm1$ ncli host ls | less

Id : 125763g-32e3-46s3-1404-103sagcg769g::7     ---- Note this host ID(::7).
Uuid : dasjal13-9547-9732-ljfp-fk42ck109
Name : NTNX-Prod-DC
IPMI Address : 50.1.1.5
Controller VM Address : 50.1.1.6
Controller VM NAT Address :
Controller VM NAT PORT :
Hypervisor Address : 50.1.1.7
Hypervisor Version : Nutanix AHV 
Host Status : NORMAL
Oplog Disk Size : 135.96 GiB (145,988,511,744 bytes) (3.5%)
Under Maintenance Mode : false (Hypervisor upgrade)
Metadata store status : Metadata store enabled on the node
Node Position : Node physical position can't be displayed for this model. Please refer to Prism UI for this information.
Node Serial (UUID) : ##########
Block Serial (Model) : NSM######
  • Note the CVM-Host id is 7 which is in double colons.
  • Enter the below commands to verify the all cluster services and node are up and in running mode
nutanix@prod-cvm1$ cluster status 
  • Also, verify the cluster status with Prism element dashboard.
Data Resiliency status
  • To enter CVM in maintenance mode, enter below command
nutanix@prod-cvm1$ ncli host edit id=7 enable-maintenance-mode=true

After this command you can see that CVM host is showing “Under Maintenance Mode : true .

To verify run the ncli host ls | less

nutanix@prod-cvm1$ ncli host ls | less

Id : 125763g-32e3-46s3-1404-103sagcg769g::7 ---- Note this host ID(::7).
Uuid : dasjal13-9547-9732-ljfp-fk42ck109
Name : NTNX-Prod-DC
IPMI Address : 50.1.1.5
Controller VM Address : 50.1.1.6
Controller VM NAT Address :
Controller VM NAT PORT :
Hypervisor Address : 50.1.1.7
Hypervisor Version : Nutanix AHV
Host Status : NORMAL
Oplog Disk Size : 135.96 GiB (145,988,511,744 bytes) (3.5%)
Under Maintenance Mode : true
Metadata store status : Metadata store enabled on the node
Node Position : Node physical position can't be displayed for this model. Please refer to Prism UI for this information.
Node Serial (UUID) : ##########
Block Serial (Model) : NSM######

Now you can shut down CVM using cvm_shutdown -P now, and then respective host.

Once the activity is completed exit the cvm from maintenance mode

nutanix@prod-cvm1$ ncli host edit id=7 enable-maintenance-mode=false

We will see how to place Hypervisor in maintenance mode

Nutanix AHV

Nutanix AHV is very simple to enter in maintenance mode.

To get the AHV IP hypervisor address or UUID enter the below command

nutanix@cvm$ acli host.list

Node down the Host Ip address or UUID and Check whether the host can enter in maintenance mode.

nutanix@prod-cvm1$ acli host.enter_maintenance_mode_check <host ip> --- Enter the host IP address
Ok to enter is maintanance mode

To enter AHV hypervisor in maintenance mode:

nutanix@cvm$ acli host.enter_maintenance_mode <hypervisor_address> wait=true

To shut down the AHV hypervisor after shut doing down all guest vms including CVM

root@prod-AHV # poweroff

To exit AHV host from maintenance mode:

nutanix@cvm$ acli host.exit_maintenance_mode <hypervisor_address>

VMware ESXi Hypervisor

You can use SSH or VMware vCenter web client to place ESXi hosts in Maintenance mode.

Take the SSH of the ESXi host to enter in maintenance mode:

root@esxihostA# esxcli system maintenanceMode set --enable true

To exit ESXi hosts from maintenance mode or you can end the maintenance mode in ESXi host from vCenter Web client.

root@esxihostA# esxcli system maintenanceMode set --enable false

To get ESXi host maintenance mode status

root@esxihostA# esxcli system maintenanceMode get

Microsoft Hyper-V:

You can use failover cluster manager to place host in pause state ⇾ select Drain roles.

Drain Role

Using PowerShell you can do this

Suspend-ClusterNode
PS C:\winows\cluster> Suspend-ClusterNode

To exit Hyper-V host from maintenance mode using failover cluster manager Resume ⇾ Select Fail Roles Back

Resume-ClusterNode

To exit Hyper-V host maintenance mode:

PS C:\winows\cluster> Resume-ClusterNode

Citrix XenServer

Using XenServer Console

Xen Maintenance

Take the SSH of the host and Identify the UUID of the host you want to place in Maintenance Mode

root@xenhostA# xe host-list

To enter the Xen host in maintanace mode

root@xenhostA# xe host-disable uuid=<host_uuid>
root@xenhostA# xe host-evacuate uuid=<host_uuid>

Once the maintenance operation is completed, Exit the host by running below command

root@xenhostA# xe host-enable 

Using Xen Console

Xen exit Maintenance

See also :- How to add or remove nics from OVS bridge

Cirtix Xen KB for reference

Leave a Reply