In Nutanix AHV networking terminology the network (in VMware vSphere world you call it portgroup), is a logical component of the networking stack where Virtual Machine virtual NIC is plugged in to. In the network object, you specify the VLAN ID and name (basic settings). If you leverage Nutanix AHV IPAM, you can set up all parameters on the network too. When you create the Nutanix network on the Nutanix AHV cluster, the network configuration is instantly replicated to all nodes in the Nutanix cluster. Similar to VMware vDS, but you do not need expensive Enterprise Plus license 🙂
There are several ways to create and configure networks on Nutanix. You can do it from Prism Central, Prism Element, Powershell or from command-line using acli.
For deployment and configuration using Prism, see Nutanix official documentation.
If you would like to learn more about Nutanix AHV networking, have a look at my earlier blog post – Nutanix AHV CheatShet
Powershell
Create portgroup using New-NtnxNetwork -vlanId -Name
PS C:\WINDOWS\system32> New-NTNXNetwork -VlanId 1111 -Name vlan1111
networkUuid
-----------
13de23dd-9ab2-446e-9a18-07382355aeaf
PS C:\WINDOWS\system32>
List networks on Nutanix cluster – Get-NTNXNetwork
PS C:\WINDOWS\system32> Get-NTNXNetwork | Select-Object -Property name, vlanid
name vlanId
---- ------
Objects-IPAM-Network-568 568
vm 0
vlan1111 1111
Objects-IPAM-Network-567 567
VLAN567 567
VLAN568 568
Delete portgroup Remove-NTNXNetwork -Networkid
PS C:\WINDOWS\system32> Remove-NTNXNetwork -Networkid 13de23dd-9ab2-446e-9a18-07382355aeaf
Success!
PS C:\WINDOWS\system32> Get-NTNXNetwork | Select-Object -Property name, vlanid
name vlanId
---- ------
Objects-IPAM-Network-568 568
vm 0
Objects-IPAM-Network-567 567
VLAN567 567
VLAN568 568
PS C:\WINDOWS\system32>
Nutanix acli
After getting into acli, to create network, run command net.create <network_name> vlan=<vlanID>
<acropolis> net.create VLAN1111 vlan=1111
<acropolis> net.list
Network name Network UUID Type Identifier Subnet
Objects-IPAM-Network-567 4c00e7be-f4c7-4686-a5cf-b24bf966de92 kBridged 567
Objects-IPAM-Network-568 e5685e6e-dc0c-4176-92b3-cbaa0e374c77 kBridged 568
VLAN1111 48453a31-b1c4-4b9e-a787-3baeff6163c8 kBridged 1111
VLAN567 93e80b13-1d87-4c1b-9ddc-55c8731f4a5e kBridged 567
VLAN568 c7f89a6b-dcad-4cb5-b62b-c22e96604e88 kBridged 568
vm 060c0a0b-147f-4417-93c3-556621b7efa3 kBridged 0
Delete network using acli
<acropolis> net.delete VLAN1111
<acropolis> net.list
Network name Network UUID Type Identifier Subnet
Objects-IPAM-Network-567 4c00e7be-f4c7-4686-a5cf-b24bf966de92 kBridged 567
Objects-IPAM-Network-568 e5685e6e-dc0c-4176-92b3-cbaa0e374c77 kBridged 568
VLAN567 93e80b13-1d87-4c1b-9ddc-55c8731f4a5e kBridged 567
VLAN568 c7f89a6b-dcad-4cb5-b62b-c22e96604e88 kBridged 568
vm 060c0a0b-147f-4417-93c3-556621b7efa3 kBridged 0
<acropolis>
Mass Nutanix network deployment
Simple 1-liner to create multiple Nutanix networks on the cluster
nutanix@cvm: for i in {1111..1115} ; do acli net.create vlan$i vlan=$i ; done
nutanix@cvm:~$ for i in {1111..1115} ; do acli net.create vlan$i vlan=$i ; done
nutanix@cvm:~$ acli net.list
Network name Network UUID Type Identifier Subnet
Objects-IPAM-Network-567 4c00e7be-f4c7-4686-a5cf-b24bf966de92 kBridged 567
Objects-IPAM-Network-568 e5685e6e-dc0c-4176-92b3-cbaa0e374c77 kBridged 568
VLAN567 93e80b13-1d87-4c1b-9ddc-55c8731f4a5e kBridged 567
VLAN568 c7f89a6b-dcad-4cb5-b62b-c22e96604e88 kBridged 568
vlan1111 bf21fbe1-899a-4125-a1e8-d4e0ded0df9c kBridged 1111
vlan1112 b5366df2-0e27-4177-8490-5d15ced30063 kBridged 1112
vlan1113 3a6632ac-a30a-4475-bbe7-2a3f0ff204df kBridged 1113
vlan1114 d8c573db-5ef8-440b-b34f-9d3e93521d2a kBridged 1114
vlan1115 b54dee54-32fc-48d5-987f-f3e2aceef1a6 kBridged 1115
vm 060c0a0b-147f-4417-93c3-556621b7efa3 kBridged 0
nutanix@cvm:~$
Brilliant post! I had to do this recently with a client that had a lot of different networks. Used the acli version, and created the commandline from their Excel sheet using concatenation. Simple copy & paste from there.
I believe this is also the only way to (currently) add PortGroups to bridges other than br0 if clients are trying to physically separate NIC traffic.
acli net.create VLAN999 vlan=999 vswitch_name=br1