Hyper-V Start Configuration - Reset

BrianPitt 176 Reputation points
2021-06-10T10:11:17.94+00:00

We have an Azure Lab Services environment where the instructor of the class is requesting that a VM the class uses be able to start up at the same config point each time, allow the students to do their class work, change the VM / etc and then when finished, have the VM go back to its starting point.

Is there a way to Automate this?

Once the initial template VM gets cloned out to all the class VMs, I dont want the instructor to have to login to each VM, open Hyper-V and revert the Hyper-V VM back to its checkpoint.

Thank you ahead of time.

Azure Lab Services
Azure Lab Services
An Azure service that is used to set up labs for classrooms, trials, development and testing, and other scenarios.
297 questions
{count} votes

Accepted answer
  1. kobulloc-MSFT 26,321 Reputation points Microsoft Employee
    2021-06-16T18:50:21.57+00:00

    Edit:

    @BrianPitt Sorry for the back and forth here, nested virtualization isn't my area of specialization so I reached out to the product group and the original answer should stand--"Reset" should reset both the VM and the nested VM.

    Looking at a diagram I've updated from our documentation on nested virtualization, the medium blue represents the VM that you use and the light blue represents your nested VM. When you use the "Reset" button, both the medium blue and light blue VMs would revert to the state they were in when the lab was published because the light blue client VM’s hard disks are saved on the medium blue’s OS disk.

    106300-image.png

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. kobulloc-MSFT 1 Reputation point
    2021-06-11T22:24:43.023+00:00

    You can quickly reset one or multiple VMs in your lab using the Reset option on the toolbar:

    https://video2.skills-academy.com/en-us/azure/lab-services/how-to-set-virtual-machine-passwords#reset-vms

    104900-image.png

    Example

    I created a lab then set a template using a Windows 10 machine that I made changes to (Original Configuration document on the desktop). I then published the template and created 3 VMs.

    Someone (like a student) used one of the VMs and made some changes (NewChanges document):

    104961-image.png

    Back in the Azure Lab Services Portal, I went into the lab and clicked on Virtual machine pool. From there, I selected the VMs I wanted to reset and clicked on "Reset" at the top.

    104908-image.png

    All VMs were reset and the next class has a fresh start:

    104909-image.png


  2. BrianPitt 176 Reputation points
    2021-06-16T18:50:24.457+00:00

    Out of curiousity....if the Azure Lab VM was set to start at a checkpoint, where Hyper-V was configured with VMs in a certain setup inside the Azure Lab VM, when I reset the VM, why wouldnt it just set the Hyper-V VMs and settings back to where they were at start? The Hyper-V install is part of the OS, so I would think it would set itself back to how it was when the whole VM was reset.

    But apparently not?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.