VMware Cloud Community
blainewilliams
Contributor
Contributor

rm: cannot remove <filname> Device or resource busy - But no VMX file exists

Morning,

I imported a physical server and it booted up fine, then restarted on its own and then would never turn on again. I thought i deleted the VM from disk but looking via veeam fastscp there are still there. Well 2x .vmdk 1x .log 1x .nvram files.

How can i release these files to beable to delete them. I have read through a couple of other threads but they all seem to go on about the .vmx which i dont have .

As you can see below the vms arent running, and annoying there is lhr0td01 and LHR0TD01 .

"/[root@lhr0ehst03] root]# vmware-cmd -l /vmfs/volumes/471ca062-44290ce1-9c6c-001cc45adbee/LHR0NET05A/LHR0NET05A.vmx /vmfs/volumes/471ca02a-6115e247-e7d5-001cc45adbee/LHR0TD03/LHR0TD03.vmx /vmfs/volumes/471ca062-44290ce1-9c6c-001cc45adbee/LHR0NET04B/LHR0NET04B.vmx /vmfs/volumes/471ca062-44290ce1-9c6c-001cc45adbee/LHR0NET03A/LHR0NET03A.vmx /vmfs/volumes/471ca062-44290ce1-9c6c-001cc45adbee/LHR0WSPS012/LHR0WSPS012.vmx /vmfs/volumes/471ca062-44290ce1-9c6c-001cc45adbee/LHR0WSQL012/LHR0WSQL012.vmx /vmfs/volumes/471ca062-44290ce1-9c6c-001cc45adbee/LHR0WFLSP001/LHR0WFLSP001.vmx /vmfs/volumes/471ca062-44290ce1-9c6c-001cc45adbee/LHR0TD02/LHR0TD02.vmx /vmfs/volumes/471ca062-44290ce1-9c6c-001cc45adbee/LHR0NET02/LHR0NET02.vmx /vmfs/volumes/471ca062-44290ce1-9c6c-001cc45adbee/LHR0NET01A/LHR0NET01A.vmx # ps -elf|grep lhr0td01 0 S root 25130 2173 0 76 0 - 924 pipe_w 11:28 pts/0 00:00:00 grep lhr0td01 # ps -elf|grep LHR0TD01 0 S root 25450 2173 0 75 0 - 922 pipe_w 11:28 pts/0 00:00:00 grep LHR0TD01 #"

If i try to kill 25130 25450 it says no such pid, how can i get the pid simply ?

I hope this makes sense

thanks

b

Reply
0 Kudos
14 Replies
Karunakar
Hot Shot
Hot Shot

HI,

This usually happens, when there is a userworld running for the VM you are trying to delete.

Try to check with the below command.

ps -aux | grep &lt;vm name&gt;

here you will get the PID of that process, and then try to kill using the below command.

kill -9 &lt;pid&gt;

And then try to perform the action , this shoudl work.

-Karunakar

Reply
0 Kudos
blainewilliams
Contributor
Contributor

Thanks for the reply, still no joy though, unless im doing something wrong ?

# ps -aux | grep lhr0td01 root 22841 0.0 0.2 3692 676 pts/0 S 14:36 0:00 grep lhr0td01 # kill -9 22841 -bash: kill: (22841) - No such process #

Reply
0 Kudos
Karunakar
Hot Shot
Hot Shot

Hi Blaine,

the process you are trying to kill was the search process Ps command you ran, so this will not work.

Seeing the output you gave, there is no process running for the VM.

One question I have, is the vm on shared storage, or was this VM being access from any other ESx host previously.

If yes, then try to run the same command in that ESX, to see if there was any process running in that machine.

-Karunakar

Reply
0 Kudos
Karunakar
Hot Shot
Hot Shot

Sorry, I forgot that this was a physical to virtual convertion.

As you say that you can not find any .vmx file along with the .vmdk files, can you pelase check if there is any other folder with the same VM name_1 or any other, in the storage.

