VMware Cloud Community
SRCPTony
Contributor
Contributor
Jump to solution

ESX - VM Expandable Virtual Disk Option

When using Converter to to import my old VMWare Server Virtual Machines into ESX Server, I've noticed that the option to "Allow Virtual Disk Files to Expand" seems to be missing. Is it just me or is that feature not available with virtual machines in ESX 3.5? If so, all VMs in ESX need to have the disk space preallocated? (I know the question relates to Converter but it pertains more to ESX).

(Screenshot attached for quick reference)

Thanks,

Tony

0 Kudos
1 Solution

Accepted Solutions
Texiwill
Leadership
Leadership
Jump to solution

Hello,

Moved to Virtual Machine and Guest OS forum as this question is more about VMs than ESX itself.

VMware ESX by default uses a zeroed-thick VMDK format as it performs better and provides better security than any of the other formats. Consider that when you grow a disk you will incur SCSI Reservation requests and these can cause havoc within the virtual infrastructure until they stop. Granted this is generally for heavily loaded systems, but they should be avoided at all times to increase performance.

You can use vmkfstools once the VMDK is within ESX to convert to the other formats as desired but VMware Converter does not allow that.


Best regards,

Edward L. Haletky

VMware Communities User Moderator

====

Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.

Blue Gears and SearchVMware Pro Blogs: http://www.astroarch.com/wiki/index.php/Blog_Roll

Top Virtualization Security Links: http://www.astroarch.com/wiki/index.php/Top_Virtualization_Security_Links

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill

View solution in original post

0 Kudos
9 Replies
Texiwill
Leadership
Leadership
Jump to solution

Hello,

Moved to Virtual Machine and Guest OS forum as this question is more about VMs than ESX itself.

VMware ESX by default uses a zeroed-thick VMDK format as it performs better and provides better security than any of the other formats. Consider that when you grow a disk you will incur SCSI Reservation requests and these can cause havoc within the virtual infrastructure until they stop. Granted this is generally for heavily loaded systems, but they should be avoided at all times to increase performance.

You can use vmkfstools once the VMDK is within ESX to convert to the other formats as desired but VMware Converter does not allow that.


Best regards,

Edward L. Haletky

VMware Communities User Moderator

====

Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.

Blue Gears and SearchVMware Pro Blogs: http://www.astroarch.com/wiki/index.php/Blog_Roll

Top Virtualization Security Links: http://www.astroarch.com/wiki/index.php/Top_Virtualization_Security_Links

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos
woodsrl
Contributor
Contributor
Jump to solution

I have been using VMWare Server 1.x and 2.x for a while now, and especially for Linux based development servers, have used the expandable disk option quite a bit. Now that I would like to migrate all of these guests over to ESXi, I do not have the room to fit several guests that have 5% utilized partitions over given they now have to take up the full space of their partition size setting. You eluded to option of using vmkfstools to convert these guests to the expandable option once they are on the ESXi box. Did I read this right, and if so, what would the syntax used with vmkfstools? I went through the manual for it, and did not see where that was an options. Second, if I cannot use expandable as an option, is there any way to change a guest, that for example has a 40GB partition, but is only using 5GB, to a 10GB partition on ESXi? Please let me know if I have any options to accomplishing this.

Thanks,

RW

0 Kudos
SRCPTony
Contributor
Contributor
Jump to solution

@woodsrl

Facing a similar predicament, I used VMWare Converter to convert all of my freeware VMWare Server VMs to ESX VMs. When doing so, I resized all of my drives (which had been set to 300gb expandable) to resemble much more closely what they were actually using (actual data plus 10-20%, depending on expected growth). This way, I didn't totally hog my entire SAN with dozens of VMs that will likely barely grow in size from 10GB C: drives. All of my dynamic data (databse files, public folders, etc) are stored in separate LUNs with Snap Manager and Server 2k3 Storage manager controlling them. This worked for me, in your case, you may prefer to use vmkfstools. Either way, my best advice: Size up your servers and make a solid estimate on how much space each will need, then constrast that with the amount of space you actually have to work with. Draw it out on a whiteboard. Once you go make your move to ESX/ESXi (assuming you delete your original free VMWare Server files afterwards) you will be locked in.

0 Kudos
woodsrl
Contributor
Contributor
Jump to solution

I have done this exact process, resize the guests to reasonable partition size, for all of my Windows based guests. This works fine because VMWare Converter does the resizing for you. How do I accomplish the same thing for my Linux guests? Specifically CentOS 4 and 5.

0 Kudos
SRCPTony
Contributor
Contributor
Jump to solution

In VMWare Server, there is a tool called vdiskmanager that I believe will allow you to shrink the disks prior to moving them into ESXi.

Not sure about using it with Linux guests but I would research it, if in your position.

0 Kudos
woodsrl
Contributor
Contributor
Jump to solution

