What is Sync VM?
Every now and then a technology on a storage array gets me really excited. When Adam Cavaliere showed me Sync VM last month I was impressed. After talking about it and showing it to customers, they were very interested. More specifically they wanted to see it automated, and in vRealize Automation.
So what is it, and how does it work?
I think it’s best explained by Adam Cavaliere and Emad Younis who have posts and videos on this already.
Video showing Database Example: https://www.youtube.com/watch?v=bWsVLUb9O_A
Blog post by Emad Younis: https://www.tintri.com/blog/2015/04/tech-tuesday-time-travel-syncvm-snapshots
The vRealize Orchestrator Workflow
In this part (5a), I will explain how to use the vRO workflow I’ve created which is available on FlowGrab along with the others in this series. In part 5b I will be showing how to integrate this vRO workflow with vRA, to offer it as a day 2 operation.
1. Completed Part 3 verifying that you can get a Tintri UUID from a virtual machine.
2. Have a source and target virtual machine in vCenter with the same disk configuration upon which you want to sync.
3. Download the latest Tintri Workflow Package I created and uploaded to FlowGrab.
Do not execute this vRO workflow without an understanding of SyncVM. The code in this example replaces 3 disks (SCSI 0:1, SCSI 0:2, SCSI 0:3 to be precise). If you need to use alternate disk configurations, then you will need to adjust the parameters and action item to compensate. Please post questions if you are unsure how to do this, but this assumes a good understanding of vRealize Orchestrator.
Step 1: Import the Tintri Workflow Package you downloaded from FlowGrab.
You should now see extra workflows in your vRO Design view as per the screenshot below.
Take a look at FG-SyncVMExample you can see this utilizes a number of the other workflows previously created.
- FG-Tintri-CreateSession – See Part 2: vRO Workflow – Tintri Create REST Session
- FG-Tintri-UUIDfromVM – See Part 3: vRO Workflow – Get a Tintri UUID from Virtual Machine Object
- FG-Tintri-SnapVM – See Part 4: vRO workflow – Tintri Snapshot Virtual Machine
- FG-Tintri-GetSnapUUID – This is a new vRO workflow which allows us to get the snapshot UUID. It contains a vRO action that sends a rest command to the Tintri VM Store to get the snapshot UUID.
- Pre-Built VMware vRO workflows for shutdown and startup of Virtual Machines
- FG-Tintri-SyncVM – This is a new vRO workflow which has an action containing the rest command to sync 2 VMs. (Again, this syncs SCSI 0:1, SCSI 0:2, and SCSI 0:3)
Running FG-Tintri-SyncVM by itself, you can see this requires the RestHost, SessionID, and a snapshot UUID from the source VM, as well as the Tintri VM UUID from the target VM.
In FG-SyncVMExample I use the modular components built previously to retrieve all the information required to initiate a Sync VM operation.
The process is as follows:
- Create Rest Session
- Tintri Snapshot the Source VM in order to get the latest data.
- Get the Tintri VM UUID
- Snapshot the VM
- Get the Snapshot UUID for the latest snapshot
- Get the Tintri VM UUID for the target VM
- Shutdown the Guest OS (This is because if you initiate a sync VM via REST API it will do a hard power off of the virtual machine.)
- Initiate SyncVM now that we have the UUIDs we needed.
- Power back on the target VM.
Step 2: Run the workflow!
Select your REST Host, type in a sample name for the snapshot (this could obviously be set as a general attribute or automatically generated in the future), select your source VM and target VM from vCenter…and off we go!
Step 3: End Result
Login to your Tintri VM Store and you should see a message on the target VM indicating that synchronization is complete.
vRealize Orchestrator will also show logging to indicate the Sync VM operation was successful.
Hopefully this workflow helps. I would recommend adapting the actions and workflow to your use cases. i.e. which disks to sync? How many VMs do you want to sync to?
In the next post I’ll be demonstrating how you can add this capability to vRealize Automation as a Day 2 Operation you can present to Software Development and QA teams in order to get the latest data.