
In the early days of space exploration, Apollo 13 set out on a daring mission with dreams of landing on the Moon. The crew—Jim Lovell, Jack Swigert, and Fred Haise—were full of hope as they launched into space on April 11, 1970. Everything was running smoothly at first until one fateful day when disaster struck.
On April 13, while the spacecraft was flying, one of its oxygen tanks blew up. This caused big problems for the mission. The astronauts said the famous words, ‘Houston, we have a problem.‘ They started to lose oxygen and power. Suddenly, their trip to space turned into a fight to stay alive.
Despite the chaos, the Lunar Module, which was initially built for landing on the Moon—became the lifeboat. Although it wasn’t meant to support the crew for long, it was the perfect backup system. With quick thinking and creative problem-solving, NASA’s ground team and the brave astronauts repurposed the module to keep the crew alive. The crew had to quickly improvise with basic materials to fix an issue with the filters.
The astronauts on Apollo 13 used their little lunar lander as a kind of lifeboat. It helped them get back home safely. Even though everything went wrong, they flew around the Moon and landed back on Earth on April 17, 1970. Crazy!
This amazing story shows how important it is to have a good plan B. Just like VMware’s VM Fault Tolerance feature, which keeps a live backup of a virtual machine ready to take over if the main one fails, Apollo 13’s Lunar Module saved the day by being prepared for the unexpected.
In the next few minutes, I’ll talk about the steps required to make it work using VCF Orchestrator.
What is Fault Tolerance?
VMware vSphere Fault Tolerance (FT) provides continuous availability for applications (with up to four virtual CPUs) by creating a live shadow instance of a virtual machine that mirrors the primary virtual machine. If a hardware outage occurs, vSphere FT automatically triggers failover to eliminate downtime and prevent data loss. After failover, vSphere FT automatically creates a new, secondary virtual machine to deliver continuous protection for the application.
To enable FT, there are a few things required:
- The VM you want to enable it on.
- The ESXi host the VM is running on.
- The Datastore the VM’s files are living on.
- Create secondary VM FT disk spec.
Let’s take a look at each one of them. As usual, I will expand the virtualMachineManagement
action element by adding a new FaultTolerance
class using vRBT.
To the VSCode.
Get ESXi host
First thing first. I can create a simple function like that to get the VC:HostSystem
of the VM.
private getHost(vm: VcVirtualMachine): VcHostSystem {
return Server.findForType("VC:HostSystem", vm.vimHost.id);
}
Get ESXi host object function
This function will find the ESXi host by its ID provided by the VM running on it and return it as an object. Done.
Get Datastore
I will create another simple function to get a datastore as an object. I can fetch the datastore details again from the same VM by querying the vm.datastore
method.
private getDatastore(vm: VcVirtualMachine): VcDatastore {
if (!vm.datastore || vm.datastore.length === 0) {
throw new Error("No datastore found for the virtual machine.");
}
if (vm.datastore.length > 1) {
throw new Error("Multiple datastores found. Expected only one.");
}
return Server.findForType("VC:Datastore", vm.vimHost.id + "/" + vm.datastore[0].id);
}
Get Datastore object function
Read the full story
Sign up now to read the full story and get access to all members-only posts.
Subscribe