VMware Cloud Community
Bill_Oyler
Hot Shot
Hot Shot

vmkfstools -X fails to expand VMDK file

When I attempt to exapnd a VMDK file using vmkfstools -X, I get the following error message:

Failed to extend disk : The file specified is not a virtual disk. (15)[/b]

However, I am certain that the file I specified is in fact a VMDK file. Have things changed in 3.0 such that this method no longer works to expand a VMDK file?

The VMDK file is located on a standard VMFS 3.0 partition. Here is a complete copy and paste of my command sequence:

\[root@lab-esx2 VM1]# vmkfstools -X 8G VM1.vmdk

Failed to extend disk : The file specified is not a virtual disk. (15)[/b]

The current size of the VMDK file is 6GB.

Thanks to anyone who can help solve this mystery!

Bill

Bill Oyler Systems Engineer
Reply
0 Kudos
23 Replies
CHogan
VMware Employee
VMware Employee

Can you try putting the full path to the .vmdk file to see if it makes a difference?

http://cormachogan.com
Reply
0 Kudos
virtech
Expert
Expert

Are you able to assign the vmdk file to a Virtual Machine and confirm if its ok?

Certainly the command is correct to expand the file

Reply
0 Kudos
Bill_Oyler
Hot Shot
Hot Shot

Yep, I tried specifying the absolute path, but the same error results:

\[root@lab-esx2 VM1]# vmkfstools -X 8G /vmfs/volumes/das_esx2/VM1/VM1.vmdk

Failed to extend disk : The file specified is not a virtual disk. (15)

\[root@lab-esx2 VM1]#[/b]

Bill Oyler Systems Engineer
Reply
0 Kudos
Bill_Oyler
Hot Shot
Hot Shot

Yep, the VMDK is just fine, I boot from it all the time. Works great. It's just too small (6 GB).

Bill Oyler Systems Engineer
Reply
0 Kudos
dpomeroy
Champion
Champion

Create a new VMDK and see if you can expand that one. Maybe there is some issue with just this one.

Reply
0 Kudos
virtech
Expert
Expert

then if that works maybe you could try and import the vmdk to the newer bigger vmdk you have created.

Reply
0 Kudos
CHogan
VMware Employee
VMware Employee

OK, in ESX 3.0 each VM has got 2 .vmdk[/b] files associated with it:

\- the actual data disk file which has usually got a '-flat' in the name

\- a disk descriptor .vmdk file

The vmkfstools command is ESX 3.0 needs to be run against the disk descriptor file, which is a plain text file.

Are you running the extend against the disk descriptor file and not the data file?

If so, can you display the descriptor file contents here?

http://cormachogan.com
Reply
0 Kudos
virtech
Expert
Expert

Arh huh, if I run that command on the actual data disk file I get the following error...

Failed to extend disk : The file specified is not a virtual disk. (15)

So I think the vmkfstools -X is being run on the wrong file.......

Reply
0 Kudos
Chris_S_UK
Expert
Expert

Use the full path but don't use the VMFS friendly name, use the long GUID instead...

Chris

Reply
0 Kudos
admin
Immortal
Immortal

Use the full path but don't use the VMFS friendly

name, use the long GUID instead...

Chris

I'm afraid that won't make any difference.

Reply
0 Kudos
Bill_Oyler
Hot Shot
Hot Shot

CHogan,

You are exactly correct. Running the command against the descriptor file solved the problem entirely. Thank you so much!

Bill

Bill Oyler Systems Engineer
Reply
0 Kudos
smartodd
Contributor
Contributor

Hi,

I'm trying to run the same command, however I'm stuck on the syntax !!

vmkfstools -X 10G /vmfs/volumes/vmsys3/New Virtual Machine/PS_Test.vmdk

....I've tried "g" for the size; full path, not full path, flat and non flat file. The current error I get is "Extra arguments at the end of the command line."

Any suggestion you could offer would be much appreciated Smiley Happy

Reply
0 Kudos
Bill_Oyler
Hot Shot
Hot Shot

I believe the issue has to do with the "spaces" in the path (i.e. whitespace between "New", "Virtual", and "Machine." You need to surround the entire path with quotes " i.e., "/vmfs/volumes/vmsys3/New Virtual Machine/PS_Test.vmdk". Give that a whirl and let us know if it works.

Bill Oyler Systems Engineer
Reply
0 Kudos
daborg
Contributor
Contributor

Additional hint.

If you copied an ESX 2.x vmdk file to an ESX 3 host then you cannot run the extend command on it. You get an error: "Failed to extend disk : One of the parameters supplied is invalid (1)".

To fix you must migrate the disk to and ESX 3 format.

vmkfstools -M diskname.vmdk

This takes about 10 seconds for a 6GB disk and then you can run the vmkfstools -X command as you always have. Note when you migrate the disk you will now have 2 .vmdk associated with the system, whereas before you had just 1.

Reply
0 Kudos
cookrob
Contributor
Contributor

I was having the same issue, running vmkfstools -M and then vmkfstools -X worked like a champ. Thanks for taking the time to post.

Reply
0 Kudos
VMwareUserR
Contributor
Contributor

I used vmkfstools -X to expand VMDK file for a VM that was runing in Redhat. After the command, I saw the size of vmdk indeed was expanded in VI. But after reboot the redhat, the expanded size was not recognized by Redhat, how do I make Redhat know that the disk size is enlarged?

Thanks.

Reply
0 Kudos
Jae_Ellers
Virtuoso
Virtuoso

Right. You've extended the size of the disk, but the original data is still there intact. Download the latest gparted iso and boot from that. Edit the partition sizes to use the new space you've added.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=- http://blog.mr-vm.com http://www.vmprofessional.com -=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Reply
0 Kudos
Jeff_Shaw
Enthusiast
Enthusiast

Hi, you can find a detailed answer to your question here: http://www.vmweekly.com/articles/expanding_the_virtual_disk_size_in_4_steps/1/

The article gives an easy way to expand vmdk and even provides screenshots to make it clear)

