Obtaining and preparing disk images for Azure deployments
Pexip publishes Azure-optimized disk images for the Management Node and for Conferencing Nodes.
Preparing disk images for use
Before you can use the published Pexip Infinity disk images, you must copy them to your storage account in Azure. This guide refers to a disk image copied to your storage account as a prepared disk image. All deployment operations use prepared disk images.
The following PowerShell script will copy the published disk images for a Management Node and for a Conferencing Node to your storage account so that they may be used to deploy VM instances.
You must edit the variables in the script to provide the name of your Azure subscription ($subscriptionName), the name of the resource group ($resourceGroupName), the name of the storage account ($storageAccountName), and the Pexip Infinity version-build number to use ( $version — currently 12-2-0-29803-0-0 for v12 software).
# Name of your Azure subscription
$subscriptionName = ""
# Name of the resource group to use
$resourceGroupName = ""
# Name of the storage account to copy the disk images into
$storageAccountName = ""
# Name of the container within the storage account to copy the disk images into
$containerName = "vm-images"
# Version of Pexip Infinity to copy
$version = "12-2-0-29803-0-0"
# Add your Azure account to the PowerShell environment
Add-AzureRmAccount
# Set the current subscription
Get-AzureRmSubscription -SubscriptionName $subscriptionName | Select-AzureRmSubscription
# Obtain the access key for the storage account
$storageAccountKey = Get-AzureRmStorageAccountKey -ResourceGroupName $resourceGroupName -Name $storageAccountName
If($storageAccountKey.GetType().Name -eq "StorageAccountKeys") {
# AzureRM.Storage < 1.1.0
$storageAccountKey = $storageAccountKey.Key1
} Else {
# AzureRm.Storage 1.1.0
$storageAccountKey = $storageAccountKey[0].Value
}
# Create the storage access context
$ctx = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey
# Ensure that the container exists
New-AzureStorageContainer -Name $containerName -Context $ctx
# Start copying the Management Node image
$mgmt = Start-AzureStorageBlobCopy -AbsoluteUri "https://pexipas.blob.core.windows.net/infinity/$version/management-node.vhd" -DestContainer $containerName -DestBlob "pexip-infinity-$version-management-node.vhd" -DestContext $ctx
# Start copying the Conferencing Node image
$cnfc = Start-AzureStorageBlobCopy -AbsoluteUri "https://pexipas.blob.core.windows.net/infinity/$version/conferencing-node.vhd" -DestContainer $containerName -DestBlob "pexip-infinity-$version-conferencing-node.vhd" -DestContext $ctx
# Wait for the Management Node image to finish copying
$status = Get-AzureStorageBlobCopyState -Blob $mgmt.Name -Container $containerName -Context $ctx
While($status.Status -eq "Pending") {
$status
$status = Get-AzureStorageBlobCopyState -Blob $mgmt.Name -Container $containerName -Context $ctx
Start-Sleep 10
}
$status
# Wait for the Conferencing Node image to finish copying
$status = Get-AzureStorageBlobCopyState -Blob $cnfc.Name -Container $containerName -Context $ctx
While($status.Status -eq "Pending") {
$status
$status = Get-AzureStorageBlobCopyState -Blob $cnfc.Name -Container $containerName -Context $ctx
Start-Sleep 10
}
$status
# Print out the prepared disk image URLs for later use
"Prepared Management Node disk image: " + $mgmt.ICloudBlob.Uri.AbsoluteUri
"Prepared Conferencing Node disk image: " + $cnfc.ICloudBlob.Uri.AbsoluteUri
Alternatively, if using the Azure CLI, the following script is equivalent.
You must edit the variables in the script to provide the name of your Azure subscription (subscriptionName), the name of the resource group (resourceGroupName), the name of the storage account (storageAccountName) and the Pexip Infinity version number to use ( version — currently 12-2-0-29803-0-0 for v12 software).
#!/bin/sh
set -e
# Name of your Azure subscription
subscriptionName=""
# Name of the resource group to use
resourceGroupName=""
# Name of the storage account to copy the disk images into
storageAccountName=""
# Name of the container within the storage account to copy the disk images into
containerName="vm-images"
# Version of Pexip Infinity to copy
version="12-2-0-29803-0-0"
# Ensure CLI is in ARM mode
azure config mode arm
# Log in to Azure
azure login
# Set the current suscription
azure account set $subscriptionName
# Obtain the access key for the storage account
storageAccountKey=$(azure storage account keys list -g $resourceGroupName $storageAccountName | grep 'Primary' | sed -e 's/^.*Primary: \(.*\)$/\1/')
# Ensure that the container exists
azure storage container create -a $storageAccountName -k $storageAccountKey $containerName || true
# Start copying the Management Node image
azure storage blob copy start --dest-account-name $storageAccountName --dest-account-key $storageAccountKey --dest-container $containerName --dest-blob "pexip-infinity-$version-management-node.vhd" "https://pexipas.blob.core.windows.net/infinity/$version/management-node.vhd"
# Start copying the Conferencing Node image
azure storage blob copy start --dest-account-name $storageAccountName --dest-account-key $storageAccountKey --dest-container $containerName --dest-blob "pexip-infinity-$version-conferencing-node.vhd" "https://pexipas.blob.core.windows.net/infinity/$version/conferencing-node.vhd"
# Wait for the Management Node image to finish copying
while azure storage blob copy show --json -a $storageAccountName -k $storageAccountKey --container $containerName --blob "pexip-infinity-$version-management-node.vhd" | grep -q '"copyStatus": "pending"'; do sleep 10; done
azure storage blob copy show --json -a $storageAccountName -k $storageAccountKey --container $containerName --blob "pexip-infinity-$version-management-node.vhd"
# Wait for the Conferencing Node image to finish copying
while azure storage blob copy show --json -a $storageAccountName -k $storageAccountKey --container $containerName --blob "pexip-infinity-$version-conferencing-node.vhd" | grep -q '"copyStatus": "pending"'; do sleep 10; done
azure storage blob copy show --json -a $storageAccountName -k $storageAccountKey --container $containerName --blob "pexip-infinity-$version-conferencing-node.vhd"
# Print out the prepared disk image URLs for later use
echo "Prepared Management Node disk image: https://$storageAccountName.blob.core.windows.net/$containerName/pexip-infinity-$version-management-node.vhd"
echo "Prepared Conferencing Node disk image: https://$storageAccountName.blob.core.windows.net/$containerName/pexip-infinity-$version-conferencing-node.vhd"
Now that you have your prepared disk images in your Azure storage account you can use them to create the VM instances in Azure in which you can deploy the Pexip Infinity Management Node and Conferencing Nodes.