Hi welcome to the communities,
that's exactly the feature that is called Fault Tolerance in VMware vSphere: VMware vSphere Fault Tolerance (FT) for Zero Downtime
It's available in the ESXi 5.1 standard license and above.
There are limitations, though: FT can only be enabled on VMs with 1 vCPU.
Could you give more information about your environment, so we can see what's possible for you?
Needed information:
- do you have a vCenter Server
- what licenses do you use ( ESXi )
- what type of storage do you use? ( local , shared -> NAS )
Regards