Skip to content
Stand up a MATLAB Production Server using Azure Deployment
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
pics
scripts
templates
LICENSE.md
README.md

README.md

MATLAB Production Server on Microsoft Azure

Requirements

Before starting, you need the following:

Costs

You are responsible for the cost of the Azure services used when you create cloud resources using this guide. Resource settings, such as instance type, will affect the cost of deployment. For cost estimates, see the pricing pages for each Azure service you will be using. Prices are subject to change.

Introduction

The following guide will help you automate the process of running MATLAB Production Server on Azure using your Azure account. The automation is accomplished using an Azure Resource Manager (ARM) template. The template is a JSON file that defines the resources needed to deploy and manage MATLAB Production Server on Azure. Once deployed, you can manage the server using the MATLAB Production Server Cloud Console—a web-based interface to configure and manage server instances on the cloud. For more information, see MATLAB Production Server Cloud Console User's Guide. For information about the architecture of this solution, see Architecture and Resources.

Deployment Steps

Step 1. Launch the Template

Click the Deploy to Azure button to deploy resources on Azure. This will open the Azure Portal in your web browser.

Release Windows Server 2016 VM Ubuntu 16.04 VM
MATLAB R2018b

For other releases, see How do I launch a template that uses a previous MATLAB release?

Note: Creating resources on Azure can take at least 30 minutes.

Step 2. Configure Cloud Resources

Provide values for parameters in the custom deployment template on the Azure Portal :

Parameter Name Value
Subscription Choose an Azure subscription to use for purchasing resources.

Example: VERTHAM Dev

Resource group Choose a name for the resource group that will hold the resources. It is recommended you create a new resource group for each deployment. This allows all resources in a group to be deleted simultaneously.

Example: Saveros

Location Choose the region to start resources in. Ensure that you select a location which supports your requested instance types. To check which services are supported in each location, see Azure Region Services. We recommend you use East US or East US 2.

Example: East US

Server VM Instance Size Specify the size of the VM you plan on using for deployment. Each MATLAB Production Server instance runs on a VM and each instance will run multiple workers. We recommend you choose a VM size where the number of cores on your VM match the number of MATLAB workers per VM you plan on using. The template defaults to: Standard_D4s_v3. This configuration has 4 vCPUs and 16 GiB of Memory. For more information, see Azure documentation.

Example: Standard_D4s_v3

Instance Count Number of VMs to run MATLAB Production Server instances. Each MATLAB Production Server instance runs on a VM and each instance will run multiple workers. The maximum number of MATLAB Production Server instances is limited to 24. This means only a maximum of 24 VMs can be provisioned. Therefore, your instance count cannot exceed 24.

Example: 6

If you have a standard 24 worker MATLAB Production Server license and select Standard_D4s_v3 VM (4 cores) as the Server VM Instance Size, you will need 6 VMs to fully utilize the workers in your license. Therefore, your instance count will be 6.

You can always under provision the number of VMs. In which case you may end up using fewer workers than you are licensed for.

Admin Username Specify the admin user name for all VMs. This will be the username to log in to the MATLAB Production Server Cloud Console.
Admin Password Specify the admin password for all VMs. This will be the password to log in to the MATLAB Production Server Cloud Console.

Note: Your password must not contain single (') or double (") quotes.

Allow connections from This is the IP address range that will be allowed to connect to the cloud console that manages the server. The format for this field is IP Address/Mask.

Example:

10.0.0.1/32
  • This is the public IP address which can be found by searching for "what is my ip address" on the web. The mask determines the number of IP addresses to include.
  • A mask of 32 is a single IP address.
  • Use a CIDR calculator if you need a range of more than one IP addresses.
  • You may need to contact your IT administrator to determine which address is appropriate.


Click Purchase to begin the deployment. This can take up to 40 minutes.

Step 3. Connect to the Cloud Console

Note: Complete these steps only after your resource group has been successfully created.

Note: The Internet Explorer web browser is not supported for interacting with the cloud console.

  1. In the Azure Portal, on the navigation panel on the left, click Resource groups. This will display all your resource groups.

  2. Select the resource group you created for this deployment from the list. This will display the Azure blade of the selected resource group with its own navigation panel on the left.

  3. Select the resource labeled servermachine-public-ip. This resource contains the public IP address to the MATLAB Production Server Cloud Console.

  4. Copy the IP address from the IP address field.

  5. In your browser, connect to the cloud console using the IP address.

Example: https://11.22.135.137

You will now be connected to the MATLAB Production Server Cloud Console.

If you are using a template from a MATLAB release prior to R2018b, you will need to specify a port number of 9000.

Example: https://11.22.135.137:9000

Step 4. Log in to the Cloud Console

Use the admin username and password you created in Step.2 while configuring your resources to log in to the MATLAB Production Server Cloud Console. The cloud console provides a web-based interface to configure and manage server instances on the cloud. For more information on how to use the cloud console, see MATLAB Production Server Cloud Console User's Guide.

MATLAB Production Server Cloud Console

Accept Terms and Conditions: Access to and use of the MATLAB Production Server Cloud Console is governed by license terms in the file C:\MathWorks\Cloud Console License.txt (Linux: /MathWorks/Cloud Console License.txt) available on the servermachine in the resource group for this solution.

Note: The cloud console uses a self-signed certificate which can be changed. For information on changing the self-signed certificates, see Change Self-signed Certificates.

Step 5. Upload the License File

Note: You will need a fixed MAC address to get a license file from the MathWorks License Center. For more information, see Configure MATLAB Production Server Licensing on the Cloud.

  1. In the cloud console, click Administration > Manage License.

  2. Click Browse License File, select the license file you want to upload, and click Open.

  3. Click Upload.

You are now ready to use MATLAB Production Server on Azure.

To run applications on MATLAB Production Server, you will need to create applications using MATLAB Compiler SDK. For more information, see Deployable Archive Creation in the MATLAB Production Server product documentation.

Additional Information

Delete Your Resource Group

Note: Your license file is tied to your MAC address. If you delete your resource group to delete your cluster, you will need to get a new license file. You are limited to changing your MAC address 4 times per year.

You can remove the resource group and all associated cluster resources when you are done with them. Note that there is no undo.

  1. Login to the Azure Portal.
  2. Select the resource group containing your cluster resources.
  3. Select the Delete resource group icon to destroy all resources deployed in this group.
  4. You will be prompted to enter the name of the resource group to confirm the deletion.

Security

When you run MATLAB Production Server on the cloud you get two HTTPS endpoints that use self-signed certificates.

  1. A HTTPS endpoint to the application gateway that connects the server instances. This endpoint is displayed in the home page of the cloud console and is used to make requests to the server.

  2. A HTTPS endpoint to the cloud console. This endpoint is used to connect to the cloud console.

For information on changing the self-signed certificates, see Change Self-signed Certificates.

Architecture and Resources

Deploying this reference architecture will create several resources in your resource group.

Cluster Architecture

Architecture on Azure

Resources

Resource Name Resource Name in Azure Number of Resources Description
MATLAB Production Server Cloud Console and License Manager virtual machine servermachine 1 Virtual machine(VM) that hosts the MATLAB Production Server Cloud Console and license manager. Use the cloud console to:
  • Upload your license file and start using the server
  • Get HTTP/HTTPS endpoint to make requests
  • Upload applications (.ctf files) to the server
  • Manage server configurations
  • Manage the HTTPS certificate

For more information, see MATLAB Production Server Cloud Console User's Guide.

MATLAB Production Server Cloud Console public IP servermachine-public-ip 1 Public IP address to connect to MATLAB Production Server Cloud Console.

NOTE: Provides HTTPS endpoint to the cloud console for managing server instances.

Virtual machine scale set vmss<uniqueID> 1 Manages the number of identical VMs to be deployed. Each VM runs an instance of MATLAB Production Server which in turn runs multiple MATLAB workers.
Application gateway vmss<uniqueID>-agw 1 Provides routing and load balancing service to MATLAB Production Server instances. The MATLAB Production Server Cloud Console retrieves the HTTP/HTTPS endpoint for making requests to the server from the application gateway resource.

NOTE: Provides HTTPS endpoint to the server for making requests.

Storage account serverlog<uniqueID> NA Storage account where logs for the reference architecture are stored. The server logs are stored in an Azure Table.
Virtual network vmss<uniqueID>-vnet 1 Enables resources to communicate with each other.

FAQ

How do I launch a template that uses a previous MATLAB release?

Release Windows Server 2016 VM Ubuntu 16.04 VM
MATLAB R2018a

What versions of MATLAB Runtime are supported?

Release MATLAB Runtime MATLAB Runtime MATLAB Runtime MATLAB Runtime MATLAB Runtime MATLAB Runtime MATLAB Runtime
MATLAB R2018a R2015b R2016a R2016b R2017a R2017b R2018a
MATLAB R2018b R2016a R2016b R2017a R2017b R2018a R2018b

Why do requests to the server fail with errors such as “untrusted certificate” or “security exception”?

These errors result from either CORS not being enabled on the server or due to the fact that the server endpoint uses a self-signed certificate.

If you are making an AJAX request to the server, make sure that CORS is enabled in the server configuration. You can enable CORS by editing the property --cors-allowed-origins in the config file. For more information, see Edit the Server Configuration.

Also, some HTTP libraries and Javascript AJAX calls will reject a request originating from a server that uses a self-signed certificate. You may need to manually override the default security behavior of the client application. Or you can add a new HTTP/HTTPS endpoint to the application gateway. For more information, see Create a Listener.

Enhancement Request

Provide suggestions for additional features or capabilities using the following link: https://www.mathworks.com/cloud/enhancement-request.html

Technical Support

Email: cloud-support@mathworks.com

You can’t perform that action at this time.