True story, recently my car was broken into and my Mac Book was stolen. Not a total loss as I keep most of my files synced to VMware Horizon data. However I did invest a lot of time setting up my Mac just the way I like it. So it dawned on me that I should probably start backing up my Macs. I looked into a Time Capsule from Apple and they are not cheap. Around $300. Essentially it is just a network attached drive so I started researching if I could just create one. This resulted in my previous blog post here. Now let’s take it a step further and setup vRA and Project Photon to provide this as a service.
Pre-Reqs
You will need a working Photon Blueprint by following my guide here
Your Photon Blueprint will need to be configured with enough storage to back up your MAC
The Photon Base image will need internet access to pull the time-container image
A quite place to work where you will not be interrupted
Disclaimer
Warning! This solution uses some open source software and is used as an education tool to learn how to use vRA/vCAC and experience VMware’s project Photon. There is no support, guarantee or warranty provided by myself, VMtoCloud.com or VMware. USE AT YOUR OWN RISK!
systemctl start docker
systemctl enable docker
docker pull bobrik/time-container
echo "docker run -d -p $1:548:548 -v /mybackups:/share -e AFPD_LOGIN=$2 -e AFPD_PASSWORD=$3 -e AFPD_NAME="Backup" -e AFPD_SIZE_LIMIT=8000 --name TimeCapsule bobrik/time-container" >> /capsulestart.sh chmod u+x /capsulestart.sh sh /capsulestart.sh
You should end up with only three lines in the file, the first line is long, I know!
Press esc and then Shift ZZ to save it then type chmod u+x /capsulecreate.sh and press enter to make the file executable.
Now login to vRA as an administrator and go to the infrastructure tab, then computer resources, compute resources then hover over your vCenter Cluster and click
Now login to vRealize Orchestrator and import the package I created. (Remember to unzip it first!)
Download Package Here org.vmtocloud.PhotonTimeCapsule
Go to the general Tab and change the vmUsername and vmPassword to whatever you set when you deployed your Photon VM
Now login to vRA as cloudadmin and go to the infrastructure tab, then Blueprints, then Build Profiles and create the following build profile
Turn on time machine and enjoy!
Note: Again this is for learning purposes. It is not meant for real production use. Some issue you may run into are the fact that the container is not persistent. Meaning if the VM reboots for any reason it is not configured to start the time capsule container. Data integrity has also not been fully tested. Use this at your own risk.