VMware SRM – finding VMs in a recovery plan
I am evaluating VMware Site Recovery Manager (SRM) and there are some things that I need to do in testing that I can not do in the base product. I am going to run some PowerShell to reconfigure the VMs and rename them. One of the first roadblocks is finding out which VMs are part of a particular recovery plan. Since the SRM API is limited I went into the database and dug around. Here is what I came up with. Let me know how it works for you. Especially if you have multiple protection groups. My configuration only has one.
Recommendations for better ways of doing this are appreciated.
USE [SRMDB01] SELECT rp.plan_name, sv.shadowvmname AS shadowvm_name FROM pdsr_shadowvm sv, (SELECT sg.mo_id AS groupmoid, convert(varchar(255), g.string_val) AS shadowvmmoid FROM pdsr_shadowgroup sg LEFT OUTER JOIN g_string_array g ON sg.vmmoids = g.seq_id) sg, (SELECT rp.name AS plan_name, convert(varchar(255), g.string_val) AS shadowgroupmoid FROM pdsr_recoveryprofile rp LEFT OUTER JOIN g_string_array g ON rp.shadowgroupmoids = g.seq_id) rp WHERE sg.shadowvmmoid = sv.mo_id AND rp.shadowgroupmoid = sg.groupmoid AND rp.plan_name LIKE 'Recovery Plan 01'
Categories: System Administration, VMware