VMware Cloud Community
nettravel
Contributor
Contributor
Jump to solution

How to remove a folder in the VMware datastore

HI,

First VM4&VM5 is migrated while migration of VM20 is running, so migration of VM4&VM5 failed several minutes later. But VM4  folder could be seen under backup2 datastore. When VM4  is migrated again after migration of VM20  finished, VM4_1 folder can be seen in datastore backup2.  And VM4 folder includes a DB_backup-flat.vmdk file.

vm4-2.jpg

So I have some questions:

1) How can I remove the VM4 because it is useless?  Should I delete  DB_backup-flat.vmdk file and then delete VM4 folder? But I cannot find steps to delete VM4 folder in the backup2 datastore. Who Can provide the steps ?

2) How can I rename VM4_1 folder name to VM4?

Thanks!

Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
vThinkBeyondVM
VMware Employee
VMware Employee
Jump to solution

Thanks Andre for the clarification. Yes, even though folder can be renamed when VM is powered on but it will lead to issues if we want to migrate the VM to other datastore or if we shutdown & try to power on. Hence please do not rename folder when VM is running.

Second approach will work just fine.  i.e. renaming display name of the VM and then SVMotion to another datastore & then again you can bring back the VM to earlier datastore.

Refer:VMware KB: Renaming a virtual machine and its files in VMware ESXi and ESX


----------------------------------------------------------------
Thanks & Regards
Vikas, VCP70, MCTS on AD, SCJP6.0, VCF, vSphere with Tanzu specialist.
https://vThinkBeyondVM.com/about
-----------------------------------------------------------------
Disclaimer: Any views or opinions expressed here are strictly my own. I am solely responsible for all content published here. Content published here is not read, reviewed or approved in advance by VMware and does not necessarily represent or reflect the views or opinions of VMware.

View solution in original post

Reply
0 Kudos
4 Replies
vThinkBeyondVM
VMware Employee
VMware Employee
Jump to solution

This is simple.

Steps:From VI client

1. You can delete VM4 folder straightway as you already have running VM files in VM4_1 folder. Directly deleting  VM4 folder will delete all the files inside that folder. No issues would be there.

VI client::Browse datastore>>right click on VM4 folder>>click on delete from disk >>It will pop up with warning message, plz carefully read & click on OK.

2. Renaming is process: VI client>>:Browse datastore>>right click on VM4_1 folder>>click on "rename">>just rename to "VM4. This should not be done for the VM which is already registered in inventory  (either powered on or off).

Message was edited by: Vikas


----------------------------------------------------------------
Thanks & Regards
Vikas, VCP70, MCTS on AD, SCJP6.0, VCF, vSphere with Tanzu specialist.
https://vThinkBeyondVM.com/about
-----------------------------------------------------------------
Disclaimer: Any views or opinions expressed here are strictly my own. I am solely responsible for all content published here. Content published here is not read, reviewed or approved in advance by VMware and does not necessarily represent or reflect the views or opinions of VMware.

nettravel
Contributor
Contributor
Jump to solution

Thanks for your answer!

I agree the first answer. I think it is correct.

For the second one, I have a question. the current VM4  is running. Can I rename VM4_1 folder online ?

Is there any VM Ware admin guide for it ?

Thanks again!

Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

No, a folder cannot be renamed if files are in use. To rename the folder only, you may shutdown the VM, remove it from the inventory, rename the folder and add the VM to the inventory again.

To rename the folder (as well as the files) with the VM powered on, is to rename the VM in the inventory, and then use storage vMotion to migrate the VM to another datastore.

André

Reply
0 Kudos
vThinkBeyondVM
VMware Employee
VMware Employee
Jump to solution

Thanks Andre for the clarification. Yes, even though folder can be renamed when VM is powered on but it will lead to issues if we want to migrate the VM to other datastore or if we shutdown & try to power on. Hence please do not rename folder when VM is running.

Second approach will work just fine.  i.e. renaming display name of the VM and then SVMotion to another datastore & then again you can bring back the VM to earlier datastore.

Refer:VMware KB: Renaming a virtual machine and its files in VMware ESXi and ESX


----------------------------------------------------------------
Thanks & Regards
Vikas, VCP70, MCTS on AD, SCJP6.0, VCF, vSphere with Tanzu specialist.
https://vThinkBeyondVM.com/about
-----------------------------------------------------------------
Disclaimer: Any views or opinions expressed here are strictly my own. I am solely responsible for all content published here. Content published here is not read, reviewed or approved in advance by VMware and does not necessarily represent or reflect the views or opinions of VMware.

Reply
0 Kudos