VMware Cloud Community
pseudoyams
Contributor
Contributor
Jump to solution

Rename/Move VM on File system

I have a VM that crashed but I was able to recover everything, thankfully to all all the information on these discussions. In the process, I had to the delete the VM and re-create it with the same vmdk's. In doing that, I now have a folder in the /vmfs/volumes/SAN01-VDISK02_LUN04 named SERVER (which is the original folder) and not one named SERVER_1 (which is the new folder from when the VM was recreated). The problem with this is that the vmdk is the SERVER folder and all the other files (.nvram, .vmsd, .vmx, .vswp, and logs) are in the SERVER_1 folder. What do I need to do to get everything back into a single folder, preferrably the SERVER folder. The vmdk in that folder is over 1TB.

Thanks!

-Rob

0 Kudos
1 Solution

Accepted Solutions
Rubeck
Virtuoso
Virtuoso
Jump to solution

- Remove VM from Inventory

- Copy the .vmx file from the SERVER_1 folder to the SERVER folder (backup /rename old .vmx first)

- Right click the .vmx file in the SERVER folder and Add to inventory

Before powering on you could rename the SERVER_1 folder to something else, just to verify that no references to this folder is there..

/Rubeck

View solution in original post

0 Kudos
7 Replies
Rubeck
Virtuoso
Virtuoso
Jump to solution

- Remove VM from Inventory

- Copy the .vmx file from the SERVER_1 folder to the SERVER folder (backup /rename old .vmx first)

- Right click the .vmx file in the SERVER folder and Add to inventory

Before powering on you could rename the SERVER_1 folder to something else, just to verify that no references to this folder is there..

/Rubeck

0 Kudos
weinstein5
Immortal
Immortal
Jump to solution

I have two suggestions but both will require an outage for the VM -

  1. Do you have vCenter - if you do I would cold migrate the VM which will to bring alll the files together onto a different data store which will consolidate the files

  2. If it is a stand alone server- power down the vm - remove the VM form inventory - copy the files from server_1 directory to the server directory renaming the files as necessay - add the VM back into the inventory and power up -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
philvirt
Hot Shot
Hot Shot
Jump to solution

Using vCenter, migrate the VM using the option to move all files.

Thanks,

Phil Couto

Thanks, phIL
0 Kudos
pseudoyams
Contributor
Contributor
Jump to solution

Thanks guys. Ill give it a try tonight when I can take the server down.

-Rob

0 Kudos
pseudoyams
Contributor
Contributor
Jump to solution

We do have VCenter. Are you talking about just VMotion'ing it or migrating to another datastore? If moving everything to another datastore, we dont have enough space to move the 1 TB+ vmdk to a different one.

0 Kudos
pseudoyams
Contributor
Contributor
Jump to solution

Ooops, double post....

0 Kudos
pseudoyams
Contributor
Contributor
Jump to solution

Rubeck-

Thanks for the direction. That took care of it. Things were a bit tossed around in there so I used "vmkfstools -i" to rename and move a vmdk. I moved all the other file into the correct directory and edited the .vmx to have the correct path. Then I renamed the old directories in case anything was there that i missed pointing to the old locations. I then removed the VM from inventory, went into the datastore, right clicked the vmx and added it back into Inventory. The only remaining thing to do is to clean up the old files. Ill do that tomorrow when I get in just to be safe.

Thanks for the replies!

-Rob

0 Kudos