A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/azure/virtual-network/create-vm-accelerated-networking-cli below:

Create an Azure Virtual Machine with Accelerated Networking

This article describes how to create a Linux or Windows virtual machine (VM) with Accelerated Networking (AccelNet) enabled by using the Azure CLI command-line interface.

Prerequisites Azure Cloud Shell

Azure hosts Azure Cloud Shell, an interactive shell environment that you can use through your browser. You can use either Bash or PowerShell with Cloud Shell to work with Azure services. You can use the Cloud Shell preinstalled commands to run the code in this article, without having to install anything on your local environment.

To start Azure Cloud Shell:

To use Azure Cloud Shell:

  1. Start Cloud Shell.

  2. Select the Copy button on a code block (or command block) to copy the code or command.

  3. Paste the code or command into the Cloud Shell session by selecting Ctrl+Shift+V on Windows and Linux, or by selecting Cmd+Shift+V on macOS.

  4. Select Enter to run the code or command.

If you choose to install and use PowerShell locally, this article requires the Azure PowerShell module version 1.0.0 or later. Run Get-Module -ListAvailable Az to find the installed version. If you need to upgrade, see Install Azure PowerShell module. If you're running PowerShell locally, you also need to run Connect-AzAccount to create a connection with Azure.

If you don't have an Azure account, create a free account before you begin.

Create a virtual network Create a virtual network and an Azure Bastion host

The following procedure creates a virtual network with a resource subnet, an Azure Bastion subnet, and a Bastion host:

  1. In the portal, search for and select Virtual networks.

  2. On the Virtual networks page, select + Create.

  3. On the Basics tab of Create virtual network, enter, or select the following information:

    Setting Value Project details Subscription Select your subscription. Resource group Select Create new.
    Enter test-rg for the name.
    Select OK. Instance details Name Enter vnet-1. Region Select East US 2.

  4. Select Next to proceed to the Security tab.

  5. In the Azure Bastion section, select Enable Azure Bastion.

    Bastion uses your browser to connect to VMs in your virtual network over Secure Shell (SSH) or Remote Desktop Protocol (RDP) by using their private IP addresses. The VMs don't need public IP addresses, client software, or special configuration. For more information, see What is Azure Bastion?.

    Note

    Hourly pricing starts from the moment that Bastion is deployed, regardless of outbound data usage. For more information, see Pricing and SKUs. If you're deploying Bastion as part of a tutorial or test, we recommend that you delete this resource after you finish using it.

  6. In Azure Bastion, enter or select the following information:

    Setting Value Azure Bastion host name Enter bastion. Azure Bastion public IP address Select Create a public IP address.
    Enter public-ip-bastion in Name.
    Select OK.

  7. Select Next to proceed to the IP Addresses tab.

  8. In the address space box in Subnets, select the default subnet.

  9. In Edit subnet, enter or select the following information:

    Setting Value Subnet purpose Leave the default of Default. Name Enter subnet-1. IPv4 IPv4 address range Leave the default of 10.0.0.0/16. Starting address Leave the default of 10.0.0.0. Size Leave the default of /24 (256 addresses).

  10. Select Save.

  11. Select Review + create at the bottom of the window. When validation passes, select Create.

Before creating a virtual network, you have to create a resource group for the virtual network, and all other resources created in this article. Create a resource group with New-AzResourceGroup. The following example creates a resource group named test-rg in the eastus location.

$resourceGroup = @{
    Name = "test-rg"
    Location = "EastUS2"
}
New-AzResourceGroup @resourceGroup

Create a virtual network with New-AzVirtualNetwork. The following example creates a virtual network named vnet-1 with the address prefix 10.0.0.0/16.

$vnet1 = @{
    ResourceGroupName = "test-rg"
    Location = "EastUS2"
    Name = "vnet-1"
    AddressPrefix = "10.0.0.0/16"
}
$virtualNetwork1 = New-AzVirtualNetwork @vnet1

Create a subnet configuration with Add-AzVirtualNetworkSubnetConfig. The following example creates a subnet configuration with a 10.0.0.0/24 address prefix:

$subConfig = @{
    Name = "subnet-1"
    AddressPrefix = "10.0.0.0/24"
    VirtualNetwork = $virtualNetwork1
}
$subnetConfig1 = Add-AzVirtualNetworkSubnetConfig @subConfig

Create a subnet configuration for Azure Bastion with Add-AzVirtualNetworkSubnetConfig. The following example creates a subnet configuration with a 10.0.1.0/24 address prefix:

