VMware Cloud Community
kilbride98
Contributor
Contributor

Running ESXI Patch from CD using Powershell

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

Tags (2)
Reply
0 Kudos
6 Replies
nnedev
VMware Employee
VMware Employee

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

Regards, Nedko Nedev PowerCLI Development Team
Reply
0 Kudos
LucD
Leadership
Leadership

That's what I thought as well.

But how do you get the CD mounted in ESXi ?

____________

Blog: LucD notes

Twitter: lucd22


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

Reply
0 Kudos
kilbride98
Contributor
Contributor

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

Reply
0 Kudos
RvdNieuwendijk
Leadership
Leadership

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

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
Reply
0 Kudos
nnedev
VMware Employee
VMware Employee

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

Regards, Nedko Nedev PowerCLI Development Team
Reply
0 Kudos
LucD
Leadership
Leadership

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


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

Reply
0 Kudos