VMware Cloud Community
James_DGAP
Contributor
Contributor
Jump to solution

Powercli script to list "Status Details" for incompatible vibs during upgrade

Hi,

I'm plagiarized a script that will remove incompatible vibs but I'm struggling with getting the list of incompatible vibs in the "Status Details" after a baseline scan.  For example, Mellanox_bootbank_net-mst_2.0.0.0-1OEM.550.0.0.472560 found under "Status Details".

pastedImage_0.png

Currently I have to manually select that with my script.  If I could get this information with a script automagically the script would be a bit more seamless.  Any help would be appreciated.

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

I'm afraid that functionality is missing.

See also VUM cmdlets - get name of "conflicting VIBs" on ESXi hosts?

Which script are you using?

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

I'm afraid that functionality is missing.

See also VUM cmdlets - get name of "conflicting VIBs" on ESXi hosts?

Which script are you using?

---------------------------------------------------------------------------------------------------------

Was it helpful? Let us know by completing this short survey here.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
James_DGAP
Contributor
Contributor
Jump to solution

Thanks for the reply.  Here is what I have so far which works well but I'm sure it could be written better.  Might help someone out though.

$Combo1 = "net-mst"

#Removes

#Mellanox_bootbank_net-mst_2.0.0.0-1OEM.550.0.0.472560

$Combo2 = "scsi-mpt3sas"

#Removes

#LSI_bootbank_scsi-mpt3sas_04.00.00.00.1vmw-1OEM.500.0.0.472560

$Combo3 = "scsi-lpfc820","net-mst"

#Removes

#Emulex_bootbank_scsi-lpfc820_8.2.4.157.70-1OEM.500.0.0.472560

#Mellanox_bootbank_net-mst_2.0.0.0-1OEM.550.0.0.472560

$Combo4 = "scsi-qla2xxx","net-mst"

#Removes

#qlogic_bootbank_scsi-qla2xxx_911.k1.1-26OEM.500.0.0.472560

#Mellanox_bootbank_net-mst_2.0.0.0-1OEM.550.0.0.472560

$Combo5 = "scsi-qla2xxx","scsi-lpfc820"

#Removes

#qlogic_bootbank_scsi-qla2xxx_911.k1.1-26OEM.500.0.0.472560

#Emulex_bootbank_scsi-lpfc820_8.2.2.126.50-1OEM.500.0.0.472560

$Combo6 = "scsi-lpfc820","scsi-qla2xxx","net-mst"

#Removes

#Emulex_bootbank_scsi-lpfc820_8.2.4.157.70-1OEM.500.0.0.472560

#qlogic_bootbank_scsi-qla2xxx_934.5.20.0-1OEM.500.0.0.472560

#Mellanox_bootbank_net-mst_2.0.0.0-1OEM.550.0.0.472560

$Combo7 = "scsi-mpt3sas","net-bna","scsi-qla2xxx","scsi-bfa","scsi-mtip32xx-scsi"

#Removes

#LSI_bootbank_scsi-mpt3sas_04.00.00.00.1vmw-1OEM.500.0.0.472560

#Brocade_bootbank_net-bna_3.2.0.0-1OEM.500.0.0.472560

#qlogic_bootbank_scsi-qla2xxx_934.5.20.0-1OEM.500.0.0.472560

#Brocade_bootbank_scsi-bfa_3.2.0.0-1OEM.500.0.0.472560

#Micron_bootbank_scsi-mtip32xx-scsi_2.4.10-1OEM.500.0.0.472560

$vibList = $Combo2  # select the comination of vibs to remove

Write-host "You are about to remove the following VIBs from the following hosts"

Write-host "-----------------------"

Write-output $vibList

Write-host "-----------------------"

Write-output $VMhostList.name

Pause

foreach($VMhost in $VMHostList.name){

        write-host $VMhost

        Write-host "------------------"

    foreach ($vib in $vibList){

        $esxcli = Get-EsxCli -VMHost $VMhost -V2 

        $esxliRemoveVibArgs = $esxcli.software.vib.remove.CreateArgs()

        $esxliRemoveVibArgs.dryrun = $false # change this to true for testing only  

        $vibs = $esxcli.software.vib.list.Invoke() | where {$_.Name -match $vib}

        foreach ($vib in $vibs){

              $esxliRemoveVibArgs.vibname = $vib.Name

              $esxcli.software.vib.remove.Invoke($esxliRemoveVibArgs)

       }

}}

Pause

Write-host "Hosts will be rebooted"

Write-output $VMhostlist

Foreach ($vmhost in $VMhostlist){

$ismaint = get-VMhost $vmhost.name | select ConnectionState

If ($ismaint.ConnectionState = "Maintenance") {

    $eventManager = Get-View eventManager

    $vmhost = Get-VMHost -Name $vmhost.name

    $message = "Patching and Upgrades"

    $eventManager.LogUserEvent($vmhost.ExtensionData.MoRef,$message)

    Restart-VMHost $vmhost -Confirm

    }

}

Remove-Variable * -Force -ErrorAction SilentlyContinue

#End of script.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Thanks for sharing


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos