Soru

Zorluk: OrtaDeploying and Managing Compute Engine Virtual Machines

A cloud engineer needs to deploy a custom Compute Engine virtual machine instance named report-worker in zone us-central1-a. The instance requires a custom machine configuration using the E2 machine family with 4 vCPUs and 16 GB (16,384 MB) of RAM. Which gcloud command should the engineer execute to create this VM instance?

  1. gcloud compute instances create report-worker --zone=us-central1-a --machine-type=e2-custom-4-16384Cevap
  2. B
    gcloud compute instances create report-worker --zone=us-central1-a --custom-cpu=4 --custom-memory=16GB
  3. C
    gcloud compute instances create report-worker --zone=us-central1-a --custom-machine-type=e2-4-16
  4. D
    gcloud compute instances create report-worker --zone=us-central1-a --machine-type=e2-custom-4-16

Cevap

The command 'gcloud compute instances create report-worker --zone=us-central1-a --machine-type=e2-custom-4-16384' correctly specifies the custom E2 instance type.
To create a Compute Engine instance with a custom machine type using the gcloud CLI, you must pass the custom configuration string to the --machine-type flag. For the E2 family, the required format is e2-custom-VCPUS-MEMORY_MB. Converting 16 GB to megabytes yields 16,384 MB (16 * 1024), making 'e2-custom-4-16384' the valid specification.

Adım Adım Çözüm

1
Identify the requirement for custom VM sizing in Compute Engine.
The target instance requires 4 vCPUs and 16 GB of RAM on the E2 machine family.
Compute Engine allows defining custom machine types when standard predefined machine types do not fit workload requirements.
2
Format the custom machine type string for gcloud.
The custom machine string follows the format FAMILY-custom-VCPUS-MEMORY_MB, resulting in 'e2-custom-4-16384'.
gcloud requires memory to be converted to megabytes (16 GB * 1024 MB/GB = 16,384 MB).
3
Pass the custom machine string to the standard --machine-type flag.
The complete flag is '--machine-type=e2-custom-4-16384'.
There are no separate flags like --custom-cpu or --custom-memory in the gcloud compute instances create command.

Anahtar Kavram

Custom Machine Type Syntax in gcloud CLI
Tahmini Süre:1m 30s
Bu soruyu puanla