VMware Cloud Community
VirtualTman
Contributor
Contributor
Jump to solution

cannot power off vm due to vmx error

I have a server 2003 vm which was working fine until i used the connect cd/dvd button to connect a client cdrom drive to the vm. The client device is a usb cdrom attached to my desktop computer.

Now the vm shows as running, but if I try to edit any hardware settings I get "Operation failed since another task is in progress" (this is for any task like trying to switch cdrom to use host, disconnecting a connected nic, powering off vm etc etc)

So I cannot turn it off as I just want to delete it and rather use another test vm with host cdrom instead.

I suspect issue in vmx file. When I try to connect to this vm's console I get "Error connecting to <vmx file path> because the VMX is not started"

How do I regain control of this vm so that I can delete it from disk as I cannot turn it off to do this?

Any help would be most appreciated,

thanks.

0 Kudos
1 Solution

Accepted Solutions
lamw
Community Manager
Community Manager
Jump to solution

You'll want to use 30082

If you just run pe -ef You'll see that value in the 2nd column which is the PID and the 3rd contains the Parent PID.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

View solution in original post

0 Kudos
10 Replies
runclear
Expert
Expert
Jump to solution

Have you tried to shutdown the VM from a Console Session?

Give this a whirl -

> vmware-cmd /pathtoVM/server.vmx stop trysoft

or

> vmware-cmd /pathtoVM/server.vmx stop hard

-------------------- What the f* is the cloud?!
0 Kudos
runclear
Expert
Expert
Jump to solution

Once you get the VM shut down, you can then Unregister the VM

> vmware-cmd -s unregister /pathtoVM/server.vmx

then delete from disk

> rm -rf /vmFolder/

-------------------- What the f* is the cloud?!
0 Kudos
VirtualTman
Contributor
Contributor
Jump to solution

Hi runclear, thanks for reply.

I tried the first command (trysoft) and it returns the "Operation failed since another task is in progress" error

I have not tried the 'hard' option yet - is it OK to try this or do I need to be mindful of anything?

Thanks for the help!

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

Usually that error means there's a process already running and it will not be able to complete the command you're trying because one is currently being applied to the VM. The first flag trysoft is exactly that, it'll try to do a soft shutdown meaning if the VM has VMware Tools installed it'll shutdown properly, if it does not have VMware Tools then it'll do a hard power off. This way you can shutdown the guest cleanly if possible and if not, then you'll do a hard power off. The second is exactly a hard power off as if you were pulling the power from a system, it may put your system or application/data in an inconsistent state. Always make sure you have VMware Tools installed and that it's up to date

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

0 Kudos
VirtualTman
Contributor
Contributor
Jump to solution

Neither of the commands have helped me - the 'hard' command also returns "Operation failed since another task is in progress"

I know what the error means, in that a previous task has not completed, but I don't know what task is running or how to stop it, so that I can shut this vm down and delete it.

Is it possible to edit a vmx file of a running vm? Perhaps I could try removing the client cdrom entries there that started the symptoms.

Any ideas as to what I can do to take back control of this vm?

Thanks

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

You can search for the PID (Process ID) and manually kill the process which will kill the VM.

ps auxfww | grep <vmname> | grep -v grep

This will return the PID of your VM and will not show the original grep command. Then you can issue the kill command and hopefully it'll gracefully kill the process if not, you always do kill -9 (kill with prejudice).

kill <pid>

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

0 Kudos
VirtualTman
Contributor
Contributor
Jump to solution

OK have run first command, here is part of it, just want to confirm, what is the PID before I try the kill command? Is it 30082?

root 30082 0.0 0.1 2020 920 ? S&lt; 09:45 0:00 /usr/lib/vmware/b in/vmkload_app /usr/lib/vmware/bin/vmware-vmx

Thanks!

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

You'll want to use 30082

If you just run pe -ef You'll see that value in the 2nd column which is the PID and the 3rd contains the Parent PID.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

0 Kudos
VirtualTman
Contributor
Contributor
Jump to solution

Thank-You William! That did it.

The process killed off without needing -9 and the vm shut down. I could then delete the vm from disk.

Thanks very much for your help. I'll award points.

I think we'll keep sticking to the practice of using the ESX server host for CDRom instead of using a client device as this is where all the problems started to occur and we never had any issue before by using ESX host.

Thanks again!

T

0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

Awesome to hear.

=========================================================================

William Lam

VMware vExpert 2009

VMware ESX/ESXi scripts and resources at:

0 Kudos