VMware Cloud Community
nichy
Contributor
Contributor

Commands run on ESXi

Hi,

I have a vm image which was originally hosted in a VMWare Player. Now I need to use this vm image (.vmdk file) as the installer hard disk in an ESXi host.

Since both the formats/parameters of the image in the VMWare Player is different from the ESXi host, I have to convert this image that I have to a version that is compatible with the ESXi host.

To do so, I refer to this article for solution :

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=102894...

However, when I ran the :

vmkfstools -i /vmfs/volumes/datastore/virtual_machine_folder/ virtual_machine.vmdk /vmfs/volumes/datastore/new_virtual_machine_folder/ virtual_machine.vmdk


(using a different path of course, which is the path to the actual .vmdk file)


I get an error :

Failed to open '/vmfs/volumes/datastore1/nta_xp_2014/nta_xp_2012-cl1.cmdk': The system cannot find the file specified (25).


The path to the .vmdk file is correct, however I do not know why I receive this error.

Am I doing anything wrong here?

Please help, thanks.

0 Kudos
7 Replies
virtualdive
VMware Employee
VMware Employee

Hi Nichy,

Your path says "cmdk" instead of "vmdk" is that a typo?

Failed to open '/vmfs/volumes/datastore1/nta_xp_2014/nta_xp_2012-cl1.cmdk': The system cannot find the file specified (25).

Thanks

Regards,

'V'
thevshish.blogspot.in
vExpert-2014-2021
0 Kudos
nichy
Contributor
Contributor

Ooops yea...sorry....it's a typo. It's supposed to be '.vmdk' :

Failed to open '/vmfs/volumes/datastore1/nta_xp_2014/nta_xp_2012-cl1.vmdk': The system cannot find the file specified (25).

0 Kudos
SatyS
Hot Shot
Hot Shot

Just try with this option

vmkfstools -i test1.vmdk test2.vmdk -d zeroedthick|eagerzereodthick|thin

Just have a look @ Release Notes: vSphere5.1 vmkfstools imports/exports « Mike Laverick…

Hope this helps.

_SatyS

If you find this useful,please mark the answer as correct/helpful

Regards,
SatyS
http://myvirtuallearning.wordpress.com/

0 Kudos
nichy
Contributor
Contributor

When I execute this step :

#vmkfstools -i [test1.vmdk] [test2.vmdk] -d zeroedthick|eagerzereodthick|thin

Is the italic highlighted word zereod correct? Or is it a typo?

I get this error :

sh: eagerzeroedthick : not found

sh: thin : not found

However, the clone is created, in the form of a -flat file, i.e. test2-flat.vmdk.

What is the difference between a flat file and a normal .vmdk file?

When I try to run the virtual machine with the flat file, (I did not rename the file) I get the error :

Cannot open the disk '/vmfs/volumes/5310bc6b-c07e5acf-8725-d4ae52d0076f/nta_xp_2014/nta_xp_2012-cl1.vmdk' or one of the snapshot disks it depends on. Failed to lock the file

0 Kudos
SatyS
Hot Shot
Hot Shot

Its a typo.

vmkfstools -i [test1.vmdk] [test2.vmdk] -d  [zeroedthick|thin|eagerzeroedthick]

-SatyS

If you find this useful,please mark the answer as correct/helpful

Regards,
SatyS
http://myvirtuallearning.wordpress.com/

0 Kudos
aleph0
Hot Shot
Hot Shot

Not sure but VMware Converter standalone should be free and should help in this case...

try having a look.

HTH

\Aleph0

\aleph0 ____________________________ http://virtualaleph.blogspot.com/ ############### If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!
0 Kudos
continuum
Immortal
Immortal

> What is the difference between a flat file and a normal .vmdk file?

A normal vmdk ? - to answer this question first forget Datastorebrowser for a minute.
A normal virtual disk consists of 2 files: one small textfile and one large binary file.
The small textfile is a configuration file that uses a ini-like format.
The most important info in that config-file is one line that specifies the path to the binary file , the type of the binaryfile, the size of the binary and the read-mode that should be used to read the binary file.
Here is an example:

RW 16777216 VMFS ""My VM-flat.vmdk"
If any of the parameters in this description is invalid or if a syntax error is in the file  - the virtual disk can not be used by a VM.

The engineers created  "virtual disk" as 2 files because that makes it easier to work with virtualdisk-files.
The part that has to be edited occasionally all goes into a small - easy to edit - textfile and the actual data - the diskimage - goes into a large binary-file which should not be edited by users.

The creators of the Datastorebrowser thought that 2 files would be to confusing for the users - so they decided to display those 2 files as 1.
The creators of Workstation thought the same and so they created a special type of vmdks that embedded the descriptor in the binary file.

The result is even more confusing:
Now Datastorebrowser displays the virtual disk that consists of the description in text and the actual data in binary as a single entity.
So most of the times the virtual disk, that you created when ordering a new VM named "My VM", will be displayed in Datastorebrowser as "My VM.vmdk"

Datastorebrowser says that "My VM.vmdk" has a size of 20Gb.
In reality you have ""My VM.vmdk" with a size of 500 bytes and "My VM-flat.vmdk" with a size of 8 GB.

Sometimes Datastorebrowser seems to have forgotten the rule to simplify the display and it displays really the actual content of the directory.
Then it shows "My VM.vmdk" with a size of 500 bytes and "My VM-flat.vmdk" with a size of 8 GB.


Have a look at the screenshot ...

http://sanbarrow.com/img/datastorebrowser-logic.png

1. display in winscp  - displaying the directory as it really is

2. display in Datastorebrowser of a "normal" VM - hiding the flat.vmdk

3. display in Datastorebrowser when the flat.vmdk has no correct description

4.display in Datastorebrowser when the flat.vmdk has no correct description and the vmx-file has a syntax error

To come back to your question: when you see a flat.vmdk in Datastorebrowser it just means that a correct descriptorfile is missing.
When ever you are asked to specify a path to a vmdk - you must assign the path by giving the location of the descriptorfile - not of the binary file.

You should have a descriptorfile using the same name as the -flat.vmdk - just without the -flat.
If that descriptor exists but you get a message like "the file is not a virtual disk" on ESXi then you probably still have a Workstation-descriptorfile.
The ESXi-compatible descriptor for a -flat.vmdk is slightly different.

createType="vmfs"

RW 16777216 VMFS "My VM-flat.vmdk"

createType="monolithicFlat"

RW 16777216 FLAT "My VM-flat.vmdk" 0

The red version is for ESXi - the blue one for Workstation. The referenced flat.vmdk can be used in both platforms.RW 16777216 VMFS "My VM-flat.vmdk"

If you get an error "cant find the file" but you are sure that the path to the vmdk as specified in the vmx is correct - then check wether the path specified in the vmdk-descriptorfile is also valid.

vmx:
scsi0:0.filename = "My VM.vmdk"

vmdk:
RW 16777216 VMFS "My VM-flat.vmdk"


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

0 Kudos