VMware Cloud Community
LabDevUser
Enthusiast
Enthusiast

vmdk = 0kb but flat-vmdk=41GB

I have a VM (2012r2 vm) that I've moved around and copied a bunch. It's a VM Version-8. I imported it into my ESXi 5.5u2 lab box to see what it is before deciding to archive it or just delete it. When I got the thing imported (I used the vSphere thick client to upload the folder directly to a datastore) the flat-file is 40GB and the regular vmdk is 0kb. Is there a way to reverse this or salvage the vmkd or is it dead/gone?

Thx.

22 Replies
npadmani
Virtuoso
Virtuoso

A virtual disk is always created out of two files. .vmdk & flat.vmdk

Let's say you have a VM with name VM01, and this VM has got a virtual disk of size 40 GB(thin/Thick) attached to it.

in the VM folder you will see

VM01.vmdk - (This is disk descriptor/metadata - Size of this file is always very small, only few bytes worth information is stored in it)

VM01-flat.vmdk - (this is Data Disk - Size of this file is going to be always Big because this one holds actual data)

so in your case, the VM you are talking about, I guess you are referring disk descriptor which is being reported as 0 KB in size, that's quite normal. Nothing need to be worried about as long as your VM is working well.

Narendra Padmani VCIX6-DCV | VCIX7-CMA | VCI | TOGAF 9 Certified
Reply
0 Kudos
LabDevUser
Enthusiast
Enthusiast

Thanks for the reply. The reason why I was confused was because the vSphere Web Client is reporting the vHDD size as 0.00 B. So I know that there is data there and the 41GB file exists but how do I restore the hard drive on the VM so that it points to the right place and has the right size?

The VM is also failing to start.

Reply
0 Kudos
npadmani
Virtuoso
Virtuoso

Please post exact error message of VM startup failure here. That will give us a direction to take next step.

Narendra Padmani VCIX6-DCV | VCIX7-CMA | VCI | TOGAF 9 Certified
Reply
0 Kudos
LabDevUser
Enthusiast
Enthusiast

An error was received from the ESX host while powering on (virtual machine).

Failed to start the virtual machine.

Module DiskEarly power on failed.

Cannot open the disk 'xx.vmdk' on one of the snapshot disks it depends on.

The system cannot find the file specified.

VMware ESX cannot find the virtual disk 'xx.vmdk'. Verify the path is valid and try again.

So it looks like I'm missing snapshots. How do I find them and/or modify a config file to make them go away?

Reply
0 Kudos
npadmani
Virtuoso
Virtuoso

Since you uploaded set of files from some old ESXi host or from backup. (VMDK file was not manually renamed, was it?)

try going back to original set of files, pickup .VMDK file from there, and upload that again. and try to power on VM.

