Skip to content

reset-parent-or-child #18

reset-parent-or-child

reset-parent-or-child #18

name: reset-parent-or-child
on:
workflow_dispatch:
inputs:
parent-or-child:
description: "Lab jobs to observe"
required: true
type: string
vm-name:
description: "The name of the VM to reset"
default: "netperf-windows-2022-client"
required: true
type: string
jobs:
do-reset-manual:
name: Reset parent or child Machine
runs-on:
- self-hosted
- ${{ inputs.parent-or-child }}
steps:
- name: RESET STATE (parent or child)
run: |
# TODO: Eventually, for WS 2025, we want to instead CRUD the VMs, instead of simply reseting their checkpoints here.
$vmName = "${{ inputs.vm-name }}"
$checkPointName = "LATEST"
Restore-VMSnapshot -VMName $vmName -Name $checkPointName -Confirm:$false
- name: Start VM, wait for online status, alert observer.
run: |
$vmName = "${{ inputs.vm-name }}"
Start-VM -Name $vmName
while (-not (Get-VMNetworkAdapter -VMName $vmName).IPAddresses) {
Write-Host "Waiting for VM to be online..."
Start-Sleep -Seconds 5
}
Start-Sleep 10