Obtaining and preparing disk images for Azure deployments

Pexip publishes Azure-optimized disk images for the Management Node and for Conferencing Nodes. This topic includes a PowerShell script that copies and prepares your disk images, and instructions for running the script via a Windows client.

Preparing disk images for use

Before you can use the published Pexip Infinity disk images, you must copy them into your Azure environment. This guide refers to a disk image copied into your Azure environment as a prepared disk image. All deployment operations use prepared disk images.

The following PowerShell script copies both of the published VHDs (for a Management Node and for a Conferencing Node) to your storage account (into a storage container called vm-images) and then creates an image from those VHDs so that they may be used to deploy VM instances. Note that these images can be stored in your shared resource group (whereas we recommend that each VM instance created from these images is deployed in its own resource group).

You must edit the variables in the script to provide the name of the:

  • Azure subscription ($subscriptionName)
  • region (location) to use ($regionName)
  • resource group ($resourceGroupName)
  • storage account ($storageAccountName)
  • Pexip Infinity version-build number to use ($version — currently 34-0-0-76191-0-0 for v34 software). If you are running an older version of Pexip Infinity software, see Version information for previous Pexip Infinity releases.
Copy to clipboard
# Name of your Azure subscription
$subscriptionName = ""
# Name of the Azure region (location) to use
$regionName = ""
# 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 = "34-0-0-76191-0-0"

# Add your Azure account to the PowerShell environment
Import-Module Az -MinimumVersion 9.0.1
Connect-AzAccount

# Set the current subscription
Get-AzSubscription -SubscriptionName $subscriptionName | Select-AzSubscription

# Obtain the access key for the storage account
$storageAccountKey = Get-AzStorageAccountKey -ResourceGroupName $resourceGroupName -Name $storageAccountName
If($storageAccountKey.GetType().Name -eq "StorageAccountKeys") {
    # Az.Storage < 1.1.0
    $storageAccountKey = $storageAccountKey.Key1
} Else {
    # Az.Storage 1.1.0
    $storageAccountKey = $storageAccountKey[0].Value
}            

# Create the storage access context
$ctx = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey

# Create the container
New-AzStorageContainer -Name $containerName -Context $ctx

# Start copying the Management Node image
$mgmt = Start-AzStorageBlobCopy -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-AzStorageBlobCopy -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-AzStorageBlobCopyState -Blob $mgmt.Name -Container $containerName -Context $ctx
While($status.Status -eq "Pending") {
    $status
    $status = Get-AzStorageBlobCopyState -Blob $mgmt.Name -Container $containerName -Context $ctx
    Start-Sleep 10
}
$status

# Wait for the Conferencing Node image to finish copying
$status = Get-AzStorageBlobCopyState -Blob $cnfc.Name -Container $containerName -Context $ctx
While($status.Status -eq "Pending") {
    $status
    $status = Get-AzStorageBlobCopyState -Blob $cnfc.Name -Container $containerName -Context $ctx
    Start-Sleep 10
}
$status

# Create Azure images from the vhd files
$imageConfigMgmt = New-AzImageConfig -Location $regionName
$osDiskVhdUriMgmt = $mgmt.ICloudBlob.Uri.AbsoluteUri
Set-AzImageOsDisk -Image $imageConfigMgmt -OsType "Linux" -OsState "Generalized" -StorageAccountType "Premium_LRS" -BlobUri $osDiskVhdUriMgmt
$imageMgmt = New-AzImage -Image $imageConfigMgmt -ImageName "pexip-infinity-$version-management-node-image" -ResourceGroupName $resourceGroupName

$imageConfigCnfc = New-AzImageConfig -Location $regionName
$osDiskVhdUriCnfc = $cnfc.ICloudBlob.Uri.AbsoluteUri
Set-AzImageOsDisk -Image $imageConfigCnfc -OsType "Linux" -OsState "Generalized" -StorageAccountType "Premium_LRS" -BlobUri $osDiskVhdUriCnfc
$imageCnfc = New-AzImage -Image $imageConfigCnfc -ImageName "pexip-infinity-$version-conferencing-node-image" -ResourceGroupName $resourceGroupName

# Print out the prepared disk image resource IDs for later use
"Management Node disk image resource ID:   " + $imageMgmt.Id
"Conferencing Node disk image resource ID: " + $imageCnfc.Id

Running the script via your Windows client

To run the PowerShell script from your Windows PC, you need to connect your local machine to Azure:

  1. From your PC, run PowerShell ISE as Administrator by right-clicking on it and selecting Run as Administrator.

  2. When in PowerShell run the following two commands:

    1. Install-Module -Name Az -MinimumVersion 9.0.1 -MaximumVersion 9.7.1 -AllowClobber -Scope AllUsers

      This installs the Azure Resource Manager modules from the PowerShell Gallery.

    2. Install-Module Azure

      This installs the Azure Service Management module from the PowerShell Gallery.

    If you get any prompts while running these commands, select Y for Yes.

    See https://docs.microsoft.com/en-gb/powershell/azure/ for more information about Azure PowerShell.

  3. Copy and paste the PowerShell script from above into a text editor and add in your Subscription Name, Region Name, Resource Group Name and Storage Account name (where shown below), and then save the file as a .ps1 file.

  4. Run the script:

    1. Close the file, right-click on it and select Run with PowerShell.
    2. You are prompted to login, so enter your Azure login credentials.

      If you are using multi-factor authentication, and your credentials are already populated, you may need to manually retype them for the authentication process to complete successfully.

    3. The script will run and copy the images over to your Azure environment. This takes approximately 10 minutes
  5. You can use the Azure portal to confirm when the VHD files have been copied across and the images have been created. From the Azure portal go to your Azure dashboard and select your Resource Group used for shared resources. You will see the Pexip Management Node and Conferencing Node prepared disk images.

Now that you have your prepared disk images in your Azure environment, you can use them to create the VM instances in Azure in which you can deploy the Pexip Infinity Management Node and Conferencing Nodes.

Azure US Government Cloud

If you use Azure US Government Cloud you have to modify the disk images PowerShell script to ensure that you are connected to the correct environment:

  • Change Connect-AzAccount to Connect-AzAccount -EnvironmentName AzureUSGovernment

Note that you will also need to modify the ARM template used to create the VM instances in Azure.

Version information for previous Pexip Infinity releases

If you are running an older version of Pexip Infinity software, and you want to deploy a new Conferencing Node, you must use a published Pexip Infinity disk image version that corresponds to the software version running on your Management Node. This includes dot releases — so for example, for a v21.2 Management Node you must install a v21.2 Conferencing Node rather than a v21 Conferencing Node. Similarly, if your system has been upgraded since you first installed the Management Node and some Conferencing Nodes, you will need to obtain and prepare the appropriate Conferencing Node image corresponding to the software version you are currently running.

To obtain the published disk images for older software versions (for both the Management Node and for a Conferencing Node) you need to use the appropriate software version number in the PowerShell scripts supplied above.

You must replace the current version number (34-0-0-76191-0-0) with the relevant older version as given in the table below:

Pexip Infinity release Version number to use in script
v33.1 33-1-0-74786-0-0
v33 33-0-0-74761-0-0
v32.3 32-3-0-73168-0-0
v32.1 32-1-0-73149-0-0
v32 32-0-0-73111-0-0
v31.4 31-4-0-71765-0-0
v31.3 31-3-0-71747-0-0
v31.2 31-2-0-71745-0-0
v31.1 31-1-0-71716-0-0
v30.1 30-1-0-70407-0-0
v30 30-0-0-70372-0-0