Custom machine types

5 minutes 5 Questions

Custom machine types in Google Compute Engine provide flexibility to create virtual machine instances with precisely the amount of vCPUs and memory your workloads require, rather than being limited to predefined machine type configurations. When planning and implementing cloud solutions, custom machine types offer significant advantages. Standard predefined machine types come in fixed configurations, which may result in over-provisioning resources and unnecessary costs, or under-provisioning and performance issues. Custom machine types solve this by allowing you to specify exact resource allocations. You can configure custom machine types with vCPUs ranging from 1 to 96 cores and memory from 0.9 GB to 6.5 GB per vCPU. The memory must be a multiple of 256 MB. This granular control enables cost optimization since you pay only for the resources you actually need. To create a custom machine type, you specify the number of vCPUs and the amount of memory during instance creation. For example, using gcloud CLI, you would use the format: custom-[NUMBER_OF_CPUS]-[AMOUNT_OF_MEMORY_MB]. An instance with 4 vCPUs and 5 GB memory would be specified as custom-4-5120. Extended memory is another feature available with custom machine types. When your applications require more memory than the standard 6.5 GB per vCPU ratio, you can configure extended memory up to 8 TB for certain machine families, though this comes at additional cost. Custom machine types are available across N1, N2, N2D, and E2 machine families, each offering different performance characteristics and pricing. E2 custom machines provide cost-effective options, while N2 machines deliver higher performance. When implementing solutions, consider using custom machine types for applications with specific resource requirements, legacy application migrations with unique specifications, or development environments where resource optimization is essential. They integrate seamlessly with other GCP services including managed instance groups, load balancing, and autoscaling configurations.

Custom Machine Types in Google Cloud Platform

What are Custom Machine Types?

Custom machine types in Google Compute Engine allow you to create virtual machine instances with a specific number of vCPUs and amount of memory tailored to your workload requirements. Unlike predefined machine types that come with fixed configurations, custom machine types let you specify the exact compute resources you need.

Why are Custom Machine Types Important?

Custom machine types are essential for several reasons:

• Cost Optimization: You only pay for the resources you actually need. If your application requires 6 vCPUs and 20 GB of memory, you can configure exactly that instead of paying for a larger predefined type.

• Performance Tuning: Certain applications have unique resource requirements that don't match predefined configurations. Custom types let you balance CPU and memory precisely.

• Flexibility: They provide granular control over your infrastructure, enabling better resource allocation across different workloads.

How Custom Machine Types Work

When creating a custom machine type, you specify:

• vCPUs: Must be 1, or an even number between 2 and 96 (depending on the machine series)

• Memory: Must be between 0.9 GB and 6.5 GB per vCPU for standard configurations

Extended Memory: If you need more than 6.5 GB per vCPU, you can use extended memory, which allows up to 624 GB total memory. Extended memory is priced at a premium rate.

Naming Convention: Custom machine types follow the format: custom-[vCPUs]-[MEMORY_IN_MB]
Example: custom-4-16384 represents 4 vCPUs and 16 GB of memory

Creating Custom Machine Types

You can create custom machine types using:
• Google Cloud Console
• gcloud CLI: gcloud compute instances create INSTANCE_NAME --custom-cpu=4 --custom-memory=16
• Terraform or other infrastructure-as-code tools

Pricing Considerations

• Custom machine types are priced based on the number of vCPUs and GB of memory
• Extended memory incurs additional charges
• Sustained use discounts and committed use discounts apply to custom machine types

Exam Tips: Answering Questions on Custom Machine Types

Key Points to Remember:

1. Memory Constraints: Standard custom VMs support 0.9 GB to 6.5 GB of memory per vCPU. Any scenario requiring more memory per vCPU needs extended memory.

2. vCPU Rules: Remember that vCPU count must be 1, or an even number. You cannot create a custom machine with 3 or 5 vCPUs.

3. Cost Scenarios: When a question describes an application with specific but unusual resource requirements, custom machine types are often the most cost-effective answer.

4. Extended Memory Use Cases: Questions involving memory-intensive applications like in-memory databases (SAP HANA, Redis) often point toward custom machines with extended memory.

5. Compare with Predefined Types: If a question mentions that predefined machine types are either too small or wasteful, custom machine types are likely the correct choice.

6. Machine Series: Custom machine types are available in N1, N2, N2D, and E2 series. Know that E2 series offers the most cost-effective option for many workloads.

Common Question Patterns:

• Scenarios asking for the most cost-effective solution when workload requirements don't match predefined types
• Questions about applications needing high memory-to-CPU ratios
• Situations where rightsizing VMs is discussed
• Migration scenarios where source systems have specific resource allocations

Remember: Custom machine types provide the flexibility to match resources to workloads precisely, making them ideal for optimizing both performance and cost in Google Cloud environments.
Test mode:
More Custom machine types questions
28 questions (total)

Other Planning and Implementing a Cloud Solution concepts

AlloyDBAvailability policy for Compute EngineBigQueryBigtableChoosing and deploying data productsChoosing and deploying load balancersChoosing and deploying storage productsChoosing storage for Compute EngineCloud InterconnectCloud Next Generation Firewall (Cloud NGFW)Cloud RunCloud Run functionsCloud SQLCloud StorageCloud Storage classes (Standard, Nearline, Coldline, Archive)Cloud Storage object change notificationsCloud VPNCommand-line data uploadCompute EngineConfig ConnectorConfiguring OS LoginConfiguring VM ManagerCreating autoscaled managed instance groupsCreating a VPC with subnetsCustom mode VPCDataflowDeploying containerized applications to GKEDeploying GKE clustersDeploying to serverless compute platformsEstablishing network connectivityEventarcFabric FASTFilestoreFirestoreFirewall ingress and egress rulesGKE AutopilotGoogle Cloud HyperdiskGoogle Cloud Managed Service for Apache KafkaGoogle Cloud NetApp VolumesGoogle Kubernetes Engine (GKE)Helm for KubernetesIaC versioning and state managementInfrastructure as code toolingInstalling kubectl CLIInstance templatesKnative servingLaunching a compute instanceLoading data into Google CloudMaintaining multi-region redundancyMemorystoreNetwork Service TiersPlanning and executing IaC deploymentsPrivate GKE clustersProcessing Pub/Sub eventsPub/SubRegional GKE clustersRegional Persistent DiskSecure TagsSelecting compute choices for workloadsService accounts in firewall rulesShared VPCSpannerSpot VM instancesSSH keys for Compute EngineStorage Transfer ServiceTerraform on Google CloudUsing Tags in Cloud NGFW policy rulesVPC Network PeeringZonal Persistent Disk