Main Content

Install Products for Submitting Polyspace Analysis from Desktops to Servers Hosted on Azure

Cloud platforms enable you to easily scale your resources to meet your requirements and to securely access those resources from anywhere. This topic describes installation and configuration steps so that you can offload a Polyspace® analysis from a client machine to a more powerful machine hosted on a Microsoft® Azure® cloud platform.

Note

These instructions are valid only for Polyspace Server products version R2021b and later. To deploy versions R2021a and earlier to Azure, contact MathWorks Technical Support.

Prepare Your Installation

Before you begin your installation, make sure that you have:

  • A Microsoft Azure account.

  • A valid license for Polyspace Bug Finder or Code Prover Server and MATLAB Parallel Server.

  • A client machine with a Polyspace Desktop product already installed. See Install Polyspace Desktop Products.

To ease cloud deployments, MathWorks provides reference architectures that enable you to start a cluster in a few clicks by using a template. The clusters run on Windows virtual machines. To complete this installation:

  1. Install a license manager. See Configure and Deploy Network License Manager Resources. This step is optional if you already have a license manager server.

  2. Deploy the MATLAB Parallel Server and Polyspace resources on Azure. See Configure and Deploy MATLAB Parallel Server and Polyspace Server Resources.

  3. Configure the client machines that offload the analysis to the Azure cluster. See Configure Client Machines.

Polyspace does not support online licensing. To manage license checkouts, install a license server on the cloud or use an onsite license server.

Client machine offloading to MPS cluster hosted on Azure

Configure and Deploy Network License Manager Resources

If you already have a License Manager Server running and that server is accessible from the cloud, skip this section.

To deploy a network license manager on Microsoft Azure, use the license-manager-for-matlab-on-azure architecture:

  1. Select a release. Polyspace products are available in the reference architecture only in R2021b and later releases.

  2. On the page for the release that you selected, click Deploy to Azure. You can deploy the resources in a new virtual network or in an existing virtual network. You might be asked to log into your Azure account.

  3. Complete the template configuration.

    ParameterDescription
    Resources groupSelect a resource group from the drop-down list or click Create new to create a group. See What is a resource group.
    RegionSelect a region from the drop-down list. This field is read-only if you use an existing resource group.
    Client IP address

    Specify a public IP address that is allowed to connect to the server hosting the license manager from outside the network security group (NSG). Typically, this is the public IP of your client machine.

    To find this IP address, from the client machine, search “What’s my IP address” in a search engine or contact your IT administrator.

    For example, if your IP is 123.456.78, enter 123.456.78/32.

    Admin PasswordPassword you use to log into the license manager dashboard.
    Virtual Network Resource ID

    Specify the resource ID of an existing virtual network. To find the resource ID of a virtual network:

    1. From the Azure portal, click Resource groups and select the resource group of the virtual network on the next page.

    2. On the resource group page, click the name of the virtual network.

    3. Click Properties in the left pane and copy the Resource ID field.

    You specify this parameter only if you deploy the license server to an existing virtual network.

    Subnet Name

    Specify the name of an existing virtual network subnet. To find the subnet name, follow steps a and b from the previous row, then click Subnets in the left pane and copy the Name field.

    You specify this parameter only if you deploy the license server to an existing virtual network.

  4. Click Review + create. After the final validation completes, click Create. The creation of the resources takes a few moments to complete.

  5. Once the deployment is complete, click Outputs in the left pane and copy the networkLicenseManagerAddress URL. You use this URL to access the license manager dashboard.

    Azure license server stack output tab

    Use the password from step 3 to log into the dashboard and follow the Getting started instructions to activate your license and start the license manager.

Configure and Deploy MATLAB Parallel Server and Polyspace Server Resources

