VMware

VMware ESX Server 2.0

Features | Documentation | Knowledge Base | Discussion Forums

previous Prev   Contents   Last   Next next

File System Management on SCSI Disks and RAID

File System Management on SCSI Disks and RAID

VMFS (VMware ESX Server File System) is a simple, high-performance file system on physical SCSI disks and partitions, used for storing large files such as the virtual disk images for ESX Server virtual machines and, by default, the memory images of suspended virtual machines. The VMFS also stores the redo-log files for virtual machines in nonpersistent, undoable, or append disk modes. For more information on disk modes, see Creating a New Virtual Machine.

ESX Server 2.0 supports two types of file systems: VMFS version 1 (VMFS-1) or VMFS version 2 (VMFS-2). VMFS-1 is the same VMFS shipped with previous versions of ESX Server 1.x. VMFS-2 is a new VMFS released with ESX Server 2.0 and contains the following features that are not available with the older VMFS-1 file system:

  • Ability to span multiple VMFS-2 partitions on the same or different SCSI disks.
  • Ability for multiple ESX Servers (and the virtual machines on these servers) to access files on a VMFS-2 volume concurrently (non-clustering setup).

    VMware ESX Server 2.0 includes a new automatic per-file locking mechanism that allows these concurrent accesses without file system corruption.

  • Larger file system volumes and larger files on the VMFS volumes.
  • Raw disks can be mapped as VMFS files.

Note: Unlike VMFS-1, VMFS-2 is not backwardly compatible with previously released (1.x) versions of ESX Server.

A server's VMFS volumes are mounted automatically by the service console, as soon as the storage adapter drivers are loaded, and appear in the /vmfs directory.

The vmkfstools command provides additional functions that are useful when you need to create files of a particular size and when you need to import files from and export files to the service console's file system. In addition, vmkfstools is designed to work with large files, overcoming the 2GB limit of some standard file utilities.

Viewing and Manipulating Files in the /vmfs Directory

Viewing and Manipulating Files in the /vmfs Directory

You can view and manipulate files under /vmfs in these mounted VMFS volumes with ordinary file commands such as ls and cp.

Note: If you use the ls command to view the contents of your /vmfs directory, and the response is slow, then use the /bin/ls command instead.

Although mounted VMFS volumes may appear similar to any other file system such as ext3, VMFS is primarily intended to store large files such as disk images. Unfortunately, the service console (which is based on a Linux 2.4 kernel) does not support files greater than 2GB. nfs is known to run into this limitation, while ftp, scp and cp are not affected by it. Thus, you should use ftp, scp and cp for copying files to and from a VMFS volume, as long as the host file system supports these large files.

Note: If you use the ls command inside a ftp session, the file size may be different from the output of the ls -l command or vmkfstools -l command. This is because ftp uses 32-bit values for file sizes, and the maximum file size it can display is 4GB. However, you can safely transfer any large files between ESX Server machines with a ftp session. The entire file is correctly copied over.

VMFS Volumes

VMFS Volumes

In ESX Server 2.0, a VMFS-2 volume can span multiple partitions, across the same or multiple (up to 32) LUNs or physical disks. A VMFS-2 volume is a logical grouping of physical extents. Each physical extent is part of a disk; for example, a physical disk partition. That is, a physical extent is a disk partition that is part of a VMFS-2 volume.

By contrast, VMFS-1 volumes are limited to a single physical extent.

You can view the VMFS volumes on your ESX Server at any time by changing directories to the /vmfs directory, then listing its contents. You can use vmkfstools -P <VMFS_volume_label>, to obtain more details about your VMFS volume.

# cd /vmfs
# ls
vmhba0:0:0:2 vmhba0:0:0:6

The entries in the /vmfs directory are updated dynamically. Any changes you make to VMFS-2 volumes through the VMware Management Interface are immediately reflected in this directory.

See Using vmkfstools.

Labelling VMFS Volumes

Labelling VMFS Volumes

If you create a VMFS volume on a SCSI disk or partition, you can give a label to that volume and use that label when specifying VMFS files on that volume. For instance, suppose you have a VMFS volume on the SCSI partition vmhba0:3:0:1 and have created a VMFS file nt4.dsk. You can label that volume by using a vmkfstools command such as:

vmkfstools -S mydisk vmhba0:3:0:1

