Veeam Backup software is one of the most powerful solution for VMware and Hyper-V. It is capable to replicate VMs cross datacenters while with it’s stronger proxies he can gain more power and backup capacity increase.

 It operates at the virtualization layer and uses an image-based approach for VM backup. Veeam copies VM data from the source volume at a block level, compresses and deduplicates it, and stores in backup files in the backup repository in Veeam format.

Power off VM is recommended when you are backing up databases or sensitive software where live backup does not guarantee data consistency. In this case we will use pre and port backup scripts option of Veeam Backup jobs.

This can be be configured in Backup job creation or by hitting edit existing ones, then on Guest processing option will be needed to enable Application aware processing. In Applications you will need to go on Scripts tab and there add pre and post script.

For power off server we have 2 options, first is when used to shutdown VM gracefully if vmware tools are available. Script for this option is:

# Ignore SSL errors with not signed certificate
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
# Setup connection to vCenter
Connect-VIServer -Server vcenter_server -User [email protected] -Password your_password
# Shutdown VM forced
Get-VM "VM NAME" | Stop-VM -confirm:$false

When vmware tools are available VM shutdown will be gracefully and script will be:

# Ignore SSL errors with not signed certificate
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
# Setup connection to vCenter
Connect-VIServer -Server vcenter_server -User [email protected] -Password your_password
# Shutdown VM gracefully
Get-VM "VM NAME" | Stop-VMguest -confirm:$false

To start server we will need another script, it looks looks the following:

# Ignore SSL errors with not signed certificate
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
# Setup connection to vCenter
Connect-VIServer -Server vcenter_server -User [email protected] -Password your_password
# Start VM
Get-VM "VM NAME" | Start-VM

Need help with VM backup workflows or automation in production?
→ Explore our Infrastructure Support Services

Learn how to stop a VM before backup and start it after using Veeam and scripting. Automate safe backup workflows for sensitive workloads.

Categories: Blog

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *