![]() VMName (string: We will make it mandatory and check if the VM exists in the Param() section of the script.These following parameters will be available to the end-user when running the script. The first goal is to make sure that we have a solid input process to save code validation down the road. We could use the same script to restore a previous snapshot by using this command: snap.ps1 -VMName apvm006 -Snapname patch77 -restore Let’s imagine that our operation went wrong and we need to restore the snapshot. snap.ps1 -VMName apvm006 -Snapname patch171 -backup We are going to start by creating a snapshot of the current VM and save for the future using the following command. ![]() The idea behind this is to keep it simple and save time to protect and restore any given VM by not asking too much input before running the script. I created a script to address the process to protect and restore a VM. In this kind of scenario, it is recommended to use a consistent process, such as a script, especially when we have VMs with several disks attached to it. However, you may have to do that to an entire farm of VMs. If you are running that process for a single VM or a couple of disks, it is simple and faster using the Azure Portal. Since there would be no activity on the disks, the snapshot process will keep the data intact without risks of open files. ![]() When performing a snapshot, the recommendation is to stop the VM first. A snapshot is a read-only copy of a virtual hard drive (also known as VHD). When using IaaS ( infrastructure-as-a-service) in Microsoft Azure, the cloud administrator can create snapshots of a disk, which could be either an OS or a data disk.
0 Comments
Leave a Reply. |