HyperVCheckpoints.ps1

Wrote a simple PowerShell script today for one of my lab environments that safely reboots all virtual machines under a local Hyper-V host, and upon restart, creates a new checkpoint. The script is best used on a scheduled basis, i.e; using Task Scheduler. I have the script running every night at 0300.

While scheduled reboots may seem risky to some, I believe the opposite; risk is mitigated with the practice. Depending on your scheduled time windows, this gives administrators the ability to identify/resolve issues with a rebooting server, as opposed to the issue appearing during primary operational hours, resulting in downtime.

A few caveats:

  • Checkpoints are generally not recommended in a production environment (see https://hyperv.veeam.com/blog/what-are-hyper-v-snapshots-12-things-to-know/) and are definitely not a replacement for full backups.
  • The script, by default, restarts all VMs under the local Hyper-V host. If you have VMs that you do not wish to be restarted/have checkpoints taken, use the ExemptVMNames parameter to specify said VMs.

 

Script can be found on my github:

https://github.com/mehlsec/HyperVCheckpoints

rofi-grey Theme

Spent a while creating a rofi color scheme today, so I uploaded my .Xresources to my github. The theme is essentially a basic grey theme, designed for working with my current XFCE4 setup, with the Xfce-dusk GTK theme.

https://github.com/mehlsec/rofi-grey

I have an XFCE4 keybinding to the Windows button on my keyboard (I know, heresy) that calls rofi in run mode, specifying the path to my .Xresources as the config file as well. The full command is:

$ rofi -config ~/.Xresources -show run