VMware Cloud Community
hakimbhungra
Enthusiast
Enthusiast
Jump to solution

Unable to unmount the datastore

Hi,

I'm getting below error when I was trying to un mount the Datastore.

Call"HostDatastoreSystem.RemoveDatastore" for object "datastoreSystem-15" on VCenter Server failed.

It seems there are two swap file inside the Datastore and I was not able to delete it also. This swap file for old
templates which is not exists now.

Please let me know how I can delete this swap file from the ESXi shell command forcefully So I can un mount the Datastore.

Regards,

  Hakim. B

0 Kudos
1 Solution

Accepted Solutions
tomtom901
Commander
Commander
Jump to solution

Check if there are VM's deployed from this template and set the swapfile policy to stay with the Virtual Machine. Also see, if you are able to remove the other vswp file with this command:


rm -rf New Template-8d25d1fe.vswp

View solution in original post

0 Kudos
13 Replies
tomtom901
Commander
Commander
Jump to solution

CD to your datastore directory:

cd /vmfs/volumes/<datastore name>

Check which files are in here:
ls -allh

Before you remove this, could you post the output of the ls command here, so we can see if it's safe to remove this.

Remove the files:
rm -rf *

0 Kudos
hakimbhungra
Enthusiast
Enthusiast
Jump to solution

Please find the below output

drwxr-xr-t    1 root     root         1.4k Dec  7 11:32 .

drwxr-xr-x    1 root     root          512 Dec  8 07:47 ..

-r--------    1 root     root        10.3M Dec 16  2012 .fbb.sf

-r--------    1 root     root       254.7M Dec 16  2012 .fdc.sf

-r--------    1 root     root         1.1M Dec 16  2012 .pb2.sf

-r--------    1 root     root       256.0M Dec 16  2012 .pbc.sf

-r--------    1 root     root       250.6M Dec 16  2012 .sbc.sf

-r--------    1 root     root         4.0M Dec 16  2012 .vh.sf

-rw-------    1 root     root         2.0G Aug  3 17:58 New Template-8d25d1fe.vswp

-rw-------    1 root     root         4.0G Aug  3 17:58 WinSrv2008R2STD-9b153a0e.vswp

/vmfs/volumes/50cddea3-33093f34-e783-6cae8b1f5873 #

Regards,

Hakim. B

0 Kudos
tomtom901
Commander
Commander
Jump to solution

Yes, you could safely remove those if the VM's New Template and WinSrv2008R2STD aren't in use anymore. Just wondering how you can have a vswp file for a template, but that would be a different discussion.

Perform the following command:

rm -rf WinSrv2008R2STD-9b153a0e.vswp New Template-8d25d1fe.vswp

0 Kudos
hakimbhungra
Enthusiast
Enthusiast
Jump to solution

Hi Tom.

I got the below error when I was trying to run this command.

rm: cannot remove 'WinSrv2008R2STD-9b153a0e.vswp': Device or resource busy

Regards,

Hakim. B

0 Kudos
tomtom901
Commander
Commander
Jump to solution

Hi Hakim,


That would indicate that the vswp file is being used by a VM somewhere. Can you check if there is a WinSrv2008R2STD VM (it might also be renamed) using this swapfile? Another thing to check is, if this datastore is being used as a swap datastore. Grab a host, and go to configuration -> VM swapfile location and see if it references the datastore here.

0 Kudos
hakimbhungra
Enthusiast
Enthusiast
Jump to solution

HI Tom,

This templates already deleted before but there swap file still exist.

regards,

hakim

0 Kudos
tomtom901
Commander
Commander
Jump to solution

Are there VM's deployed from this template? Perhaps they use the swap file? Something (a VM) is still using this swap file. This could also relate to your other problem, in which you had to manually set the VM swapfile policy to stay with the VM. Perhaps setting all VM swapfile policies to stay with the VM, this means running through every VM and setting the swapfile policy.

0 Kudos
hakimbhungra
Enthusiast
Enthusiast
Jump to solution

Hi Tom,

Please let me know what should be my next step.

regards.

hakim

0 Kudos
tomtom901
Commander
Commander
Jump to solution

Check if there are VM's deployed from this template and set the swapfile policy to stay with the Virtual Machine. Also see, if you are able to remove the other vswp file with this command:


rm -rf New Template-8d25d1fe.vswp

0 Kudos
john23
Commander
Commander
Jump to solution

your swap file size is 2G and 4G, it means vm are powered on. check which vm is consuming it.

Thanks -A Read my blogs: www.openwriteup.com
0 Kudos
tomtom901
Commander
Commander
Jump to solution

Geachte lezer,

Wegens activiteiten buiten de deur zal het antwoord op uw e-mail mogelijk wat vertraging oplopen.

Graag vraag ik hiervoor uw begrip.

Met vriendelijke groet,

Tom Verhaeg

Real Websolutions

0 Kudos
hakimbhungra
Enthusiast
Enthusiast
Jump to solution

Hi Tom,

Thanks for your support.

I found the two VM deploy through this template, I shutdown the virtual machine and deleted the swap file.

Appreciated your support.

Regards,

Hakim. B

0 Kudos
tomtom901
Commander
Commander
Jump to solution

Great to see that you managed to resolve this. Thanks for letting me know.

Tom

0 Kudos