Skip to content

Instantly share code, notes, and snippets.

@gowatana
Created November 6, 2021 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gowatana/4bdf805cb32b4ffe748562973432e1c4 to your computer and use it in GitHub Desktop.
Save gowatana/4bdf805cb32b4ffe748562973432e1c4 to your computer and use it in GitHub Desktop.
$ova_file = "C:\work\nsx-edge-3.1.2.0.0.17884008-le.ova"
$nsx_manager_thumbprint = "XXXXXXXXXXXXXXXXXXXXXXXXXXX"
$ovf_config = Get-OvfConfiguration -Ovf $ova_file
# DeploymentOption
$ovf_config.DeploymentOption.Value = "small"
# NetworkMapping
$ovf_config.NetworkMapping.Network_0.Value = "dvpg-0010-mgmt"
$ovf_config.NetworkMapping.Network_1.Value = "dvpg-nested-trunk"
$ovf_config.NetworkMapping.Network_2.Value = "dvpg-nested-trunk"
$ovf_config.NetworkMapping.Network_3.Value = "dvpg-nested-trunk"
# Application
$ovf_config.Common.nsx_cli_passwd_0.Value = "VMware1!VMware1!"
$ovf_config.Common.nsx_passwd_0.Value = "VMware1!VMware1!"
# Network properties
$ovf_config.Common.nsx_hostname.Value = "lab-nsx-edge-21"
$ovf_config.Common.nsx_ip_0.Value ="192.168.10.26"
$ovf_config.Common.nsx_netmask_0.Value ="255.255.255.0"
$ovf_config.Common.nsx_gateway_0.Value ="192.168.10.1"
# DNS
$ovf_config.Common.nsx_dns1_0.Value ="192.168.1.101 192.168.1.102"
$ovf_config.Common.nsx_domain_0.Value = "go-lab.jp"
# Services Configuration
$ovf_config.Common.nsx_ntp_0.Value = "192.168.1.101 192.168.1.102"
$ovf_config.Common.nsx_isSSHEnabled.Value = $true
$ovf_config.Common.nsx_allowSSHRootLogin.Value = $true
# NSX Manager
$ovf_config.Common.mpIp.Value = "192.168.10.25"
$ovf_config.Common.mpUser.Value = "admin"
$ovf_config.Common.mpPassword.Value = "VMware1!VMware1!"
$ovf_config.Common.mpThumbprint.Value = $nsx_manager_thumbprint
Import-VApp -Name "lab-nsx-edge-21" `
-OvfConfiguration $ovf_config -Source $ovf_config.Source `
-InventoryLocation (Get-Folder -Type VM "vm_lab-vc-02") `
-Location (Get-Cluster "infra-cluster-01" | Get-ResourcePool "rp-03-lab") `
-VMHost (Get-Cluster "infra-cluster-01" | Get-VMHost | Get-Random) `
-Datastore "vsanDatastore" -StorageFormat Thin
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.MemoryReservationLockedToMax = $false
$vm = Get-VM "lab-nsx-edge-21" | Get-View
$vm.ReconfigVM($spec)
Get-VM "lab-nsx-edge-21" | Get-VMResourceConfiguration | Set-VMResourceConfiguration -MemReservationGB 0 -CpuReservationMhz 0
Get-VM "lab-nsx-edge-21" | Start-VM
@gowatana
Copy link
Author

gowatana commented Nov 7, 2021

下記の投稿むけ。

NSX-T Edge を PowerCLI でデプロイしてみる。
https://vm.gowatana.jp/entry/2021/11/06/235731

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment