VMware Cloud Community
pointer_00
Enthusiast
Enthusiast

Ubuntu Virtual Machine hangs on grub menu while powering on VM - vSphere API

Hi,

I am trying to power on the virtual machines inside ESXi (manged by vCenter Server) using vSphere API. The OS I am using is Ubuntu 12.04 server.

I have a Java script that uses the API to do so, however, while powering on the VM, most of the times it gets stuck on the grub boot menu and never gets on from there.

I have changed the default grub settings on Ubuntu (in /etc/default/grub) machine to:

GRUB_HIDDEN_TIMEOUT=0

GRUB_HIDDEN_TIMEOUT_QUIET=false

GRUB_TIMEOUT=0


The VM boots up fine if I do it through the vSphere Client, and the problem occurs only while doing it through the API.


Any pointers would be much appreciated..

Thanks,

0 Kudos
4 Replies
Sreejesh_D
Virtuoso
Virtuoso

May be a code problem. Please post the coder here (only the vm power on part).

0 Kudos
pointer_00
Enthusiast
Enthusiast

Thanks for your response. I am using one of the sample scripts given in vSphere SDK for Java. VMpowerOps.java is attached to the message.

0 Kudos
Sreejesh_D
Virtuoso
Virtuoso

Just a test.

1. Try script after moving the target VM to a different host.

2. If there is no success, try removing the following coder from Poweron if condition.

if(task.waitForMe()==Task.SUCCESS)

      {

        System.out.println(vmname + " powered on");

      }

0 Kudos
pointer_00
Enthusiast
Enthusiast

I tried these and it didn't help.

For:

2. ..try removing the following coder from Poweron if condition.

The string "vmname powered on" is printed both cases though when the VM boots successfully / is stuck at grub menu.

0 Kudos