Thursday, 23 May 2013

Migrating physical RDP mapping to VMDK

According to Cormac Hogan at VMware, you can migrate a physical RDM to VMDK, the only 'gocha' is that the VM must be shutdown to perform the cold migration.i.e. no live Storage vMotion. I needed to do this migrate data from a EMC to EqualLogic array.

Doing this causes this error at the end of the operation :(

Incompatible device specified for device ’0′

One solution is to clone the disk using vmkfstools, but after the clone you need to remove the RDM and add the cloned VMDK by adding an existing disk to the VM configuration. My test was with a 40GB disk.

You can time the operation, I used this command

time vmkfstools -i /vmfs/volumes/lun1/test-vm/test-vm_1-rdmp.vmdk /vmfs/volumes/lun1/test-vm/test-vm_2.vmdk  -d zeroedthick

Clone: 100% done.
real    7m 54.56s
user    0m 0.63s
sys     0m 0.00s

Tuesday, 7 May 2013

Useful ESXCFG commands

To run any of these commands on you local machine you will need vSphere CLI 5.1 of higher.
You will need to change the server address for your ESXi host and also insetr the correct password.

Enter maintenance mode: --server= --username root --password "password" --operation enter

Reboot a host: --server= --username root --password "password" --operation reboot

Disable DelayedAck:
esxcli --server= --username root --password "password" iscsi adapter param set --adapter=vmhba33 --key=DelayedAck --value=false

Set the iSCSI login time out to 60 seconds:
esxcli --server= --username root --password "password" iscsi adapter param set -A vmhba33 -k LoginTimeout -v 60

List the values for the SWiSCSI HBA:
esxcli --server= --username root --password "password" iscsi adapter param get -A=vmhba33

Find the iQN name of a host:
esxcli --server= --username root --password "password" iscsi adapter get -A vmhba33 | find "iqn"

Establish if NetQ is enabled:

esxcli --server= --username root --password "password" system settings kernel list | find "netNet"

Find the version of Broadcom driver:
esxcli --server= --username root --password "password" system module get -m tg3

List all NICs in a host , like 'esxcfg-nics -l'
esxcli --server= --username root --password "password" network nic list

Disable LRO on a host:
esxcli --server= --username root --password "password" system settings advanced set -o "/Net/TcpipDefLROEnabled" -i 0

See if LRO is enabled on a host:
esxcli --server= --username root --password "password" system settings advanced list -o "/Net/TcpipDefLROEnabled"

Add a time server to a host: --server= --username root --password "password" --add

Specify a syslog server :
esxcli --server= --username root --password "password" system syslog config set --logdir-unique true --loghost=udp://

Install a patch on a host after using SCP to copy it to the path below :
esxcli --server= --username root --password "password" software vib install -d /vmfs/volumes/esxiserver/

Set the PSP to RoundRobin and IOPS to 3 for EqualLogic arrays:
esxcli --server= --username root --password "password" storage nmp satp rule add -s "VMW_SATP_EQL" -V "EQLOGIC" -M "100E-00" -P "VMW_PSP_RR" -O "iops=3"

Verify the IOPS have been saved
esxcli --server= --username root --password "P@ssw0rd" storage nmp device list | find "iops"

Set the PSP to RoundRobin and IOPS to 1 for other arrays:
esxcli --server= --username root --password "password" storage nmp psp roundrobin deviceconfig set -d naa.devicename --iops 1 --type iops

Install a bundle:
esxcli --server= --username root --password "password" software vib install -d /vmfs/volumes/esxi01/

Remember, don't issue these commands if you don't understand what they do!!