Ask an Expert
What tools are available for disk management on ESX Server?
|
 |
| |
Answer: You can use the vmkfstools command line utility to create and manipulate virtual disks, file systems, and physical storage devices. vmkfstools comes with all versions of VMware ESX Server.
Examples for ESX 3.0 environment:
1. Viewing VMFS Volumes / Partitions Information
To display VMFS volumes /partition information, type
vmkfstools -P "/vmfs/volumes/storage1 (1)"
The response looks like this:
VMFS-3.21 file system spanning 1 partitions.
File system label (if any): storage1 (1)
Mode: public
Capacity 71672266752 (68352 file blocks * 1048576), 2749366272 (2622 blocks) avail
UUID: 458ff675-cb212c03-168b-000423c06e33
Partitions spanned:
vmhba0:0:0:3
2. Creating a virtual disk
To create a virtual disk, use the following command:
vmkfstools -a lsilogic -c 1024m "/vmfs/volumes/storage1 (1)/Win XP/Win XP.vmdk"
This command creates a 1 GB virtual disk at a given location, with all space allocated at creation time. The –a option specifies SCSI controller type that should be used to communicate with the virtual disk.
3. Extending a virtual disk
The vmkfstools command can also be used for extending a virtual disk to the new specified length.
For example, to extend a disk to a size of 2 GB, type
vmkfstools -X 2048m "/vmfs/volumes/storage1 (1)/Win XP/Win XP.vmdk"
Always specify the virtual disk descriptor file with the vmkfstools command. After expanding the disk file, it is necessary to run a partition manipulation tool in the virtual machine to expand the partition seen by the guest OS.
4. Deleting virtual disks
Type the command
vmkfstools -U "/vmfs/volumes/storage1 (1)/Win XP/Win XP.vmdk"
Note: you can also perform tasks 1 - 4 by means of Virtual Infrastructure Client.
5. Importing and exporting virtual disks
Another typical administrative task is to move a virtual machine either from an ESX server to another VMware platform, or the other way around. This task involves a format conversion of the virtual machine disks.
To export a virtual disk from VMFS volume, you need to specify ‘2gbsparse’ disk format. Disks in this format can be used with other VMware products.
vmkfstools -i "/vmfs/volumes/storage1 (1)/Win XP/Win XP.vmdk" -d 2gbsparse "/vmimages/Win XP.vmdk"
Destination disk format: sparse with 2GB maximum extent size
Cloning disk '/vmfs/volumes/storage1 (1)/Win XP/Win XP.vmdk'...
Clone: 100% done.
To import a virtual disk named ‘Win XP.vmdk’ to VMFS volume, type:
vmkfstools -i "/vmimages/Win XP.vmdk" "/vmfs/volumes/storage1 (1)/Win XP/Win XP.vmdk"
Destination disk format: VMFS thick
Cloning disk '/vmimages/WinXP.vmdk'...
Clone: 100% done.
To get the full listing of command options, type vmkfstools or man vmkfstools in a console session.
|