VMware Cloud Community
ehsanijavad
Enthusiast
Enthusiast

Remove some dirvers from esxiCLI.system.module.list

Hi 

Can you help me to remove some driver:

$esxiCLI = Get-EsxCli -VMHost $h -V2

$esxiCLI.device.driver.list.Invoke()

$Rep = @()

$Rep += $esxiCLI.system.module.list.Invoke() | sort Name | where name -Match 'qfle'
$Rep +=$esxiCLI.system.module.list.Invoke() | sort Name| where name -Match 'qflge'

$Rep +=$esxiCLI.system.module.list.Invoke() | sort Name | where name -Match 'bnx2'

$Rep | ft -AutoSize

$List = $esxiCLI.software.vib.get.Invoke()

$List | where Name -Match 'bnx' | select name

ehsanijavad_0-1622126240261.png

Thanks in advance for your help.

Jawad

Reply
0 Kudos
13 Replies
LucD
Leadership
Leadership

Not too sure what exactly you are asking?

Do you want to remove those drivers from the ESXi node or from the output?


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

Reply
0 Kudos
ehsanijavad
Enthusiast
Enthusiast

Hi LucD

I want to remove them from ESXi node.

Reply
0 Kudos
LucD
Leadership
Leadership

You can use the software vib remove command via the Get-EsxCli cmdlet.
Just like you did for the list command.


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

Reply
0 Kudos
ehsanijavad
Enthusiast
Enthusiast

Hi LucD

I have already removed them:

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

$targetargs2.vibname = "net-bnx2"
$esxcli.software.vib.remove.Invoke($targetargs2)
$targetargs2.vibname = "net-bnx2x"
$esxcli.software.vib.remove.Invoke($targetargs2)
$targetargs2.vibname = "scsi-bnx2fc"
$esxcli.software.vib.remove.Invoke($targetargs2)
$targetargs2.vibname = "scsi-bnx2i"
$esxcli.software.vib.remove.Invoke($targetargs2)

after remove:

$List = $esxiCLI.software.vib.get.Invoke()

$List | where Name -Match 'bnx' | select name

Name
----
bnxtnet
bnxtroce

But I can see them IsEnable=False  and IsLoaded=False

$esxiCLI.system.module.list.Invoke() | sort Name | where name -Match 'bnx2'

IsEnabled IsLoaded Name
--------- -------- ----
true true qfle3
true true qfle3f
false false bnx2
false false bnx2fc
false false bnx2i
false false bnx2x

 

I want to remove them form list.

 

 

 

Reply
0 Kudos
LucD
Leadership
Leadership

That is what I asked earlier.
And you answered "... from the ESXi node" 


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

Tags (1)
Reply
0 Kudos
ehsanijavad
Enthusiast
Enthusiast

Hi LucD.

please let me know how can I remove them form List.

Thanks in advance.

Reply
0 Kudos
LucD
Leadership
Leadership

Did you reboot the ESXi node after you removed the VIBs?


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

Reply
0 Kudos
ehsanijavad
Enthusiast
Enthusiast

Yes, two times.

Reply
0 Kudos
LucD
Leadership
Leadership

Did you do the software vib remove with the parameters force and noliveinstall set to $true?


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

Reply
0 Kudos
ehsanijavad
Enthusiast
Enthusiast

Hi LucD

my script:

$h = Get-VMHost $vmHost*

if($h.Version -eq "6.5.0"){

$ServerState = $h.ConnectionState

if($ServerState -eq "Maintenance"){

$esxcli = $null
$esxcli = $h | Get-EsxCli -V2
$targetargs = $null
$targetargs2 = $null
$targetargs = $esxcli.system.module.set.CreateArgs()
$targetargs2 = $esxcli.software.vib.remove.CreateArgs()
$drivercheck = $null
$drivercheck = $esxcli.network.nic.list.Invoke() | ?{ ($_.Driver -like "bnx2x”)}

if($drivercheck -ne $null) {

Write-Host "Running on" $h.Name

$targetargs.enabled = $true
$targetargs.module = "qflge"
$esxcli.system.module.set.Invoke($targetargs)
$targetargs.module = "qfle3"
$esxcli.system.module.set.Invoke($targetargs)

$targetargs.enabled = $false
$targetargs.module = "bnx2"
$esxcli.system.module.set.Invoke($targetargs)
$targetargs.module = "bnx2i"
$esxcli.system.module.set.Invoke($targetargs)
$targetargs.module = "bnx2x"
$esxcli.system.module.set.Invoke($targetargs)
$targetargs.module = "bnx2fc"
$esxcli.system.module.set.Invoke($targetargs)

$targetargs2.maintenancemode = $true
$targetargs2.noliveinstall = $true
$targetargs2.vibname = "net-bnx2"
$esxcli.software.vib.remove.Invoke($targetargs2)
$targetargs2.vibname = "net-bnx2x"
$esxcli.software.vib.remove.Invoke($targetargs2)
$targetargs2.vibname = "scsi-bnx2fc"
$esxcli.software.vib.remove.Invoke($targetargs2)
$targetargs2.vibname = "scsi-bnx2i"
$esxcli.software.vib.remove.Invoke($targetargs2)

}
}
}

Yes, I have tried, same result.

ehsanijavad_0-1622205062372.png

 

Reply
0 Kudos
LucD
Leadership
Leadership

I don't see where you used the force parameter.


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

Reply
0 Kudos
ehsanijavad
Enthusiast
Enthusiast

Hi LucD

I could not find any parameter for force.

 

Regards

Jawad

Reply
0 Kudos
LucD
Leadership
Leadership

force.png


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