Last active
June 11, 2018 14:56
-
-
Save gowatana/b62a77772fedbe01d56aa75371572d34 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@' | |
# Usage: | |
# PowerNSX> .\migrate_hol_nw.ps1 <ESG_IF_NAME> | |
$if_name = $args[0] | |
$tz = Get-NsxTransportZone -Name "RegionA0-Global-TZ" | |
$src_esg = Get-NsxEdge -Name "Perimeter-Gateway-01" | |
$dst_dlr = Get-NsxLogicalRouter -Name "Distributed-Router-01" | |
# Disconnect from ESG | |
$if = $src_esg | Get-NsxEdgeInterface -Name $if_name | |
$if_ip = $if.addressGroups.addressGroup.primaryAddress | |
$if_prefix = $if.addressGroups.addressGroup.subnetPrefixLength | |
$if_pg_name = $if.portgroupName | |
$if | Clear-NsxEdgeInterface -Confirm:$false | |
$if_pg = Get-NsxLogicalSwitch -TransportZone $tz -Name $if_pg_name | |
# Disconnect to DLR | |
$dlr_if = $dst_dlr | New-NsxLogicalRouterInterface -Name $if_name -Type internal -ConnectedTo $if_pg -PrimaryAddress $if_ip -SubnetPrefixLength $if_prefix | |
$dst_dlr | Get-NsxLogicalRouterInterface -Name $if_name | %{ | |
$ip = $_.addressGroups.addressGroup | |
$_ | select ` | |
Index, | |
type, | |
name, | |
connectedToName, | |
@{N="primaryAddress";E={$ip.primaryAddress}}, | |
@{N="Prefix";E={$ip.subnetPrefixLength}} | |
} | |
'@ | Out-File .\migrate_hol_nw.ps1 |
下記の投稿むけ。
NSX の HoL シナリオを PowerNSX でためす。Part.6
https://communities.vmware.com/people/gowatana/blog/2018/06/11/hol1803-powernsx-6
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HOL-1803-01-NET - VMware NSX - Getting Started
http://labs.hol.vmware.com/HOL/catalogs/lab/3661
P.224 むけ。