Visual Studio Team Foundation Server 2015 Update 3 (on premise)
VMware Resource Deployment 1.0.0 (ms-vscs-rm.vmwareapp)
The loop to find a snapshot on the virtual machine doesn't return when it actually finds a snapshot.
https://github.com/Microsoft/vsts-vmware/blob/master/src/Tools/vmOpsTool/VMWareImpl.java#L614
Right after that line, there should be a check to see if snapshotMor
is not null and if so, break
out of the loop or return snapshotMor
.
The problematic behavior is observed when there's a snapshot hierarchy similar to the following:
- Root Snapshot
|- Child Snapshot A
|- Grandchild Snapshot 1
|- Child Snapshot B
When trying to revert to "Grandchild Snapshot 1", the output log is similar to the follow:
...
Successfully established session with vCenter server.
Restoring snapshot [ Grandchild Snapshot 1 ] on virtual machine [ My Virtual Machine ].
Querying VirtualMachine objects on vCenter server.
Querying snapshot information for virtual machine [ My Virtual Machine ].
Found snapshot [ Grandchild Snapshot 1 ] for virtual machine.
No snapshot found on virtual machine [ My Virtual Machine ] with name Grandchild Snapshot 1
Failed to [restore] snapshot [Grandchild Snapshot 1] on virtual machines [My Virtual Machine ].
Return code: 1
##[debug]rc:1
##[debug]success:false
##[error]Failure reason : Error: C:\ProgramData\Oracle\Java\javapath\java.exe failed with return code: 1
##[debug]load strings from: C:\agent\tasks\VMwareTask\1.0.0\node_modules\vsts-task-lib\lib.json
##[debug]load loc strings from: C:\agent\tasks\VMwareTask\1.0.0\node_modules\vsts-task-lib\strings\resources.resjson\en-US\resources.resjson
##[debug]task result: Failed
Finishing task: VMwareTask
##[error]Task VMwareTask failed. This caused the job to fail. Look at the logs for the task for more details.
Ideally, I would like to be able to specify the specific snapshot hierarchy in the case where there's more than one snapshot with the same name.
For example, I want to explicitly specify the snapshot name "Root Snapshot\Child Snapshot B\Grandchild Snapshot 1", in the case where there's already a snapshot named "Grandchild Snapshot 1" higher up in the hierarchy, i.e. "Root Snapshot\Child Snapshot A\Grandchild Snapshot 1".
Currently, there isn't a way to specify which snapshot I want to revert to.
Thank you!