$subBConfig = @{
    Name = "AzureBastionSubnet"
    AddressPrefix = "10.0.1.0/24"
    VirtualNetwork = $virtualNetwork1
}
$subnetConfig2 = Add-AzVirtualNetworkSubnetConfig @subBConfig

Write the subnet configuration to the virtual network with Set-AzVirtualNetwork, which creates the subnet:

$virtualNetwork1 | Set-AzVirtualNetwork
Create Azure Bastion

Create a public IP address for the Azure Bastion host with New-AzPublicIpAddress. The following example creates a public IP address named public-ip-bastion in the vnet-1 virtual network.

$publicIpParams = @{
    ResourceGroupName = "test-rg"
    Name = "public-ip-bastion"
    Location = "EastUS2"
    AllocationMethod = "Static"
    Sku = "Standard"
}
New-AzPublicIpAddress @publicIpParams

Create an Azure Bastion host with New-AzBastion. The following example creates an Azure Bastion host named bastion in the AzureBastionSubnet subnet of the vnet-1 virtual network. Azure Bastion is used to securely connect Azure virtual machines without exposing them to the public internet.

$bastionParams = @{
    ResourceGroupName = "test-rg"
    Name = "bastion"
    VirtualNetworkName = "vnet-1"
    PublicIpAddressName = "public-ip-bastion"
    PublicIpAddressRgName = "test-rg"
    VirtualNetworkRgName = "test-rg"
}
New-AzBastion @bastionParams -AsJob
  1. Use az group create to create a resource group that contains the resources. Be sure to select a supported Windows or Linux region as listed in Windows and Linux Accelerated Networking.

    export RANDOM_SUFFIX=$(openssl rand -hex 3)
    export RESOURCE_GROUP_NAME="test-rg$RANDOM_SUFFIX"
    export REGION="eastus2"
    
    az group create \
        --name $RESOURCE_GROUP_NAME \
        --location $REGION
    

    Results:

    {
      "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg69e367",
      "location": "eastus2",
      "managedBy": null,
      "name": "test-rg69e367",
      "properties": {
        "provisioningState": "Succeeded"
      },
      "tags": null,
      "type": "Microsoft.Resources/resourceGroups"
    }
    
  2. Use az network vnet create to create a virtual network with one subnet in the resource group:

     export RESOURCE_GROUP_NAME="test-rg$RANDOM_SUFFIX"
     export VNET_NAME="vnet-1$RANDOM_SUFFIX"
     export SUBNET_NAME="subnet-1$RANDOM_SUFFIX"
     export VNET_ADDRESS_PREFIX="10.0.0.0/16"
     export SUBNET_ADDRESS_PREFIX="10.0.0.0/24"
    
     az network vnet create \
         --resource-group $RESOURCE_GROUP_NAME \
         --name $VNET_NAME \
         --address-prefix $VNET_ADDRESS_PREFIX \
         --subnet-name $SUBNET_NAME \
         --subnet-prefix $SUBNET_ADDRESS_PREFIX
    

    Results:

    {
      "newVNet": {
        "addressSpace": {
          "addressPrefixes": [
            "10.0.0.0/16"
          ]
        },
        "enableDdosProtection": false,
        "etag": "W/\"300c6da1-ee4a-47ee-af6e-662d3a0230a1\"",
        "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg69e367/providers/Microsoft.Network/virtualNetworks/vnet-169e367",
        "location": "eastus2",
        "name": "vnet-169e367",
        "provisioningState": "Succeeded",
        "resourceGroup": "test-rg69e367",
        "resourceGuid": "3d64254d-70d4-47e3-a129-473d70ea2ab8",
        "subnets": [
          {
            "addressPrefix": "10.0.0.0/24",
            "delegations": [],
            "etag": "W/\"300c6da1-ee4a-47ee-af6e-662d3a0230a1\"",
            "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg69e367/providers/Microsoft.Network/virtualNetworks/vnet-169e367/subnets/subnet-169e367",
            "name": "subnet-169e367",
            "privateEndpointNetworkPolicies": "Disabled",
            "privateLinkServiceNetworkPolicies": "Enabled",
            "provisioningState": "Succeeded",
            "resourceGroup": "test-rg69e367",
            "type": "Microsoft.Network/virtualNetworks/subnets"
          }
        ],
        "type": "Microsoft.Network/virtualNetworks",
        "virtualNetworkPeerings": []
      }
    }
    
  3. Create the Bastion subnet with az network vnet subnet create.

    export RESOURCE_GROUP_NAME="test-rg$RANDOM_SUFFIX"
    export VNET_NAME="vnet-1$RANDOM_SUFFIX"
    export SUBNET_NAME="AzureBastionSubnet"
    export SUBNET_ADDRESS_PREFIX="10.0.1.0/24"
    
    az network vnet subnet create \
        --vnet-name $VNET_NAME \
        --resource-group $RESOURCE_GROUP_NAME \
        --name AzureBastionSubnet \
        --address-prefix $SUBNET_ADDRESS_PREFIX
    

    Results:

    {
      "addressPrefix": "10.0.1.0/24",
      "delegations": [],
      "etag": "W/\"a2863964-0276-453f-a104-b37391e8088b\"",
      "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg69e367/providers/Microsoft.Network/virtualNetworks/vnet-169e367/subnets/AzureBastionSubnet",
      "name": "AzureBastionSubnet",
      "privateEndpointNetworkPolicies": "Disabled",
      "privateLinkServiceNetworkPolicies": "Enabled",
      "provisioningState": "Succeeded",
      "resourceGroup": "test-rg69e367",
      "type": "Microsoft.Network/virtualNetworks/subnets"
    }
    
