1 2 Previous Next 16 Replies Latest reply on Apr 23, 2015 2:02 PM by workingengg

    remove software vib via connecting vcenter

    workingengg Novice

      instated of connecting to ESXi Host directly. is any way to remove the software vib on a esxi ... remove software vib via connecting vcenter

      when we have to remove a vib from more than 100+ esxi host .. We have to connect all server servers to remove the module? it too loaded. Is there any way that we can connect to vCenter using powercli and then read the esxcli of the host. and remove the vib

      i tried below no luck

      PS C:\Users\Administrator> $esxcli = Get-VMHost | Get-EsxCli

      PS C:\Users\Administrator> $hpams=$esxcli.software.vib.list() | Where { $_.Name -like “*scsi-megaraid-sas*”}

      PS C:\Users\Administrator> $hpams | ForEach { $esxcli.software.vib.remove($false, $false, $false, $false, $_.Name)}

      Missing required parameter –vibname

      At line:1 char:47

      + $hpams | ForEach { $esxcli.software.vib.remove <<< $hpams

      AcceptanceLevel : VMwareCertified

      ID : VMware_bootbank_scsi-megaraid-sas_4.32-1vmw.500.0.0.469512

      InstallDate : 2015-01-11

      Name : scsi-megaraid-sas

      ReleaseDate : 2011-08-19

      Status :

      Vendor : VMware

      Version : 4.32-1vmw.500.0.0.469512


      same commands i am able to remove if i am connected individual esxi host using root id ( Connect-VIServer <esxi ip> ) … But when i connected with vcenter using administrator (Connect-VIServer vcenter ip ) it not working getting above error message .. .


      i tried with $hpams | ForEach { $esxcli.software.vib.remove($null, $false, $false, $false, $_.Name)} also no luck ...


      and me if you have any fix for this ...

        • 1. Re: remove software vib via connecting vcenter
          LucD Guru
          Community WarriorsUser ModeratorsvExpert

          You can use the Get-EsxCli cmdlet, and then the remove method.

          remove.png

          Something like this

           

          $esxcli.software.vib.remove($false, $true, $false, $true, $vibName)

           

          The last parameter is the VIB name, you can get those with

           

          $esxcli.software.vib.list() | Select Name

           

           

           

          Building on your trial, did you already try like this ?

           

          Get-VMHost | %{

              $esxcli = Get-EsxCli -VMHost $_

              $esxcli.software.vib.list() | Where { $_.Name -like “*scsi-megaraid-sas*”} | %{

                  $esxcli.software.vib.remove($false, $false, $false, $true, $_.Name)

              }

          }

           

          • 2. Re: remove software vib via connecting vcenter
            workingengg Novice

            i tried same issue

             

            PS C:\Users\Administrator\Desktop> $esxcli.software.vib.remove($false, $true, $false, $true, $scsi-megaraid-sas)

            You must provide a value expression on the right-hand side of the '-' operator.

            At line:1 char:65

            + $esxcli.software.vib.remove($false, $true, $false, $true, $scsi- <<<< megaraid-sas)

                + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException

                + FullyQualifiedErrorId : ExpectedValueExpression

            hpams issue.jpg

             

            about

             

            Get-VMHost | %{

                $esxcli = Get-EsxCli -VMHost $_

                $esxcli.software.vib.list() | Where { $_.Name -like “*scsi-megaraid-sas*”} | %{

                    $esxcli.software.vib.remove($false, $false, $false, $true, $_.Name)

                }

            }


            hpams issue1.jpg

            • 3. Re: remove software vib via connecting vcenter
              LucD Guru
              User ModeratorsCommunity WarriorsvExpert

              In your code that last parameter on the method should be $_.Name in my opinion.

               

              For the code I provided, can you check that the following actually returns an object that has the Name property ?

              $esxcli.software.vib.list() | Where { $_.Name -like “*scsi-megaraid-sas*”}

              • 4. Re: remove software vib via connecting vcenter
                workingengg Novice

                I already tried with the $_.Name same issue .. when i run the same commend connecting individual esxi host .. its working $esxcli.software.vib.remove($null, $true, $false, $true, $_.Name)

                 

                but when i connect vcenter and ran facing the issue ....

                 

                below is out of $esxcli.software.vib.list() | Where { $_.Name -like "*scsi-megaraid-sas*"}


                PS C:\Users\Administrator> $esxcli = Get-VMHost | Get-EsxCli

                PS C:\Users\Administrator> $esxcli.software.vib.list() | Where { $_.Name -like "*scsi-megaraid-sas*"}

                 

                 

                AcceptanceLevel : VMwareCertified

                ID              : VMware_bootbank_scsi-megaraid-sas_4.32-1vmw.500.0.0.469512

                InstallDate     : 2015-01-11

                Name            : scsi-megaraid-sas

                ReleaseDate     : 2011-08-19

                Status          :

                Vendor          : VMware

                Version         : 4.32-1vmw.500.0.0.469512

                • 5. Re: remove software vib via connecting vcenter
                  LucD Guru
                  User ModeratorsvExpertCommunity Warriors

                  It could be a limitation for the software.vib namespace and the remove method, that you need in fact to be connected to the ESXi node.

                  Not sure about that, and can't find any documentation on that.

                   

                  Just a wild guess, did you already try setting the 2nd parameter (Force) to $true on the remove method ?

                  • 6. Re: remove software vib via connecting vcenter
                    workingengg Novice

                    i already tried $null

                    2nd parameter as $true also ... no luck ...

                     

                    thinking to automate how to remove a software vib from 100+ esxi .. logging each and every server is too loaded .. so thinking alternate .. 

                     

                    PS C:\Users\Administrator> $hpams |  ForEach { $esxcli.software.vib.remove($null, $true, $false, $true, $_.Name)}

                     

                    Missing required parameter --vibname

                    At line:1 char:48

                    + $hpams |  ForEach { $esxcli.software.vib.remove <<<< ($null, $true, $false, $true, $_.Name)}

                        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException

                        + FullyQualifiedErrorId : MethodInvocationException

                     

                     

                     

                    PS C:\Users\Administrator> $hpams |  ForEach { $esxcli.software.vib.remove($false, $true, $false, $true, $_.Name)}

                     

                    Missing required parameter --vibname

                    At line:1 char:48

                    + $hpams |  ForEach { $esxcli.software.vib.remove <<<< ($false, $true, $false, $true, $_.Name)}

                        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException

                        + FullyQualifiedErrorId : MethodInvocationException

                     

                     

                     

                    PS C:\Users\Administrator> $hpams |  ForEach { $esxcli.software.vib.remove($null, $true, $false, $true, $_.Name)}

                     

                    Missing required parameter --vibname

                    At line:1 char:48

                    + $hpams |  ForEach { $esxcli.software.vib.remove <<<< ($null, $true, $false, $true, $_.Name)}

                        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException

                        + FullyQualifiedErrorId : MethodInvocationException

                    • 7. Re: remove software vib via connecting vcenter
                      LucD Guru
                      User ModeratorsCommunity WarriorsvExpert

                      Can you try like this ?

                       

                      Get-VMHost | %{

                          $esxcli = Get-EsxCli -VMHost $_

                          $esxcli.software.vib.list() | Where { $_.Name -like “*scsi-megaraid-sas*”} | %{

                              $esxcli.software.vib.remove($false, $false, $false, $true, @($_.Name))

                          }

                      }

                       

                      • 8. Re: remove software vib via connecting vcenter
                        workingengg Novice

                        No luck ... LucD...

                         

                        luc.jpg

                        • 9. Re: remove software vib via connecting vcenter
                          LucD Guru
                          vExpertCommunity WarriorsUser Moderators

                          One more variation, $null for the first parameter

                           

                          Get-VMHost | %{

                              $esxcli = Get-EsxCli -VMHost $_

                              $esxcli.software.vib.list() | Where { $_.Name -like “*scsi-megaraid-sas*”} | %{

                                  $esxcli.software.vib.remove($null, $false, $false, $true, @($_.Name))

                              }

                          }

                           

                          • 10. Re: remove software vib via connecting vcenter
                            workingengg Novice

                            i already tried with $null ... same issue .

                             

                            nullluc.jpg

                            • 11. Re: remove software vib via connecting vcenter
                              LucD Guru
                              User ModeratorsvExpertCommunity Warriors

                              I'm out of ideas for now I'm afraid.

                              I'll have to do some experimenting in my lab this evening.

                              • 12. Re: remove software vib via connecting vcenter
                                workingengg Novice

                                Hmmmm.. do post me if you find my fix on you lab experimenting .. meanwhile i will do from my end ... let see ..

                                 

                                LucD :- Thanks for your prompt reply

                                • 13. Re: remove software vib via connecting vcenter
                                  LucD Guru
                                  vExpertCommunity WarriorsUser Moderators

                                  Been playing with this on a test ESXi node in my lab, and for me this seems to work (while connected to the vCenter).

                                  In fact, I wasn't able to reproduce the issue you are seeing.

                                  vib-remove.png

                                  I have no idea at this time why you're seeing the error.

                                   

                                  Do you have another box where you could install PowerCLI, and try from there ?

                                  • 14. Re: remove software vib via connecting vcenter
                                    workingengg Novice

                                    are you using same command $esxcli = Get-VMHost | Get-EsxCli   


                                    to get the esxcli right ?

                                    1 2 Previous Next