Category Archives: howto

ESXi Raw Device Mapping RDM

To configure a local device as an RDM disk:

  1. Open an SSH session to the ESXi host.
  2. Run this command to list the disks that are attached to the ESXi host:
    ls -l /vmfs/devices/disks
  3. From the list, identify the local device you want to configure as an RDM and copy the device name.
    Note: The device name is likely be prefixed with t10. and look similar to: t10.F405E46494C4540046F455B64787D285941707D203F45765
  4. To configure the device as an RDM and output the RDM pointer file to your chosen destination, run this command:
    vmkfstools -z /vmfs/devices/disks/diskname /vmfs/volumes/datastorename/vmfolder/vmname.vmdk

For example:

vmkfstools -z /vmfs/devices/disks/t10.F405E46494C4540046F455B64787D285941707D203F45765 /vmfs/volumes/Datastore2/localrdm1/localrdm1.vmdk

https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1017530

Test Jumbo Frames / MTU 9000

Linux:

ping -M do -s 8972 xxx.xxx.xxx.xxx

OSX/BSD:

ping -D -s 8184 xxx.xxx.xxx.xxx

Windows:

ping -f -l 9000 xxx.xxx.xxx.xxx

Example results on Linux

If you’ve forgotten to enable jumbo frames/9k MTU on your client device you’re sending the ping from:

PING xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx): 8184 data bytes
ping: sendto: Message too long

If you have enabled jumbo frames on your client but not the destination (or a switch in between):

PING xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx): 8184 data bytes
Request timeout for icmp_seq 0

If you’ve done everything righ:

PING xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx): 8184 data bytes
8192 bytes from xxx.xxx.xxx.xxx: icmp_seq=0 ttl=128 time=0.714 ms

How to insert hotfixes and drivers and then create a bootable Windows Setup DVD

  • Create local folders c:\temp\src, c:\temp\mount, c:\temp\winremount, c:\temp\hotfix, and c:\temp\drivers.
  • Copy the setup sources from the DVD or a mounted ISO to C:\temp\src.
  • Copy the hotfix (.msu or .cab files) to C:\temp\hotfix.
  • Copy the driver files to c:\temp\drivers.
  • Run Command Prompt as an administrative.
dism /Mount-Wim /WimFile:c:\temp\src\sources\boot.wim /Index:1 /MountDir:c:\temp\mount
dism /Image:C:\temp\mount /Add-Package /PackagePath:c:\temp\hotfix
dism /Image:C:\temp\mount /Add-Driver /Driver:c:\temp\drivers /Recurse
dism /Unmount-Wim /MountDir:C:\temp\mount /Commit
dism /Mount-Wim /WimFile:c:\temp\src\sources\boot.wim /Index:2 /MountDir:c:\temp\mount
dism /Image:C:\temp\mount /Add-Package /PackagePath:c:\temp\hotfix
dism /Image:C:\temp\mount /Add-Driver /Driver:c:\temp\drivers /Recurse
  • Manually sort the folder C:\temp\mount\sources by date, and then copy the updated files to c:\temp\src\sources.
dism /Unmount-Wim /MountDir:C:\temp\mount /commit
  • Obtain the index from the Install.wim information by running the following command, and then check every index to see how many indexes have to be updated.
dism /Get-WimInfo /WimFile:c:\temp\src\sources\install.wim
  • Insert the hotfixes and drivers to install.wim and winre.wim by running the following commands:
dism /Mount-Wim /WimFile:c:\temp\src\sources\install.wim /Index:1 /MountDir:c:\temp\mount
dism /Image:C:\temp\mount /Add-Package /PackagePath:c:\temp\hotfix
dism /Image:C:\temp\mount /Add-Driver /Driver:c:\temp\drivers /Recurse
dism /Mount-Wim /WimFile:c:\temp\mount\windows\system32\recovery\winre.wim /Index:1 /MountDir:c:\temp\winremount
dism /Image:C:\temp\mount /Add-Package /PackagePath:c:\temp\hotfix
dism /Image:C:\temp\mount /Add-Driver /Driver:c:\temp\drivers /Recurse
dism /Unmount-Wim /MountDir:C:\temp\winremount /Commit
dism /Unmount-Wim /MountDir:C:\temp\mount /Commit

Note If there are multiple indexes in step 8, update them one by one.

Create an ISO file by running the following oscdimg commands.

Install the latest Windows ADK for Windows 8.1 update.

  • For Legacy BIOS Boot mode:
oscdimg -LTEST -m -u2 -bC:\temp\src\boot\etfsboot.com C:\temp\src C:\temp\Win7.ISO
  • For Legacy and UEFI BIOS multiple Boot mode:
oscdimg -LTEST -m -u2 -bootdata:2#p0,e,bC:\temp\src\boot\etfsboot.com#pEF,e,bC:\temp\src\efi\microsoft\boot\efisys.bin C:\temp\src C:\temp\Win7.ISO

https://support.microsoft.com/en-au/help/2990941/update-to-add-native-driver-support-in-nvm-express-in-windows-7-and-windows-server-2008-r2

Static network config with dhcp fallback

/etc/network/interfaces:

auto wan
iface wan inet manual
	up ifup eth0=eth0-static
	post-up /etc/network/checkConnectivity.sh eth0 192.168.0.1 10.10.0.2

iface eth0 inet manual

#static eth0 config
iface eth0-static inet static
	address 192.168.0.97
	netmask 255.255.255.0
	gateway 192.168.0.1
	dns-nameservers 192.168.0.1 10.10.0.2
	dns-search example.net

#dhcp eth0 config
iface eth0-dhcp inet dhcp

/etc/network/checkConnectivity.sh:

#!/bin/bash
nif=${1}
shift


sleep 1

for i in ${@}; do
	ping -c 2 ${i} \
		&& exit 0
done

# if nothing responds
ifdown ${nif}
ifup ${nif}=${nif}-dhcp

manually override:

  • ifup eth0=eth0-static
  • ifup eth0=eth0-dhcp