Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 168455

Re: Where to find the IaaS __Clone_SnapshotId used on linked-clone Blueprints in vRA?

$
0
0

Okay so i finally tracked it down. Seems like vRA IAAS is using the snapshotTree id for linked-clone references. If you have access to the VC:VirtualMachineSnapshot you can find the id like this:

 

//snap is the provided VC:VirtualMachineSnapshot you want to use as linked clone reference
var vm = snap.vm;
var id = snap.id;
function findSnap(snapTrees, snapId)
{  System.log("Searching SnapshotTree for id '" + snapId + "'...");  for each(snapTree in snapTrees)  {  System.log("Checking snapTree '" + snapTree.id + "' with id '" + snapTree.snapshot.id + "'...");  if(snapTree.snapshot.id == snapId)  {  System.log("Found matching snapshot! SnapTree id is: '" + snapTree.id + "'.")  return snapTree.id;  }  else  {  var childSnaps = snapTree.childSnapshotList;  if(childSnaps.length > 0)  {  System.log("Checking children...");  return findSnap(childSnaps, snapId);  }  }  }  return null;
}

// Get the id like this
var snapTreeId = findSnap(vm.snapshot.rootSnapshotList, id);

 

 

Hope this saves somebody some time.


Viewing all articles
Browse latest Browse all 168455

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>