Archive

Archive for August, 2009

Maximum vSwitches in vSphere

August 24th, 2009 Eric No comments

There appears to be a discrepancy in the VMware documentation regarding the maximum number of vSwitches. The Configuration Maximums document states that the limit is 248. The configuration guide lists the maximum as 127 which is what it was in 3.5. I am not sure if I misunderstand what they mean by “Standard switches per host 248″. If you see the error of my ways let me know.

Here is some code that I used to see how many vSwitches I could put on a host. This will create 126 vSwitches, each with 8 usable ports, (I am assuming that vSwitch0 is already configured. Any attempts to add another one fail.

$vmhost = Get-VMhost <mytestHost>.local
1..126 | % {New-VirtualSwitch -VMHost $vmhost -Name vSwitch$_ -NumPorts 16}
Categories: Scripting, System Administration, VMware Tags:

Configure NTP on Multiple Hosts Using PowerShell

August 11th, 2009 Eric No comments

A handy script to correct NTP settings on multiple hosts.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#Usage: Get-VMHost | .\ConfigureNtpServer.ps1
 
BEGIN
{
    $ntpServers = @("ntpserver01","ntpserver02")
 
    $hostDateTimeConfig = New-Object Vmware.Vim.HostDateTimeConfig 
    $hostNtpConfig = New-Object VMware.Vim.HostNtpConfig 
    $hostDateTimeConfig.ntpConfig = $hostNtpConfig 
    $hostDateTimeConfig.ntpConfig.server = $ntpServers
}
 
 
PROCESS
{
    $vmHost = $_
    $vmHostView = Get-View $vmHost.ID
    $dateTimeSystem =  $vmHostView.ConfigManager.DateTimeSystem 
    $DateTimeSystemRef = Get-View  $dateTimeSystem
    $DateTimeSystemRef.updateDateTimeConfig($hostDateTimeConfig)
}
Categories: Scripting, VMware Tags:

Switch to our mobile site