You can then refer to the nt4.dsk file as mydisk:nt4.dsk (instead of vmhba0:3:0:1:nt4.dsk) in a virtual machine configuration file and in other vmkfstools commands. For more information on vmkfstools, see vmkfstools Options.

If there is no persistent binding, then labelling VMFS volumes is especially useful if you may be adding SCSI adapters or disks to your system. The actual disk and target numbers specifying a particular VMFS may change, but the label stays the same. Also, other ESX Servers see the same label, which is useful for LUN ID between servers.

For more information, see Using Persistent Binding.

VMFS Accessibility

VMFS Accessibility

There are two modes for accessing VMFS volumes: public and shared.

  • public — This is the default mode for ESX Server.

    With a public VMFS version 1 (VMFS-1) volume, multiple ESX Server computers have the ability to access the VMware ESX Server file system, as long as the VMFS volume is on a shared storage system (for example, a VMFS on a storage area network). However, only one ESX Server can access the VMFS volume at a time.

    With a public VMFS version 2 (VMFS-2) volumes, multiple ESX Server computers can access the VMware ESX Server file system concurrently. VMware ESX Server file systems with a public mode have automatic locking to ensure file system consistency.

  • shared — Used for a VMFS volume that is used for failover-based clustering among virtual machines on the same or different ESX Servers.

    Caution: If you create a shared VMFS volume on a LUN, then do not create any additional VFMS volumes on this LUN. Physical bus sharing among clustered virtual machines on a shared VMFS volume interferes with locking mechanisms for other VMFS volumes on the same LUN.

    For more information on clustering with ESX Server, see Configuration for Clustering.

Note: In ESX Server 2.0, private VMFS volumes are deprecated. If you have existing VMFS version 1 (VMFS-1) or VMFS version 2 (VMFS-2) private volumes, then you can continue to use them, but we recommend you change the access mode to public. There is no performance penalty in making this change.

VMFS Accessibility on a SAN

VMFS Accessibility on a SAN

Any VMFS volume on a disk that is on a SAN should have VMFS accessibility set to public or shared. Public, the default and recommended accessibility mode, makes the VMFS volume available to multiple physical servers, and to the virtual machines on those servers. With VMFS-2 volumes, public access is concurrent to multiple physical servers, whereas for VMFS-1 volumes, public access is limited to a single server at a time. For more information on configuring ESX Server with a SAN, see Using Storage Area Networks with ESX Server.

Changing Storage Configuration Options

Changing Storage Configuration Options

To create or modify disk partitions through the VMware Management Interface, complete the following steps.

  1. Log in to the VMware Management Interface as root.

    The Status Monitor page appears.

  2. Click the Options tab.
  3. Click Storage Configuration.
  4. Make the appropriate changes, then click OK.

    Note: You cannot change VMFS accessibility if there are any open files on the VMFS volume. (The attempted operation returns errors). Close any open files, then edit the VMFS volume.

See Configuring Storage: Disk Partitions and File Systems for additional information.

Using vmkfstools

Using vmkfstools

The vmkfstools command supports the creation of a VMware ESX Server file system (VMFS) on a SCSI disk. Use vmkfstools to create, manipulate and manage files stored in VMFS volumes. You can store multiple virtual disk images on a single VMFS volume.

Note: You can also do most of the vmkfstools operations through the VMware Management Interface.

vmkfstools Command Syntax

vmkfstools Command Syntax

Note: You must be logged in as the root user to run the vmkfstools command.

vmkfstools Syntax When Specifying a SCSI Device

vmkfstools Syntax When Specifying a SCSI Device

The format for the vmkfstools command, when specifying a SCSI device, is:

vmkfstools <options> <device_or_VMFS_volume>[:<file>]

where <device_or_VMFS_volume> specifies a SCSI device (a SCSI disk or a partition on a SCSI disk) being manipulated or a VMFS volume, and <options> specifies the operation to be performed.

If <device_or_VMFS_volume> is a SCSI device, then it is specified in a form such as:

vmhba1:2:0:3

Here, vmhba1 specifies the second SCSI adapter activated by the command vmkload_mod .../XXX.o vmhba. (See VMkernel Module Loader for details on vmkload_mod.) The second number specifies the target on the adapter, the third number specifies the LUN (logical unit number) and the fourth number specifies the partition. Partition 0 (zero) implies the whole disk; otherwise, the number specifies the indicated partition.

<device_or_VMFS_volume> may also be a VMFS volume label, as set in the management interface or with the vmkfstools --setfsname command.

<file> is the name of a file stored in the file system on the specified device.

vmkfstools Syntax When Specifying a VMFS Volume or File

vmkfstools Syntax When Specifying a VMFS Volume or File

The format for the vmkfstools command, when specifying a VMFS volume or file, is:

vmkfstools <options> <path>

where <path> is an absolute path that names a directory or a file under the /vmfs directory.

For example, you can specify a VMFS volume by a path such as:

/vmfs/vmhba1:2:0:3

You can also specify a single VMFS file:

/vmfs/lun1/rh9.dsk

vmkfstools Options

vmkfstools Options

This section includes a list of all the options used with the vmkfstools command.

Some of the tasks in this section include options that are suggested for advanced users only. These advanced options are not available through the VMware Management Interface.

Note: The long and short (single letter) forms of options are equivalent. For example, the following commands are identical:

vmkfstools --createfs vmfs2 --blocksize 2m --numfiles 32 vmhba1:3:0:1

vmkfstools -C vmfs2 -b 2m -n 32 vmhba1:3:0:1

If the vmkfstools command fails, and you don't know why, then check the log files in /var/log/vmkernel or use the management interface to view the latest warning.

  1. Log in to the VMware Management Interface as root.

    The Status Monitor page appears.

  2. Click the Options tab.

    The Options page appears.

  3. Click System Logs.
Basic vmkfstools Options

Basic vmkfstools Options

Basic options are common tasks that you may perform frequently. You may also perform through the management interface.

Creates a VMFS on the specified SCSI device.

-C --createfs [vmfs1|vmfs2]
-b --blocksize #[gGmMkK]
-n --numfiles #

This command creates a VMFS version1 (vmfs1) or version 2 (vmfs2) file system on the specified SCSI device.

For advanced users:

  • Specify the block size by using the -b option. The block size must be 2x (a power of 2) and at least 1MB. (The default file block size is 1MB.) You can specify the size in kilobytes, megabytes, or gigabytes by adding a suffix of k (kilobytes), m (megabytes), g (gigabytes) respectively.
  • Specify the maximum number of files in the file system with the -n option. The default maximum number of files is 256 files.

Lists the attributes of a VMFS volume or a raw disk mapping.

-P --querypartitions <VMFS_volume_name>
-P --querypartitions <VMFS_volume:fileName>

For a VMFS_volume_name, the listed attributes include the VMFS version number (VMFS-1 or VMFS-2), the number of physical extents (partitions) comprising the specified VMFS volume, the volume label (if any), the UUID (if any), and a listing of the SCSI device names of all the physical extents comprising the VMFS volume.

For a VMFS_volume:fileName, the listed attributes include the vmhba name of the raw disk or partition, corresponding to the mapping referenced by fileName, and any identification information for the raw disk.

Creates a file with the specified size on the file system of the specified SCSI device.

-c --createfile #[gGmMkK]

The size is specified in bytes by default, but you can specify the size in kilobytes, megabytes, or gigabytes by adding a suffix of k (kilobytes), m (megabytes), g (gigabytes) respectively.

Exports the contents of the specified file on the specified SCSI device to a virtual disk on the file system of the service console.

-e --exportfile <dstFile>

After the export, you may transfer the virtual disk to another server machine and import it to a SCSI device on the remote machine.

If your virtual disk has redo logs, you have the following options:

  • If you use the exportfile option on the base virtual disk, only the base virtual disk is exported. Any uncommitted redo logs are not exported, but can be copied out separately.
  • If you use the exportfile option on a ESX Server redo log, the exported virtual disk contains the redo log, any previously created redo logs, and the base virtual disk. That is, the newly created exported virtual disk appears as if the redo log(s) was committed to its base virtual disk.

    Note: However, your original source redo log(s) and base virtual disk remain unchanged.

  • If you want to export your redo logs and base virtual disk separately, then use the exportfile option to export the base virtual disk, and the cp command to export each redo log separately.

Use the combination of exportfile and importfile together to copy VMFS files to remote machines. The virtual disk should take less space than the full size of the VMFS file, since the virtual disk does not include zeroed sectors of the VMFS file.

Imports the contents of a VMware virtual, plain, or raw disk on the service console to the specified file on the specified SCSI device.

-i --importfile <srcFile>

This command is often used to import the contents of a VMware Workstation or VMware GSX Server virtual disk onto a SCSI device. You may also run this command to import a virtual disk, that was created by exporting the contents of a disk from another SCSI device.

Note: The destination device must have space for the entire size of the virtual disk, even if it is mostly free space, as the complete contents of the source disk are copied.

Lists the files on the file system on the specified device.

-l --list
-h --human-readable
-M --verbosemappings

The output includes permissions, sizes and the last modification time for redo logs, virtual disk files, and swap files. You can use the -h option to print the sizes in an easier-to-read format; for example, 5KB 12.1MB, and so on.

(Advanced users only) The -M option lists the vmhba name that corresponds to each raw disk mapping.

Sets the name of the VMFS on the specified SCSI device to <fsName>.

-S --setfsname <fsName>

You can see the VMFS name by running the vmkfstools command with the -l option, vmkfstools -l.

Advanced vmkfstools Options

Advanced vmkfstools Options

Advanced options are tasks that you may perform infrequently. These tasks are not available through the management interface, or are available in a limited form, and are suggested for advanced users only.

Commits the redo log of the specified file, making the associated changes permanent.

-m --commit

If a virtual machine is in undoable or append mode, then the redo log is created automatically. The name of the redo log is derived by appending .REDO to the name of the file that contains the base disk image. You can commit the changes to the disk that are stored in the redo log by using the commit option or eliminate the changes by using the rm command to delete the redo-log file.

Sets the VMFS on the specified SCSI device to the specified mode.

-F --config [public|shared|writable]

Note: In ESX Server 2.0, private VMFS volumes are deprecated. If you have existing VMFS version 1 (VMFS-1) or VMFS version 2 (VMFS-2) private volumes, then change the access to public.

Public —

With public VMFS-2 volumes, multiple ESX Server computers can access the same VMware ESX Server VMFS volume concurrently. VMware ESX Server file systems with a public access mode use an automatic per-file locking to ensure file system consistency.

With a public VMFS-1 volume, multiple ESX Server computers have the ability to access the VMware ESX Server VMFS volume, as long as the VMFS volume is on a shared storage system (for example, a VMFS on a storage area network). However, only one ESX Server can access the VMFS-1 volume at a time.

Note: ESX Server creates VMFS volumes as public by default.

Shared —

The shared access mode allows virtual machines on multiple servers to access the same virtual disk on a VMFS-2 volume simultaneously. (In public mode, virtual machines can only access the same VMFS volume, never the same virtual disk, at the same time.)

Note: A VMFS volume that is used for failover-based clustering should have its mode set to shared.

Writable —

When virtual machines access a file on a shared VMFS, the file system metadata becomes read-only. That is, no virtual machine or user command can create, delete or change the attributes of a file.

If you need to create, remove, or change the length of a file (vmkfstools -X), then you need to change the volume to "writable". First, be sure that no virtual machines are accessing the VMFS volume (all virtual machines are powered off or suspended), then change the file system metadata to writable with the command, vmkfstools --config writable. Once you power on or resume a virtual machine, the file system metadata reverts to being read-only.

Prints out the name of a Linux device that represents the specified SCSI device on the service console.

-N --consolename

You can use the resulting device name to access the SCSI device by using commands such as fdisk on the service console. The association between the Linux device name and the specified SCSI device lasts only until ESX Server is unloaded or the server machine is rebooted.

Extends an existing logical VMFS-2 volume by spanning multiple partitions.

-Z --extendfs <extension-SCSIDevice>
-n --numfiles #

This option adds another physical extent (designated by <extension-SCSIDevice>), starting at the specified SCSI device. By running this option, you lose all data on <extension-SCSIDevice>.

Note: A logical VMFS-2 volume can have at most 32 physical extents.

This operation is not supported on the VMFS-1 file system and in fact, returns an error if the specified SCSI device is formatted as VMFS-1. Each time you use this option and extend a VMFS-2 volume with a physical extent, the VMFS volume supports, by default, an additional 64 files. You can change this default number of files by using the -n option.

Maps a raw disk or partition to a file on a VMFS-2 volume.

-r --maprawdisk <raw-SCSI-device>

Once this mapping is established, you can access the raw disk like a normal VMFS file. The file length of the mapping is the same as the size of the raw disk or partition. The mapping can be queried for the raw SCSI device name by using the -P option.

By mapping a raw disk or partition to a file, you can manipulate this raw disk or partition as any other file. In addition, this mapping enables you to have undoable, append, and nonpersistent "raw disks".

All VMFS-2 file-locking mechanisms apply to raw disks.

Displays disk geometry for a VMware Workstation or GSX Server virtual disk.

-g -- geometry <virtual-disk>

The output is in the form: Geometry information C/H/S is 1023/128/32, where C represents the number of cylinders, H represents the number of heads, and S represents the number of sectors.

When importing VMware Workstation or VMware GSX virtual disks to VMware ESX Server, you may see a disk geometry mismatch error message. A disk geometry mismatch may also be the cause if you have problems loading a guest operating system, or running a newly created virtual machine.

View the events log through the VMware Management Interface (Users and Events page for the virtual machine) or through the service console (the vmware.log file, found, by default, in the <user>/vmware/<guest_operating_system> directory). Look for C/H/S and compare this with the output of the vmkfstools -g command.

If the disk geometry information is different, then specify the correct information, from the output of the vmkfstools -g command, in the configuration file of the newly created virtual machine.

See Problems Importing GSX Server Virtual Machines to ESX Server for complete details on specifying the disk geometry in a virtual machine's configuration file.

Extends the specified VMFS to the specified length.

-X --extendfile #[gGmMkK]

Use this command to extend the size of a disk allocated to a virtual machine, after the virtual machine has been created. The virtual machine that uses this disk file must be powered off when you enter this command. Also, the guest operating system must be able to recognize and use the new size of the disk, for example by updating the file system on the disk to take advantage of the extra space.

You specify the size in kilobytes, megabytes, or gigabytes by adding a suffix of k (kilobytes), m (megabytes), g (gigabytes) respectively.

Manages SCSI reservations of physical targets or LUNs.

-L --lock [reserve|release|reset]

Caution: Be careful when using these commands. The reserve, release, and reset commands can interrupt the operations of other servers on a storage area network (SAN), so use these commands with great caution.

The -L reserve command reserves the specified raw disk, or the disk containing the specified VMFS volume. After the reservation, other servers will get a SCSI reservation error if they attempt to access that disk, but the server that did the reservation will be able to access the disk normally.

The -L release command releases the reservation on the specified disk, or disk containing the specified VMFS volume. Any other server can access the disk again.

The -L reset command does a SCSI reset to the specified disk. Any reservation held by another server is released.

Recovers a VMFS.

-R --recover

This command enables you to recover a VMFS (accessible by multiple ESX servers) when other vmkfstools commands indicate that the file system is locked by another ESX Server machine, but, in fact, no other server is currently accessing this file system. This situation may occur if the VMFS was being accessed by a server (for example, running a virtual machine) and that server crashed.

Note: You should only use this command if you are certain that no other ESX Server is still accessing the file system.

Scans the specified vmhba adapter for devices and LUNs.

-s --scan <FC_SCSI_adapter>

This option is particularly useful for adapters connected to storage area networks, particularly if you are reconfiguring your SAN. If a new device or LUN becomes accessible through the adapter, then ESX Server registers this new virtual device for use by virtual machines. If an existing device or LUN is no longer used and appears to be gone, then it is removed from use by virtual machines.

Note: Only use this -s option for Fibre Channel adapters.

You can see the results of the scan by using ls /vmfs or looking at the contents of /proc/vmware/scsi.

Creates a swap file with the specified size on the VMFS volume of the specified SCSI device.

-w --createswapfile #[gGmMkK]

The size is specified in bytes by default, but you can specify the size in kilobytes, megabytes, or gigabytes by adding a suffix of k (kilobytes), m (megabytes), g (gigabytes) respectively.

ESX Server starts using the swap file immediately after it is created.

You can use the -w option to activate an existing swap file. If the newly specified length of the swap file is different from the length of the existing swap file, then the length of the swap file is changed.

Caution: If you reboot the ESX Server machine, ESX Server does not recognize the file as a swap file until you activate it as mentioned previously.

Changes the VMFS from VMFS-1 to VMFS-2.

-T --tovmfs2

This command converts the VMFS volume on the specified partitions from VMFS-1 to VMFS-2, while preserving all files in the volume. ESX Server's locking mechanism attempts to ensure that no remote ESX Server or local process is accessing the VMFS volume that is being converted.

Note: If you have an active swap partition, you must deactivate it before running this command. Deactivate swap through the VMware Management Interface and reboot your server. Once this vmkfstools -T command completes, you can reactivate your swap file.

This conversion may take several minutes. When your prompt returns, the conversion is complete.

Note: In ESX Server 2.0, private VMFS volumes are deprecated. If you have an existing VMFS version 1 (VMFS-1) private volume, then the newly created VMFS-2 volume's access mode is automatically changed to public.

Before starting this conversion, check the following:

  • Back up the VMFS-1 volume that is being converted
  • Be sure there are no virtual machines powered on using this VMFS-1 volume
  • (SAN only) Be sure no other ESX Server is accessing this VMFS-1 volume
  • (SAN only) Be sure this VMFS-1 volume is not mounted on any other ESX Server

Caution: The VMFS- 1 to VMFS-2 conversion is a one-way process. Once the VMFS volume is converted to VMFS-2, you cannot revert it back to a VMFS-1 volume.

Note: The first time you access a newly converted VMFS-2 volume, the initial access will be slow, because of internal volume consistency checking.

Examples Using vmkfstools

Examples Using vmkfstools

This section includes examples using the vmkfstools command with the different options described previously.

Create a new file system.

vmkfstools -C vmfs2 -b 2m -n 32 vmhba1:3:0:1

This example illustrates creating a new VMFS version 2 (vmfs2) on the first partition of target 3, LUN 0 of SCSI adapter 1. The file block size is 2MB and the maximum number of files is 32.

Extends the new logical volume by spanning two partitions.

vmkfstools -Z vmhba0:1:2:4 vmhba1:3:0:1

This example illustrates extending the new logical file system by adding the 4th partition of target 1 (and LUN 2) of vmhba adapter 0. The extended file system supports a maximum of 64 (2 X 32) files, and spans two partitions — vmhba1:3:0:1 and vmhba0:1:2:4.

You can address the file system by using the name of its head partition; for example, vmhba1:3:0:1.

Names a VMFS volume.

vmkfstools -S mydisk vmhba1:3:0:1

This example illustrates assigning the name of mydisk to the new file system.

Creates a new VMFS virtual disk file.

vmkfstools -c 2000m mydisk:rh6.2.dsk

This example illustrates creating a 2GB VMFS file with the name of rh6.2.dsk on the VMFS volume named mydisk. The rh6.2.dsk file represents an empty disk that may be accessed by a virtual machine.

Imports the contents of a virtual disk to the specified file on a SCSI device.

vmkfstools -i ~/vms/nt4.dsk vmhba0:2:0:0:nt4.dsk

The example illustrates importing the contents of a virtual disk (that contains Windows NT 4.0) from the service console's file system to a file named nt4.dsk on target 2 of SCSI adapter 0.

You can configure a virtual machine to use this virtual disk by adding the following lines to its configuration file:

scsi0.virtualDev = vmxbuslogic
scsi0:0.present = TRUE
scsi0:0.name = vmhba0:2:0:0:nt4.dsk

Migrate virtual machines to VMware GSX Server or VMware Workstation, then back to VMware ESX Server.

Note: The following example, illustrating the -e and -i options, result in the export or import of a virtual disk.

This example illustrates migrating a virtual machine's virtual disk file from ESX Server to VMware GSX Server or VMware Workstation, then migrating the virtual disk back to ESX Server.

vmkfstools -e winXP.vmdk vmhba0:6:0:1:winXP.dsk

The preceding command exports the winXP.dsk virtual disk file to one or more .vmdk files, maximum size 2GB, that you can use as a virtual disk in a virtual machine on GSX Server or Workstation. The resultant winXP.vmdk file(s) can reside on a VMFS volume, or an /ext2, /ext3, or NFS file system.

The following example imports a GSX Server or Workstation virtual disk file into the VMFS volume on the specified SCSI device.

vmkfstools -i winXP.vmdk vmhba0:6:0:1:winXP.dsk

By contrast, if you are importing directly into a raw partition, the example becomes:

vmkfstools -i winXP.vmdk vmhba0:6:0:1

Lists the files on the VMFS of the specified device.

