Attempting to automate some SRM stuff, and I need SRMSite objects in order to grab the deploymentId, to be used later in other calls to get a list of unassigned replicated VMs . I don't see any methods within SRM Plugin that will give me this info. Any suggestions?
Hi,
I don't have SRM environment to verify it, but the following code should work:
var sites = Server.findAllForType("SRM:Site", "");
for each (var site in sites) {
// do something with the site
}
Hi,
I don't have SRM environment to verify it, but the following code should work:
var sites = Server.findAllForType("SRM:Site", "");
for each (var site in sites) {
// do something with the site
}
Thanks. Will try that now. I've seen other references to this call. What type of object is the Server? (It is just the vCenter object).
Did find another technique. SRM deploymentId is just the VRVcRemoteSite.vcInstanceUuid with a suffix concatenated to the end.
Server is one of the predefined vRO helper/utility scripting classes. It is not related to vCenter, SRM or other 3rd-party systems.
You can find the list of methods provided by Server and other helper classes in the vRO documentation, available in vRO client UI > Tools > API Explorer...
Works like a champ for many things, including the SRMSite