The shrinking option does not change the allocation size of the partition, it merely reduces the disk file to it's smallest possible size. Much like packing a database. I still need a way to reduce the size of a linux guest partition before I move it to ESXi. Can anyone help with this?

0 Kudos
rentzd
Contributor
Contributor
Jump to solution

I have the same need. I am looking into the possible use of ESX / ESXi for purposes of IT training involving VMs where we have historically been using VMware Server. Because we are running several courses at different times on a single host, we have to keep the Virtual Machine .vmdk file sizes as small as possible or we'll run out of disk space very quickly even when using large 750GB drives on the host servers. Sharing the .vmdk files among several VMs and using multiple layers of snapshots is a practice we also employ for purposes of managing .vmdk disks and how much storage space they consume. Because students only write to snapshot files that are later discarded after training sessions, there are no advantages for us to have pre-allocated .vmdk disk space.

It appears that ESX/i requires all VM .vmdk disk files to be preallocated. In short, I am asking if this is a hard fast rule with no work around or alternative? Are there no tools or options available that would allow me to use growable .vmdk files in stead of preallocated? Again, for my purposes, it makes no sense to use pre-allocated .vmdk files.

____________

Hummm, looks like it may be available via the command line using the vmkfstools command with the thin option. I'm looking into that now.

____________

Still working on it. I've created a VM with and without Thin Provisioning on ESX4 and in both cases, the .vmdk file appears to be preallocated/takes up all the space I set for the virtual disk size.

I ran the command: "vmkfstools -i Windows01.vmdk -d thin Windows01b.vmdk" to try and clone a virtual disk that was 10GB preallocated to a thin diskformat with no change in the size either. Both the source and destination drive ended up being identical in size: 10GB.

root@esx02 Windows01# vmkfstools -i Windows01.vmdk -d thin Windows01b.vmdk

Destination disk format: VMFS thin-provisioned

Cloning disk 'Windows01.vmdk'...

Clone: 100% done.

root@esx02 Windows01# ls -lh

-rw------- 1 root root 10G Feb 26 05:00 Windows01b-flat.vmdk

-rw------- 1 root root 446 Feb 26 05:02 Windows01b.vmdk

-rw------- 1 root root 10G Feb 26 04:49 Windows01-flat.vmdk

-rw------- 1 root root 419 Feb 26 04:34 Windows01.vmdk

____________

Hummm,

Apparently, if you look at it from the command line with the ls -lh command, you get the incorrect file size listed: When I, instead, looked at the file sizes using the GUI Datastore Browser, the size of the disk, is actually correct / thin / growable rather than pre-allocated. --Strange.

____________

Ahh, du -sh works from the command-line.

root@esx02 Windows01# du -sh *

1.0M vmware.log

1.7G Windows01b-flat.vmdk

64K Windows01b.vmdk

10G Windows01-flat.vmdk

64K Windows01.nvram

64K Windows01.vmdk

0 Windows01.vmsd

64K Windows01.vmx

64K Windows01.vmxf

____________

Migrating a the ESX VM with thin/growable vmdk file from esx4 to esxi4 worked. The VM retained its thin/growable disk provisioning.

0 Kudos
SRCPTony
Contributor
Contributor
Jump to solution

Hey, great work, rentzd!! Thanks for posting your findings!

0 Kudos
rentzd
Contributor
Contributor
Jump to solution

Some additional information regarding thin provisioning of .vmdk files:

Under esx4 and esxi4, you have the ability to specify via the gui, at the time you create a VM, whether or not to use thin (growable) or thick (pre-allocated) disk (.vmdk) file provisioning. Under esx3 and esxi3, these options are not available via the gui. Under esxi3 and esxi4, of course, you only have the gui to work with--no command line availble. In addition, you can, under esx4 and esx3 create or convert .vmdk files using the vmkfstools command specifying thin provisioning. I am told that everything you can do via the gui, you can do via command-line. Wether or not that is true, I do know that you can definitely do some things via the command line that you cannot do via the gui.

As I mentioned before, you can migrate a VM that is thin provisioned to a different host and different datastore retaining its thin provisioning using the Virtual Center version 4 gui. You are also presented the option to convert it to thick if you cared to. Migrating a VM is a feature available using the Virtual Center product. Note, migrating a VM is not something you can do with the esx or esxi product alone. You need something similar to the Virtual Center product.

After creating or converting a .vmdk file with thin provisioning, I have tried to migrate it using Virtual Center version 3, to a different server and different datastore (via the gui) and I was not given the option to retain the VM's disk provisioning. The result was that the thin disk provisioning converted to thick during the migration--not what I wanted to see happen. So, this is definitely a difference between version 4 and version 3 of virtual center. Under version 4, using the gui, you can migrate a VM to a new datastore and retain the thin provisioning of its .vmdk files. Under version 3 you cannot.

Under virtual center version 3, I do not know yet, if migrating the VM to a new host, but the same datastore, will allow you to keep / retain thin disk provisioning, but I suspect it will. I'll let you know.

0 Kudos