Quickstart: Create an Azure Operator Nexus virtual machine by using Azure Resource Manager template (ARM template)
- Deploy an Azure Nexus virtual machine using an Azure Resource Manager template.
This quick-start guide is designed to help you get started with using Nexus virtual machines to host virtual network functions (VNFs). By following the steps outlined in this guide, you're able to quickly and easily create a customized Nexus virtual machine that meets your specific needs and requirements. Whether you're a beginner or an expert in Nexus networking, this guide is here to help. You learn everything you need to know to create and customize Nexus virtual machines for hosting virtual network functions.
Before you begin
If you don't have an Azure subscription, create an Azure free account before you begin.
Use the Bash environment in Azure Cloud Shell. For more information, see Quickstart for Bash in Azure Cloud Shell.
If you prefer to run CLI reference commands locally, install the Azure CLI. If you're running on Windows or macOS, consider running Azure CLI in a Docker container. For more information, see How to run the Azure CLI in a Docker container.
If you're using a local installation, sign in to the Azure CLI by using the az login command. To finish the authentication process, follow the steps displayed in your terminal. For other sign-in options, see Sign in with the Azure CLI.
When you're prompted, install the Azure CLI extension on first use. For more information about extensions, see Use extensions with the Azure CLI.
Run az version to find the version and dependent libraries that are installed. To upgrade to the latest version, run az upgrade.
Install the latest version of the necessary Azure CLI extensions.
This article requires version 2.49.0 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
If you have multiple Azure subscriptions, select the appropriate subscription ID in which the resources should be billed using the
az account
command.Before proceeding with virtual machine creation, ensure that the container image to be used is created according to the instructions.
Create a resource group using the
az group create
command. An Azure resource group is a logical group in which Azure resources are deployed and managed. When you create a resource group, you're prompted to specify a location. This location is the storage location of your resource group metadata and where your resources run in Azure if you don't specify another region during resource creation. The following example creates a resource group named myResourceGroup in the eastus location.az group create --name myResourceGroup --location eastus
The following output example resembles successful creation of the resource group:
{ "id": "/subscriptions/<guid>/resourceGroups/myResourceGroup", "location": "eastus", "managedBy": null, "name": "myResourceGroup", "properties": { "provisioningState": "Succeeded" }, "tags": null }
To deploy a Bicep file or ARM template, you need write access on the resources you're deploying and access to all operations on the Microsoft.Resources/deployments resource type. For example, to deploy a cluster, you need Microsoft.NetworkCloud/virtualMachines/write and Microsoft.Resources/deployments/* permissions. For a list of roles and permissions, see Azure built-in roles.
You need the
custom location
resource ID of your Azure Operator Nexus cluster.You need to create various networks according to your specific workload requirements, and it's essential to have the appropriate IP addresses available for your workloads. To ensure a smooth implementation, it's advisable to consult the relevant support teams for assistance.
- Complete the prerequisites for deploying a Nexus virtual machine.
Review the template
Before deploying the virtual machine template, let's review the content to understand its structure.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vmName": {
"type": "string",
"metadata": {
"description": "The name of Nexus virtual machine"
}
},
"location": {
"type": "string",
"metadata": {
"description": "The Azure region where the VM is to be deployed"
},
"defaultValue": "[resourceGroup().location]"
},
"extendedLocation": {
"type": "string",
"metadata": {
"description": "The custom location of the Nexus instance"
}
},
"tags": {
"type": "object",
"metadata": {
"description": "The metadata tags to be associated with the cluster resource"
},
"defaultValue": {}
},
"adminUsername": {
"type": "string",
"defaultValue": "azureuser",
"maxLength": 32,
"minLength": 1,
"metadata": {
"description": "The name of the administrator to which the ssh public keys will be added into the authorized keys."
}
},
"bootMethod": {
"type": "string",
"defaultValue": "UEFI",
"allowedValues": ["UEFI", "BIOS"],
"metadata": {
"description": "Selects the boot method for the virtual machine."
}
},
"cloudServicesNetworkId": {
"type": "string",
"metadata": {
"description": "The Cloud Services Network attachment ARM ID to attach to virtual machine."
}
},
"cpuCores": {
"type": "int",
"defaultValue": 2,
"metadata": {
"description": "Number of CPU cores for the virtual machine. Choose a value between 2 and 46."
}
},
"memorySizeGB": {
"type": "int",
"defaultValue": 4,
"metadata": {
"description": "The memory size of the virtual machine in GiB (max 224 GiB)"
}
},
"networkAttachments": {
"type": "array",
"metadata": {
"description": "The list of network attachments to the virtual machine."
}
/*
{
"attachedNetworkId": "string",
"defaultGateway": "True"/"False",
"ipAllocationMethod": "Dynamic"/"Static"/"Disabled",
"ipv4Address": "string",
"ipv6Address": "string",
"networkAttachmentName": "string"
}
*/
},
"networkData": {
"type": "string",
"metadata": {
"description": "The Base64 encoded cloud-init network data."
},
"defaultValue": ""
},
"placementHints": {
"type": "array",
"metadata": {
"description": "The placement hints for the virtual machine."
},
"defaultValue": []
/*
{
"hintType": "Affinity",
"resourceId": "string",
"schedulingExecution": "Hard",
"scope": "Rack"
}
*/
},
"sshPublicKeys": {
"type": "array",
"metadata": {
"description": "The list of SSH public keys for the virtual machine."
}
/*
{
"keyData": "string"
}
*/
},
"storageProfile": {
"type": "object",
"metadata": {
"description": "StorageProfile represents information about a disk."
},
"defaultValue": {
"osDisk": {
"createOption": "Ephemeral",
"deleteOption": "Delete",
"diskSizeGB": 64
}
}
},
"userData": {
"type": "string",
"metadata": {
"description": "The Base64 encoded cloud-init user data."
},
"defaultValue": ""
},
"vmDeviceModel": {
"type": "string",
"defaultValue": "T2",
"allowedValues": ["T1", "T2"],
"metadata": {
"description": "The type of the device model to use."
}
},
"vmImage": {
"type": "string",
"metadata": {
"description": "The virtual machine image that is currently provisioned to the OS disk, using the full URL and tag notation used to pull the image."
}
},
"vmImageRepositoryCredentials": {
"type": "object",
"metadata": {
"description": "Credentials used to login to the image repository."
}
/*
"password": "string",
"registryUrl": "string",
"username": "string"
*/
}
},
"resources": [
{
"type": "Microsoft.NetworkCloud/virtualMachines",
"apiVersion": "2023-07-01",
"name": "[parameters('vmName')]",
"location": "[parameters('location')]",
"extendedLocation": {
"type": "CustomLocation",
"name": "[parameters('extendedLocation')]"
},
"tags": "[parameters('tags')]",
"properties": {
"adminUsername": "[if(empty(parameters('adminUsername')), json('null'), parameters('adminUsername'))]",
"bootMethod": "[if(empty(parameters('bootMethod')), json('null'), parameters('bootMethod'))]",
"cloudServicesNetworkAttachment": {
"attachedNetworkId": "[parameters('cloudServicesNetworkId')]",
"defaultGateway": "False",
"ipAllocationMethod": "Dynamic"
},
"cpuCores": "[parameters('cpuCores')]",
"memorySizeGB": "[parameters('memorySizeGB')]",
"networkData": "[if(empty(parameters('networkData')), json('null'), parameters('networkData'))]",
"networkAttachments": "[if(empty(parameters('networkAttachments')), json('null'), parameters('networkAttachments'))]",
"placementHints": "[if(empty(parameters('placementHints')), json('null'), parameters('placementHints'))]",
"sshPublicKeys": "[if(empty(parameters('sshPublicKeys')), json('null'), parameters('sshPublicKeys'))]",
"storageProfile": "[if(empty(parameters('storageProfile')), json('null'), parameters('storageProfile'))]",
"userData": "[if(empty(parameters('userData')), json('null'), parameters('userData'))]",
"vmDeviceModel": "[if(empty(parameters('vmDeviceModel')), json('null'), parameters('vmDeviceModel'))]",
"vmImage": "[if(empty(parameters('vmImage')), json('null'), parameters('vmImage'))]",
"vmImageRepositoryCredentials": "[if(empty(parameters('vmImageRepositoryCredentials')), json('null'), parameters('vmImageRepositoryCredentials'))]"
}
}
]
}
Once you have reviewed and saved the template file named virtual-machine-arm-template.json
, proceed to the next section to deploy the template.
Deploy the template
- Create a file named
virtual-machine-parameters.json
and add the required parameters in JSON format. You can use the following example as a starting point. Replace the values with your own.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vmName": {
"value": "myNexusVirtualMachine"
},
"location": {
"value": "eastus"
},
"extendedLocation": {
"value": "/subscriptions/<subscription>/resourcegroups/<cluster-managed-resource-group>/providers/microsoft.extendedlocation/customlocations/<custom-location-name>"
},
"cloudServicesNetworkId": {
"value": "/subscriptions/<subscription>/resourceGroups/<network-resource-group>/providers/Microsoft.NetworkCloud/cloudServicesNetworks/<csn-name>"
},
"networkAttachments": {
"value": [
{
"attachedNetworkId": "/subscriptions/<subscription>/resourceGroups/<network-resource-group>/providers/Microsoft.NetworkCloud/l3Networks/<l3network-name>",
"ipAllocationMethod": "Dynamic",
"defaultGateway": "True",
"networkAttachmentName": "mgmt0"
}
]
},
"sshPublicKeys": {
"value": [
{
"keyData": "ssh-rsa AAAAB3...."
}
]
},
"vmImage": {
"value": "<Image ACR URL>"
},
"vmImageRepositoryCredentials": {
"value": {
"password": "********************",
"registryUrl": "<ACR registry URL>",
"username": "<ACR user name>"
}
}
}
}
- Deploy the template.
az deployment group create --resource-group myResourceGroup --template-file virtual-machine-arm-template.json --parameters @virtual-machine-parameters.json
Review deployed resources
After the deployment finishes, you can view the resources using the CLI or the Azure portal.
To view the details of the myNexusVirtualMachine
cluster in the myResourceGroup
resource group, execute the following
az networkcloud virtualmachine show --name myNexusVirtualMachine --resource-group myResourceGroup
Clean up resources
When no longer needed, delete the resource group. The resource group and all the resources in the resource group are deleted.
Use the az group delete command to remove the resource group, virtual machine, and all related resources except the Operator Nexus network resources.
az group delete --name myResourceGroup --yes --no-wait
Next steps
You've successfully created a Nexus virtual machine. You can now use the virtual machine to host virtual network functions (VNFs).