Or (if above thing doesn't work)

First go to VM's edit settings, remove Harddisk (delete it from the disk)

upload .vmdk and flat.vmdk both again from set of backed up files.

again go to VM's edit settings

add Harddisk -> existing virtual disk-> browse VMDK, and attach the one you uploaded.

try to power on VM.

in worst case, if descriptor has gone corrupt or missing, as long as there's flat.vmdk file available, we can re-build descriptor anyway. step by step instruction to do so is given in following KB, use this if nothing works.

VMware KB: Recreating a missing virtual machine disk descriptor file

see if this helps?

Narendra Padmani VCIX6-DCV | VCIX7-CMA | VCI | TOGAF 9 Certified
Reply
0 Kudos
LabDevUser
Enthusiast
Enthusiast

The web client will not allow me to delete the disk (keeping files or not). I get a red diamond "!" error because the vHDD is showing up with a size of "0.00 B". Should I manually enlarge the size from "0.00 B" to something larger (suggestions??) in order to delete it?

Thank you npadmani for your help and responses, much appreciated. Will hopefully mark as "correct answer" shortly.

Reply
0 Kudos
npadmani
Virtuoso
Virtuoso

web client screen is slightly different to work with when it comes to removing virtual hardware components from VM.

look at the following screen

Screen Shot 2015-07-12 at 5.33.06 pm.png

If I want to remove hard disk 2 from list of hardware devices, I got to move my mouse pointer on that hardware record, so I can see cross mark at the end of the record and remove hardware device.

Do you see red diamond right next to that hardware component?

Narendra Padmani VCIX6-DCV | VCIX7-CMA | VCI | TOGAF 9 Certified
Reply
0 Kudos
LabDevUser
Enthusiast
Enthusiast

Yes, there was a red diamond next to the HDD. However, I was able to change the value to "1 MB" and then it allowed me to remove the HDD. I opted to remove the hdd from the VM but also kept the files on the datastore (I did not select "remove vmdk and delete files").

Now when I browse the datastore I can see the files (the flat and the vmkd) but only when I browse, when I select "add an existing HDD" to the VM that browsing window does NOT show the vmkd in the directory. Does that make sense?

When I edit the .vmdk file with notepad it reads:

# Disk DescriptorFile

version=1

encoding="UTF-8"

CID=ee66bed6

parentCID=ffffffff

isNativeSnapshot="no"

createType="vmfs"

# Extent description

RW 83886080 VMFS "NAME-OF-VIRTUAL-MACHINE-flat.vmdk"

# The Disk Data Base

#DDB

ddb.toolsVersion = "9216"

ddb.adapterType = "lsilogic"

ddb.thinProvisioned = "1"

ddb.geometry.sectors = "63"

ddb.geometry.heads = "255"

ddb.geometry.cylinders = "5221"

ddb.uuid = "60 00 C2 97 23 d1 ad 86-ba 6a 6f e1 35 da 9b 2c"

ddb.longContentID = "581ea0a66f5847992d39b0f5ee66bed6"

ddb.virtualHWVersion = "8"

Reply
0 Kudos
continuum
Immortal
Immortal

> Now when I browse the datastore I can see the files (the flat and the vmkd) but only when I browse, when I select "add an existing HDD" to the VM that browsing window does NOT show the vmkd in the directory. Does that make sense?

Yes - invalid combinations of descriptorfile plus extent (flat.vmdk) are displayed as the files really are = visible flat.vmdk and a small descriptor
Invalid can be a small syntax error - wrong type of quotes for example.
It can also be a size mismatch, a lock error, an I/O error .... and more ...

> When I edit the .vmdk file with notepad it reads:

I tell all my customers to use the embedded editor of winscp or mobaterm or similar.
Windows-editors like notepad or wordpad may already produce syntax-errors.

Good, free and working editor for Windows is for example Notepad+

Please post the exact size of the flat.vmdk in bytes - then I check your syntax



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

LabDevUser
Enthusiast
Enthusiast

41,943,040.00 KB so 41943040000 bytes.

Reply
0 Kudos
npadmani
Virtuoso
Virtuoso

screenshot you have attached shows flat.vmdk in it. when we browse datastore in web client, it doesn't show us flat.vmdk, it normally shows us the descriptor vmdk with actual size of flat.vmdk.

in your case, I would suggest, forget existing descriptor, and re-create one for this flat.vmdk by following steps given in following KB.

VMware KB: Recreating a missing virtual machine disk descriptor file

What continuum is asking is, not to convert KBs in to bytes, but run a command like

ls -l

in the VM director where flat.vmdk resides and take number from there, that will be more accurate.

Narendra Padmani VCIX6-DCV | VCIX7-CMA | VCI | TOGAF 9 Certified
Reply
0 Kudos
continuum
Immortal
Immortal

Change line

RW 83886080 VMFS "NAME-OF-VIRTUAL-MACHINE-flat.vmdk"
to

RW 81920000 VMFS "NAME-OF-VIRTUAL-MACHINE-flat.vmdk

Does that change the display of file-icons ?
Please really look up size as already has been suggested - your value and the descriptorfile have a size-missmatch which could explain the case


________________________________________________
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
LabDevUser
Enthusiast
Enthusiast

PuTTy is telling me

-rw-------    1 root     root     42949672960 Jul 11 07:50 NAME-OF-VM-flat.vmdk

EDIT: Now I am unsure of what needs to be changed or converted with the number 42949672960.

EDIT2:

> When I edit the .vmdk file with notepad it reads:

I tell all my customers to use the embedded editor of winscp or mobaterm or similar.
Windows-editors like notepad or wordpad may already produce syntax-errors.

Good, free and working editor for Windows is for example Notepad+

continuum, I do exactly as you suggest, Notepad++ is my default text reader/editor on all windows machines and I probably don't use WinSCP editor as much as I should but for all ESXi related editing I always use it.

Reply
0 Kudos
npadmani
Virtuoso
Virtuoso

PuTTy is telling me

-rw-------    1 root     root     42949672960 Jul 11 07:50 NAME-OF-VM-flat.vmdk

as per above size of flat.vmdk

your descriptor entry as follows is perfect, doesn't need to be changed.

# Extent description

RW 83886080 VMFS "NAME-OF-VIRTUAL-MACHINE-flat.vmdk"

Narendra Padmani VCIX6-DCV | VCIX7-CMA | VCI | TOGAF 9 Certified
Reply
0 Kudos
continuum
Immortal
Immortal

the extent description fits that value - no need to change the RW .... line.

Can you display the content of the flat.vmdk with a command like ?
hexdump -C flat.vmdk | less


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

LabDevUser
Enthusiast
Enthusiast

Is this OK to be seeing (meaning the "Input/output error"): (from PuTTy)

/vmfs/volumes # ls

ls: ./3c33f3c6-cc0ff8df: Input/output error

1.3TB R10 SSD                        54c494df-4425c2a4-c059-000423081630

890GB R10-OLD TORX                       552d7a65-2bc3cbac-2fee-000423081630

164fb5e7-ba23dd84-74b1-74481759b087  55494c2e-5ae9b57c-71cf-000423081630

26dba5e1-54bd4f42-abbe-88f38c4a1b3c  7.2TB R6

1.4TB R10 Raptors                     28TB NFS1 R6

54a08ad9-e3015928-146a-000423081630  6.5TB NFS2 R10

54c3e11a-aaa15420-d312-000423081630  fdca4dcf-92241a62

/vmfs/volumes #

Output as follows:

/vmfs/volumes/54c3e11a-aaa15420-d312-000423081630/VM-NAME # hexdump -C VM-NAME-flat.vmdk | less

00000000  33 c0 8e d0 bc 00 7c 8e  c0 8e d8 be 00 7c bf 00  |3.....|......|..|

00000010  06 b9 00 02 fc f3 a4 50  68 1c 06 cb fb b9 04 00  |.......Ph.......|

00000020  bd be 07 80 7e 00 00 7c  0b 0f 85 0e 01 83 c5 10  |....~..|........|

00000030  e2 f1 cd 18 88 56 00 55  c6 46 11 05 c6 46 10 00  |.....V.U.F...F..|

00000040  b4 41 bb aa 55 cd 13 5d  72 0f 81 fb 55 aa 75 09  |.A..U..]r...U.u.|

