Net Assured

Net Assured

Network and Security Consultancy

T 07789 400408
Email: info@netassured.co.uk

Net Assured Limited
84 Goodacre, Orton Goldhay, Peterborough, PE2 5LZ

  • Home
  • Services
  • Blog
  • About
  • Contact
FREEQUOTE

VMware ESXi Host Backups Python Script

Saturday, 19 May 2018 / Published in Automation, Networking

VMware ESXi Host Backups Python Script

This post details a VMware ESXi host backups Python Script I use in my home lab. VCSA does not backup the configuration for the hosts it manages.

Config items like vswitch, vnic, MTU settings, kernel interfaces and various other settings would be lost if the host fails. Re-building a host manually, especially hosts with complex network configurations would take some time.

The script connects to each host specified in a list and retrieves the VMware product version and build number prior to taking a backup. The filename for the backup includes the ESXi hostname, product, build number and date/time. Restoring a configuration requires the new host to be running the same version and build number as the host that the configuration was taken from. There is an option to use a ‘–force’ switch in the restore command if the build number is different but its not VMware supported.

Requirements

At the time of writing this post my hosts were running vSphere 6.5. The script was executed from Ubuntu with VMware vCli installed

TFTP Server:

The script includes a section to copy the backup files to a TFTP server if desired. One of the hosts being backed up homes the Ubuntu VM that executes the script. I wanted a simple way to archive the backup files off the VM and ultimately off the host. In my lab a Synology NAS provides storage and various services including a TFTP server. You can simply remove the TFTP section from the script if not required.

If you plan to use crontab to execute the script you might be interested in a previous post I wrote:

Executing Python scripts from crontab

Known Limitations

Only execute this script on a dedicated management network or over a VPN as TFTP is not encrypted.

The script backs up the host configuration only, it does not backup the VM’s running on the host. You will need another backup solution for the VM’s.

Implementing a VM backup solution for the home lab

You can find the VMware ESXi Host Backups Python Script script on GitHub. In the next post I’ll detail how to restore the configuration to a host.

Categories

  • Automation
  • Networking
  • Security
  • Starlink
  • Ubiquiti UniFi

NEWSLETTER SIGNUP

By subscribing to our mailing list you will always be updated with the latest news from us.

We never spam!

Menu

  • Home
  • Services
  • Blog
  • About
  • Contact
  • Privacy Policy
  • Cookie Policy

Get In Touch

T 07789 400408
Email: info@netassured.co.uk
NET ASSURED LIMITED
84 Goodacre | Orton Goldhay
Peterborough | PE2 5LZ
Company Registration: 9480811
VAT Registration: 207 5161 32
  • GET SOCIAL

© 2015 - 2026 Copyright by Net Assured Limited | All rights reserved

TOP
Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behaviour or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}