Create Azure Bastion
  1. Create a public IP address for the Azure Bastion host with az network public-ip create.

    export RESOURCE_GROUP_NAME="test-rg$RANDOM_SUFFIX"
    export PUBLIC_IP_NAME="public-ip-bastion$RANDOM_SUFFIX"
    export LOCATION="eastus2"
    export ALLOCATION_METHOD="Static"
    export SKU="Standard"
    
    az network public-ip create \
      --resource-group $RESOURCE_GROUP_NAME \
      --name $PUBLIC_IP_NAME \
      --location $LOCATION \
      --allocation-method $ALLOCATION_METHOD \
      --sku $SKU
    

    Results:

    {
      "publicIp": {
        "ddosSettings": {
          "protectionMode": "VirtualNetworkInherited"
        },
        "etag": "W/\"efa750bf-63f9-4c02-9ace-a747fc405d0f\"",
        "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg69e367/providers/Microsoft.Network/publicIPAddresses/public-ip-bastion69e367",
        "idleTimeoutInMinutes": 4,
        "ipAddress": "203.0.113.173",
        "ipTags": [],
        "location": "eastus2",
        "name": "public-ip-bastion69e367",
        "provisioningState": "Succeeded",
        "publicIPAddressVersion": "IPv4",
        "publicIPAllocationMethod": "Static",
        "resourceGroup": "test-rg69e367",
        "resourceGuid": "fc809493-80c8-482c-9f5a-9d6442472a99",
        "sku": {
          "name": "Standard",
          "tier": "Regional"
        },
        "type": "Microsoft.Network/publicIPAddresses"
      }
    }
    
  2. Create an Azure Bastion host with az network bastion create. Azure Bastion is used to securely connect Azure virtual machines without exposing them to the public internet.

    export RESOURCE_GROUP_NAME="test-rg$RANDOM_SUFFIX"
    export BASTION_NAME="bastion$RANDOM_SUFFIX"
    export VNET_NAME="vnet-1$RANDOM_SUFFIX"
    export PUBLIC_IP_NAME="public-ip-bastion$RANDOM_SUFFIX"
    export LOCATION="eastus2"
    
    az network bastion create \
      --resource-group $RESOURCE_GROUP_NAME \
      --name $BASTION_NAME \
      --vnet-name $VNET_NAME \
      --public-ip-address $PUBLIC_IP_NAME \
      --location $LOCATION
    

    Results:

    {
      "disableCopyPaste": false,
      "dnsName": "bst-cc1d5c1d-9496-44fa-a8b3-3b2130efa306.bastion.azure.com",
      "enableFileCopy": false,
      "enableIpConnect": false,
      "enableKerberos": false,
      "enableSessionRecording": false,
      "enableShareableLink": false,
      "enableTunneling": false,
      "etag": "W/\"229bd068-160b-4935-b23d-eddce4bb31ed\"",
      "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg69e367/providers/Microsoft.Network/bastionHosts/bastion69e367",
      "ipConfigurations": [
        {
          "etag": "W/\"229bd068-160b-4935-b23d-eddce4bb31ed\"",
          "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg69e367/providers/Microsoft.Network/bastionHosts/bastion69e367/bastionHostIpConfigurations/bastion_ip_config",
          "name": "bastion_ip_config",
          "privateIPAllocationMethod": "Dynamic",
          "provisioningState": "Succeeded",
          "publicIPAddress": {
            "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg69e367/providers/Microsoft.Network/publicIPAddresses/public-ip-bastion69e367",
            "resourceGroup": "test-rg69e367"
          },
          "resourceGroup": "test-rg69e367",
          "subnet": {
            "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg69e367/providers/Microsoft.Network/virtualNetworks/vnet-169e367/subnets/AzureBastionSubnet",
            "resourceGroup": "test-rg69e367"
          },
          "type": "Microsoft.Network/bastionHosts/bastionHostIpConfigurations"
        }
      ],
      "location": "eastus2",
      "name": "bastion69e367",
      "provisioningState": "Succeeded",
      "resourceGroup": "test-rg69e367",
      "scaleUnits": 2,
      "sku": {
        "name": "Standard"
      },
      "type": "Microsoft.Network/bastionHosts"
    }
    