00000050  f7 c1 01 00 74 03 fe 46  10 66 60 80 7e 10 00 74  |....t..F.f`.~..t|

00000060  26 66 68 00 00 00 00 66  ff 76 08 68 00 00 68 00  |&fh....f.v.h..h.|

00000070  7c 68 01 00 68 10 00 b4  42 8a 56 00 8b f4 cd 13  ||h..h...B.V.....|

00000080  9f 83 c4 10 9e eb 14 b8  01 02 bb 00 7c 8a 56 00  |............|.V.|

00000090  8a 76 01 8a 4e 02 8a 6e  03 cd 13 66 61 73 1c fe  |.v..N..n...fas..|

000000a0  4e 11 75 0c 80 7e 00 80  0f 84 8a 00 b2 80 eb 84  |N.u..~..........|

000000b0  55 32 e4 8a 56 00 cd 13  5d eb 9e 81 3e fe 7d 55  |U2..V...]...>.}U|

000000c0  aa 75 6e ff 76 00 e8 8d  00 75 17 fa b0 d1 e6 64  |.un.v....u.....d|

000000d0  e8 83 00 b0 df e6 60 e8  7c 00 b0 ff e6 64 e8 75  |......`.|....d.u|

000000e0  00 fb b8 00 bb cd 1a 66  23 c0 75 3b 66 81 fb 54  |.......f#.u;f..T|

000000f0  43 50 41 75 32 81 f9 02  01 72 2c 66 68 07 bb 00  |CPAu2....r,fh...|

00000100  00 66 68 00 02 00 00 66  68 08 00 00 00 66 53 66  |.fh....fh....fSf|

00000110  53 66 55 66 68 00 00 00  00 66 68 00 7c 00 00 66  |SfUfh....fh.|..f|

00000120  61 68 00 00 07 cd 1a 5a  32 f6 ea 00 7c 00 00 cd  |ah.....Z2...|...|

00000130  18 a0 b7 07 eb 08 a0 b6  07 eb 03 a0 b5 07 32 e4  |..............2.|

00000140  05 00 07 8b f0 ac 3c 00  74 09 bb 07 00 b4 0e cd  |......<.t.......|

00000150  10 eb f2 f4 eb fd 2b c9  e4 64 eb 00 24 02 e0 f8  |......+..d..$...|

00000160  24 02 c3 49 6e 76 61 6c  69 64 20 70 61 72 74 69  |$..Invalid parti|

:

Does that work? Thanks for all the help. I see the "|$..Invalid parti|" which must mean something isn't kosher but I have no idea.

Reply
0 Kudos
a_p_
Leadership
Leadership

Just one quick question. Can you confirm that the file name mentioned in the descriptor .vmdk file (as in your example)

RW 83886080 VMFS "NAME-OF-VIRTUAL-MACHINE-flat.vmdk"

exactly matches the flat file's name (case-sensitive!)?

André

Reply
0 Kudos
continuum
Immortal
Immortal

the flat vmdk seems to be named VM-NAME-flat.vmdk - at least it looks like that guessing by the hexdump command from last post.

Why users think they need to obscure filenames in questions like this one is beyond me Smiley Wink


________________________________________________
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
LabDevUser
Enthusiast
Enthusiast

Sorry, I am intentionally changing it. It's an old development webserver for a current client and the name of their company is in the filename. I just didn't want it to be out there in public that I'm having trouble accessing anything, even if its an old archive VM that was created/managed before my time. I thought about changing the datastore info but it's generic enough and its a lab host.

Yes, the file name for both the vmdk and the -flat.vmdk are identical in name and case sensitive. The names are XX_XXXXXX_XX-flat.vmdk and XX_XXXXXX_XX.vmdk where "X" is a capital letter of the alphabet on both files. For example, GE_GOOGLE_AK.vmdk where VM = the two letter stock-ticker of the company such as "GE=General Electric" in this fictitious example, GOOGLE is in place of the actual URL of their domain without the ".com" and AK=Alaska, or the two letter state in which the ESXi host is physically located.

Reply
0 Kudos