Hi,
We have ESXi 3.5 server in which we have windows and Linux VMs hosted.
Is it possible to update the VMtools of Windows VMs through any script?
In our VC server we have VI toolkit 1.0 installed
Well if thats the case then its as simple as the below:
Connect-viserver "MyVIServer"
Get-VMHost "myhost.mydomain.com" | get-vm | Update-Tools
If you found this information useful, please consider awarding points for Correct or Helpful.
Alan Renouf
Have you read this previous post ?
http://communities.vmware.com/thread/151936
Hi,
Thanks.. I had missed to see that post.
I think, below script will upgrade all the VMs in the VC
Get-VIServer -Server <VC server>
$ToolsCurrent = <target Tools version>
Get-Content target-vms.txt | %{Get-VM -Name $_} | %{$vm = $_; Get-View $_.ID} | `
%{if($_.config.tools.toolsVersion -eq 0 -or $_.config.tools.toolsVersion -lt $ToolsCurrent) {Update-Tools -VM $vm} }
Can we install only few VMs at a time?
In our environment we have around 20 ESXi 3.5 server in which there are around 450VMs hosted. We guess it is worth doing one by one ESXi host as we cant get downtime of all VMs at a time.
Is it possible to modify above script (or write some new) to meet my requirement?
That code reads the entries from a text file and updates only those vms, to do a host at a time you should be able to do:
Get-VIServer -Server <VC server>
$ToolsCurrent = <target Tools version>
$ESXHost = "Host1.mydomain.com"
Get-VMHost -Name $ESXHost | %{Get-VM | %{$vm = $_; Get-View $_.ID} | `
%{if($_.config.tools.toolsVersion -eq 0 -or $_.config.tools.toolsVersion -lt $ToolsCurrent) {Update-Tools -VM $vm} }
If you found this information useful, please consider awarding points for Correct or Helpful.
Alan Renouf
VMware, Citrix, Microsoft Consultant
UK
Sorry for awakardness
Do we really need give the current version of the VMtools? In my case all the VMs has old VMtools as we have updated ESXi with BUILD158869 recently.
ToolsCurrent = <target Tools version>
Can we avoid this and update all the VMs hosted in the ESXi host? (since all the VMs tool status or old)
If I really need to give the current status, how to know the current version? (Before updating ESXi host, Earlier OS BUILD was 130755)
Well if thats the case then its as simple as the below:
Connect-viserver "MyVIServer"
Get-VMHost "myhost.mydomain.com" | get-vm | Update-Tools
If you found this information useful, please consider awarding points for Correct or Helpful.
Alan Renouf
Ok. This is what I was looking for.
One final question? how to see the current version of VMtools?
Connect-viserver"MyVIServer"
Get-VMHost "MyHost.mydomain.com" | Get-VM | Get-View | Select Name, @{N="ToolsVersion";E={$_.Config.Tools.ToolsVersion}}
or for all vms on all hosts:
Get-VM | Get-View | Select Name, @{N="ToolsVersion";E={$_.Config.Tools.ToolsVersion}}
If you found this information useful, please consider awarding points for Correct or Helpful.
Alan Renouf
Any way of modifying the script to tell windows not to reboot after the install so we can reboot at a later date?