Compute Engine Live Migration & best practices
Live Migration:
When the host system in needs to be updated live migration of the virtual instance happens. The virtual instance is migrated to a different host system from the same zone. The properties of the instance do not change. However, this is not supported for instances with GPU or for Spot instances. The live migration option can be selected when creating the virtual instance under the availability policy.
if the virtual instance is terminated due to non-user-initiated reasons like hardware failure the virtual instances will automatically be restarted by the compute engine service.
GPU in Virtual Instances:
GPU are usually used when the workload is graphic intensive. The costs of GPU are usually higher & it needs to be noted that the software installed on the virtual instance should use the GPU otherwise the GPU will not be used. There are few restrictions with GPU on Google cloud platforms and one of them is that instances with GPU cannot be live migrated to another host and automatic restart is the recommended availability policy in case of failure of the instance due to non-user-initiated reasons. It also needs to be noted GPU is not available for all machine types.
Best practices related to Virtual machines:
- Choose the right region for your virtual instances. The cost will vary slightly depending on the region
- For high availability distribute the instances across multiple zones & regions
- Identify the right machine type for your workload for optimal performance.
- use commited use discounts if you know the workload is going to be on for atleast an year.
- use spot instances for fault tolerant non critical workloads.