VMware ESXi MegaCLI StorCLI Enable Cache Write Back

You have two options for managing the LSI Logic, Dell PERC, etc. from the ESXi CLI: StorCLI or MegaCLI.

You can download MegaCLI for VMware here: 8.04.07_MegaCLI

You can download StorCLI from the LSI website and here: CLI_VMWare_MN_8.04.07

MegaCLI:

esxi1# ./MegaCli -LDSetProp -Cached -LAll -aAll

Set Cache Policy to Cached on Adapter 0, VD 0 (target id: 0) success
Set Cache Policy to Cached on Adapter 1, VD 0 (target id: 0) success

esxi1# ./MegaCli -LDSetProp EnDskCache -LAll -aAll

Set Disk Cache Policy to Enabled on Adapter 0, VD 0 (target id: 0) success
Set Disk Cache Policy to Enabled on Adapter 1, VD 0 (target id: 0) success

esxi1# ./MegaCli -LDSetProp RA -LALL -aALL

Set Read Policy to ReadAhead on Adapter 0, VD 0 (target id: 0) success

For those who have good power:

esxi1# ./MegaCli -LDSetProp WB -LALL -aALL

Set Write Policy to WriteBack on Adapter 0, VD 0 (target id: 0) success
Set Write Policy to WriteBack on Adapter 1, VD 0 (target id: 0) success

For those that live in fear, run the above command and also:

esxi1# ./MegaCli -LDSetProp NoCachedBadBBU -LALL -aALL

Set No Write Cache if bad BBU on Adapter 0, VD 0 (target id: 0) success
Set No Write Cache if bad BBU on Adapter 1, VD 0 (target id: 0) success

StorCLI:

Show all:

./storcli /c0 show all

Enable WriteBack Cache:
./storcli /c0/v0 set wrcache=AWB

Enable IOCache:
./storcli /c0/v0 set iopolicy=cached

Not recommended see:

Enable Physical Disk Drive Cache:

./storcli /c0/v0 set pdcache=On

Read Ahead

./storcli /c0/v0 set rdcache=RA  or  NoRA

VMware PowerCLI – How do I add functions?

When first using VMware PowerCLI, you will need to add functions that are associated with your profile.

Create a new profile:

PowerCLI> New-item –type file –force $profile

Once your profile has been created, you can now add functions by typing:

PowerCLI> notepad $profile

The above command simply opens notepad and allows you to edit your profile directly.

Once you have added functions, you will need to reload your profile (or restart PowerCLI):

PowerCLI> .$profile

ESXi identify boot LUN + boot LUN claim rules

Identify bootlun:

# ls -l /
lrwxrwxrwx 1 root root 49 Oct 27 17:55 bootbank -> /vmfs/volumes/94671c74-55d3efd8-6f90-332c181fc3cf

Obtain the disk ID:

# vmkfstools -P path

For example:

# vmkfstools -P /vmfs/volumes/bebbef72-6cbc41fa-b169-68d3824c6d51

vfat-0.04 file system spanning 1 partitions.
File system label (if any):
Mode: private
Capacity 261853184 (63929 file blocks * 4096), 114647040 (27990 blocks) avail
UUID: bebbef72-6cbc41fa-b169-68d3824c6d51
Partitions spanned (on “disks”):
naa.600601604550250018ea2d38073cdf11

Get the paths:
esxcfg-mpath -b -d naa.600601604550250018ea2d38073cdf11
vmhba33:C0:T3:L0 state:active Local HBA vmhba33 channel 0 target 3
vmhba33:C0:T2:L0 state:standby Local HBA vmhba33 channel 0 target 2
vmhba33:C0:T1:L0 state:active Local HBA vmhba33 channel 0 target 1
vmhba33:C0:T0:L0 state:standby Local HBA vmhba33 channel 0 target 0

Create claim rules:

esxcli storage core claimrule add –type=”location” –rule=202 –plugin=”NMP” –adapter=vmhba0 –channel=0 –target=2 –lun=0
esxcli storage core claimrule add –type=”location” –rule=203 –plugin=”NMP” –adapter=vmhba1 –channel=0 –target=2 –lun=0
esxcli storage core claimrule add –type=”location” –rule=204 –plugin=”NMP” –adapter=vmhba2 –channel=0 –target=2 –lun=0
esxcli storage core claimrule add –type=”location” –rule=205 –plugin=”NMP” –adapter=vmhba3 –channel=0 –target=2 –lun=0

