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.
http://blogs.vmware.com/vsphere/2012/02/migrating-rdms-and-a-question-for-rdm-users.html

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.

https://my.vmware.com/web/vmware/details?downloadGroup=VSP510-VCLI-51U1&productId=285
You will need to change the server address 0.0.0.0 for your ESXi host and also insetr the correct password.

Enter maintenance mode:
vicfg-hostops.pl --server=0.0.0.0 --username root --password "password" --operation enter

Reboot a host:
vicfg-hostops.pl --server=0.0.0.0 --username root --password "password" --operation reboot

Disable DelayedAck:
esxcli --server=0.0.0.0 --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=0.0.0.0 --username root --password "password" iscsi adapter param set -A vmhba33 -k LoginTimeout -v 60

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

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

Establish if NetQ is enabled:

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

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

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

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


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

Add a time server to a host:
vicfg-ntp.pl --server=0.0.0.0 --username root --password "password" --add 0.uk.pool.ntp.org

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

Install a patch on a host after using SCP to copy it to the path below :
esxcli --server=0.0.0.0 --username root --password "password" software vib install -d /vmfs/volumes/esxiserver/BCM-NetXtremeII-4.0-offline_bundle-862948.zip

Set the PSP to RoundRobin and IOPS to 3 for EqualLogic arrays:
esxcli --server=0.0.0.0 --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=172.26.253.185 --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=0.0.0.0 --username root --password "password" storage nmp psp roundrobin deviceconfig set -d naa.devicename --iops 1 --type iops

Install a bundle:
esxcli --server=0.0.0.0 --username root --password "password" software vib install -d /vmfs/volumes/esxi01/BCM-NetXtremeII-4.0-offline_bundle-862948.zip

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