Vmware ESXi 5.0 Update1 Autostart breakup Fix

Credits: Thanks to Mr. Syed Jahanzaib  & others for there kind guidance.

In my company, we have two virtual servers based on Microsoft Hyper-V & Free version of ESXi 4.0 running 10 guest OS. We did planned to convert all of our physical machine to virtual to get benefit from underutilized modern hardware. Last week I decided to move our Domain Controller & ADC to virtual (which were installed on IBM Xseries physical serve machines).

As a rule of thumb, always test any new / trial product in LAB before deploying it on production server, following this theory I installed Vmware ESXi 5.0 Update 1 on vmware workstation 7.xand found out a BUG that guest vm’s do not auto start anymore when the host ESXi starts (In previous versions i.e 4.x , they auto start normally if they are set to autostart). This is a bug for theFREE version of the hypervisor. (For example if you have installed the FREE License key provided by vmware)

After some googling, I found out that There were some changes made in the way the ESXi APIs are accessed in Update 1 that unfortunately breaks the Guest VM Auto Start feature.

Here is a quick workaround to give you the autostart functionality in traditional Linux style.

If you haven’t done so already, Do Enable SSH on the ESXi host server. This can be easily done using Sphere client.

  • Connect to ESXI using Vsphere client.
  • Goto Configuration Tab | Security Profile | in Services, click on Properties
  • Highlight SSH | Select Options | Service Commands | Start
  • Use any SSH client like PuTTY) to log into your host server. As showed in the image below

In my case, I only wanted to auto start only single guest vm  (Which is my test DC)  So first We need to get the VM ID’s for the virtual machines. Use the following command to do so. Make note of theID numbers in the first column

Use the following command to get the VM ID of the machine you want to start.

vim-cmd vmsvc/getallvms

You will get results something like below ( I only have one test machine, so only one entry is visible)

Vmid          Name                                File                               Guest OS         Version   Annotation
1      TestPC-4-Autostart   [store] TestPC-4-Autostart/TestPC-4-Autostart.vmx   win2000AdvServGuest   vmx-08

The VM ID for test pc guest OS is 1

Use vi to edit /etc/rc.local  – & Insert the following startup lines above the IF statement and save.

vim-cmd vmsvc/power.on 1

[VI TIP: to enable editing, press i , now add your lines, to save, press ESC, now press shift+: & type wq and press enter]
As showed in the image below . . .

Save & Exit.

Now reboot the ESXi host server.

After reboot completes, you will see the target guest OS Auto starting this time.

Auto Start All VM’s guest OS

TIP: If you want to start all vm’s you need to add them as follow

vim-cmd vmsvc/power.on 1
sleep 180
vim-cmd vmsvc/power.on 2
sleep 180
vim-cmd vmsvc/power.on 3
sleep 180

Change the ID number as per your configuration. Now after starting 1st VM, ESXi HOST will wait 180 Seconds (3 minutes) to start second one and so on. You can change this number as per your hardware/software load.

I hope you will find it useful.

Advertisements
Posted in Ubuntu

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

ABOUT AUTHOR
Rodel Sales is a freelance I.T Professional . Start blogging on May 2013 to share my technical skills to other I.T professionals, and collect imperative guide from the internet world.
Blog Archieve
May 2013
M T W T F S S
    Jun »
 12345
6789101112
13141516171819
20212223242526
2728293031  
%d bloggers like this: