hp-lefthand

HP LeftHand 12 MPIO for ESXi 5.5

One of the new features of HP LeftHand 12.0 is the Multipathing Extension Module for VMWare, which reduces latency and improves performance. With this extension and configuring VMWare with Dynamic Discovery and the VIP (Virtual IP address) of the LeftHand, it discovers all the nodes and creates a link to every node.

With the extension installed and working, in LeftHand administration where before you could see only the paths to the VIP for every LUN now you can see at least a link for every node and duplicated in case of the VIP because it handles data and control.

The extension is now available for ESXi 5.0, 5.1 and 5.5, and can be downloaded from here: HP StoreVirtual Storage: LeftHand OS 12.0

To install the extension into a host with ESXi 5.x you need:

  1. Place host into maintenance mode.
  2. Enable SSH (it is always recommended not to leave it always enabled).
  3. With WinSCP or any other application that supports SCP copy the VIB file to a storage, if you are going to update multiple hosts it is recommended to copy to a shared storage so it is accessible from all hosts (e.g. /vmfs/volumes/xxx).
  4. With Putty or any other SSH client connect to the ESXi host and update with the following command:

    This is an example of a successfully completed installation
  5. No reboot is required but before exiting maintenance mode, reconfigure the Path Policy for all LeftHand’s LUNs with the new Path Policy HP_PSP_LH.

    HP_PSP_LH_Path_Policy

    HP_PSP_LH Path Policy

  6. Verify all the LeftHand’s LUNs are OK and then exit maintenance mode.

This is a very manual process and only useful for a LAB or very reduced environment, but if you have to update multiple LUNs for every host it is better to use PowerCLI.

The following script changes the Path Policy on all LeftHand datastores of an ESXi host, please be careful and test in a Lab before applying into production.

[wpfilebase tag=file id=8 /]

Serial Port

Remove serial and parallel ports with PowerCLI

Removing unnecessary hardware from virtual machines is always a good practice and it usually we found that creating new VMs we left hardware like serial and parallel ports configured.

With the functions from the file you can remove serial and parallel ports from a VM, recommended to perform with powered off VMs. It can be added to a recursive scripts and remove cluster wide or even Datacenter wide all serial and parallel ports from the virtual machines.

As all PowerCLI scripts it requires a connection to a vCenter.

[wpfilebase tag=file id=7 /]

PowerCLI

Bulk change NTP on all ESXi with PowerCLI

Changing the NTP data in one host is a pretty easy task but change it across multiple hosts is a repetitive task than can be scripted with PowerCLI.

The script adds a NTP server on all ESXi hosts connected to the vCenter server you previously connected with “Connect-ViServer” and then restarts the NTP service so the changes are applied.

 

[wpfilebase tag=file id=6 /]

 

 

batch-scripting

Parse GUID on BCDEdit command line when creating new entry

Creating an entry and setting parameters with BCDEdit on command line in a batch process can be difficult because of the random GUID generated that must be specified when changing parameters to the new entry.

With a CMD file like this:
for /f "tokens=2 delims={}" %%g in ('bcdedit.exe -store c:\boot\bcd /create /d "New Entry" /application osloader') do (set guid={%%g})
echo %guid%

The generated GUID is stored as variable and can be used, within the same batch file with variable %guid%.

Attached to the post is an example of CMD Batch file that creates and entry and sets a few parameters.

time-machine-tips

Time Machine on unsupported NAS

To use an unsupported NAS as a Time Machine some configurations have to be made so it runs OK.

  • Enable unsupported NAS on TimeMachine with Terminal: “defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
  • Gather MAC Address of the Mac that will be used as a source of Time Machine Backups from Terminal: “ifconfig en0 | grep ether | awk ‘{print $2}’ | sed ‘s/://g’
  • Create a new sparsebundle file where the Time Machine backups will be archived via Terminal, replacing the appropriate fields of size,  <computer name>, is better to use a single word computer name (on Sharing option from Preferences) and <MAC Address>: “sudo hdiutil create -size <SIZE>g -type SPARSEBUNDLE -nospotlight -volname “Backup of <COMPUTER NAME>” -fs “Case-sensitive Journaled HFS+” -verbose ~/Desktop/<COMPUTER NAME>_<MAC ADDRESS>.sparsebundle“. It is recommended to use small size like 1G and resize later, in case to use full size now omit the next step.
  • Open the new created image file with Disk Utility and click on Resize Image, be careful to unroll the arrow and select “Only image size”, insert new size and click Resize. Now mount image and select Partitions tab, select create 1 partition of the dropdown menu and apply, when finished you can unmount the image.
