Posey's Tips & Tricks
How To Stop an Imminent Reboot
Sometimes you just can't be interrupted by an update and reboot. Here's a simple solution to pause the task until later.
As much as I appreciate Microsoft making the effort to provide patches that improve security, fix bugs and introduce new functionality into its products, I think that we can all agree that sometimes patch-related reboots occur at very inconvenient times. Sure, there are ways of making patch management a manual process, or specifying a system's active hours, but patch management is, by its very nature, disruptive.
In some ways, Microsoft has done a really good job of making the patch management less disruptive. A couple of weeks ago, for example, I discovered that Windows Update had rebooted my primary desktop system overnight. Let's just say that I wasn't happy about the reboot. Prior to the automatic reboot, I had about fifteen or twenty different windows open and was heavily engaged in about half a dozen different projects. When I logged in, however, the operating system automatically reopened most of those windows, and although there were a few that I had to reopen myself, it was almost as though the reboot had never even happened.
Although I applaud Microsoft for coming up with a less disruptive reboot, there are times when a reboot simply cannot be tolerated. In fact, I encountered such a situation this morning.
My production environment consists of a single virtual machine running Windows Server 2012 R2. This VM acts as a file server and contains everything that I have ever written, all of my business records, pictures and home movies and all of the study materials for my spaceflight training. In other words, I have several TB of data stored on a single VM.
As you would probably expect, I protect this VM in many different ways. For example, I back the VM up using a continuous data protection solution and I also use Hyper-V replication to maintain a duplicate copy of the VM and its data on a different physical server.
Periodically, I like to make an offline backup of my data. That way, if some sort of catastrophe were to compromise my VM, my replica copies and my online backup, I would have a relatively current offline backup that would not be impacted by the incident.
The way that I create this offline backup is relatively straightforward. The Hyper-V replication feature includes an option to test the failover process. Doing so creates a snapshot of the replica. This makes it possible to power up and test the replica VM. Best of all, the replication process continues in the background. I take advantage of this test mode for the purposes of creating offline backups. Because the test mode creates a snapshot, it means that even though the replication process continues to function, the virtual hard disks are placed into a static state and will not be modified. This makes it possible to copy the virtual hard disk files without fear of corruption.
To make an offline backup, I simply attach a high-capacity USB hard disk to the replica server, and then make copies of select virtual hard disks. Once that process is done, I remove the USB hard disk, and attach a different USB hard disk and use it to back up the remaining virtual hard disks.
The process works really well, but it does have one major disadvantage. The copy process takes a long time to complete.
I started one of my offline backups about a day and a half ago. At the start of the backup, I opened a remote desktop session on my primary workstation so that I could keep an eye on the progress of the backup. This morning, however, I received the dreaded message indicating that my server would be rebooted in fifteen minutes whether I like it or not. While a reboot might not be catastrophic, it would mean that I would have to restart the backup process, losing a day and a half of progress.
At the time, I really wasn't sure if there was a way to avoid a reboot or not. After all, the pending reboot screen does not exactly contain a Cancel button. Out of sheer desperation, I tried something, without really knowing if it would work or not. Thankfully, my technique worked perfectly. So here is how I avoided the dreaded reboot.
I opened an administrative Command Prompt window (I am guessing that a regular Command Prompt window may not work). Upon doing so, I shut down Windows Update by typing this command:
Net Stop wuauserv
You can see what this process looks like in Figure 1.
This technique ended up working flawlessly. Even so, I do wish that Microsoft would include a Cancel button on its fifteen minute warning screen to allow admins to avoid unwanted reboots until a more convenient time.
Brien Posey is a 16-time Microsoft MVP with decades of IT experience. As a freelance writer, Posey has written thousands of articles and contributed to several dozen books on a wide variety of IT topics. Prior to going freelance, Posey was a CIO for a national chain of hospitals and health care facilities. He has also served as a network administrator for some of the country's largest insurance companies and for the Department of Defense at Fort Knox. In addition to his continued work in IT, Posey has spent the last several years actively training as a commercial scientist-astronaut candidate in preparation to fly on a mission to study polar mesospheric clouds from space. You can follow his spaceflight training on his Web site at.