In this blog we are going to take a look at Logical Networks for Azure Stack HCI, what they are, why you need them and how to create them.
What are they?
Logical networks (abbreviated to LNets) are the Azure resources that represent physical networks and are self-contained projections of the on-premises physical networks.
Logical Networks typically represent a segment of the physical networks with options to configure both static and dynamic IP addresses assignments (dynamic being DHCP). Typically, the VLANs that are trunked to the Azure Stack HCI clusters will be mapped onto the Logical Networks in a 1:1 mapping. This will allow VMs & workloads to be deployed into those VLANs. Logical Networks are created using the Virtual Switch that is configured on your Azure Stack HCI cluster nodes.
What are they used for?
Logical Networks are primarily used for hosting Arc VMs, Kubernetes clusters and AVD session hosts on Azure Stack HCI and to connect virtual machines to the on-premises networks, as VM network interfaces are placed onto the Logical Networks.
When you deploy an Arc VM from the Azure Portal, you can choose to add a Network Interface, where you’ll need to select the Logical Network and provide an IP address choose the automatic allocation method (see below example).

Creating Logical Networks
Portal
LNets can be created in the Azure Portal or the Azure CLI and they are located under the Arc Cluster resource in the portal.

When creating an LNet, as they are Azure resources, you need to specificy a resource group and the name of the External Virtual Switch on the HCI Cluster.

Then enter the details for the network that should align to the on-premises VLAN you are emulating with the LNet

Finally add tags and click review and create.
Azure CLI
To create an LNet using the Azure CLI, first set the Parameters for the ‘lnet create’ command, login to Azure and set the context of the relevant subscription, then run the command. See the below example syntax.
$lnetName = “10-10-1-0-24-V31-CL-HCI01”
$vmSwitchName = ‘“ConvergedSwitch(management_compute_storage)”’
$subscription = “c5980d72-12345-6789f-1011a-813ce58cfbvd”
$resource_group = “AzureStackHCI-cl01-rg”
$customLocationName = “CL-HCI01-CustomLocation”
$customLocationID = “/subscriptions/$subscription/resourceGroups/$resource_group/providers/Microsoft.ExtendedLocation/customLocations/$customLocationName”
$location = “eastus”
$vlan = “31”
$addressPrefixes = “10.10.1.0/24”
$gateway = “10.10.1.1”
$dnsServers = “10.10.1.10”,“10.10.1.11”
az login --use-device-code
az account set --subscription $Subscription
az stack-hci-vm network lnet create --subscription $subscription --resource-group $resource_group --custom-location $customLocationID --location $location –vlan $vlan --name $lnetName --vm-switch-name $vmSwitchName --ip-allocation-method “Static” --address-prefixes $addressPrefixes --gateway $gateway --dns-servers $dnsServers
The above example will run the below command:
az stack-hci-vm network lnet create --subscription "c5980d72-12345-6789f-1011a-813ce58cfbvd" --resource-group "AzureStackHCI-cl01-rg" --custom-location "/subscriptions/c5980d72-12345-6789f-1011a-813ce58cfbvd/resourceGroups/AzureStackHCI-cl01-rg/providers/Microsoft.ExtendedLocation/customLocations/CL-HCI01-CustomLocation" --vlan "31" --name "10-10-1-0-24-V31-CL-HCI01" --vmSwitchName "ConvergedSwitch(management-compute-storage)" --ip-allocation-method "Static" --address-prefixes "10.10.1.0/24" --gateway "10.10.1.1" --dns-servers "10.10.1.10","10.10.1.11"
Conclusion
Without Logical Networks, you won’t be able to deploy Arc VMs, Kubernetes Clusters of AVD session hosts onto you HCI Clusters. They are an integral part of the Hybrid and Arc ecosystem and key to Azure becoming the Management and Control plane for your on-premises HCI Clusters.
I hope the above helps you to understand what LNets are and how to create them.
As ever, please see the official Microsoft documentation on creating LNets:
https://learn.microsoft.com/en-us/azure-stack/hci/manage/create-logical-networks?tabs=azurecli