vCloudBackups provides a way to hot clone VMs and vApps running in a Virtual Datacenter for the purpose of local backups.
This release should work with any vCloud Provider running 1.5 or 5.1.
vCloud Backups takes a running vApp or Virtual Machine and makes a hot clone of the source.
- VApp backups are cloned to another VApp named
Backup-<VApp Name>-<Backup Date and Time>
- VM backups are cloned to a VApp called
Backups
and are named<Source VApp Name>-<VM Name>-<Backup Date and Time>
Restoring VMs and vApps must currently be done through the UI (or through the API if one was so inclined to automate restores)
- Powershell 2 or higher
- VMware PowerCLI (for admins or tenants) 5.1 or higher downloadable for free here.
To use vCloudBackups, open Powershell (or PowerCLI) and import the module:
Import-Module vCloudBackups.psm1
The following (cmdlets) are now available:
- Backup-CIVM
- Backup-CIVApp
- Save-VCloudBackupConfig
- Import-VCloudBackupConfig
-
Connect to your vCloud Organization. This will prompt for credentials.
Connect-CIServer vcloud.example.com -org MyOrganization
-
Get the VM, and pipe the object to Backup-CIVM and specify a number of backups to retain.
Get-CIVM "MyVM" | Backup-CIVM -retain 3
Note: VM Backups are currently done in serial.
If you have multiple VMs of the same name in your Virtual Datacenter, you can specify which VM by first selecting the vApp
Get-CIVApp "MyVApp" | Get-CIVM "MyVM" | Backup-CIVM -retain 3
Scheduling backups can be done using task scheduler on any Windows machine that meets the Powershell requirements and has Internet Access.
- MyBackups.ps1 (included in this Repo)
- vCloudBackupConfig.csv (generated by Save-VCloudBackupConfig)
- vCloudBackups.psm1 (The module itself)
-
It is recommended you save all files in a single folder in this version.
-
Important: Login as the user who the scheduled task will be running as.
-
Open Powershell and change your folder to where the vCloudBackup files are located.
-
Run the following. (Note: You might have to Set your execution policy if this is your first time using Powershell.)
Import-Module .\vCloudBackups.psm1 Save-VCloudBackupConfig
-
Enter your username and password in the dialog box.
-
Enter the vCloud hostname and your Org in the Powershell console.
-
The configuration will be saved in a CSV file in the folder as vCloudBackupConfig.csv.
-
Open Windows Task Scheduler.
-
Create Basic Task.
-
Action to perform: Start a Program
-
Program/Script box:
powershell -file "C:\path\to\vcloudBackups\MyBackups.ps1" -setexecutionpolicy unrestricted
-
You can fine tune the task as needed by editing the properties of the scheduled task.
For help, find me on Twitter: @jakerobinson
Please report any issues using the Github issues for this project.