• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Yellow Bricks

by Duncan Epping

  • Home
  • Unexplored Territory Podcast
  • HA Deepdive
  • ESXTOP
  • Stickers/Shirts
  • Privacy Policy
  • About
  • Show Search
Hide Search

vmdk

Repairing your vmdk header files…

Duncan Epping · Apr 3, 2009 ·

Increasing the size of a disk when a snapshot exists or deleting the wrong folder on your vmfs volume, it’s something that probably has happened to all of us.

This usually means that you will either need to edit the current vmdk header file or even recreate it. Although it’s not a difficult task it’s still error prone cause it’s a manual task, the procedure is outlined in this KB article for those interested.

Eric Forgette(NetApp), also known of mbralign and mbrscan, wrote a script that automates the recreation of a vmdk header file. The script also gives you the option to verify a header and if it’s corrupt fix it. Eric posted his script on the NetApp community forums and it can be found here.

I especially like the “fix” option of which the following is an example output:

[root@x3 root]# vmdkdtool /vmfs/volumes/test/testvm/fixed-template.vmdk

vmdkdtool version 1.0.090402.
Copyright (c) 2009 NetApp, Inc.
All rights reserved.

/vmfs/volumes/test/testvm/fixed-template-flat.vmdk is 12884902400 bytes (12.0000004768372 GB)

size = 25165825 (current 25125)
sectors = 63 (current value 21)
heads = 255 (current value 3)
cylinders = 1566 (current value 106)

NOTE: A backup of the file will be made if you choose yes.
Shall I fix the descriptor file? yes
Creating a backup of /vmfs/volumes/test/testvm/fixed-template.vmdk
Fixed.

Head over to the NetApp communities and pick it up, definitely a must have for your toolkit.

Orphaned vmdk’s

Duncan Epping · Jan 16, 2009 ·

While doing a “mini-healthcheck” at a customer site I noticed a specific Datastore with less than 2% of free diskspace. After a bit of research an orphaned VMDK was found. Orphaned vmdk’s are virtual hard-disks that are not connected to a VM. Probably because they were removed from the inventory without deleting the files.

You can easily find these orphaned vmdk’s via the Service Console:

find -iname “*-flat.vmdk” -mtime +7

For those that don’t like using the Service Console you can also check this with Powershell Ad van Bokhoven created a nice script which he describes as follows:

This script asks the virtual center what the disk are of each VM and puts this into an array. After this, it reads all files on all datastores. If the file is a vmdk file, it will check wheter this file is in the array. If it’s not, you’ve found a orphaned vmd.

I would advise to regularly check your environment on orphaned disks, it can save precious diskspace.

Defraging a VMDK

Duncan Epping · Nov 1, 2008 ·

Team Fusion wrote a great post on “defragging” vm’s and why you shouldn’t do it. Or at least be very careful about it. Make sure to read it!

Before we begin, it’s important to note that defragmentation isn’t a necessary task – your virtual machine will still work just fine even if you never defrag, and the effects of fragmentation are usually not noticeable. Personally, I’ve never feel the need to defrag. However, if for some reason you do feel the need to defrag, here’s how to do it. Note that snapshots get in the way of proper defragmenting.

Primary Sidebar

About the Author

Duncan Epping is a Chief Technologist and Distinguished Engineering Architect at Broadcom. Besides writing on Yellow-Bricks, Duncan is the co-author of the vSAN Deep Dive and the vSphere Clustering Deep Dive book series. Duncan is also the host of the Unexplored Territory Podcast.

Follow Us

  • X
  • Spotify
  • RSS Feed
  • LinkedIn

Recommended Book(s)

Advertisements




Copyright Yellow-Bricks.com © 2025 · Log in