VMware Cloud Community
bkelleman
Contributor
Contributor

Could not power on VM: No swap file. Failed to power on VM

Hello --

A coworker did a simple "Power Off" on 2 live VM's. Now when they are powered on we are receiving the error " Could not power on VM: No swap file. Failed to power on VM "

The vswp file is present in the datastore.

Any guidance or help would be appreciated.

So far we have tried

--Cold migration

--Rename files

\-- Deleting the vswp (Invalid Argument error came back, file still present)

PLEASE Help!!

0 Kudos
16 Replies
sbeaver
Leadership
Leadership

Unregister the VM and if you need to move the vmdk using vmkfstools and the vmx to a new directory and register the VM and then start

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
bkelleman
Contributor
Contributor

Thanks for your quick response. How do I unregister a VM safely?

0 Kudos
sbeaver
Leadership
Leadership

Right click on the VM and remove from inventory but do not delete the files.

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
bkelleman
Contributor
Contributor

Ok, maybe this is the issue?

\[root@esxnj04 jes-mail]# vmkfstools -i /vmfs/volumes/45797ed5-bcb1531d-6716-00144f407010/jes-mail/jes-mail.vmdk /vmfs/volumes/45832dee-8f2fbae7-e9de-00144f407010/jesmailnew/jesmailnew.vmdk

Destination disk format: VMFS thick

Failed to open '/vmfs/volumes/45797ed5-bcb1531d-6716-00144f407010/jes-mail/jes-mail.vmdk': Invalid argument (1441801)[/b]

\[root@esxnj04 jes-mail]#

I am stumped

0 Kudos
sbeaver
Leadership
Leadership

Check the vmdk header file on that one and one that works and see if anything jumps out to you that something is wrong

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
sbeaver
Leadership
Leadership

Did you move the vmdk to another folder and how did you do it? You might need to update the vmdk of the new file path or the vmx

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
kitcolbert
VMware Employee
VMware Employee

Are you sure the VM powered off properly before? 'cat /proc/vmware/sched/cpu' on the server where the VM was last running to see if it still is (or to see if it's in some sort of zombie state).

0 Kudos
ph0rse
Contributor
Contributor

I have this same problem and under that proc file you mention the VM shows up. How can I manually bring it down now that its process has already been killed?

0 Kudos
danam
Contributor
Contributor

For the record, below worked for me:

http://thelifecode.blogspot.com states:

0 Kudos
jpbutler
Enthusiast
Enthusiast

If the VM shows up in the /proc/vmware/sched/cpu how can you bring it down after the process has already been killed?

Thanks.

0 Kudos
RParker
Immortal
Immortal

**A coworker did a simple "Power Off" on 2 live VM's. Now when they are powered on we are receiving the error " Could not power on VM: No swap file. Failed to power on VM " **

Have him drawn and quartered immediately!

Take away his access rights and only give him "Look but don't touch" rights ..hehe..

0 Kudos
YeDai
Contributor
Contributor

Hi

I got this problem early this week since I rebooted the ESX server without turning the VMs off. After the ESX server robooted, here is what I saw and what I did:

-


1. windowsxp (orphaned)

I right click the windowsxp (orphaned), then choose Remove from Inventory. Then I find the folder of windowsxp in the datastore, manually add the windowsxp into the inventory.

Then I trying to power on windowsxp, I got the same error message: "Could not power on VM: No swap file. Failed to power on VM ".

Since the windowsxp is off, what I did was that I try to migrate the windowsxp to another ESX server, you will get error message "A general system error occured: internal error". After that, the windowsxp will be automatically powered on properly Smiley Happy

-


regards,

Levi.

0 Kudos
Park3r
Contributor
Contributor

i had the same issue yesterday, was reconfiguring luns on SAN and cold migrating vm images here and there. 1 vm didn't make it back up though.

inspired by the earlier posts the following worked for me:

#1 cat /proc/vmware/sched/cpu | grep <machinename> to indentify the host running the zombie vm.

#2 let the host enter maintenance mode to migrate all vms off the host.

#3 step #2 fails (at least in my case) with 'operation timeout' even there are no more vms running on it and you keep clicking on enter maintenance mode.

#4 as there is only 1 (zombie) vm running on the host, which is not really running anyway, reboot the host. when it comes online, power on the vm

Message was edited by: Park3r

0 Kudos
skywalkr
Contributor
Contributor

Be careful w/ using kill.. VMware support suggests several options, but the preferred method I've been handed a couple of times is as follows b/c it will clean up the vmworld setups etc.

Q: We have a VM which is in a hung state, what is the safest way to terminate or kill it?

A: For ESX, the safest way to terminate or kill a hung VM is to use the following VMware commands:

  1. Login to the hosting system's service console as root

  2. cd \tmp

  3. Obtain the vmid of the VM you want to kill by typing vm-support -x

  4. Kill the VM and generate core dumps and logs by typing vm-support -X XXX where XXX is the VMID you found in the last step.

    1. You will be prompted for the following:

      1. Do you want to include a screen shot of the VM? -> N

      2. Do you want to send a NMI to the VM and send a ABORT to the VM? You must answer Yes to the ABORT question to kill the VM.

    2. The entire process will take about 5-10 minutes to run.

    3. The process will create a tar archive in the directory you run it in.

    4. Delete the tar archive when finished if not needed.

Later,

GC Mobley, IBM

Later, GC Mobley
0 Kudos
Narkis
Enthusiast
Enthusiast

Use the command vmware -l ( on all host to find the VM Need to know which Host currently has the VM )

if you indentified the host on which your target VM running, use the command ps -efl|grep <VMname> ( It will give the Process ID )

To get the Process ID

Use the command Kill -9 < PID >

Power on the VM in VC

Cheers!

0 Kudos
jcmoriaud
Contributor
Contributor

@14: skywalkr@us.ibm.com

You saved my life Thanks and best regards, JCMoriaud

0 Kudos