为了得到工作的VMotion的网络设置起着重要的作用,下列任何一种可能会导致你的大问题:
- A spelling mistake in a PortGroup name
- A missing PortGroup
- A PortGroup configured incorrectly
- A non-existing PortGroup on one of your hosts
- etc
这就是为什么自动化和PowerCLI的关键是你的vSwitch和端口组的的设置, 你可以手动添加每个vSwitch,然后创建一个端口组为每个VLAN有中继到您的主机上手动但什么是你会错过一个机会,什么是的机会,你会得到的VLAN ID不正确?而你肯定不觉得无聊的精灵,当你有4 vSwitch和大约20端口组!
The following code will take you through copying all vSwitches and PortGroups from an existing ESX server over to a new server, ensuring they are exactly the same. It sure does save me time !
$VISRV = Connect-VIServer (Read-Host "Please enter the name of your VI SERVER") $BASEHost = Get-VMHost -Name (Read-Host "Please enter the name of your existing server as seen in the VI Client:") $NEWHost = Get-VMHost -Name (Read-Host "Please enter the name of the server to configure as seen in the VI Client:") $BASEHost |Get-VirtualSwitch |Foreach { If (($NEWHost |Get-VirtualSwitch -Name $_.Name-ErrorAction SilentlyContinue)-eq $null){ Write-Host "Creating Virtual Switch $($_.Name)" $NewSwitch = $NEWHost |New-VirtualSwitch -Name $_.Name-NumPorts $_.NumPorts-Mtu $_.Mtu $vSwitch = $_ } $_ |Get-VirtualPortGroup |Foreach { If (($NEWHost |Get-VirtualPortGroup -Name $_.Name-ErrorAction SilentlyContinue)-eq $null){ Write-Host "Creating Portgroup $($_.Name)" $NewPortGroup = $NEWHost |Get-VirtualSwitch -Name $vSwitch |New-VirtualPortGroup -Name $_.Name-VLanId $_.VLanID } } }