MATLAB Production Server on Microsoft Azure
Before starting, you need the following:
- A MATLAB® Production Server™ license. For more information, see Configure MATLAB Production Server Licensing on the Cloud. In order to configure the license in the cloud, you will need the MAC address of the license server on the cloud. You can get the license server MAC address only after deploying the solution to the cloud. For more information, see Get License Server MAC Address.
- A Microsoft Azure™ account.
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.
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.
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|
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 :
|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.
|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.
|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.
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 (
|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.
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.
In the Azure Portal, on the navigation panel on the left, click Resource groups. This will display all your resource groups.
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.
Select the resource labeled servermachine-public-ip. This resource contains the public IP address to the MATLAB Production Server Cloud Console.
Copy the IP address from the IP address field.
In your browser, connect to the cloud console using the IP address.
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
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.
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
servermachinein 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.
In the cloud console, click Administration > Manage License.
Click Browse License File, select the license file you want to upload, and click Open.
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.
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.
- Login to the Azure Portal.
- Select the resource group containing your cluster resources.
- Select the Delete resource group icon to destroy all resources deployed in this group.
- You will be prompted to enter the name of the resource group to confirm the deletion.
When you run MATLAB Production Server on the cloud you get two HTTPS endpoints that use self-signed certificates.
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.
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.
Architecture on Azure
|Resource Name||Resource Name in Azure||Number of Resources||Description|
|MATLAB Production Server Cloud Console and License Manager virtual machine||
||1||Virtual machine(VM) that hosts the MATLAB Production Server Cloud Console and license manager. Use the cloud console to:
For more information, see MATLAB Production Server Cloud Console User's Guide.
|MATLAB Production Server Cloud Console 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||
||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.|
||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.
||NA||Storage account where logs for the reference architecture are stored. The server logs are stored in an Azure Table.|
||1||Enables resources to communicate with each other.|
How do I launch a template that uses a previous MATLAB release?
|Release||Windows Server 2016 VM||Ubuntu 16.04 VM|
What versions of MATLAB Runtime are supported?
|Release||MATLAB Runtime||MATLAB Runtime||MATLAB Runtime||MATLAB Runtime||MATLAB Runtime||MATLAB Runtime||MATLAB Runtime|
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.
Provide suggestions for additional features or capabilities using the following link: https://www.mathworks.com/cloud/enhancement-request.html