Create a network interface with Accelerated Networking

Accelerated networking is enabled in the portal during virtual machine creation. Create a virtual machine in the following section.

Use New-AzNetworkInterface to create a network interface (NIC) with Accelerated Networking enabled, and assign the public IP address to the NIC.

$vnetParams = @{
    ResourceGroupName = "test-rg"
    Name = "vnet-1"
    }
$vnet = Get-AzVirtualNetwork @vnetParams

$nicParams = @{
    ResourceGroupName = "test-rg"
    Name = "nic-1"
    Location = "eastus2"
    SubnetId = $vnet.Subnets[0].Id
    EnableAcceleratedNetworking = $true
    }
$nic = New-AzNetworkInterface @nicParams
  1. Use az network nic create to create a network interface (NIC) with Accelerated Networking enabled. The following example creates a NIC in the subnet of the virtual network.

     export RESOURCE_GROUP_NAME="test-rg$RANDOM_SUFFIX"
     export NIC_NAME="nic-1$RANDOM_SUFFIX"
     export VNET_NAME="vnet-1$RANDOM_SUFFIX"
     export SUBNET_NAME="subnet-1$RANDOM_SUFFIX"
    
     az network nic create \
         --resource-group $RESOURCE_GROUP_NAME \
         --name $NIC_NAME \
         --vnet-name $VNET_NAME \
         --subnet $SUBNET_NAME \
         --accelerated-networking true
    

    Results:

    {
      "NewNIC": {
        "auxiliaryMode": "None",
        "auxiliarySku": "None",
        "disableTcpStateTracking": false,
        "dnsSettings": {
          "appliedDnsServers": [],
          "dnsServers": [],
          "internalDomainNameSuffix": "juswipouodrupijji24xb0rkxa.cx.internal.cloudapp.net"
        },
        "enableAcceleratedNetworking": true,
        "enableIPForwarding": false,
        "etag": "W/\"0e24b553-769b-4350-b1aa-ab4cd04100bf\"",
        "hostedWorkloads": [],
        "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg69e367/providers/Microsoft.Network/networkInterfaces/nic-169e367",
        "ipConfigurations": [
          {
            "etag": "W/\"0e24b553-769b-4350-b1aa-ab4cd04100bf\"",
            "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg69e367/providers/Microsoft.Network/networkInterfaces/nic-169e367/ipConfigurations/ipconfig1",
            "name": "ipconfig1",
            "primary": true,
            "privateIPAddress": "10.0.0.4",
            "privateIPAddressVersion": "IPv4",
            "privateIPAllocationMethod": "Dynamic",
            "provisioningState": "Succeeded",
            "resourceGroup": "test-rg69e367",
            "subnet": {
              "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg69e367/providers/Microsoft.Network/virtualNetworks/vnet-169e367/subnets/subnet-169e367",
              "resourceGroup": "test-rg69e367"
            },
            "type": "Microsoft.Network/networkInterfaces/ipConfigurations"
          }
        ],
        "location": "eastus2",
        "name": "nic-169e367",
        "nicType": "Standard",
        "provisioningState": "Succeeded",
        "resourceGroup": "test-rg69e367",
        "resourceGuid": "6798a335-bd66-42cc-a92a-bb678d4d146e",
        "tapConfigurations": [],
        "type": "Microsoft.Network/networkInterfaces",
        "vnetEncryptionSupported": false
      }
    }
    
Create a VM and attach the NIC Create test virtual machine

