VMware Cloud Community
AShaub
Contributor
Contributor
Jump to solution

ESXi can't find the vmdk file after converting to a thin provision from thick.

Running ESXi 6.5 Update 2. (Dell version).

I was trying to convert the seven images from Thick provisions to thin provisions (my mistake not realizing what thick vs thin was at the time). After digging around online I found a suggestion that cloning the VMDK file will allow you to create the clone as a thin provision drive.

Below are the commands I used to do so just for reference.

-Cloning the original file. This created a cloned vmdk file along with a new *flat-vmdk file.

"vmkfstools -i VMname.vmdk -d thin thin-VMname.vmdk"

-Renamed the original VMDK files (the main and flat file) with a .old at the end.

"mv OldName.vmdk NewName.vmdk"

-Renamed the cloned vmdk files to match the original files.

"mv Cloned.vmdk Original.vmdk"

Unregister the image then Re Register it back in.

This worked perfectly fine for my first image. But when trying this with the second the esxi server can't find the vmdk file. Taking a look at the datastore I can see it's present but when trying to add a new drive and looking at the same path it's not shown.

Renaming everything back to the way it was resolves the issue.

Did something go wrong with the clone process or is something else going on?

The drives are setup to be single file and not multiple. I don't have any snapshots.

Reply
0 Kudos
1 Solution

Accepted Solutions
continuum
Immortal
Immortal
Jump to solution

> For some reason I can't use the vmkfstools -E to rename my files. I get an error stating "The system cannot find the file specified (25)"

That error message appears in different scenarios - most problably in a case like this:

you have name.vmdk and name-flat.vmdk
If you open the descriptor vmdk in WinSCP it will very likely show an incorrect path or file in the RW line ...

[root@localhost:/vmfs/volumes/5c4a0938-1919180b-352e-000c29bade33/test-vmdks] cat  name.vmdk

# Disk DescriptorFile

version=1

encoding="UTF-8"

CID=fffffffe

parentCID=ffffffff

createType="vmfs"

# Extent description

RW 2097152 VMFS "wrong-name-flat.vmdk"

# The Disk Data Base

#DDB

ddb.adapterType = "lsilogic"

ddb.geometry.cylinders = "130"

ddb.geometry.heads = "255"

ddb.geometry.sectors = "63"

ddb.virtualHWVersion = "14"

[root@localhost:/vmfs/volumes/5c4a0938-1919180b-352e-000c29bade33/test-vmdks] vmkfstools -E name.vmdk name-new.vmdk

Failed to rename 'name.vmdk' to 'name-new.vmdk': The system cannot find the file specified (25)

[root@localhost:/vmfs/volumes/5c4a0938-1919180b-352e-000c29bade33/test-vmdks]

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

View solution in original post

8 Replies
NathanosBlightc
Commander
Commander
Jump to solution

"vmkfstools -i VMname.vmdk -d thin thin-VMname.vmdk"

Your executed command is not wrong but before that, you can choose to safety migrate VM storage (storage vMotion) in GUI methods (vSphere Client or Web Client) so there is an option to change virtual disk format... Please try it first

pastedImage_2.png

Please mark my comment as the Correct Answer if this solution resolved your problem
Reply
0 Kudos
a_p_
Leadership
Leadership
Jump to solution

Welcome to the Community,

the issue is likely caused by the way you renamed the .vmdk files.

Each virtual disk consists of two files, a header/descriptor file "vmname.vmdk", and a data file "vmname-flat.vmdk".

Renaming the files manually using the mv command requires that you also edit the header file, so that it points to the renamed data file.

The better (recommended) way to rename virtual disks from the command line, is to use vmkfstools -E oldname.vmdk newname.vmdk, which renames both, the header as well as the data file, and also adjusts the metadata within the header file.


André

Reply
0 Kudos
AShaub
Contributor
Contributor
Jump to solution

I'm sad to say I don't have vCenter available to me so I'm stuck with using commands through SSH. Using the Web Client was the first thing I dug around on until I ended up searching online and found those commands. vMotion is only available to vCenter and not the ESXi Web Client.

Reply
0 Kudos
AShaub
Contributor
Contributor
Jump to solution

For some reason I can't use the vmkfstools -E to rename my files. I get an error stating "The system cannot find the file specified (25)"

Checking over the command a few times I don't see any typos since I can replace the "vmkfstools -E" with "mv" and works fine.

I'll download both files at the end of the day and tomorrow see if I can't figure out how to modify the files directly. Wouldn't be the first time I've done this when converting from a multi file to a single file setup last year. That was a headache fixing it.

Reply
0 Kudos
continuum
Immortal
Immortal
Jump to solution

> For some reason I can't use the vmkfstools -E to rename my files. I get an error stating "The system cannot find the file specified (25)"

That error message appears in different scenarios - most problably in a case like this:

