Automation

 View Only
  • 1.  Running ESXI Patch from CD using Powershell

    Posted Sep 09, 2010 08:31 AM

    Hi

    I need to run an update file from a CD (that is in the drive of the ESXi server) on an ESXi server using powershell.

    Does anyone know the command for this please?

    Thanks in advance



  • 2.  RE: Running ESXI Patch from CD using Powershell

    Broadcom Employee
    Posted Sep 09, 2010 09:06 AM

    Hi,

    Your update is .vib file or batch(metadata.zip) file, right?

    I believe you're looking for the Install-VMHostPatch cmdlet. Note that it supports providing update from local file system, host file system(I believe cd too), web path(http).

    Regards,

    Nedko Nedev

    PowerCLI Development Team



  • 3.  RE: Running ESXI Patch from CD using Powershell

    Posted Sep 09, 2010 09:39 AM

    That's what I thought as well.

    But how do you get the CD mounted in ESXi ?

    ____________

    Blog: LucD notes

    Twitter: lucd22



  • 4.  RE: Running ESXI Patch from CD using Powershell

    Posted Sep 09, 2010 11:30 AM

    Hi

    I have now gotten to the point where I am running it locally.

    I have used the following command line

    C:\> Install-VMHostPatch -vmhost xxxxxx-LocalPath c:

    \ESXi400-200912001\metadata.zip -Hostusername xxxxx -HostPassword xxxxxx

    But am being told the following

    Install-VMHostPatch : 09/09/2010 10:29:38 Install-VMHostPatch The hos

    t must be in the following state: Maintenance.

    How do I change the host to maintenance mode and if I do this will it stop my virtual machines from running?

    Sorry for all the questions but I am totally new to this.

    Thanks again



  • 5.  RE: Running ESXI Patch from CD using Powershell

    Posted Sep 09, 2010 11:37 AM

    You can set a host in Maintenance Mode with:

    Set-VMHost -VMHost Host -State "Maintenance"
    

    If you are using DRS in your cluster all the virtual machines might be moved to other hosts in your cluster, depending on your cluster's DRS settings. If you are not using DRS you will have to move all the virtual machines to other host yourself. Or you will have to shutdown all the virtual machines before the host can be put in Maintenance Mode.

    Regards, Robert



  • 6.  RE: Running ESXI Patch from CD using Powershell

    Broadcom Employee
    Posted Sep 09, 2010 11:38 AM

    You should run

    Set-VMHost -State Maintenance -VMHost $vmhost

    line to get your host in maintenance mode. The host will wait untill you power off(manually) all of its VM and then will change its state to "Maintenance".

    You can power off the virtual machines with the following line:

    Get-VM -Location $vmhost | Stop-VM

    I hope this answers your question.

    Regards,

    Nedko Nedev

    PowerCLI Development Team



  • 7.  RE: Running ESXI Patch from CD using Powershell

    Posted Sep 09, 2010 11:39 AM

    Your guest will have to be powered off or migrated away from the host you're going to patch.

    You can set a host to maintenance mode like this

    Get-VMHost -Name <hostname> | Set-VMHost -State Maintenance -Confirm:$false
    

    ____________

    Blog: LucD notes

    Twitter: lucd22