Thursday, September 30, 2010

VMware ESX command line essentials PART #2

Following on PART #1, PART #2 is focusing on exploring storage Information.

Display currently mounted storage

####vdf for ESX host  is equivalent to  df  command for Linux, it shows any type (SCSI/FC/NFS/ISCSI)
$ vdf -h
Filesystem            Size  Used Avail Use% Mounted on
..
/vmfs/volumes/4c5be33b-3a356289-ea3f-0024c1a35c5c
135G   16G  118G  12% /vmfs/volumes/esx01:stor1
/vmfs/volumes/7292e403-4f367279
1.7T  1.5T  206G  88% /vmfs/volumes/nfs_stor 
####Check detailed file system information on the storage
$ vmkfstools -P -h /vmfs/volumes/esx01:stor1
VMFS-3.33 file system spanning 1 partitions.
File system label (if any): esx01:stor1
Mode: public
Capacity 135.2 GB, 118.5 GB available, file block size 1 MB
UUID: 4c5be33b-3a356289-ea3f-0024c1a35c5c
Partitions spanned (on "lvm"):
mpx.vmhba0:C0:T0:L0:5 
$ vmkfstools -P -h /vmfs/volumes/nfs_stor
NFS-1.00 file system spanning 1 partitions.
File system label (if any): nfs_stor
Mode: public
Capacity 1.7 TB, 206.5 GB available, file block size 4 KB
UUID: 7292e403-4f367279-0000-000000000000
Partitions spanned (on "notDCS"):
nfs:nfs_stor 

Find out storage type (SCSI/FC/NFS/ISCSI) 
####SCSI/FC TYPE
[ESX4]$esxcfg-scsidevs -m
mpx.vmhba0:C0:T0:L0:5   /dev/cciss/c0d0p5    4c5be33b-3a356289-ea3f-0024c1a35c5c  0  esx01:stor1
[ESX3]$ esxcfg-vmhbadevs  -m
vmhba0:0:0:9    /dev/cciss/c0d0p9                4951068b-1dabf5db-74c8-0022640e9ea6
####NFS TYPE
$esxcfg-nas -l
nfs_stor is /vol/vmdk_vol1 from 10.1.1.1.1  mounted
####ISCSI TYPE
vmkiscsi-tool ?


Find out adapter Vendor/ Device name


$ esxcfg-info | grep -B 12 vmhba0  
|----Vendor Name........................................Hewlett-Packard Company
|----Device Name........................................Smart Array E200i
|----Device Class.......................................260
|----PIC Line...........................................11
|----Service Console IRQ................................25
|----Vector.............................................162
|----PCI Pin............................................0
|----Spawned Bus........................................0
|----Flags..............................................513
|----Module Id..........................................34
|----Chassis............................................0
|----Physical Slot......................................255
|----VmKernel Device Name...............................vmhba0

How to find out storage not mounted


[ESX3]$esxcfg-mpath -l
Disk vmhba0:0:0 /dev/cciss/c0d0 (139979MB) has 1 paths and policy of Fixed
Local 66:8.0 vmhba0:0:0 On active preferred
[ESX4]$  esxcfg-scsidevs -l
mpx.vmhba0:C0:T0:L0
Device Type: Direct-Access
Size: 139979 MB
Display Name: Local VMware Disk (mpx.vmhba0:C0:T0:L0)
Plugin: NMP
Console Device: /dev/cciss/c0d0
Devfs Path: /vmfs/devices/disks/mpx.vmhba0:C0:T0:L0
Vendor: VMware    Model: Block device      Revis: 1.0
SCSI Level: 2  Is Pseudo: false Status: on
Is RDM Capable: false Is Removable: false
Is Local: true
Other Names:
vml.0000000000566d676261303a303b30
[ESX4]$ esxcfg-mpath -l device=vml.0000000000566d676261303a303b30
block.cciss/c0d0:0-block.0:0-mpx.vmhba0:C0:T0:L0
Runtime Name: vmhba0:C0:T0:L0
Device: mpx.vmhba0:C0:T0:L0
Device Display Name: Local VMware Disk (mpx.vmhba0:C0:T0:L0)
Adapter: vmhba0 Channel: 0 Target: 0 LUN: 0
Adapter Identifier: block.cciss/c0d0:0
Target Identifier: block.0:0
Plugin: NMP
State: active
Transport: block


Misc


####show vmware crash dump partition 
esxcfg-dumppart -l 
####clone disk/convert thick disk to thin disk 
vmkfstools   -i /vmfs/volumes/storage1/vm01.vmdk  -d thin    /vmfs/volumes/storage2/vm02.vmdk 
Thick Disk: size of ls output = size of du output 
Thin Disk: size of ls output > size of du output

No comments:

Post a Comment