To deploy the MATLAB Parallel Server, which includes Polyspace, on Microsoft Azure, use the matlab-parallel-server-on-azure reference architecture.

  1. Select a release. Polyspace products are available in the reference architecture only in R2021b and later releases.

  2. On the page for the release that you selected, click Deploy to Azure. You can deploy the resources in a new virtual network or in an existing virtual network. If you deployed your license manager on Azure, deploy MATLAB® Parallel Server™ within the same virtual network as the license manager.

  3. Complete the template configuration.

    ParameterDescription
    Resources groupSelect a resource group from the drop-down list or click Create new to create a new group. See What is a resource group. If you deployed the license manager on Azure, select the resource group of the license manager.
    RegionSelect a region from the drop-down list. This field is read-only if you use an existing resource group.
    Cluster NameSpecify a name for the MATLAB Parallel Server cluster. You use this name to specify the cluster when you configure client machines.
    Num Worker NodesSpecify the number of Azure instances to start for worker nodes to run on, for instance 1.
    Num Workers Per NodeSpecify the number of workers to start on each node. It is recommended to specify one worker for every two vCPUs. For more on the number of vCPUs for each type of Azure instance, see Sizes for virtual machines in Azure.
    Head Node Vm SizeSpecify the Azure instance type that you use for the head node. This node runs only the job manager and can be a smaller instance size. See Sizes for virtual machines in Azure.
    Worker Vm Size

    Specify the Azure instance type that you use for the worker nodes.

    Make sure that the instance type meets or exceeds the minimum Polyspace hardware requirements (16 GB RAM and 4 cores). See Sizes for virtual machines in Azure.

    Client IP address

    Specify a public IP address that is allowed to connect to the server hosting the license manager from outside the network security group (NSG). Typically, this is the public IP of your client machine.

    To find this IP address, from the client machine, search “What’s my IP address” in a search engine or contact your IT administrator.

    For example, if your IP is 123.456.78, enter 123.456.78/32.

    Admin PasswordPassword you use in combination with username "matlab" to log into any instance using remote desktop protocol.
    Virtual Network Resource ID

    Specify the resource ID of an existing virtual network. To find the resource ID of a virtual network:

    1. From the Azure portal, click Resource groups and select the resource group of the virtual network on the next page.

    2. On the resource group page, click the name of the virtual network.

    3. Click Properties in the left pane and copy the Resource ID field.

    You specify this parameter only if you deploy MATLAB Parallel Server and Polyspace to an existing virtual network.

    Subnet Name

    Specify the name of an existing virtual network subnet, for instance netlm-subnet.

    To find the subnet name, follow steps a and b from the previous row, then click Subnets in the left pane and copy the Name field.

    You specify this parameter only if you deploy MATLAB Parallel Server and Polyspace to an existing virtual network.

    License Server

    Specify the address of the license manager in the format port@hostname, for example, 27000@netlm-server.

    The port and hostname that you specify must be accessible from the virtual network and subnet where you deploy the MATLAB Parallel Server resources.

  4. Click Review + create. After the final validation completes, click Create. The creation of the resources takes a few moments to complete.

  5. Once the deployment is complete, click Go to resource group and then, on the resource group page, click the storage account.

    list of Azure resources, including storage account

  6. On the storage account page:

    1. Click File shares in the left pane.

    2. Click shared and then cluster.

    3. Download the cluster profile .settings file. You use this file when you configure the client machines to enable communication between the cluster and the client machine.

Configure Client Machines

After you deploy the MATLAB Parallel Server and Polyspace Server to the cloud, configure the client machines that you use to offload the analyses to Polyspace in the cloud.

  1. From the client machine, open the Polyspace desktop interface, go to Tools > Preferences, select the Server Configuration tab, and click Settings.

  2. On the Cluster Profile Manager window toolstrip, click Import. Select the cluster profile .settings file that you downloaded in step 6 of Configure and Deploy MATLAB Parallel Server and Polyspace Server Resources. If you did not configure and deploy the MATLAB Parallel Server resources on Azure, contact your Azure administrator to obtain the cluster profile file.

    Copy the values of the MJSName and Host fields from the properties tab. Click Edit at the bottom right of the window to make the field text selectable. You use these values in later configuration steps.

  3. Click Validate on the toolstrip to check the communication with the Azure cluster. Some issues that might cause the validation to fail are:

    • Incorrect client IP address. Check the resources settings or contact your cluster administrator.

    • Incorrect virtual network port configuration. Check the virtual network settings or contact your cluster administrator. See also Port requirements for accessing MATLAB Parallel Server.

    • Invalid MATLAB Parallel Server license. Check that you are using the correct license or contact your license administrator.

    This validation step does not check the validity of your Polyspace Server product license. To check that you are using a valid license, see Check the Polyspace Server License.

  4. Close the Cluster Profile Manager and enter the MJSName that you obtained in step 2 in the Job Scheduler host name field.

  5. Restart the Polyspace desktop interface to apply the new settings.

To start offloading an analysis to Polyspace in the cloud, in the Configuration pane of the Polyspace desktop interface, select the Run Settings node and enable analysis on a remote cluster. See also Code Prover Analysis on Clusters.

Check the Polyspace Server License

The validation step that you perform in the Cluster Profile Manager does not check the validity of the Polyspace Server license. To check the Polyspace Server license, at the command line on the client machine, navigate to the Polyspace desktop installation folder, for instance C:\Program Files\Polyspace\R2024b, and run this command:

  • Windows®

    polyspace\bin\polyspace-bug-finder.exe -ver -batch -scheduler MJSName@host

  • Linux®

    polyspace/bin/polyspace-bug-finder -ver -batch -scheduler MJSName@host

where MJSName and host are the values that you obtained from the Cluster Profile Manager in step 2 of Configure Client Machines.

The command outputs system information about the machine where the Polyspace Server products are deployed. If you have a valid license, you see a message similar to this message in the output:

Polyspace related licenses and license feature names:

Polyspace Bug Finder Server: Polyspace_BF_Server
Polyspace Code Prover Server: Polyspace_CP_Server
If you get a license error message or if the output does not list any Polyspace products under the line Polyspace related licenses and license feature names:, your Polyspace license might be invalid. Contact your Polyspace license administrator.

Update or Delete Resources

To upgrade to a newer release of the reference architectures, you must delete the existing resources and deploy the new version.

To delete the existing resources:

  1. From the Azure portal, click Resource groups, and then click the name of the resource group that you want to do delete.

  2. On the resource group page, click Delete resource group and follow the instructions.

If you update the license manager to a newer version, the new resource has a different host ID. Even if you choose to keep the same license manager stack, you must update your license file when you update to a new version of Polyspace.