Have you ever wondered what happens when a Hyper-V VM goes down because of a server crash or reboot when you are not around? You might have a business critical data transaction delayed or even worse, you might lose transactions that are left unprocessed forever.

Vembu not only wants to provide a fool-proof business continuity plan with its backup support for Microsoft Hyper-V, but also wants to make sure you have every precautionary measure set in place to minimize the risk of losing your data. Here is a quick guide on how to auto-start your VMs on Microsoft Hyper-V hosts, in case of an accidental shut-down.

Protect Your Data with BDRSuite

Cost-Effective Backup Solution for VMs, Servers, Endpoints, Cloud VMs & SaaS applications. Supports On-Premise, Remote, Hybrid and Cloud Backup, including Disaster Recovery, Ransomware Defense & more!

Steps to AutoStart a VM:

  • Initial Requisites
  • Finding VM count configured for Auto Start
  • Configure VM Automatic Start
  • Configure Auto Start with Multiple Hyper-V Hosts
  • Configure Automatic Start Delay for VM

Initial Requisites:

Starting VMs manually per VM/host via Hyper-V settings is a hectic task and there is an easier way to do it – automatically. In order to do that you need to learn a few powershell commands at the initial level.

  • Create and configure VMs in your Hyper-V hosts.
  • Now open Windows powershell.
  • Make sure administrative privileges are set to ON.

Finding VM Count Configured for Auto Start:

Executing the below powershell command lets you list the VMs configured in a particular host and their respective AutoStart status of VMs. If multiple Hyper-V hosts are configured, then executing the powershell command by default will list the host under which the machine is registered to.

Get-VM –VMname * | Select-Object VMname,AutomaticStartAction
windows powershell

Download Banner

Configure VM Automatic Start:

Executing the below powershell command lets you enable the auto-start option for a particular VM in a particular host.

Get-VM –VMname * | Set-VM –AutomaticStartAction Start
Set-VM –AutomaticStartAction Start

Configure Auto Start with Multiple Hyper-V Hosts:

To enable the auto-start option for VMs in multiple Hyper-V hosts, executing the below powershell command is required which provides the list of running hosts.

Get-VM –computername TestVM, TestVM1 –VMname * | Select-Object VMname,AutomaticStartAction,AutomaticStartDelay

 Select-Object VMname,AutomaticStartAction,AutomaticStartDelay

Once the list is generated, filter the required host with following command.

$hosts = @{ComputerName = “TestVM”,”TestVM1″}

Test Virtual Machine

Once done selecting the host, list VMs in the specific host and enable auto-start:

Get-VM @hosts –VMname * | Set-VM –AutomaticStartAction start

Set Virtual Machine

Configure Automatic Start Delay for VM:

You also have the option to define the time delay to auto-start a VM with the following powershell command.

Get-VM –VMname * | Where-Object –FilterScript {$.VMname –notlike “TestVM*”}

Set Virtual Machine name

Once done listing VMs, now set the required time delay in seconds.

Get-VM –VMname * | Where-object –FilterScript {$_.vmname –notlike “TestVM*”} | Set-VM –AutomaticStartDelay 240

Set Virtual Machine Automatic start delay

Have questions? Email vembu-support@vembu.com for answers.

Follow our Twitter and Facebook feeds for new releases, updates, insightful posts and more.

 

Rate this post