The following procedure creates a test virtual machine (VM) named vm-1 in the virtual network.

  1. In the portal, search for and select Virtual machines.

  2. In Virtual machines, select + Create, then Azure virtual machine.

  3. On the Basics tab of Create a virtual machine, enter or select the following information:

    Setting Value Project details Subscription Select your subscription. Resource group Select test-rg. Instance details Virtual machine name Enter vm-1. Region Select East US 2. Availability options Select No infrastructure redundancy required. Security type Leave the default of Standard. Image Select Ubuntu Server 22.04 LTS - x64 Gen2. VM architecture Leave the default of x64. Size Select a size. Administrator account Authentication type Select Password. Username Enter azureuser. Password Enter a password. Confirm password Reenter the password. Inbound port rules Public inbound ports Select None.
  4. Select the Networking tab at the top of the page.

  5. Enter or select the following information in the Networking tab:

    Setting Value Network interface Virtual network Select vnet-1. Subnet Select subnet-1 (10.0.0.0/24). Public IP Select None. NIC network security group Select Advanced. Configure network security group Select Create new.
    Enter nsg-1 for the name.
    Leave the rest at the defaults and select OK.
  6. Leave the rest of the settings at the defaults and select Review + create.

  7. Review the settings and select Create.

Note

Virtual machines in a virtual network with a bastion host don't need public IP addresses. Bastion provides the public IP, and the VMs use private IPs to communicate within the network. You can remove the public IPs from any VMs in bastion hosted virtual networks. For more information, see Dissociate a public IP address from an Azure VM.

Note

Azure provides a default outbound access IP for VMs that either aren't assigned a public IP address or are in the backend pool of an internal basic Azure load balancer. The default outbound access IP mechanism provides an outbound IP address that isn't configurable.

The default outbound access IP is disabled when one of the following events happens:

VMs that you create by using virtual machine scale sets in flexible orchestration mode don't have default outbound access.

For more information about outbound connections in Azure, see Default outbound access in Azure and Use Source Network Address Translation (SNAT) for outbound connections.

Use Get-Credential to set a user name and password for the VM and store them in the $cred variable.

$cred = Get-Credential

Note

A username is required for the VM. The password is optional and won't be used if set. SSH key configuration is recommended for Linux VMs.

Use New-AzVMConfig to define a VM with a VM size that supports accelerated networking, as listed in Windows Accelerated Networking. For a list of all Windows VM sizes and characteristics, see Windows VM sizes.

$vmConfigParams = @{
    VMName = "vm-1"
    VMSize = "Standard_DS4_v2"
    }
$vmConfig = New-AzVMConfig @vmConfigParams

Use Set-AzVMOperatingSystem and Set-AzVMSourceImage to create the rest of the VM configuration. The following example creates an Ubuntu Server virtual machine:

$osParams = @{
    VM = $vmConfig
    ComputerName = "vm-1"
    Credential = $cred
    }
$vmConfig = Set-AzVMOperatingSystem @osParams -Linux -DisablePasswordAuthentication

$imageParams = @{
    VM = $vmConfig
    PublisherName = "Canonical"
    Offer = "ubuntu-24_04-lts"
    Skus = "server"
    Version = "latest"
    }
$vmConfig = Set-AzVMSourceImage @imageParams

Use Add-AzVMNetworkInterface to attach the NIC that you previously created to the VM.

# Get the network interface object
$nicParams = @{
    ResourceGroupName = "test-rg"
    Name = "nic-1"
    }
$nic = Get-AzNetworkInterface @nicParams

$vmConfigParams = @{
    VM = $vmConfig
    Id = $nic.Id
    }
$vmConfig = Add-AzVMNetworkInterface @vmConfigParams

Use New-AzVM to create the VM with Accelerated Networking enabled. The command will generate SSH keys for the virtual machine for login. Make note of the location of the private key. The private key is needed in later steps for connecting to the virtual machine with Azure Bastion.

$vmParams = @{
    VM = $vmConfig
    ResourceGroupName = "test-rg"
    Location = "eastus2"
    SshKeyName = "ssh-key"
    }
New-AzVM @vmParams -GenerateSshKey

Use az vm create to create the VM, and use the --nics option to attach the NIC you created. Ensure you select a VM size and distribution listed in Windows and Linux Accelerated Networking. For a list of all VM sizes and characteristics, see Sizes for virtual machines in Azure.

The following example creates a VM with a size that supports Accelerated Networking, Standard_DS4_v2. The command will generate SSH keys for the virtual machine for login. Make note of the location of the private key. The private key is needed in later steps for connecting to the virtual machine with Azure Bastion.