you have name.vmdk and name-flat.vmdk
If you open the descriptor vmdk in WinSCP it will very likely show an incorrect path or file in the RW line ...

[root@localhost:/vmfs/volumes/5c4a0938-1919180b-352e-000c29bade33/test-vmdks] cat  name.vmdk

# Disk DescriptorFile

version=1

encoding="UTF-8"

CID=fffffffe

parentCID=ffffffff

createType="vmfs"

# Extent description

RW 2097152 VMFS "wrong-name-flat.vmdk"

# The Disk Data Base

#DDB

ddb.adapterType = "lsilogic"

ddb.geometry.cylinders = "130"

ddb.geometry.heads = "255"

ddb.geometry.sectors = "63"

ddb.virtualHWVersion = "14"

[root@localhost:/vmfs/volumes/5c4a0938-1919180b-352e-000c29bade33/test-vmdks] vmkfstools -E name.vmdk name-new.vmdk

Failed to rename 'name.vmdk' to 'name-new.vmdk': The system cannot find the file specified (25)

[root@localhost:/vmfs/volumes/5c4a0938-1919180b-352e-000c29bade33/test-vmdks]

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

AShaub
Contributor
Contributor
Jump to solution

That did it. Downloaded the non flat file. Opened it with a text editor and modified the name directly. Uploaded back to the datastore replacing the original and it's good to go.

Thank you for the help Smiley Happy.

Reply
0 Kudos
continuum
Immortal
Immortal
Jump to solution

Hi

dont do it like that !!!

I recommend to use WinSCP for a single very good reason : get used to it and you will significantly reduce your error-rate !!!!

Use the embedded editor for edits of vmx-files, vmdk-descriptor.vmdk-files and all other small ESXi config-files.

Advantage: faster ! - it does not need to download files before you can fix small problems like mispelled filenames , missing quotes ... stuff like that.

Advantage: where did I store the downloaded vmdk- descriptor ? -is it this or the one on the Desktop ...??? -.this will not happen again once you consistently switched to WinSCP.

Major advantage: who never messed up a downloaded Linux-Unix style textfile by opening it in an editor that autoconverted the files to DOS-format.

sh-scripts that have been autoconverted like that are a major pain if you re-upload them without knowing about the DOS-format.

Damn - why did the script worked before and now does not even find the next line ....

Once you get used to doing edits with the WinSCP embedded editor  you will soon regard using standard Windows-texteditors plus download plus reupload as a super silly procedure.

One more important advantage: WinSCP does NOT assume that you user are to dumb to realize that ESXi-compatible VMDKs are always a combination of descriptor-vmdk plus binary-vmdk.

So I highly recommend to ALWAYS use WinSCP when troubleshooting VMDK-related issues.

Regular Datastorebrowser was created with the assumption in mind that YOU ARE TOO STUPID to handle  the concept of " a virtual disk is created by 2 files. "

Instead Datastorebrowser is designed to make it look as simple as possible in sunny wether. So you start to learn basic operations and think: a virtual disk equals one vmdk-file.

To make matters worse Datastorebrowser is not at all consistent: do you know which rules it uses to decide wether to display descriptor.vmdk + plus flat.vmdk as a single disk or as 2 separate files ???

I dont even think that that logic is documented somewhere ....

The result is that user run into super silly mistakes when Datastorebrowser changes the display mode from "dumbed down idiot view" to "show reality view mode"

Who has not seen those posts were Datastorebrowser userswent into panic mode just because Datastorebrowser showed a vmdk with the -flat.vmdk extension he has never seen before.

In my experience with recovery this is one of the most frequent reasons that users destroyed their own VMs without any need.

Same scenario used with cars would tell you: a regular car with working wheels has 2 tyres like a motorbike.
Only in cases where something is wrong with the tyres it has 4 wheels.

Guess what happens when something goes wrong ... the users will make super silly mistakes ....

The fact that this has never been reviewed in the enire VMware documentation history is shocking if you understand what problems it causes in real life ....

Not sure wether I should call the fact that using WinSCP is probably "unsupported" careless, lazy or just mean.

Ask your colleagues - I dont think that more than 2 or 3 % of the ESXi ysers are even aware of the rules Datastorebrowser uses internally when deciding if he should diplay "dumbed down mode" or "reality mode"

No wonder that users like me recommend to NOT READ THE MANUAL AT ALL before you understood what really happens in the directory of a VM using common sense and a no-nonsense filebrowser / editor like WinSCP.

winscp1.png

Use the right click option to launch the embedded editor.

winscp2.png

Make your edits and save.

One last major advantage: explaing someone on the phone will produce significantly less errors if you insist on using WinSCP.

Ulli


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
AShaub
Contributor
Contributor
Jump to solution

Didn't even know WinSCP was a thing.

I ran through this with another of my other images over this past weekend.

Using WinSCP was a breeze in comparison to using a telnet console.

Thank you very much for telling me about this software.

Reply
0 Kudos