Tuesday, April 24, 2012

Installing offline bundles onto an ESXi server remotely.

Installing offline bundles onto an ESXi server may sound difficult at first, but it is actually very easy. 

1. First aquire your 'offline-bundle.zip' file and store it in the same directory you installed the RemoteCLI to.
2. Open a RemoteCLI window
3. Run the vihostupdate.pl command using the following parameters:
              --server 'servername'
              --username
              --password
              --install
              --bundle 'bundle file from step 1'
              --nosigcheck

An example of a complete command string:
         vihostupdate.pl --server ABCD.your.domain --username joe --password abcd1234 --install --bundle offline-bundle.zip --nosigcheck

Change Pathing Policy Script

The following commands can be ran in PowerCLI to display / change the pathing policy of your datastores in ESX and ESXi.

!!! Before you perform any of these commands, I do recommend the ESX\ESXi host be placed in maintenance mode, to prevent any possible service interruptions!!!

'Display all Storage Information
Get-VMHost servername.your.domain | Get-ScsiLun | Select CanonicalName, MultiPathPolicy, Model

'Check Path Selection and path model name (model name will be needed later)
Get-VMHost servername.your.domain |Get-ScsiLun -LunType “disk” |format-table VMHost,CanonicalName,MultiPathPolicy,Model –autosize

The above command should give you results that look something like:


VMHost                            CanonicalName                   MultipathPolicy     Model
------                                 -------------                       ---------------         -----
servername.your.domain     naa.################a   Fixed                ABCD
servername.your.domain     naa.################b   Fixed                ABCD

' Using model name from above (ABCD), Verify selection criteria this criteria will be used on the next command to change things so verify to be sure you get the right results,
Get-VMHost servername.your.domain |Get-ScsiLun -LunType “disk” |where {$_.MultipathPolicy –ne “RoundRobin” -and $_.model -like “*ABCD*”} |format-table VMHost,CanonicalName,MultiPathPolicy,Model –autosize

' Change Path Selection for all luns that match the above selection criteria
Get-VMHost servername.your.domain |Get-ScsiLun -LunType “disk” |where {$_.MultipathPolicy –ne “RoundRobin” -and $_.model -like “*ABCD*”} |Set-ScsiLun -MultipathPolicy "RoundRobin"

' Run this command again, you should now get no results
Get-VMHost servername.your.domain |Get-ScsiLun -LunType “disk” |where {$_.MultipathPolicy –ne “RoundRobin” -and $_.model -like “*ABCD*”} |format-table VMHost,CanonicalName,MultiPathPolicy,Model –autosize

' Run this command and verify you get RoundRobin for all paths
Get-VMHost servername.your.domain |Get-ScsiLun -LunType “disk” |where {$_.model -like “*ABCD*”} |format-table VMHost,CanonicalName,MultiPathPolicy,Model –autosize