This is a follow on from the NoSQL - MongoDB blog I posted a few weeks back now -
The premise of the above was how to automate the standing up of a 3 node MongoDB replicaset within my vSphere environment to show off the new MongoDB functionality in Veeam Data Platform 12.3.
This got me interested in looking back at some previous database functionality we have had in the Veeam Data Platform for a while but also how I could automate the deployment to make this a fast, repeatable process as well as the ability to share with the community.
The process for the deployments will be using terraform to stand up the Windows or Linux boxes for the databases we cover and then using Ansible playbooks to install the database software and get things to our desired state.
PostgreSQL
A lot has been happening with PostgreSQL and Veeam over the last few releases, the configuration database can now be stored in a PostgreSQL instance and also we have some integrations that give us some cool ways to help when it comes to recovery of your PostgreSQL databases in the form of the Veeam Explorer.
I wanted a quick way to stand up a PostgreSQL VM in my environment to be able to demonstrate and play around with said functionality.
You can find the code base here.
This code as mentioned before is going to have some terraform to stand up a new machine based on a template ready for Ansible to take over and get PostgreSQL installed.
- Deploy 1 Linux VMs (Ubuntu 22.04 tested) into a vSphere environment using Terraform
- Using Linux VM, install PostgreSQL 16 using Ansible
All you need to do if you wish to use this is edit the main.tf files to suit your vSphere environment and also edit the inventory.ini with additional details of the VM for the Ansible playbook.
There are also some instructions on the readme linked above. Feedback always welcome.
Once you have your machine up and running you can then start protecting the machine with your Veeam Backup & Replication Instance, for this protection we are going to protect the whole virtual machine and part of that configuration we need to ensure we set some configuration for application consistency.
In the backup job, at the guest processing stage you will need to enable application-aware processing and supply some OS credentials below.
Next select the Application button, if you have multiple VMs in the backup job you will see the list here, for the PostgreSQL VM we just created select this and edit.
Select the PostgreSQL tab and provide the account to interact with PostgreSQL on the box, we created this during the Ansible playbook.
Press OK and complete the job setup, all being well and after a successful backup job you will be able to use the Veeam Explorer for PostgreSQL. Navigate to your backup disks and select restore application items
Select the restore point you require, or leave to latest restore point.
Run through the rest of the wizard and this will then fire up the Veeam Explorer for PostgreSQL
From here we can get to restoring or publishing to a different server. Also to note we have Instant Recovery here… let me know if you made it this far and would like to see some more details about this.
Microsoft SQL Server
Microsoft SQL has had a longstanding integration set with Veeam, this is where the configuration database started out life and continues to be an option today, it was also one of the first Veeam explorers and since then features such as instant recovery have been added to Microsoft SQL Server deployments and backups.
The reason for my playground ambitions here was to be able to demonstrate the integration into SQL Management Studio, many Database Administrators (DBAs) are or want to be in control of their own backup journey, but we also know that infra/backup admins want or need visibility of that database backup and these experts generally want to provide a solid location to store the backups that is not just another drive on the SQL box (I have seen this happen more than once)
The premise behind this build out was to not only be able to show off instant database recovery and the Veeam explorer but to show the integration into SQL Server Management Studio (SSMS).
Once again we are going to use a blend of Terraform and Ansible to get things up and running and to our desired state. You can find this repository on GitHub here.
This time however we are going to incorporate the Ansible playbook into the Terraform code, from one command we will
- Create a new Windows Server VM (Terraform)
- Install Microsoft SQL (Ansible)
- Install Microsoft SQL management Studio (Ansible)
I initially tested with SSMS 20 and realised that the plugin support was not yet there so reverted my Ansible playbook back to 19, I am told 20 will be supported come 12.3 of the Veeam Data Platform.
Now that we have our Server and Database application up and running from a single command, we can now get the Veeam components installed. We can do this via the Veeam Data Platform ISO and mounting this to the SQL server. (I did look at automating this as well via a PowerShell script, more on this to come)
Execute the plugin and run through the wizard, it is super straight forward.
Always a good sign
Now you should have 3 new icons on the desktop of your server, all of the above I ran through manually but there is the ability to use an unattended install which is where I was looking to automate this into the process. You can find more information here in the user guide.
Start with the Configure Plug-in icon and run through adding in your Veeam Backup & Replication details.
Now go and open SQL Server Management Studio,
Connect to your database
You may have already noticed 3 similar icons to the desktop in your SSMS window.
Go ahead and create a backup of the database, select the databases you wish to protect. The second tab is going to ask you about retention and concurrency. You can also from that page save this as a SQL job so your DBA can schedule this to happen when they want.
When the backup is complete, in Veeam Backup & Replication you will see the job under applications.
Under disk you will also see the backup, but you will not be able to interact with it other than delete the file from disk. You could however have a VM backup configured as I do underneath that will give me access to the Veeam Explorer for Microsoft SQL Server
I think thats it, probably could have been two posts. But hopefully this is useful to someone, be it a technologist looking to tinker with database backups or a real world use case to automate and deploy these applications.