
Centralized management
A robust and reliable implementation of the NSX building blocks starts with a meticulous design and proceeds with a careful deployment based on a solid comprehension of prerequisites to fulfill and best practices to follow.
This Part 2 of the Exploring NSX Building Blocks module delves into NSX’s architecture and examines the Management Plane and Control Plane that converge into an NSX Manager virtual appliance.
NSX Manager is the application that we use to administer our NSX environment. In a production environment, for fault tolerance, we deploy a cluster of three NSX Manager nodes.
Understanding the NSX building blocks such as its planes, the related components, and their deployment, is crucial for implementing and configuring NSX effectively.
In this module, we’re going to cover the following main topics:
- Part 1:
- Part 2:
- Part 3:
- Part 4:
- Part 5:
- Part 6:
By the end of this second part of the module, you will learn about the role of the NSX Management Cluster and how to deploy it by leveraging any of the available methods.
Management Plane and Control Plane
The Management Plane acts as the entry point to the NSX API and provides the HTML5 UI, backed by the open-source Clarity library (https://clarity.design). The library was created years ago by VMware to provide a consistent user experience across all their product line.
The Management Plane is the centralized network management component responsible for processing and maintaining user configurations. For this purpose, the API server fulfills all users’ create, read, update, and delete (CRUD) requests implemented as REST calls. Configurations are stored in the distributed shared log data store CorfuDB developed by the VMware Research Group. This user intent is then pushed to the Control Plane to become a realized configuration in the Data Plane.
The Control Plane is functionally divided into two separate parts:
- A Central Control Plane (CCP) that runs centralized in a three-node cluster for high availability.
- A Local Control Plane (LCP) that runs distributed on each Transport Node.
The Central Control Plane computes the ephemeral runtime state based on the configuration received from the Management Plane. It is also responsible for disseminating topology updates reported by the Data Plane through the Local Control Plane agent. The agent is also known as nsx-proxy or tn-proxy (where tn stands for transport node).
The Local Control Plane is responsible for programming the forwarding engines and the firewall rules on the Data Plane with the stateless configuration it receives from the Central Control Plane. It also reports back local topology updates to be disseminated.
NSX Management Cluster Nodes
Prior to version 2.4, the Management Plane and the Control Plane ran in separate appliances. One management appliance and three controller appliances followed the same approach already seen in NSX Data Center for vSphere. With version 2.4, both Management and Control planes’ components begun running co-located in a unique three-node cluster. As a result, this improves scalability and redundancy of the planes and reduces the total amount of resources being consumed.
The NSX Management Cluster relies on a majority-based quorum and can survive a single node failure. A second node failure, though, will make the Management Cluster lose all its functions and become inaccessible. Nevertheless, all user workloads will keep running unaffected in the Data Plane, using the last known good realized state.
To further enhance resiliency, NSX Manager virtual appliances should run on a vSphere cluster, protected by vSphere High Availability (HA). That being the case, NSX Management Cluster Nodes can benefit from automatic restart in case of failure (appliance or host). Nodes can be spread across separate hypervisors by either manual selection or vSphere Distributed Resource Scheduler (DRS) anti-affinity rules.
Having all components running side-by-side within one virtual appliance, it is possible to deploy just a single node. This configuration is typically supported for non-production deployments like test, proof-of-concept, demo, or lab environments. Additionally, starting with version 3.1.1, VMware supports single-node Management Cluster deployments in small production environments. Being a single-point-of-failure, though, the time required to regain full CRUD capabilities is considerably longer. A single node exclusively relies on vSphere HA or a restore from a backup to recover after a failure.
Implementing the NSX Management cluster typically implies deploying, validating and initially configuring three NSX Manager appliances as a stepped process. That said, the deployment task can be performed either via an automated or a manual workflow.
Deployment workflows
The process always begins by deploying the first NSX Management Cluster Node, which also instantiates the cluster. Once done, the workflow continues by deploying the additional second and third nodes and joining them to the cluster.
NSX IN VMWARE CLOUD FOUNDATION
VMware Cloud Foundation (VCF) provides a full-stack, private cloud platform that integrates VMware’s leading products into a single solution. These include vSphere (compute), vSAN (storage), NSX (networking), and Aria Suite (management and automation) products.
VCF enables us to deploy its components via an entirely orchestrated workflow. Being that the initial bring-up via the Cloud Builder, or an additional Workload Domain deployed from the SDDC Manager. The objective is to offload the administrative overhead and ensure the deployment is completed successfully according to VMware’s best practices.
Broadcom‘s acquisition of VMware – back in November 22nd, 2023 – has led to significant changes in VMware’s product offerings. As a result, several products have been consolidated into bundles like VMware Cloud Foundation (VCF) and VMware vSphere Foundation (VVF). Since then, NSX is no more available as an independent product.
Nevertheless, understanding the NSX deployment workflow is key to master the recovery procedure in case of a catastrophic failure.
Deploy the first NSX Manager to a standalone ESXi host or a vSphere Cluster using one of the following methods:
- Using the vSphere Client UI (preferred).
- Via a CLI using either the OVF Tool utility or PowerCLI.
Manual deployment using the vSphere Client UI
The simplest and preferred way to deploy an NSX Manager virtual appliance is using the Deploy OVF Template workflow. This vSphere Client wizard enables us to:
- Provide the URL of the source Open Virtualization Appliance (OVA) file for a direct download from an online repository. Alternatively, select the OVA file we have previously downloaded.
- Enter a name for the NSX Manager appliance in the vCenter Server inventory. Select a folder from the VMs and Templates view where to place the appliance.
- Select or confirm a compute resource (vSphere Cluster, Resource Pool or ESXi host) to run the NSX Manager appliance.
- Check the template details.
- Select the appliance sizing, helped by a description of which use case each form factor supports.
- Choose virtual disks provisioning: thin provisioning has an initial requirement of about 17 GB, thick provisioning requires 300 GB upfront. Select a VM storage policy and a target datastore for the appliance deployment.
- Identify a virtual network for the management traffic in and out the VM.
- In the Customize Template section, we additionally define the following:
- System GRUB root user password and menu timeout.
- System root, and UI/API/CLI “admin” and “audit” accounts passwords.
- Optional different usernames for the “admin” and “audit” accounts.
- Appliance hostname and NSX Manager role.
- Management network IP address, netmask and gateway for IPv4 and IPv6.
- DNS server(s), domain search, and NTP server(s).
- Whether to enable the SSH daemon and allow root login via SSH.
- Do not set any of the “For internal use only” parameters!
- Begin the NSX Manager virtual appliance deployment.
Scripted deployment using CLI tools
The NSX Manager virtual appliance deployment can also be accomplished from the command line using tools such as:
- VMware OVF Tool: A command-line utility for Windows, macOS, and Linux operating systems. It enables us to import or export OVF/OVA packages to and from many VMware products. Open Virtualization Format (OVF) is based on a DMTF specification. Full OVF 2.0 Standard specifications can be found at https://www.dmtf.org/standards/ovf. The VMware OVF Tool download and documentation can be found at https://developer.broadcom.com/tools/open-virtualization-format-ovf-tool/latest. It may be relatively simple finding a few examples about the OVF Tool for deploying the NSX Manager appliance. Look for the “Run OVF Tool With ESXi and vCenter Target Locations” paragraph within the online documentation linked above.
- VMware PowerCLI: A suite of PowerShell modules that we can leverage to manage VMware products and services. It includes more than 7,000 cmdlets. For a list of compatible VMware products, I would recommend everyone to check the VMware Product Interoperability Matrix at https://interopmatrix.broadcom.com. VMware PowerCLI download and documentation can be found at https://developer.broadcom.com/powercli. Official examples of deploying an appliance including template customization using PowerCLI are quite a few. Hence, we’ll concentrate on the latter.
Deploy using PowerCLI
Deploying an NSX Manager appliance with PowerCLI requires using the Import-VApp cmdlet that enables us to import OVF/OVA packages. The cmdlet returns:
- A VApp object when the OVF/OVA package contains a vApp, comprising one or more virtual machines.
- A VirtualMachine object when the OVF/OVA package contains just a single virtual machine.
The Import-VApp cmdlet uses a hashtable parameter to specify values for a set of user-configurable OVF properties. In our use case, these user properties are the ones we need to customize our NSX Manager node deployment (i.e.: hostname, node role, IP configuration, credentials, etc).
The hashtable can be retrieved from an OVF/OVA package through a vCenter Server appliance using the Get-OvfConfiguration cmdlet. The package can be stored either in a local path or in a vSphere Content Library. Once we have retrieved the hashtable, we can store the customization values.
The hashtable contains various property groups: most of the parameters we want to edit are located in the Common property group. We can then:
- Retrieve the full list of properties in the Common group with the following:
echo $<hshtbl_var_name>.Common - Query each property description with:
echo $<hshtbl_var_name>.Common.<property_name>.Description - Check each property default value with:
echo $<hshtbl_var_name>.Common.<property_name>.DefaultValue - Store values in the properties with:
$<hshtbl_var_name>.Common.<property_name>.Value = "<value>"
There are two additional deployment parameters to care about:
- Appliance form factor:
$<hshtbl_var_name>.DeploymentOption.Value = "<form_factor>"- Values can be:
"extra_small"|"small"|"medium"|"large". - Default value:
“medium”.
- Values can be:
- Name of the Virtual Network the appliance should connect to:
$<hshtbl_var_name>.NetworkMapping.Network_1.Value = “<net>”
PowerCLI script example
In the following PowerShell script, we have an example of what is required to deploy an NSX Manager node using the most common parameters.
NOTE
The -Force flag for the Import-VApp cmdlet is required as the certificate used to sign the OVF package is untrusted.
# STEP 1: CONNECT TO VCENTER SERVER
$VCserver = "<vcenter_server_ip_or_fqdn>"
$VCuser = "<user_name>"
$VCpass = "<password>"
Connect-VIServer -Server $VCserver -User $VCuser -Password $VCpass
# STEP 2: SET VARIABLES WITH VCENTER SERVER INVENTORY OBJECTS REQUIRED FOR THE DEPLOYMENT AND OVA FILE PATH
$VMHost = Get-VMHost -Name <ESXi_host_inventory_name>
$VMDatastore = Get-Datastore -Name <datastore_name>
$VMFolder = Get-Folder -Name <VM_folder_name>
$OVAPath = "./nsx-unified-appliance-<nsx_build>.ova"
# STEP 3: RETRIEVE USER-CONFIGURABLE PROPERTIES HASHTABLE FROM THE NSX MANAGER OVA FILE
$OVFcfg = Get-OvfConfiguration -Ovf $OVAPath
# STEP 4: STORE VALUES IN THE HASHTABLE
$OVFcfg.Common.nsx_grub_passwd.Value = "<grub_pwd>"
$OVFcfg.Common.nsx_grub_menu_timeout.Value = "<seconds>"
$OVFcfg.Common.nsx_passwd_0.Value = "<root_pwd>"
$OVFcfg.Common.nsx_cli_passwd_0.Value = "<admin_pwd>"
$OVFcfg.Common.nsx_cli_audit_passwd_0.Value = "<audit_pwd>"
$OVFcfg.Common.nsx_hostname.Value = "<node_hostname>"
$OVFcfg.Common.nsx_ip_0.Value = "<node_ip>"
$OVFcfg.Common.nsx_netmask_0.Value = "<node_netmask>"
$OVFcfg.Common.nsx_gateway_0.Value = "<node_gateway>"
$OVFcfg.Common.nsx_dns1_0.Value = "<space_separated_dns>"
$OVFcfg.Common.nsx_domain_0.Value = "<domain_search>"
$OVFcfg.Common.nsx_ntp_0.Value = "<space_separated_ntp>"
$OVFcfg.Common.nsx_isSSHEnabled.Value = $true|$false
$OVFcfg.Common.nsx_allowSSHRootLogin.Value = $true|$false
$OVFcfg.DeploymentOption.Value = "<form_factor>"
$OVFcfg.NetworkMapping.Network_1.Value = "<pg_dvpg_name>"
# STEP 5: DEPLOY THE NSX MANAGER NODE
Import-VApp -VMHost $VMHost -Source $OVAPath -Name <nsx_manager_inventory_name> -Datastore $VMDatastore - DiskStorageFormat Thin -InventoryLocation $VMFolder - OvfConfiguration $OVFcfg -Force
# STEP 6: DISCONNECT FROM VCENTER SERVER
Disconnect-VIServer -Server $VCserver -Confirm:$false
PowerCLI script description
- STEP 1: We connect to the target vCenter Server with the
Connect-VIServerPowerCLI cmdlet. The detailed command syntax description can be found at https://developer.broadcom.com/powercli/latest/vmware.vimautomation.core/commands/connect-viserver - STEP 2: We set the script variables by retrieving objects from the vCenter Server inventory: host, datastore and folder objects. We also create a variable to store the NSX Manager appliance OVA file path.
- STEP 3: We retrieve the OVF user-configurable properties with the
Get-OvfConfigurationPowerCLI cmdlet. The detailed command syntax description can be found at https://developer.broadcom.com/powercli/latest/vmware.vimautomation.core/commands/get-ovfconfiguration - STEP 4: We store the desired values for the OVF user-configurable properties that will be used during deployment.
- STEP 5: We deploy the NSX Manager virtual appliance with the
Import-VAppPowerCLI cmdlet. The detailed command syntax description can be found at https://developer.broadcom.com/powercli/latest/vmware.vimautomation.core/commands/import-vapp - STEP 6: In order to save resources, we close the connection to the vCenter Server with the
Disconnect-VIServerPowerCLI cmdlet. The detailed command syntax description can be found at https://developer.broadcom.com/powercli/latest/vmware.vimautomation.core/commands/disconnect-viserver
Post-deployment tasks
Irrespective of how we have deployed the NSX Manager appliance – using the vSphere Client, the OVF Tool, or PowerCLI – at the end of the deployment process, the NSX Manager appliance is ready to be powered on.
During the first boot, the appliance creates the self-signed certificates and initiates the Management Cluster, automatically joining it as its first node.The next (optional) steps are:
- Configuring the “admin” account password expiration.
- Configuring a recovery method in case we forget/lose the “root” account password.
Default “admin” password expiration
IMPORTANT
By default, on all NSX appliances, the “admin” user account password expires after 90 days. If the password expires, we cannot log in and manage NSX via UI or CLI. Additionally, any REST API call will also fail.
There are three Password Management alarm definitions, enabled by default in NSX, that help monitoring password expiration:
- “Password Expiration Approaching” triggered when expiration is ≤ 30 days.
- “Password Is About To Expire” triggered when expiration is ≤ 7 days.
- “Password Expired”.
Notifications are displayed in the UI and may be sent as SNMP traps. To further clarify, SNMP must be configured and enabled, as it is not by default. Additionally, we can register notifications watchers or use Aria Operations for Logs – or other third-party applications – to achieve better alarm management.
The expiration period can be modified by using the appliance CLI as follows:
set user admin password-expiration <1 - 9999>to set a new duration (in days).clear user admin password-expirationto disable expiration.
Extending the admin password up to 27.4 years (9.999 days / 365) or even disabling password expiration is not savvy. Instead, I would personally recommend relying on alarms to get proper notifications delivered to the intended recipients.
As we have said, if the password expires, we cannot log in and manage NSX via UI or CLI. Additionally, any REST API call will also fail. To recover from the impasse, we must reset the “admin” password by logging into the NSX appliance console as the system root user and using the following command: set user admin [password <new_password> [old-password <old_password>]]
If we forget the system root user password, things get slightly more complicated.
Resetting the system root user password
If we forget the system root password, we must use the GRUB boot menu to reset it.
GRUB settings
GRUB is the Ubuntu default bootloader. In NSX, though, the GRUB menu is not displayed at boot time by default. Hence, we must change its configuration if we want to be able to reset the NSX Manager appliance root password.
To change the GRUB bootloader configuration, we must log in the NSX Manager appliance console as the system root user and edit the /etc/default/grub file as follows:
- Set the
GRUB_TIMEOUT_STYLEparameter to one of the following values:menu: GRUB displays the menu and waits for the timeout set by theGRUB_TIMEOUTparameter to expire before booting using the default menu option. Pressing any key, interrupts the timeout.countdown: GRUB waits for the timeout set by theGRUB_TIMEOUTparameter to expire before displaying the menu. Pressing the ESC or F4 keys, or holding the SHIFT key during the timeout period, makes GRUB display the menu and wait for input.
- Set the
GRUB_TIMEOUTparameter to the desired amount of time GRUB must wait for user selection. - [Optional] Change the GRUB password using one of the two following methods:
- Use
grub-mkpasswd-pbkdf2to generate a hashed password for GRUB. - Edit the
/etc/grub.d/40_customfile (the default password is NSX@VM!WaR10).
- Use
- Don’t forget to save the GRUB configuration changes with
update-grub.
To reset the root password:
- At boot, when the GRUB menu is displayed, press the left SHIFT or ESC key.
- Press E to edit the menu.
- Choose the top Ubuntu line and enter the username root and the GRUB password.
- Press E to edit the selected option.
- Search for the line starting with
linuxand addsystemd.wants=PasswordRecovery.serviceto the end of the line. - Press Ctrl-X to boot.
- When the log messages stop, enter and confirm the new password for root.
- The boot process continues, and the system is eventually rebooted. The root password has been modified.
Continue to Part 3…
In Part 2 of this Exploring NSX Building Blocks module we have started the discussion about the converged Management and Control planes and the related deployment workflows. Continue to the third part of this module to continue the discussion, completing the Management Cluster Nodes deployment, reviewing the deployment validation processes, and exploring Day2 operations.