Check claim rules:
~ # esxcfg-mpath -b -d naa.6006016005b02c0025489b6399b1e211
naa.6006016005b02c0025489b6399b1e211 : DGC Fibre Channel Disk (naa.6006016005b02c0025489b6399b1e211)
vmhba3:C0:T2:L0 LUN:0 state:active fc Adapter: WWNN: 50:06:0b:00:00:c2:6e:17 WWPN: 50:06:0b:00:00:c2:6e:16 Target: WWNN: 50:06:01:60:c7:20:23:b5 WWPN: 50:06:01:69:47:20:23:b5
vmhba0:C0:T2:L0 LUN:0 state:active fc Adapter: WWNN: 50:06:0b:00:00:c2:6e:11 WWPN: 50:06:0b:00:00:c2:6e:10 Target: WWNN: 50:06:01:60:c7:20:23:b5 WWPN: 50:06:01:61:47:20:23:b5
vmhba1:C0:T2:L0 LUN:0 state:active fc Adapter: WWNN: 50:06:0b:00:00:c2:6e:13 WWPN: 50:06:0b:00:00:c2:6e:12 Target: WWNN: 50:06:01:60:c7:20:23:b5 WWPN: 50:06:01:68:47:20:23:b5
vmhba2:C0:T2:L0 LUN:0 state:active fc Adapter: WWNN: 50:06:0b:00:00:c2:6e:15 WWPN: 50:06:0b:00:00:c2:6e:14 Target: WWNN: 50:06:01:60:c7:20:23:b5 WWPN: 50:06:01:60:47:20:23:b5

VMware converter does not find or recognize LVM CentOS 6 |-wi-ao|

As discussed in this VMware thread:  http://communities.vmware.com/thread/413602

VMware converter 5 fails to recognize LVM slices on CentOS 6 or Red Hat 6.

Log files shows:

WARN storage.lvm ]: Failed to match lvs output line ‘  lv_root|vg00|587034787840B|-wi-ao–|1

This issue is:  -wi-ao–    converter is expecting:  -wi-ao  (no –)

Two fixes:

1.  downgrade to:   lvm2-2.02.72

-or-

2. Wrap lvm with:

/sbin/lvm.wrapper $@ | sed -e ‘s/-wi-ao–/-wi-ao/’

VMware “Unable to connect to the MKS:”

Unable to connect to the MKS: Login (username / password) incorrect

  • Open /etc/vmware/config with a text editor.
  • Add this:  vmauthd.server.alwaysProxy = “TRUE”

Check your firewall config/network setup.    This error is caused by your vSphere client not able to communicate with the ESX/ESXi host directly.

All “Unable to connect to the MKS:” errors are network issues.   Do not be fooled by the mention of certificate issues…

 

Connect vCenter To ESX/ESXi Through MIP NATd IP

To make both connectivity to vCenter and clone operations function with NATd ESX service consoles:

1. In Vmware vCenter client, disable Vmware HA and DRS.
2. In Vmware vCenter client, disconnect the host. The VMs will continue to run.
3. Log in to the ESX service console via SSH and change to root.
$ ssh
$ sudo su –

1. Change the IP address in /etc/hosts to the public IP.
$ vi /etc/hosts
$ cat /etc/hosts
127.0.0.1 localhost
::1 localhost
33.33.22.22 esxhost.example.com esxhost

1. Verify the hostIP address is the public IP, and add preserveServerIp in /etc/opt/vmware/vpxa/vpxa.cfg .
$ vi /etc/opt/vmware/vpxa/vpxa.cfg


33.33.22.22

true

1. Restart the VPXA service.
$ service vmware-vpxa restart

1. Log out of the ESX service console.
2. In Vmware vCenter client, reconnect the host. You may need to re-enter the root user�s credentials.
3. In Vmware vCenter client, enable Vmware HA and DRS.

 

VMware ESX 4.0 to 4.1 Upgrade Error

When updated VMware ESX 4.0 to 4.1:

Host was not updated, no changes required.
Skipping bulletin ESX410-GA-esxupdate; it is installed or obsoleted.
Encountered error RunCommandError:
This is an unexpected error. Please report it as a bug.
Error Message – Command ‘[‘/usr/bin/vim-cmd’, ‘hostsvc/runtimeinfo’]’
terminated due to signal 6

Simply type: ldconfig

[ad#Google Adsense]