How can I wait until a vsphere node is back online after revert to snapshot

16 views
Skip to first unread message

christop...@googlemail.com

unread,
Apr 29, 2022, 5:58:58 AM4/29/22
to Jenkins Users
Hi!

I am using a naked Windows vsphere agent for automatically testing an application installer and some acceptance test of my software.
After every run I'd like to reset the machine to have a repeatable start point for the tests.

I'm doing this like so:

lock('TestRunner') {
    node('InstallerTest') {    
        ... /* do the work */
    }
    vSphere buildStep: [$class: 'RevertToSnapshot', vm: 'Installermachine', snapshotName: 'Base' ], serverName: 'myvSphere'
}

However the vsphere actions seemt to keep running after the step has been finished and the lock released.
When running two test runs in a row (the test is running longer then the prior build) this ends in the second test being suddenly interrupted because the agent goes offline.

I would prefer reusing a VM compared to creating VMS from a template because that costs some time.

Any ideas?

Regards,
Christoph
Reply all
Reply to author
Forward
0 new messages