VMware Cloud Community
OCiobanu
Contributor
Contributor

vSphere ESXi 6.5 a Autostart order issue

Hello,

I'm using ESXi version 6.5.0 (Build 4564106) for testing with 5 guest machines all having the same configuration running Centos 7 minimal OS with open-vm-tools installed. Starting and stopping them manually without any errors from ESXi or guest OS.

I've enabled Autostart  as seen in the following screen shoot :

Screen Shot 2017-03-03 at 7.55.54 PM.png

The following issues were tested with and without heartbeat

First issue is when I set autostart order.

Steps taken:

1. I right click on the first guest and selected Autostart > Increase priority and got 1 on Autostart order.

Screen Shot 2017-03-03 at 7.07.26 PM (2).png

2. I right click on the second guest machine and did the same steps as with the first one expecting that it will get 2 in Autostart order but got swapped with the first guest

Screen Shot 2017-03-03 at 7.07.36 PM (2).png

3. I continued with the other guests expecting the same behavior as with the first 2 (swapping autostart order) but I got a normal behavior getting 3rd for the 3rd, 4th for the 4th and 5th for 5th guest.

Screen Shot 2017-03-03 at 7.08.04 PM (2).png

Second issue is the fact that when the ESXi or the server is restarted the first 2 guests (the ones that swapped) are not started by the autostart with or without fixing the start order (decreasing priority on the first guest so the 1st guest is 1st in Autostart order and the 2nd is 2nd). But the other 3 guest are started as they should (respecting the order 3,4,5 waiting for delay time or heartbeat).

I also did a manual start of the first 2 guests and after that a ESXi reboot and the guests where stopped respecting the order starting with 5th guest and ending with 1st guest.

Any ideas why and how can I fix or debug this strange behavior  

4 Replies
huntrm
Contributor
Contributor

I'm seeing exact same issue.  Thank you for posting this, I thought I was going crazy and was looking all over the web client and the Vsphere client trying to fix.

Were you able to resolve it?

EDIT:  I got it working.  You must unregister a VM through the web client, then re-create it.  That fixes the issue where it won't start up.

Thanks goes to the Russian blog (and Google Chrome for translating how it can be done).  I didn't go through the shell but used the web client.

0 Kudos
OCiobanu
Contributor
Contributor

Using the Client (Web or App) was a no go. So I went "rogue" and manage to find a workaround to fix it.

I did it by reverse engineering the way the ESXi is auto starting the guests and found the file used to store the auto start configuration and changed the settings by hand.

This are the workaround steps (old school using console tools)

1. Enable ESXi SSH service using the client

2. Connect to ESXi server using a SSH client

3. Go to folder /etc/vmware/hostd ( Command used : cd /etc/vmware/hostd )

4. Edit file vmAutoStart.xml (guests auto start order was set using the client interface - if is not done there the file contains only the auto start global settings) ( Command used : vi vmAutoStart.xml )

5. Look for <startAction> element and change it to powerOn (for the guests that are failing to start it is set to something else than powerOn) and save the file.

6. Restart the ESXi server and check.

I'd love to see it fixed in the client interface so it can be done properly but until then this is the only way I can make it work.

huntrm
Contributor
Contributor

I was able to do it if you unregister and re-register the VM.  The autostart works just fine and in the order that you specify.

DerekShaw
Enthusiast
Enthusiast

Thanks to both of you for posting your workaround!  I was experiencing the same randomness of results, and wondering how to describe the behaviour.  This is a freshly-deployed esxi 6.5 server.  We migrated VMs from an esxi 6.0 server because of (RAID) hardware issues on the 6.0 server.

I had attempted to fix this by using the old-style Windows vSphere Client, where we still have the old-style "tiered" startup order

(Configuration -> Virtual Machine Startup/Shutdown -> Properties)

Automatic startup (in priority order)

  1 - dns host

  2 - mail server

  3 - file server

  4 - accounting db server

Any Order (like it says, I guess)

  print server

  wiki host

Manual Startup

  some utility machines

But upon power up, only four machines started up, in a seemingly random order (all of them in the two "autostart" classes).

So, I powered everything down, unregistered all the machines, then registered all of them again (and not in the order that I wanted them to boot).

I then used the web UI to "increase priority" of the machines, and the list built as intuition would expect, contrary to the first go-round.

Next, a reboot of the esxi host (without powering up the VMs), and the machines came up in the desired order

So in order for the autostart to work as expected, when working with a standalone esxi 6.5 box, it is clearly necessary, after you have each VM working, to unregister each VM, then re-register it.  Not sure if that applies to "all machines" or to "each machine".

0 Kudos