2.2.9. Install as a VM using Microsoft Azure¶
This section will guide you to deploy Virtual Service Router running on Microsoft Azure’s virtual machine.
The following tools are required:
Azure Command-Line Interface: The CLI used to create and manage Azure resources
AzCopy: A command-line utility to upload file on Azure.
These instructions demonstrate how to perform the steps using Azure CLI, but you can also use the Azure Portal or any other Azure capable API to complete these steps.
Build VHD image from qcow2¶
Resize image to align to 1MB
size=$(qemu-img info -f qcow2 --output json <path to qcow2> | \ gawk 'match($0, /"virtual-size": ([0-9]+),/, val) {print val[1]}') MB=$((1024*1024)) rounded_size=$((($size/$MB + 1)*$MB)) qemu-img resize -f qcow2 <path to qcow2> $rounded_size
Convert .qcow2 into a .vhd
qemu-img convert -f qcow2 -o subformat=fixed,force_size -O vpc \ <path to qcow2> <path to vhd>
Upload VHD on Azure¶
The following steps are extracted from Microsoft Azure official documentation.
Create a resource group:
az group create -l westeurope -g test
Create a disk with an upload size:
$upload_size=$(stat --print="%s" <path_to_vhd>) az disk create -n vsr-disk -g test --for-upload --upload-size-bytes $upload_size --sku standard_lrs
<path_to_vhd> is the path to the Virtual Service Router image in VHD file format.
Grant the disk access and copy the returned value:
az disk grant-access -n vsr-disk -g test --access-level Write --duration-in-seconds 3000
Upload the VHD image with AzCopy:
azcopy copy <path_to_vhd> <disk_access> --blob-type PageBlob
Make the disk usable:
az disk revoke-access -n vsr-disk -g test
Create Virtual Service Router image:
az image create -n vsr-img -g test --source vsr-disk --os-type linux
Launch a Virtual Service Router VM¶
Start Virtual Service Router on Azure’s virtual machine with 3 network interfaces: eth0 with a public IP address, eth1 and eth2 are used by DPDK.
Create network interfaces¶
Create a network security rule allowing ssh connexion:
az network nsg create -n nsg -g test az network nsg rule create -n nsgrule1 -g test --nsg-name --access Allow --protocol Tcp --direction Inbound --source-port-range "*" --destination-address-prefix "*" --destination-port-range 22 --priority 500
Create a virtual network:
az network vnet create -n vnet -g test --address-prefixes 10.0.0.0/16 --network-security-group nsg az network vnet subnet create -n subnet -g test --vnet-name vnet --address-prefixes 10.0.0.0/24
Create a public IP address for ssh connexion:
az network public-ip create -n publicIp -g test --allocation-method Dynamic --version IPv4
Create network interfaces:
az network nic create -n nic0 -g test --vnet-name vnet --subnet subnet --network-security-group nsg --public-ip-address publicIp az network nic create -n nic1 -g test --vnet-name vnet --subnet subnet --ip-forwarding true --accelerated-networking true az network nic create -n nic2 -g test --vnet-name vnet --subnet subnet --ip-forwarding true --accelerated-networking true
Important
Do not forget IP forwarding and accelerated network options. These options will enable traffic forwarding and SR-IOV on the interface.
Create a Virtual Service Router VM from the image¶
Get the id of the created vsr image:
id=$(az image show -n vsr-img -g test --query {id:id} -o tsv)
Start the VM from this image id:
az vm create -n vsr -g test --image $id --nics nic0 nic1 nic2
Then connect on the VM with the provided password. The next step is to perform your first configuration.