export RESOURCE_GROUP_NAME="test-rg$RANDOM_SUFFIX"
export VM_NAME="vm-1$RANDOM_SUFFIX"
export IMAGE="Ubuntu2204"
export SIZE="Standard_DS4_v2"
export ADMIN_USER="azureuser"
export NIC_NAME="nic-1$RANDOM_SUFFIX"

az vm create \
   --resource-group $RESOURCE_GROUP_NAME \
   --name $VM_NAME \
   --image $IMAGE \
   --size $SIZE \
   --admin-username $ADMIN_USER \
   --generate-ssh-keys \
   --nics $NIC_NAME

Note

To create a Windows VM, replace --image Ubuntu2204 with --image Win2019Datacenter.

Results:

{
    "fqdns": "",
    "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/test-rg69e367/providers/Microsoft.Compute/virtualMachines/vm-169e367",
    "location": "eastus2",
    "macAddress": "60-45-BD-84-F0-D5",
    "powerState": "VM running",
    "privateIpAddress": "10.0.0.4",
    "publicIpAddress": "",
    "resourceGroup": "test-rg69e367",
    "zones": ""
}
Confirm that accelerated networking is enabled Linux
  1. In the Azure portal, search for and select virtual machines.

  2. On the Virtual machines page, select your new VM.

  3. On the VM's Overview page, select Connect then Connect via Bastion.

  4. In the Bastion connection screen, change Authentication Type to SSH Private Key from Local File.

  5. Enter the Username that you used when creating the virtual machine. In this example, the user is named azureuser, replace with the username you created.

  6. In Local File, select the folder icon and browse to the private key file that was generated when you created the VM. The private key file is typically named id_rsa or id_rsa.pem.

  7. Select Connect.

  8. A new browser window opens with the Bastion connection to your VM.

  9. From a shell on the remote VM, enter uname -r and confirm that the kernel version is one of the following versions, or greater:

  10. Use the lspci command to confirm that the Mellanox VF device is exposed to the VM. The returned output should be similar to the following example:

    0000:00:00.0 Host bridge: Intel Corporation 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled) (rev 03)
    0000:00:07.0 ISA bridge: Intel Corporation 82371AB/EB/MB PIIX4 ISA (rev 01)
    0000:00:07.1 IDE interface: Intel Corporation 82371AB/EB/MB PIIX4 IDE (rev 01)
    0000:00:07.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 02)
    0000:00:08.0 VGA compatible controller: Microsoft Corporation Hyper-V virtual VGA
    0001:00:02.0 Ethernet controller: Mellanox Technologies MT27500/MT27520 Family [ConnectX-3/ConnectX-3 Pro Virtual Function]
    
  11. Use the ethtool -S eth0 | grep vf_ command to check for activity on the virtual function (VF). If accelerated networking is enabled and active, you receive output similar to the following example:

    vf_rx_packets: 992956
    vf_rx_bytes: 2749784180
    vf_tx_packets: 2656684
    vf_tx_bytes: 1099443970
    vf_tx_dropped: 0
    
  12. Close the Bastion connection to the VM.

Windows

Once you create the VM in Azure, connect to the VM and confirm that the Ethernet controller is installed in Windows.

  1. In the Azure portal, search for and select virtual machines.

  2. On the Virtual machines page, select your new VM.

  3. On the VM's Overview page, select Connect then Connect via Bastion.

  4. Enter the credentials you used when you created the VM, and then select Connect.

  5. A new browser window opens with the Bastion connection to your VM.

  6. On the remote VM, right-click Start and select Device Manager.

  7. In the Device Manager window, expand the Network adapters node.

  8. Confirm that the Mellanox ConnectX-4 Lx Virtual Ethernet Adapter appears, as shown in the following image:

    The presence of the adapter confirms that Accelerated Networking is enabled for your VM.

  9. Verify the packets are flowing over the VF interface from the output of the following command:

    PS C:\ > Get-NetAdapter | Where-Object InterfaceDescription –like "*Mellanox*Virtual*" | Get-NetAdapterStatistics
    
    Name                             ReceivedBytes ReceivedUnicastPackets       SentBytes SentUnicastPackets
    ----                             ------------- ----------------------       --------- ------------------
    Ethernet 2                           492447549                 347643         7468446              34991
    
    

    Note

    If the Mellanox adapter fails to start, open an administrator command prompt on the remote VM and enter the following command:

    netsh int tcp set global rss = enabled

  10. Close the Bastion connection to the VM.

Next steps

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4