< Back

New-NsxController

Sat Jan 18, 2020 9:14 pm

NAME New-NsxController



SYNOPSIS

Deploys a new NSX Controller.





SYNTAX

New-NsxController [-ControllerName <String>] [-Confirm] -IpPool <XmlElement> -ResourcePool <ResourcePoolInterop>

-Datastore <DatastoreInterop> -PortGroup <Object> [-Password <String>] [-Wait] [-WaitTimeout <Int32>] [-Connection

<PSObject>] [<CommonParameters>]



New-NsxController [-ControllerName <String>] [-Confirm] -IpPool <XmlElement> -Cluster <ClusterInterop> -Datastore

<DatastoreInterop> -PortGroup <Object> [-Password <String>] [-Wait] [-WaitTimeout <Int32>] [-Connection

<PSObject>] [<CommonParameters>]





DESCRIPTION

An NSX Controller is a member of the NSX Controller Cluster, and forms the

highly available distributed control plane for NSX Logical Switching and NSX

Logical Routing.



The New-NsxController cmdlet deploys a new NSX Controller.





PARAMETERS

-ControllerName <String>

Controller Name. Will be autogenerated in form of ControllerN if not provided.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompt for confirmation. Specify as -confirm:$false to disable confirmation prompt



Required? false

Position? named

Default value True

Accept pipeline input? false

Accept wildcard characters? false



-IpPool <XmlElement>

Pre Created IP Pool object from which controller IP will be allocated



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ResourcePool <ResourcePoolInterop>

vSphere DRS Resource Pool into which to deploy Controller VM



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Cluster <ClusterInterop>

vSphere Cluster into which to deploy the Controller VM



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Datastore <DatastoreInterop>

vSphere Datastore into which to deploy the Controller VM



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-PortGroup <Object>

vSphere DVPortGroup OR NSX Logical Switch object to connect the Controller VM to



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Password <String>

Controller Password (Must be same on all controllers)



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Wait [<SwitchParameter>]

Block until Controller deployment job is 'COMPLETED' (Will timeout with prompt after -WaitTimeout seconds)

Useful if automating the deployment of multiple controllers (first must be running before deploying second

controller)

so you dont have to write looping code to check status of controller before continuing.

NOTE: Not waiting means we do NOT return a controller object!



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-WaitTimeout <Int32>

Timeout waiting for controller to become 'RUNNING' before user is prompted to continue or cancel. Defaults to

800 seconds to exceed the normal NSX rollback timeout of 720 seconds.



Required? false

Position? named

Default value 800

Accept pipeline input? false

Accept wildcard characters? false



-Connection <PSObject>

PowerNSX Connection object



Required? false

Position? named

Default value $defaultNSXConnection

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>$ippool = New-NsxIpPool -Name ControllerPool -Gateway 192.168.0.1 -SubnetPrefixLength 24 -StartAddress

192.168.0.10 -endaddress 192.168.0.20



C:\\PS> $ControllerCluster = Get-Cluster vSphereCluster

C:\\PS> $ControllerDatastore = Get-Datastore $ControllerDatastoreName -server $Connection.VIConnection

C:\\PS> $ControllerPortGroup = Get-VDPortGroup $ControllerPortGroupName -server $Connection.VIConnection

C:\\PS> New-NsxController -ipPool $ippool -cluster $ControllerCluster -datastore $ControllerDatastore -PortGroup

$ControllerPortGroup -password "VMware1!VMware1!"



Creates a new controller. Because it is the first controller, a password must be specified.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>New-NsxController -ControllerName "MyController" -ipPool $ippool -cluster $ControllerCluster -datastore

$ControllerDatastore -PortGroup $ControllerPortGroup -password "VMware1!VMware1!" -confirm:$false



Creates a new controller with the specified name and without prompting for confirmation.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>New-NsxController -ipPool $ippool -cluster $ControllerCluster -datastore $ControllerDatastore -PortGroup

$ControllerPortGroup



A secondary or tertiary controller requires a Password to NOT be defined.











RELATED LINKS