How to Manage VMFS Datastores in VMware
- select the contributor at the end of the page -
Multiple servers can write data to, and read data from, a VMFS volume. ESX and ESXi Server use a file-locking mechanism, called SCSI reservation, to preserve the integrity of data contained on a volume. SCSI reservation occurs when a VMFS operation modifies the metadata of logical unit number (LUN) -- an individual, unique, block-based storage device (the term "LUN" is often used interchangeably with "disk" or "drive"). Examples of VMFS operations include creating a virtual machine or template, turning a VM on, or creating or deleting a file. These reservations are dynamic, rather than static; once an operation is complete, the host will release the lock.
VMFS deposits files in a storage container called a datastore, a separate filesystem that runs on top of a volume. Datastores reside on a block-based device such as iSCSI. Virtual machine disks (VMDKs) are housed in the datastore.
VMFS-5, released with vSphere and ESXi 5.0, can handle volume sizes of up to 64TB and datastores of 2TB - 512B in size. VMFS is limited to 256 volumes per host and a maximum of 64 hosts can be associated with a single volume.
To ensure the best performance, administrators should determine what kind of datastore is most suitable for a particular virtual machine. Datastores running on low-end disks or lacking redundancy, for example, should be associated with low-priority VMs. Continue reading to learn how to configure and manage your datastores in VMware vSphere.
Create a New Datastore
VMFS volumes should be created in vSphere, rather than via the fdisk tool or from the ESX/ESXi installer. The start sectors on volumes formatted in the ESX/ESXi installer or via command line will not be aligned at 128K, negatively impacting disk performance as a result.
- In vSphere, select the ESX or ESXi host. Click the Configuration tab and then select "Storage" from the Hardware pane.
- Click "Add Storage." Select "Disk/LUN" as the storage type and then click "Next."
- Select the LUN to format. Click "Next." Choose from the following options if the selected disk is not blank:
- Use All Available Partitions - Erase all data from the LUN and dedicate the entire disk for use with the datastore.
- Use Free Space- Create a VMFS volume on the remaining space available on the disk.
- Create a unique name for the datastore and then click "Next."
- Select a block size from the drop-down menu. The block size determines the maximum file size a volume can manage. 1MB corresponds to 256GB, 2MB to 512GB, 4MB to 1024GB, and 8MB to 2048GB. The block size limits the size of the VMDK.
- Check "Maximize Capacity" to use the entire LUN, if applicable. For the best performance possible, it's recommended to have a 1:1 ratio of VMFS volumes to LUNs, although LUNs can hold more than one VMFS volume at a time. Click "Next."
- Review your selections and then click "Finish" to create the VMFS datastore.
Mount a Datastore
Datastores in VMware aren't locked to their original host and can be mounted to, or unmounted from, a server. To associate an existing datastore with a new server:
- Follow the instructions in steps 1 and 2 in the above section. When prompted to select a disk, check the Label column to find the LUN that holds the existing datastore.
- Select the LUN and then choose "Keep Existing Signature" or "Assign a New Signature." Select the former if the server is a copy of a now-defunct host; select the latter if the server is a snapshot of an existing host that is still active.
- Follow the remaining prompts to attach the datastore to a new host.
Unmount a Datastore
- Go to the Configuration tab after selecting the ESX or ESXi host and then click "Datastores."
- Right-click the appropriate datastore and then select "Unmount" from the context menu.
- If the datastore is shared, deselect the host to unmount the datastore; select a host to keep the volume mounted. Click "Next."
- Click "Finish" to unmount the datastore from the target host or hosts.
Increase the Size of the Datastore
Administrators can increase the size of a VMFS datastore using an extent, which represents a partition on a LUN. VMFS volumes can accommodate multiple extents -- up to 32 at a time if each extent is the maximum 2TB in size. You can also grow an existing extent so long as it has available free space after it.
- Select the target host and then click the Configuration tab. Choose "Storage" from the Hardware pane.
- Right-click the appropriate datastore and then choose "Properties" from the context menu.
- Click "Increase." Select a device from the list. To add a new extent to the datastore, select an unexpandable device; to increase the size of an existing extent, select an expandable device. Click "Next."
- Select one of the following options:
- Use Free Space to Add New Extent - Allocate available space on the disk to the new extent.
- Use Free Space to Expand Existing Extent - Add additional storage space to an existing extent.
- Use Free Space- Use all remaining, available space on the disk to deploy a new extent.
- Use All Available Partitions - Reformat the disk, removing any existing datastores, and dedicate all available space on the disk to create a new extent. The disk must not be blank.
- Check "Maximize Capacity" to use all available space; otherwise, enter the desired size, in GB, into the available field. Click "Next."
- Click "Finish" to increase the size of the datastore.
As stated above, it's important to have a firm understanding of the requirements of your environment before associating a virtual machine with a datastore. You should have a good idea, for example, of the block size to choose when first setting up your VMFS volume; selecting too small a block size affects how large your VMDKs can be, which could have deleterious effects in the long run. Make your choices wisely when configuring your datastore.