Prepare and test your skills

Prepare and test your skills

Financial Optimization and Flexible Pricing Models in Compute Engine (opens in a new tab) is the practice of paying only for needed virtual machine (VM) capacity while using discounts and sizing tools to lower total cost. Compute Engine is an infrastructure as a service (IaaS) product that provides self-managed VMs on Google's infrastructure with no up-front costs. Costs grow with actual use, steady use can earn lower rates through commitments, and flexible work can run on deeply discounted spare capacity.
Pay-as-you-go billing in Compute Engine means charges follow compute instance, storage, and network use. VMs are billed per second with a 1-minute minimum, storage cost is based on the amount of data stored, and network cost is based on data transferred between VMs and to the internet. There are no up-front costs, so a business can add instances during a traffic spike and remove them when demand falls. This approach replaces capital spending on physical servers with operational spending that rises and falls with real usage.
Committed use discounts (CUDs) are reduced billing rates earned by committing to use Compute Engine resources or to spend a minimum amount for one year or three years. A central FinOps team often manages these commitments because it can see needs across the organization and combine them for larger savings. Product and engineering teams handle day-to-day sizing, while CUDs lower the rate paid for the resources that remain in use.
| Discount type | What is committed | Where discount applies |
|---|---|---|
| Enterprise discounts | Minimum total spend on Google Cloud at a negotiated rate | Organization's Cloud Billing commitment |
| Resource-based CUDs | Minimum quantity of Compute Engine resources for 1 year or 3 years | Specific region, shared across projects in most Cloud Billing accounts |
| Spend-based CUDs | Minimum spend on a particular product for 1 year or 3 years | Billing account level, regionally or globally depending on product |
CUDs can add significant savings on top of enterprise discounts when steady workloads are committed in advance. Resource-based CUDs depend on the region where resources run, so region choice affects both cost and latency. For memory-optimized VMs, compute flexible CUDs apply only to 3-year commitments, which makes commitment length an important decision.
Spot VMs are low-cost Compute Engine VMs that use spare Google Cloud capacity and cost more than 80% less than regular VMs. Spot VMs are designed for fault-tolerant and flexible workloads that can handle interruptions, such as batch processing where work can restart or continue on another VM. Choose Spot VMs when work can stop and restart without harm, and choose committed or on-demand VMs when the workload needs continuous availability. This tradeoff lets organizations run interruptible work at very low cost while keeping critical work on stable capacity.
A decision tree that starts with a Compute Engine workload and branches on whether it is fault-tolerant and steady or flexible, choosing Spot VMs for interruptible work at over 80% off and CUDs for steady work committed for one or three years in a known region.
Exam tip: Use Spot VMs for fault-tolerant work that can be interrupted, and use CUDs for steady work that runs for one or three years in a known region.
Resource optimization tools in Compute Engine match VM size and count to actual demand so idle capacity is not billed. Autoscaling changes the number of instances as traffic rises and falls, while custom machine types let an organization select CPU and memory that fit the workload. Sizing tools reduce the quantity of resources consumed, while CUDs and Spot VMs reduce the rate paid for the resources still needed.
Together, right-sizing, autoscaling, and discount selection control total cost of ownership without paying for unused capacity.
Operational Continuity and Global Infrastructure in Compute Engine (opens in a new tab) is how VM workloads keep running on Google's worldwide infrastructure with minimal disruption. Compute Engine is an infrastructure as a service (IaaS) product that provides self-managed VMs and bare metal instances with Linux and Windows operating systems, durable storage, and control through the Google Cloud console, CLI, or API. Because businesses can scale resources up and down and pay only for what they use, they gain flexibility without owning physical data centers.
Google's global infrastructure is a network of worldwide regions and zones where Compute Engine resources can be deployed. A region is a geographic area that contains multiple isolated zones, and choosing a region affects latency, available machine types, cost, and regulatory rules. While a virtual private cloud (VPC) is a global resource, each subnet inside it is bound to one region, so workloads moved to a new region need new subnets and updated connections such as Cloud Interconnect or Cloud VPN.
Choosing a region involves balancing several requirements:
This tradeoff matters because the cheapest region may not have the lowest latency, the needed machine types, or the lowest carbon footprint. Planning for more than one zone or region from the start makes it easier to stay available if a zone fails and to migrate later.
Reliability on Compute Engine means VMs stay available through maintenance, demand spikes, and zone-level problems. Compute Engine offers a minimum uptime service level objective (SLO) of 99.5%, and the exact SLO varies with the chosen regions, Network Service Tiers, and deployment configuration. High availability comes from spreading work so no single zone failure stops the application.
Users reach a load balancer that distributes traffic to identical Compute Engine VMs in three zones of a regional managed instance group built from one instance template, with autoscaler control and regional disk and Filestore replication for continuity if a zone fails.
Traffic flows from users to a load balancer and then to healthy VM instances, and cross-region load balancing can distribute traffic to VM instances in different regions. A managed instance group (MIG) depends on an instance template to create identical VMs, and a regional MIG automatically provisions VMs across multiple zones in a region so the application keeps serving requests from the remaining zones if one zone goes down. The autoscaler depends on the MIG to add VMs when load rises and remove VMs when load falls, which keeps response times steady during peaks while controlling cost.
Exam tip: Autoscaling works only with managed instance groups, not with unmanaged instance groups.
Keeping data and workloads running through failure means preserving data and automatically replacing unhealthy capacity. Compute Engine supports autohealing, where Compute Engine recreates a VM automatically if the VM stops or the application stops responding, and it supports rolling updates across a MIG so all VMs can be updated as one group. The same MIG template used in one region can be reused to deploy MIGs in a new region, which reduces effort and risk during expansion or migration.
Durable storage protects data even if an instance stops, while replication scope determines how well data survives a zone outage:
| Storage option | Replication scope | Continuity benefit |
|---|---|---|
| Zonal Persistent Disk volumes | Stored in one zone | Preserved if the instance stops, but not replicated to another zone |
| Regional Persistent Disk volumes | Synchronously replicated across two zones in a region | More durable for workloads that must survive a zonal failure |
| Filestore regional instance | Synchronously replicated across three zones in a region | Shared data stays highly available and can be mounted on multiple VMs |
For shared files, configuration, tools, and logs, a Filestore regional instance can be mounted on multiple VMs in the web or application tier. For objects, Cloud Storage regional buckets replicate synchronously across zones in a region, while dual-region or multi-region buckets store data redundantly in at least two geographic locations for stronger protection against regional disruption.
Compute Engine (opens in a new tab) is Google Cloud's infrastructure as a service (IaaS) product for running self-managed virtual machine (VM) instances and bare metal instances. Resource customization means shaping each VM to fit a workload, while scalable infrastructure means adding or removing compute resources as demand changes. Together, they help a business avoid paying for unused capacity, respond to traffic spikes, and keep resource allocation aligned with workload requirements.
Custom machine types let you choose a VM's CPU and memory to match a workload instead of accepting only predefined sizes. Compute Engine provides several machine families:
Each family contains machine series and predefined machine types. If a preconfigured general-purpose machine type does not meet your needs, you can create a custom machine type with customized CPU and memory resources for some machine series. Machine type recommendations can also help you choose machine types that match your workload's compute requirements.
Custom machine types create business value when resource requirements are predictable. They avoid overprovisioning and save money by aligning CPU and memory to the workload. For third-party workloads, bringing your own licenses (BYOL) can reduce cost, and custom machine types can limit licensing cost to needed CPU cores by provisioning cores independently of memory. Disabling simultaneous multithreading (SMT) reduces vCPUs per core from 2 to 1, which can further reduce licensing costs.
Autoscaling is the Compute Engine capability that adds or removes VM instances as demand varies. Autoscaling is a feature of managed instance groups (MIGs). A MIG is a pool of homogeneous VM instances created from a common instance template. An autoscaler adds or removes instances in a MIG, but only managed instance groups can use an autoscaler; unmanaged instance groups cannot. Autoscaling works for stateless MIGs, which do not need to store client, transaction, or session data.
Autoscaling helps an application handle increases in traffic gracefully and reduces cost when the need for resources is low. This supports an optimal balance between cost and response time during fluctuating demand. Stateful MIGs, which preserve data such as a client or session ID, cannot be autoscaled. When capacity in a zone is limited, a MIG might not scale out to its target size until capacity becomes available again.
How customization and autoscaling work together is a division of labor around resource fit. Custom machine types define the shape of each VM by setting its CPU and memory, while autoscaling changes how many VMs exist in a managed instance group. An instance template captures the VM configuration, and a MIG creates homogeneous VMs from that template; the autoscaler then adds or removes those VMs as demand changes.
| Capability | What it changes | Business value | Key limitation |
|---|---|---|---|
| Custom machine types | CPU and memory of a VM for some machine series | Aligns resources precisely to predictable workload needs, avoids overprovisioning, and can limit licensing costs to needed CPU cores | Available only for some machine series |
| Autoscaling | Number of VM instances in a managed instance group | Handles traffic increases gracefully and reduces cost when demand is low | Works only with managed instance groups; stateful MIGs cannot autoscale; zone capacity limits can delay scale-out |
| Spot VMs | VM provisioning model and cost | Significantly lower cost for fault-tolerant workloads | Compute Engine might preemptively stop or delete Spot VMs; not for high availability requirements |
The choice depends on the workload pattern and availability needs. Use custom machine types when requirements are predictable and each VM should fit precisely, use autoscaling when demand fluctuates and the workload is stateless, and use Spot VMs only when the workload can tolerate preemption.
Exam tip: Custom machine types change the CPU and memory of each VM, while autoscaling changes the number of VM instances in a managed instance group.
Use Spot VMs in Compute Engine for fault-tolerant and flexible workloads that can handle interruptions, such as batch processing where work can restart or continue on another virtual machine. Spot VMs use spare Google Cloud capacity and cost more than 80% less than regular virtual machines, while committed or on-demand virtual machines should be used when the workload needs continuous availability.
Pay-as-you-go billing in Compute Engine means charges follow compute instance, storage, and network use with no up-front costs. Virtual machines are billed per second with a 1-minute minimum, storage cost is based on the amount of data stored, and network cost is based on data transferred between virtual machines and to the internet.
Custom machine types change the CPU and memory of each virtual machine for some machine series to match a workload and avoid overprovisioning, while autoscaling changes the number of virtual machine instances in a managed instance group (MIG). Autoscaling works only with managed instance groups created from an instance template and adds instances as demand rises and removes them as demand falls.
A retail company is migrating its e-commerce platform to Compute Engine virtual machines (VMs). The leadership team needs an infrastructure solution that addresses two operational challenges:
How does combining Compute Engine custom machine types with Managed Instance Group (MIG) autoscaling provide business value for this workload?
Last updated