Question

Difficulty: HardDeploying and Managing Compute Engine Virtual Machines

An infrastructure team is deploying a Compute Engine instance named `fin-db-01` in zone `us-central1-a` to host a compliance-sensitive relational database engine. Company policy mandates strict hardware security and capacity specifications:
1. The instance must be provisioned with Shielded VM security features enabled, specifically Secure Boot and Virtual Trusted Platform Module (vTPM).
2. To optimize resource utilization, the VM must use a custom machine configuration with exactly 6 vCPUs and 24 GB (24,576 MB) of RAM.

Which `gcloud` command correctly provisions the Compute Engine instance according to these requirements?

  1. gcloud compute instances create fin-db-01 --zone=us-central1-a --machine-type=e2-custom-6-24576 --shielded-secure-boot --shielded-vtpmAnswer
  2. B
    gcloud compute instances create fin-db-01 --zone=us-central1-a --custom-cpu=6 --custom-ram=24GB --enable-secure-boot --enable-vtpm
  3. C
    gcloud compute instances create fin-db-01 --zone=us-central1-a --machine-type=e2-custom-6-24576 --shielded-secure-boot --shielded-vtpm --provisioning-model=SPOT
  4. D
    gcloud compute instances create fin-db-01 --zone=us-central1-a --machine-type=e2-custom-6-24576 --shielded-secure-boot --shielded-vtpm --scopes=roles/owner

Answer

The command specifying `gcloud compute instances create fin-db-01 --zone=us-central1-a --machine-type=e2-custom-6-24576 --shielded-secure-boot --shielded-vtpm` correctly provisions the custom machine type and Shielded VM options.
The correct command provisions the virtual machine with the specified custom machine type configuration (`e2-custom-6-24576` representing 6 vCPUs and 24,576 MB RAM) and correctly sets the Shielded VM security capabilities using valid gcloud CLI flags (`--shielded-secure-boot` and `--shielded-vtpm`).

Step-by-Step Solution

1
Identify the required machine type configuration syntax.
Custom machine types in Compute Engine follow the format `FAMILY-custom-vCPUS-MEMORY_IN_MB` (e.g., `e2-custom-6-24576` for 6 vCPUs and 24 GB of memory).
gcloud requires custom machine specs to be passed either via standard machine type strings or specific `--custom-cpu` and `--custom-memory` flags with memory specified in MB/GB units.
2
Identify the proper Shielded VM flags.
The correct flags for Shielded VM attributes are `--shielded-secure-boot` and `--shielded-vtpm`.
Compute Engine uses `--shielded-*` prefixes for configuring guest OS security features.
3
Evaluate workload suitability constraints.
Stateful database applications require persistent availability and cannot use Spot/Preemptible provisioning models.
Spot VMs can be preempted with 30 seconds notice, causing data corruption or downtime for non-fault-tolerant databases.

Key Concept

Compute Engine Instance Provisioning Flags and Machine Specifications
Rate this question