Expand - Resize Image
Expand - New Size
  • To prevent the automatic resize of the file done by TimeMachine, use this command in Terminal App: “chflags uchg /Volumes/TimeMachine/<COMPUTER NAME>_<MAC ADDRESS>.sparsebundle/Info.*” Replacing <COMPUTER NAME> and <MAC ADDRESS> like before.
  • Now copy the sparsebundle file to the desired location of the NAS.
  • Open TimeMachine preferences and click to use the shared folder where the file image have been copied, TimeMachine will ask for the login information to the NAS and select save so it will not be asked again.

With all this TimeMachine should be running up.

Fan Control for D-Link DNS-320 with USB support

D-Link DNS-320
Based on the great script provided by John Mnemonic (here) I have adapted to use the USB Drive, to prevent the constant use of the hard disk so the hibernation can kick in, saving some energy and preventing the wear of the drives.

The files are configured to monitor only one drive and with standard temperature configuration from the original script, all this parameters are configurable within the first lines of the file fancontrol.sh from BIN folder. Tplot.sh files are only required only if you want graphics from temperature levels.

The temperature is obtained in Celsius from parameter 194 of SMART values. The script is tested and working with fun_plug 0.7.

Installation procedure:

Continue reading →

Auto Rename computer with Serial Number on boot

Script File

When managing a large clients computers sometimes the best name convention for every client computer is a unique number so it is easy to locate and manage. One unique number available in most, if not every computer, is its serial number, with DELL computers it is known as Service Tag.

When needed it is easy to change one single computer name, but when doing a big deployment, like new computers, new operating system revision, and more it can be complicated.

With this script, in that case 2 files, the computer will be renamed with its own serial number (Service Tag) on next reboot, the purpose of the 2 files are:

* RunOnce.reg: Registry file to add the path to the script (note the double bar for the path to work), it uses the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce. When the script is run the entry on the regsitry gets deleted.

* ChangeName.vbs: The script itself, needs to be adjusted with a valid local administrator account, with username and password on line 22 and 23. In case of storing the file in a different path than C:\Windows the script have to be adjusted on line 44.

After running the script the file gets deleted, so not to worry, so much, with security regarding local administrator username and password in plain text.

Enable Wake On Lan (WOL) on Windows

green_switch-128.png

When deploying, with SCCM or any other software, one of the most important thing is to not disturb users on their job, so the best way to do it is out of work time, like nights, when there is no users working, at least not the majority, counterside the computers are offline so no way to install anything.

The solution is to enable and use the network standard Wake On Lan (known as WOL), but it is not a common configuration so you have to enable in every computer.

The solution is to use a script that enables it on Windows, take into consideration that must be enabled at BIOS level (covered in a next article), this script enables it silently the Wake On Lan. It can be deployed through SCCM when the computers are awake because it’s only an script with no other consequences.

Disable event logging with DELL OMCI

DELL

Dell OpenManage Client Instrumentation, known as DELL OMCI, enables remote management application programs to access information about the client system, monitor status of clients and even change BIOS settings, latest version available is 7.6.

When installed at all kind of alerts, like chassis intrussion, low hard disk space and more start bugging the client computers and the Windows Event Log gets flooded with alerts.

DELL supplies a few vbs scripts to disable some of the alerts, like chassis intrussion, but there is no script to complete disable the alerts and events.

Steve Lancaster helped with a script that sets the alert value to 7 (Fatal_Nonrecoverable), it means the PC will not start so it is impossible for this alert ever to be generated as the PC is total crashed.

After running the vbs script on the target computer no more alerts nor events are generated, so you can have a clean event log and no alerts bugging the users without loosing the capacity of change settings or monitor client status from a centralized server. Of course, all the installation and running the script process can be automated in a single deploy through SCCM 2007, but it will be covered in another post.