Skip to content

Instantly share code, notes, and snippets.

@gowatana
Last active November 1, 2021 17:38
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/ef58613e800a1e07808b7ded94698168 to your computer and use it in GitHub Desktop.
Save gowatana/ef58613e800a1e07808b7ded94698168 to your computer and use it in GitHub Desktop.
$ova_file = "C:\work\nsx-unified-appliance-3.1.2.0.0.17884005-le.ova"
$ovf_config = Get-OvfConfiguration -Ovf $ova_file
# DeploymentOption
$ovf_config.DeploymentOption.Value = "small"
# NetworkMapping
$ovf_config.NetworkMapping.Network_1.Value = "dvpg-0010-mgmt"
# 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-21"
$ovf_config.Common.nsx_ip_0.Value ="192.168.10.25"
$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
Import-VApp -Name "lab-nsx-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
Get-VM "lab-nsx-21" | Get-VMResourceConfiguration | Set-VMResourceConfiguration -MemReservationGB 0 -CpuReservationMhz 0
Get-VM "lab-nsx-21" | Get-AdvancedSetting -Name snapshot.maxSnapshots | Set-AdvancedSetting -Value 5 -Confirm:$false
Get-VM "lab-nsx-21" | Start-VM
@gowatana
Copy link
Author

下記の投稿むけ。
NSX-T Manager を PowerCLI でデプロイしてみる。
https://vm.gowatana.jp/entry/2021/10/31/233420

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