VMware Data Services Manager – SQL Server Database Template
In an earlier blog post, the steps to provision a database from a database template using VMware Data Services Manager (DSM) were described. We also previously observed that once the DSM provider configuration is complete, some predefined database templates for both MySQL and PostgreSQL become available for publishing. However, there is also an early access model to allow for the deployment of SQL Server databases using DSM. This does require some additional setup steps to manually create the SQL Server database template. This is the purpose of this post. Once again, we are using the latest version of VMware DSM (currently 1.3.2) in this exercise.
Retrieving the image
The first step is to identify the MS SQL Server version that you wish to use. Microsoft provides a list of container images that run SQL Server on Linux (Ubuntu). The list of SQL Server versions that can be used to create the database template are available on this Microsoft site – https://mcr.microsoft.com/v2/mssql/server/tags/list. With this information, the container image for SQL Server can be retrieved. For example, let’s say that the version we wanted to build into a database template in DSM is 2019-CU18-ubuntu-20.04. To retrieve this container image, you need an environment with docker or a docker compatible command line interface (CLI) installed. In this example, the docker CLI is used. The SQL Server container image can then be retrieved using the following docker pull command:
$ sudo docker pull mcr.microsoft.com/mssql/server:2019-CU18-ubuntu-20.04 2019-CU18-ubuntu-20.04: Pulling from mssql/server 210a236fbb96: Pull complete 4d3b5ee6a318: Pull complete b97468a53f24: Pull complete Digest: sha256:f57d743a99a4003a085d0fd67dbb5ecf98812c08a616697a065082cad68d77ce Status: Downloaded newer image for mcr.microsoft.com/mssql/server:2019-CU18-ubuntu-20.04 mcr.microsoft.com/mssql/server:2019-CU18-ubuntu-20.04
With the container image downloaded, the next step is to convert it to a format that DSM requires (.tar.gz). This is done using the docker save command, as shown here:
$ sudo docker save mcr.microsoft.com/mssql/server:2019-CU18-ubuntu-20.04 | \ gzip > 2019-CU18-ubuntu-20.04.tar.gz $ ls 2019-CU18-ubuntu-20.04.tar.gz
We are now ready to create our SQL Server database template in VMware Data Services Manager. Do note however that even though this image is highlighted with Ubuntu, DSM will actually deploy a Photon OS VM and then use this container image to install SQL Server.
Building the Database Template
As mentioned in the introduction, once the provider is configured, there are a number of predefined database templates available. In this setup, all five of these database templates have already been published by the Provider Admin. This means that they are now available to the ORG Admins for creating databases.
We are now going to create a new database template for SQL Server whilst logged in as the Provider Admin persona. To begin, navigate to the Database Templates view as shown above, and click on the ‘Create Template‘ button. Only one Engine is currently available (SQL Server – 2019.0.0) for selection. Next, provide the Version Name. I have used the name of the container image downloaded from the Microsoft site so that it is easy to identify. Then select which Editions you wish to support. Enterprise, Standard and Developer are all available to choose.
The final step is to select the resource, which is the tar.gz bundle that was created in the previous step using the SQL Server container image downloaded from the Microsoft site.
Using the tasks view in the DSM UI, it is possible to monitor the database template creation. If everything proceeds as expected, you should be able to observe the following operations occur during the creation.
If we now revisit the Database Templates view, three new ‘Provider Uploaded’ template types related to SQL Server should be visible. As three editions were selected when the template was created, we see a template present for the Enterprise, Standard and Developer editions.
The template status is currently ‘Available’. In order for the Org Admins to be able to use these templates to deploy databases, the Provider Admin needs to publish them. This is achieved by clicking on the Actions field associated with the template and selecting the Publish option from the drop-down list.
With the database templates successfully published, we can now switch contexts to the Org Admin persona, and deploy a SQL Server database from one of the SQL Server database templates.
Create a SQL Server database
At this stage, the Org Admin has logged into the DSM UI and is now ready to deploy a SQL Server database. While this makes use of certain resource structures such as environments, namespaces, and VM Plans, these have already been discussed in earlier posts so will not be revisited here.
The deployment steps are also very similar to what we have seen in previous examples. The Org Admin now has the ability to create SQL Server databases, and not just PostgreSQL and MySQL databases which we saw previously. As before, the Org Admin simply clicks on the ‘Create DB’ button to launch the wizard. Then, it is simply a matter of selecting the database type and the desired edition, giving the VM a name and associating any tags.
The Org Admin may also choose to provide any additional backup and maintenance configuration parameters that might be needed before commencing the deployment. Alternatively, they can create the database with the default configuration. Once deployed, the database should appear in the list of databases in an init state.
The Photon OS OVA appliance then gets deployed by DSM, followed by the configuration steps of installing the database components and creating the database. If all goes well, the database should eventually appear online once all configuration steps are completed.
And now the Org Admin has successfully deployed PostgreSQL, MySQL and SQL Server databases through the VMware Data Services Manager. Note customers should bring their own SQL Server license to enable database provisioning for VMware Data Services Manager.
At this point, I hope that the some of the benefits of VMware Data Services Manager are becoming apparent. My colleague Oz has also created a short 4 minute video to demonstrate this workflow which you might also find interesting.
More details are also available in the official VMware Data Services Manager documentation v1.3.2 available here.