VMware Cloud Community
jjohnston1127
Hot Shot
Hot Shot
Jump to solution

Power off VM by command line? Reboot ESX server by command line?

Is there a way to power down a VM by command line? I need to reboot one of my servers as it has stopped responding to any commands (Just says In Progress then times out).

I've tried restarting the mgmt-vmware service and its no luck.

Message was edited by:

jjohnston1127

Reply
0 Kudos
1 Solution

Accepted Solutions
VirtualNoitall
Virtuoso
Virtuoso
Jump to solution

Hello,

You can try using vmware-cmd:

“vmware-cmd /”

View solution in original post

Reply
0 Kudos
12 Replies
VirtualNoitall
Virtuoso
Virtuoso
Jump to solution

Hello,

You can try using vmware-cmd:

“vmware-cmd /”

Reply
0 Kudos
jjohnston1127
Hot Shot
Hot Shot
Jump to solution

Good answer.

Is there a way to force a reboot of the ESX SERVER via command line? It's unresponsive in virtual center and wont refresh that all VMs are off so I can enter maintanence mode.

Reply
0 Kudos
chandlm
Expert
Expert
Jump to solution

If you want to force it to reboot check out:

reboot -?

shutdown -?

Can you access the web console directly and see if that is updated? You may need to restart just some services rather than completely rebooting...

Message was edited by:

chandlm

Reply
0 Kudos
esiebert7625
Immortal
Immortal
Jump to solution

Here's some doc's I wrote on this...

How can I kill a stuck virtual machine?

ESX 3.0 method

o Login to the service console

o Type “vmware-cmd –l” to get a list of all VM’s and there paths

o You can check the VM state by typing “vmware-cmd //server.vmx start” to power on VM

Reply
0 Kudos
VirtualNoitall
Virtuoso
Virtuoso
Jump to solution

Hey,

Thanks! Smiley Happy

I use the following:

shutdown -r now

Hope that helps!

Jae_Ellers
Virtuoso
Virtuoso
Jump to solution

for shutdown and reboot VMware has done a good job with the service console maintaining integrity with the built-in Linux run levels.

I use init 0 to shutdown or init 6 to reboot. Just type that at the command line and down it goes. init 0 will halt the system and tell you when to power down. init 6 will do a normal shutdown and warm boot.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=- http://blog.mr-vm.com http://www.vmprofessional.com -=-=-=-=-=-=-=-=-=-=-=-=-=-=-
jjohnston1127
Hot Shot
Hot Shot
Jump to solution

Silly me.

I knew about the reboot and shutdown commands; however it wouldn't let me perform them logged in as another user, even if I was super-usered into root.

Reply
0 Kudos
jjohnston1127
Hot Shot
Hot Shot
Jump to solution

fadsfa

Reply
0 Kudos
danam
Contributor
Contributor
Jump to solution

I knew about the reboot and shutdown commands;

however it wouldn't let me perform them logged in as

another user, even if I was super-usered into root.

You probably used "su" instead of "su -", which will give you the full root environment.

HTH

Dan

Reply
0 Kudos
nichlas
Contributor
Contributor
Jump to solution

This don´t work for me.

If i try the stop co vmware-cmd stop command I get:

VMControl error -999: Unknown error: SoapError: ServerFaultCode(0) : (The attempted operation cannot be performed in the current state (Powered On).)

and if I try the stop hard I get:

VMControl error -999: Unknown error: SoapError: ServerFaultCode(0) : (The attempted operation cannot be performed in the current state (Powered On).)

Why?

when I list the ps-ef the state is D< of the VM I want to stop.

Reply
0 Kudos
davidjerwood
Enthusiast
Enthusiast
Jump to solution

I have exactly the same issue, When tyring to shutdown a virtual machine.

"If i try the stop co vmware-cmd stop command I get:

VMControl error -999: Unknown error: SoapError: ServerFaultCode(0) : (The attempted operation cannot be performed in the current state (Powered On).)

and if I try the stop hard I get:

VMControl error -999: Unknown error: SoapError: ServerFaultCode(0) : (The attempted operation cannot be performed in the current state (Powered On).)"

Does anyone know how to resolve the issue.

Reply
0 Kudos
pintu27
Contributor
Contributor
Jump to solution

Hi,

I can't bring down one of the vm neither from VI client nor through vmware-cmd.

I am trying to use the kill command for VM PID. However the PID is changing frequently for all vm's. PID is getting incremented by digit two. If i fire the kill command it never founds the old PID and throughs PID is not found.

Even I can't restart mgmt-vmware service. after sometime host gets disconnected from Virtual Center.

Then I have killed the vmware-hostd agent service, now things came to good shape.

But I didn't understand why VM PID is changing regularly and how to kill that ??

Any suggestion!!

Reply
0 Kudos