and check for the .vmx file there.

And also try to perform a "service mgmt-vmware restart" , this will also refresh any process running and got stuck.

-Karunakar

Reply
0 Kudos
blainewilliams
Contributor
Contributor

Hey, thanks for the responses again.

Righty then, Yes it is on a shared SAN but i imported the Physical Machine to a specific host , which is the host im looking at via putty.

I tried the migration twice and it failed both times and i seem to have lhr0td01 and also LHR0TD01 but i dont have any _1 or anything like that.

Here is a list of the files i have :

lhr0td01.nvram

lhr0td01_1-flat.vmdk

lhr0td01-49996758.vswp

lhr0td01-flat.vmdk

vmware.log

thanks

b

Reply
0 Kudos
Karunakar
Hot Shot
Hot Shot

Hi Blaine,

I think, on the first post, you said you were trying to delete the host.

Did you use the option to remove from the inventory or Delete from the Disk.

And now, as we are not able to find the VMX file, lets try to create a new VM with the same .vmdk file we have in the storage.

From the VI client on the ESX, try to create a new Virtual machine,

In this wizard, select the sutom type,

and then try to select the disk, use existing vmdk file, and point to the vmdk files of the VM you have, and then continue the wizard.

And after creating the VM, try to power on the VM.

Let me know the results. Will wait for your response.

-Karunakar

Reply
0 Kudos
blainewilliams
Contributor
Contributor

now this is weird, when i go to add the existing disks i browse to the folder and it isnt showing any vmdk files, but when i veamscp into the SAN there , there.

Reply
0 Kudos
Karunakar
Hot Shot
Hot Shot

Oooops, this looks like there is no vmdk files in the storage.

Can you try to login to the ESX console and check for the vmdk files in the storage.

-Karunakar

blainewilliams
Contributor
Contributor

yeah if i go to Configuration - Storage and then Browse the Datastore i can still see them. But however i have selected the files and then tried deleting from disk there and well put it this way, its been deleting for a very long time now so im not holding my breath.

Reply
0 Kudos
Karunakar
Hot Shot
Hot Shot

my assumption would be, when you are trying to do the physical to virtual conversion, it may be happening correctly. so you are facing this issue.

to delete these files, the best way would be to delete from the command line in the ESX.

as you said its taking very long, lets wait on this, if this does not work.

then login to the console of the ESX, and then go to particular storage in /vmfs/volumes/&lt;storage name&gt;/&lt;vm folder&gt;

and then remove by using the command rm -rf *

this will delete the files completely from the storage.

-Karunakar

Reply
0 Kudos
blainewilliams
Contributor
Contributor

Right the deleting through the Data Browser never actually deleted the vmdk or vswp files , but it let me rename them to old, but still didnt let me delete them. So im going to try the command you said but not sure how to do it and dont want to delete anything by accident , can you confirm the command.

This is the volume path

/vmfs/volumes/LHR_SAN_3/LHR0TD01old2

How do i right the command ?

thanks

b

Reply
0 Kudos
Karunakar
Hot Shot
Hot Shot

HI,

To delete from the vmfs volumes.

Try to do the below.

cd /vmfs/volumes/LHR_SAN_3/LHR0TD01old2

Then when you are in the folder, try to delete the files one after other.

rm -rf &lt;file name&gt;

this will completely remove the files from the datastore.

-Karunakar

Reply
0 Kudos
blainewilliams
Contributor
Contributor

Its starting to feel like a host reboot

# rm -rf lhr0td01_1-flat.vmdk rm: cannot remove `lhr0td01_1-flat.vmdk': Device or resource busy # rm -rf lhr0td01-49996758.vswp rm: cannot remove `lhr0td01-49996758.vswp': Device or resource busy

Reply
0 Kudos
Karunakar
Hot Shot
Hot Shot

can you check if there any process using these files.

try to run the command as below and let me know the output.

ps -aux | grep lhr0td01*

-Karunakar

Reply
0 Kudos