VMware Cloud Community
RussellArdo
Contributor
Contributor

Can vCenter place an ESX host in maintenance mode while offline or on next boot?

Im using vSphere Replication on the same site ( same LAN ) with hosts and DataStores in separate locations but with multiple 10 GbE connections.

vSphere replication keeping replicas available in opposite locations.

However... If I invoke recovery due to temporary power loss... How can I prevent a host from booting and starting up original guests that would appear on the same LAN?

I won't be able to disconnect guest NICs as the Data Store will be offline.

Can vCenter force an offline host to enter maintenance mode on next start-up? Preventing guests from starting?

0 Kudos
1 Reply
RussellArdo
Contributor
Contributor

I've come up with a potential plan to help in this scenario but not exactly sure how I can script this.

My plan is...

1) Delay VM Startup order by 5 minutes for each per host.

2) Setup a text file on my vCenter server ( may in /home directory ) called Enable_Host_Maintenance

3) At the point of host failure/outage... I recover my vCenter server ( using Arcserve Instant VM ) if needed and add the host name to this file

4) On all my hosts, setup a script that is triggered via /etc/rc.local.d/local.sh

This script needs to read the contents of Enable_Host_Maintenance through a remote ssh connection ( or some other means if anyone can recommend? ) and if the current hostname matches a line then put the server into Maintenance Mode... preventing original the VM's ( that have been recovered... ) from starting automatically.

Has anyone done anything similar to this or had experience of setting up bash scripts ( or PowerCLI ) to read a file from a host to VCSA?

Any advice or pointers would be welcome.

0 Kudos