Jeff

Reply
0 Kudos
Oczkov
Enthusiast
Enthusiast

Dear All,

I think the option which has to be given after -X is kind of confusing (10g, 50g) - it is not an extent size by which you want to expand your disk but this

seems to be the final TOTAL size of the virtual disk as the outcome of the resize operation.

A good way to diagnose the problem is to use "-v 9" flag which is increasing the vmkfstools verbosity:

If your disk is e.g. 112GB e.g. and you try -X 50G then you will receive the most common error (without verbosity switched ON you will see only the last line):

\# vmkfstools -X 50g -v 9 CentOS\ SMTP_1.vmdk

DISKLIB-VMFS : "./CentOS SMTP_1-flat.vmdk" : open successful (0) size = 140660178944, hd = 1060. Type 3

DISKLIB-DSCPTR: Opened : "CentOS SMTP_1-flat.vmdk" (0)

DISKLIB-LINK : Opened 'CentOS SMTP_1.vmdk' (0): vmfs, 230686720 sectors / 112640 Mb.

DISKLIB-LIB : Opened "CentOS SMTP_1.vmdk" (flags 0). 0x8d740d8

DISKLIB-LIB : Growing disk 'CentOS SMTP_1.vmdk' : createType = vmfs

DISKLIB-LIB : Growing disk 'CentOS SMTP_1.vmdk' : capacity = 230686720 sectors - 110.0 Gb

DISKLIB-LIB : Growing disk 'CentOS SMTP_1.vmdk' : new capacity = 104857600 sectors - 50.0 Gb

DISKLIB-LIB : capacity needs to be bigger than : 230686720 (104857600)

.DISKLIB-VMFS : "./CentOS SMTP_1-flat.vmdk" : closed.

DISKLIB-LIB : Failed to grow disk 'CentOS SMTP_1.vmdk' : One of the parameters supplied is invalid. (1)

Failed to extend disk : One of the parameters supplied is invalid. (1)

The root cause of the problem is that capacity of the new disk size needs to be bigger than it is now. So you cannot decrease the size of the disk.

And when you try to expand your 78GB disk to 79GB is work OK.

\# vmkfstools -X 79g -v 9 CentOS\ SMTP_1.vmdk

DISKLIB-VMFS : "./CentOS SMTP_1-flat.vmdk" : open successful (0) size = 83751862272, hd = 13341. Type 3

DISKLIB-DSCPTR: Opened : "CentOS SMTP_1-flat.vmdk" (0)

DISKLIB-LINK : Opened 'CentOS SMTP_1.vmdk' (0): vmfs, 163577856 sectors / 79872 Mb.

DISKLIB-LIB : Opened "CentOS SMTP_1.vmdk" (flags 0). 0x92760d8

DISKLIB-LIB : Growing disk 'CentOS SMTP_1.vmdk' : createType = vmfs

DISKLIB-LIB : Growing disk 'CentOS SMTP_1.vmdk' : capacity = 163577856 sectors - 78.0 Gb

DISKLIB-LIB : Growing disk 'CentOS SMTP_1.vmdk' : new capacity = 165675008 sectors - 79.0 Gb

DISKLIB-VMFS :ExtentCreate "CentOS SMTP_1-flat.vmdk" : success

DISKLIB-LINK : "CentOS SMTP_1.vmdk.dfgshkgrw-tmp" : creation successful.

DISKLIB-VMFS : "./CentOS SMTP_1-flat.vmdk" : closed.

DISKLIB-VMFS : "./CentOS SMTP_1-flat.vmdk" : open successful (0) size = 84825604096, hd = 2078. Type 3

DISKLIB-DSCPTR: Opened : "CentOS SMTP_1-flat.vmdk" (0)

DISKLIB-LINK : Opened 'CentOS SMTP_1.vmdk' (0): twoGbMaxExtentSparse, 165675008 sectors / 80896 Mb.

DISKLIB-LIB : Opened "CentOS SMTP_1.vmdk" (flags 0). 0x9276338

DISKLIB-DDB : "geometry.cylinders" = "10312" (was "10182")

DISKLIB-VMFS : "./CentOS SMTP_1-flat.vmdk" : closed.

AIOMGR-S : stat o=3 r=0 w=0 i=5 br=0 bw=0

I hope this will help.

Best regards,

Reply
0 Kudos