Make sure that all the machines in your Azure Local can access and external virtual machine (VM) switch. By default, an external switch is created during the deployment of your Azure Local that you can use to associate with the logical network you create.
Run the following command to get the name of the external VM switch on your system.
Get-VmSwitch -SwitchType External
Make a note of the name of the switch. You use this information when you create a logical network. Here's a sample output:
To create VMs with static IP addresses in your address space, add a logical network with static IP allocation. Reserve an IP range with your network admin and make sure to get the address prefix for this IP range.
The prerequisites for the Azure portal are the same as those for the Azure CLI. See Azure CLI.
Make sure Terraform is installed and up to date on your machine.
To verify your version of Terraform, run the terraform -v command.
You can use the az stack-hci-vm network lnet create cmdlet to create a logical network on the VM switch for a DHCP or a static IP configuration. The parameters used to create a DHCP and a static logical network are different.
Create a static logical network via CLI
In this release, you can create virtual machines using a static IP only via the Azure CLI.
Create a static logical network when you want to create virtual machines with network interfaces on these logical networks. Follow these steps in Azure CLI to configure a static logical network:
For the default VM switch created at the deployment, pass the name string encased in double quotes followed by single quotes. For example, a default VM switch ConvergedSwitch(management_compute_storage) is passed as '"ConvergedSwitch(management_compute_storage)"'.
For static IP, the required parameters are tabulated as follows:
Parameters
Description
name
Name for the logical network that you create for your Azure Local. Make sure to provide a name that follows the Naming rules for Azure network resources. You can't rename a logical network after it's created.
vm-switch-name
Name of the external virtual switch on your Azure Local where you deploy the logical network.
resource-group
Name of the resource group where you create the logical network. For ease of management, we recommend that you use the same resource group as your Azure Local.
subscription
Name or ID of the subscription where your Azure Local is deployed. This could be another subscription you use for logical network on your Azure Local.
custom-location
Use this to provide the custom location associated with your Azure Local where you're creating this logical network.
location
Azure regions as specified by az locations.
vlan
VLAN identifier for Arc VMs. Contact your network admin to get this value. A value of 0 implies that there's no VLAN ID.
ip-allocation-method
IP address allocation method and could be Dynamic or Static. If this parameter isn't specified, by default the logical network is created with a dynamic configuration.
address-prefixes
Subnet address in CIDR notation. For example: "192.168.0.0/16".
dns-servers
List of IPv4 addresses of DNS servers. Specify multiple DNS servers in a space separated format. For example: "10.0.0.5" "10.0.0.10"
gateway
Ipv4 address of the default gateway.
Note
DNS server and gateway must be specified if you're creating a static logical network.
Create a static logical network. Run the following cmdlet:
For the default VM switch created at the deployment, pass the name string encased in double quotes followed by single quotes. For example, a default VM switch ConvergedSwitch(management_compute_storage) is passed as '"ConvergedSwitch(management_compute_storage)"'.
Here are the parameters that are required to create a DHCP logical network:
Parameters
Description
name
Name for the logical network that you create for your Azure Local. Make sure to provide a name that follows the Rules for Azure resources. You can't rename a logical network after it's created.
vm-switch-name
Name of the external virtual switch on your Azure Local where you deploy the logical network.
resource-group
Name of the resource group where you create the logical network. For ease of management, we recommend that you use the same resource group as your Azure Local.
subscription
Name or ID of the subscription where Azure Local is deployed. This could be another subscription you use for logical network on your Azure Local.
custom-location
Use this to provide the custom location associated with your Azure Local where you're creating this logical network.
location
Azure regions as specified by az locations.
vlan
VLAN identifier for Arc VMs. Contact your network admin to get this value. A value of 0 implies that there's no VLAN ID.
Run the following cmdlet to create a DHCP logical network:
Complete the following steps to create a logical network using Azure portal.
In the left pane, under Resources, select Logical networks.
In the right pane, select Create logical network.
On the Create logical network page, on the Basics tab:
Select the Azure subscription name.
Select the associated resource group name.
Provide a logical network name. Make sure to provide a name that follows the Rules for Azure resources. You can't rename a logical network after it's created.
Enter the virtual switch name that you saved earlier.
The geographic region is automatically set to the region where you registered your system.
The custom location is automatically populated from the system.
When complete, select Next: Network Configuration.
Create a static logical network via portal
On the Network configuration tab, select Static and then enter the following:
IPv4 address space (previously reserved).
IP pools (if used).
Default gateway address.
DNS server address.
VLAN ID (if used).
When complete, select Review + Create.
On the Review + Create tab, review network settings and then select Create:
Create a DHCP logical network via portal
On the Network Configuration tab, select DHCP, and then select Review + Create.
Enter VLAN ID if used.
On the Review + Create tab, review settings and then select Create:
Deploy the logical network via portal
These steps are the same for both static and DHCP network deployments.
Verify the network deployment job was submitted:
Verify that the deployment is in progress:
Verify the deployment job completed successfully and then select either Pin to dashboard or Go to resource group:
In the resource group, select Overview and then verify the logical network is created and listed on the Resources tab:
You can use the Azure Verified Module (AVM) that contains the Terraform template for creating Logical Networks. This module ensures your Terraform templates meet Microsoft's rigorous standards for quality, security, and operational excellence, enabling you to seamlessly deploy and manage on Azure. With this template, you can create one or multiple Logical Networks on your cluster.
Learn how to create network interfaces on an existing logical network associated with your Azure Local. The Arc VM running on your system uses these network interfaces.