vmkfstools -l vmhba0:2:0:0

This command illustrates listing the contents of the file system, including redo logs, virtual disk files, and swap files on target 2 of SCSI adapter 0.

Scans a vmhba adapter.

This example illustrates scanning the vmhba1 adapter for any new or removed targets or LUNs.

vmkfstools -s vmhba1

Accessing Raw SCSI Disks

Accessing Raw SCSI Disks

You can access raw disks directly or use the vmkfstools -r command to map them to files on VMFS-2 volumes. Once this mapping is established, you access the raw disk or partition like a normal file. For more information on this mapping, see Using vmkfstools, in particular, the vmkfstools -r option.

Using a Physical Disk in a Virtual Machine

Using a Physical Disk in a Virtual Machine

In order for the virtual machine to access a physical disk or LUN, you must add the disk to the virtual machine. This example assumes that the virtual machine's first disk is a virtual disk and you are adding the physical disk as the second disk.

If you want the virtual machine's first disk to be a physical disk, see Creating a New Virtual Machine and select System LUN/Disk for your virtual disk.

  1. Log into the VMware Management Interface as the user who owns the virtual machine or as the root user.

    The Status Monitor page appears.

  2. Click the arrow to the right of the terminal icon ( ) for the virtual machine you want to change and choose Configure Hardware.

    The Hardware page for this virtual machine appears in a new browser window.

  3. Click Add Device. The Add Device Wizard starts.

  4. Click Hard Disk. The Virtual Disk Type page appears.

  5. Click System LUN/Disk to allow the virtual machine to access a physical disk stored on a LUN. Then specify the following.

  6. Choose the LUN you want to use in the Storage Controller LUN list.
  7. Specify the virtual device node. Select the appropriate SCSI ID in the Virtual SCSI Node list.
  8. Click OK to add the disk.
Determining SCSI Target IDs

Determining SCSI Target IDs

In order to assign SCSI disks to a virtual machine, you need to know which controller the drive is on and what the SCSI target ID of the controller is. This section helps you determine these values without opening your computer and physically looking at the SCSI target ID settings on the drives.

SCSI disks may be accessed by local SCSI adapters, or on a SAN by Fibre Channel adapters. Therefore, whenever we describe SCSI adapters in this section, these descriptions also apply to Fibre Channel adapters, even though they are not explicitly mentioned.

On a standard Linux system, or for a VMware service console that has SCSI or Fibre Channel (FC) controllers assigned to the service console rather than the VMkernel, information on attached SCSI devices, including SCSI target IDs is available in the boot log (usually /var/log/messages), or from examining /proc/scsi/scsi.

Information about the SCSI controllers assigned to the VMkernel and about the devices attached to these controllers is available in the /proc/vmware/scsi directory once the VMkernel and the VMkernel device module(s) for the SCSI controller(s) have been loaded.

Each entry in the /proc/vmware/scsi directory corresponds to a SCSI controller assigned to the VMkernel. For example, assume you issued a vmkload_mod command with the base name vmhba and a single SCSI controller was found.

To identify the controller, type this command:

ls -l /proc/vmware/scsi

The output of the ls command is:

total 0
dr-xr-xr-x 2 root    root       0 Jun 22 12:44 vmhba0

Each SCSI controller's subdirectory contains entries for the SCSI devices on that controller, numbered by SCSI target ID and LUN (logical unit number). Run cat on each target ID:LUN pair to get information about the device with that target ID and LUN. For example, type this command:

cat /proc/vmware/scsi/vmhba0/1:0

The following information is displayed:

Vendor: SEAGATE Model: ST39103LW Rev: 0002
Type: Direct-Access ANSI SCSI revision: 02
Size: 8683 Mbytes
Queue Depth: 28

Partition Info:
Block size: 512
Num Blocks: 17783240

     num: Start     Size Type
     4:   1  17526914 fb

Partition 0:
    VM 11
    Commands 2
    Kbytes read 0
    Kbytes written 0
    Commands aborted 0
    Bus resets 0
Partition 4:
    Commands 336
    Kbytes read 857
    Kbytes written 488
    Commands aborted 0
    Bus resets 0

This information should help you determine the SCSI target ID to use in the storage configuration page, as displayed by the VMware Management Interface. See Configuring Storage: Disk Partitions and File Systems.

previous Prev   Contents   Last   Next next