Friday, February 19, 2010

Cannot create a VM file larger than 256GB in ESX 4.0

When I tried to create a 500GB virtual disk on a local storage in ESX 4.0 Server, I got the error message "Cannot create a VM file or virtual disk larger than 256GB" in vSphere Client.

I googled the Internet, I only found the solution is to Increase block size of local storage in ESX 4.0. And you only can do it during the ESX 4.0 installation.


Increasing block size of local storage in ESX 4.0

Symptoms

* You cannot create a file (virtual disk) larger than 256 GB on local storage.
* You cannot reformat local storage (device or resource busy).

Resolution

ESX 4.0 uses a different installer than previous versions of ESX, and uses default block size of 1 megabyte when creating the local VMFS volume. The largest file that can be created with a 1 megabyte block size is 256 GB in size.

To create a file bigger than 256 GB, the VMFS filesystem needs to have a block size larger than 1 MB. The maximums are as follows:






Block SizeMaximum File Size
1 MB256 GB
2 MB512 GB
4 MB1 TB
8 MB2 TB


For more information about block sizes, see Verifying the block size of a VMFS data store (1003565).

The service console in ESX 4.0 runs as a virtual machine on local storage. As such, you cannot reformat this volume.

To resolve this issue, perform one of these workarounds:

  • Re-install the ESX host on a different drive (for example, a second RAID set or boot from SAN), and leave the original disk for the VMFS volume. You can then choose your blocksize when creating the second datastore.

  • Install ESX 3.5, create the volume with desired blocksize, then upgrade to ESX 4.0.

  • Carve out a new LUN or RAID set on the local controller for a new volume. Add physical disks as necessary.


You cannot create a second datastore on the same drive via the ESX GUI. You must use the following command:

Note: You may need to create a partition on the free space first with fdisk.

vmkfstools -C vmfs -b Xm -S local2mBS /vmfs/devices/disks/naa.xxxxxxxxxx:y


where:

  • Xm is the blocksize (1m, 2m, 4m, or 8m).

  • local2mBS is your volume name. If the volume name has a space (for example, volume name), enclose it in quotation marks (for example, "volume name").

  • naa is the naa identifier, and y is the partition number. To determine this, run ls -la in the /vmfs/devices/disks folder.


Note: Depending on your disk controller type, naa. may be replaced with eui., t10., or mpx.. For more information, see Identifying disks when working with VMware ESX (1014953).

Alternatively, you can reconfigure the installer to install ESX 4.0 with a different blocksize:

  1. Boot the ESX installation DVD.

  2. Press Ctrl+Alt+F2 to switch to the shell.

  3. Run:

    ps | grep Xorg


  4. Kill the PID which shows Xorg -br -logfile ....

    For example, run:

    kill 590


    where 590 is the PID.

    Note: If you specified the a GUI mode installation, killing the process identified as Xorg may switch you back to another console. If this occurs, press Ctrl+Alt+F2 to return to the console.

  5. To switch to the configuration directory, run:

    cd /usr/lib/vmware/weasel


  6. To edit the configuration script, run:

    vi fsset.py


    Note: For more information on editing files, see Editing configuration files in VMware ESX (1017022).

  7. Locate class vmfs3FileSystem(FileSystemType):.

  8. Edit the blockSizeMB parameter to the block size that you want. It is currently be set to 1. The only values that work correctly are 1, 2, 4, and 8.

    Note: Press i for insert mode.

  9. To save and close the file, press Esc, type :wq, then press Enter.

  10. To switch back to the root directory, run:

    cd /


  11. To launch the installer with the new configuration, run:

    /bin/weasel


    And continue the ESX 4.0 installation.

No comments :

Post a Comment

Comments System

Disqus Shortname