VMware Cloud Community
Dr_No2
Contributor
Contributor

Renamed a VMDK file causes it to be invisible?

Hello,

I destroyed a VM that I did not need anymore. However, I retianed the 750Gb VMDK file which I used for backups and dumps.

I decided to create another VM and add that VMDK file. Before doing so, I renamed the VMDK file to that new servers name to keep them in sync.

Problem: Now when I try to add the disk using VI Client, it cannot find it. When I go into the Datastore, I am able to see it there.

How do I fix the file so I can access it once again?

Thanks

Smiley Happy

0 Kudos
14 Replies
malaysiavm
Expert
Expert

should you try to rescan all your HBA and verify again?

Malaysia VMware Communities -

Craig vExpert 2009 & 2010 Netapp NCIE, NCDA 8.0.1 Malaysia VMware Communities - http://www.malaysiavm.com
0 Kudos
Dr_No2
Contributor
Contributor

Rescanning the HBAs does not fix the issue. I still can add it to a VM - it does not appear

0 Kudos
AWo
Immortal
Immortal

Have you changed the file extension to something different than ".vmdk"?






If you found this information useful, please consider awarding points for "Correct" or "Helpful" answers/replies. Thanks!!

vExpert 2009/10/11 [:o]===[o:] [: ]o=o[ :] = Save forests! rent firewood! =
0 Kudos
Dr_No2
Contributor
Contributor

no. It is still Servername.vmdk

0 Kudos
Craig_Baltzer
Expert
Expert

When you renamed the VMDK file did you do the rename from the datastore browser? If you connect to the service console via ssh and navigate to the vmfs volume (/vmfs/volumes/volumename/dirname where volumename is the name of your VMFS volume and dirname is the directory where you stored the VMDK file) are both the "vmdk" and "-flat.vmdk" files there and do they have the right name? For example if your vmdk file was called "oldserver.vmdk" there should also be a "oldserver-flat.vmdk" file there as well. If you look inside "oldserver.vmdk" you should see a pointer to the "flat" file under the '# Extent description" section...

0 Kudos
Dr_No2
Contributor
Contributor

How do I look inside the .vmdk file?

0 Kudos
NTurnbull
Expert
Expert

How did you rename the vmdk? Was it using the vmkfstools -E command? I've seen in VC2.5 U3 and ESX3.5 U3 that when you just browse the datastore you dont see both vmdk and flat.vmdk, you just see one .vmdk file.

Thanks,

Neil

Thanks, Neil
0 Kudos
Dr_No2
Contributor
Contributor

I renamed the file by browsing to the datastore and right clicking and renaming. When SSHing into the console I only see the one VMDK file

0 Kudos
admin
Immortal
Immortal

you can use VI or another editor to look inside the vmdk file. It must point to the appropriate flat.vmdk as others have mentioned, in order for it to work.

0 Kudos
admin
Immortal
Immortal

how large is your vmdk file that is remaining? it should be the full size of the drive it was (750GB). if you deleted the flat file you could be out of luck, as this is where the data is raelly stored (which I'm pretty sure you won't see in the datastore browser window anyway). Smiley Sad

0 Kudos
Dr_No2
Contributor
Contributor

Each directory in the datastore broser window shows me one VMDK file. I just renamed a file. I did not delete anything.

Does renaming a file cause this much damage?

0 Kudos
admin
Immortal
Immortal

interesting. I just ran some tests, and VI client will not let me rename the virtual disks. Maybe you have an earlier version (I am using version 104215)?

when I do rename the vmdk (ssh) it doesn't cause any problems since of course the contents still point to the same file. now, if you were to move that vmdk to another directory, it won't be able to find the flat.vmdk in the old directory. you could solve this by also moving the flat.vmdk, or pointing the vmdk to the correct path.

I still say, if you only see one file, that's ok (it doesn't show the flat files). you should see 2 files if you login to console via ssh though. if you don't, and are missing the flat.vmdk that's a problem too. that's where your data is.

0 Kudos
AWo
Immortal
Immortal

I did this a few days before:

I connected to the console and renamed the *.vmdk and *-flat.vmdk file by using "mv". Then I opened the *.vmdk file and changed the reference to the flat file accordingliy. Saved it and added it to a virtual machine.

But you have to have both files available.






If you found this information useful, please consider awarding points for "Correct" or "Helpful" answers/replies. Thanks!!

vExpert 2009/10/11 [:o]===[o:] [: ]o=o[ :] = Save forests! rent firewood! =
0 Kudos
Chamon
Commander
Commander

If you renamed it using mv you will have to update the metadata as mentioned. The easiest thing to do if you renamed it with mv is to name it back to the original name with mv again. Then use the

vmkfstools –E /path/to/vm/server.vmdk newserver.vmdk

This will rename both the vmdk and flat file while updating the metadata correctly for you. Then try to add it to the new vm. Also is this vmdk also in use by another VM?

0 Kudos