Application Integration

Nimble Automation Scripts - SQL Dumps

Occasional Advisor

Nimble Automation Scripts - SQL Dumps

Hi Everyone,

I have been working with two of my customers on a number of automation tasks which integration with Nimble, VMware and Microsoft. They both had a requirement to complete SQL dumps to disk and have been doing so on the production servers.

This has been a pain for them in the past due to the load and time it takes to complete the SQL Dumps, and the DBAs also like to have SQL dumps as another method for recovery..

I scripted a solution using powershell whic can be used to complete the SQL dumps from a upstream or downstream replica and thought I would share it with the community.

I have attached the scripts and some quick documentation for everyone to look at and give it a try, please feel free to send feedback or RFEs (time permitting on requests of course).

So what does the script do, well its broken up into a number of different modules which you can find under the “ModuleScript” directory. There is a VMConfig.ps1 you will need to complete with your environment variables as well, but it basically does the following:

RestoreVM.ps1 - Used to restore a VM from a clone and invoke a backup script within the VM.

    1. Connects to all management points such as VMware, Nimble, etc
    2. Creates Clones from a Volume Collection, you define which snap version you would like to use as well.
    3. Creates a number of VMware folders to keep things tidy.
    4. Attaches the Clones to a nominated ESXi host.
    5. Searches the cloned datastores for .vmx files and adds the VMs to the inventory.
    6. Disables the frontend network adapters to ensure we don’t get IP conflicts.
    7. Option to add additional NIC if required.
    8. Option to add additional HDD via a VMDK on a specified datastore. This is useful as a target for backup jobs and is reused based on the VM Name.
    9. Powers on the VMs and answers any questions.
    10. Waits for VM Tools to start successfully.
    11. Invokes a nominated script to complete a task within the VM.

RemoveClone.ps1 - Used as a post-script to clean up Cloned VM, Datastores and Nimble Volumes.

    1. Powers off VMs that have been restored.
    2. Unregisters the VMs.
    3. Unmounts cloned datastores.
    4. Deletes cloned volumes on the array.

Please ensure you read the Documentation which is in the package for further instructions. Feedback would be appreciated, I will be updating the document further with a compete howto guide and adding additional capability to all for recovery of directly presented volumes to VMs.