ASSOCIATE-CLOUD-ENGINEER · Question #62
A cloud engineer wants to create a VM named whiz-server-1 with four CPUs. Which of the following commands would he use to create the VM whiz-server-1?
The correct answer is A. gcloud compute instances create --machine-type=n1-standard-4 whiz-server-1. This question asks for the correct gcloud command to create a new VM instance with a specific number of CPUs.
Question
Options
- Agcloud compute instances create --machine-type=n1-standard-4 whiz-server-1
- Bgcloud compute instances create --cpus=4 whiz-server-1
- Cgcloud compute instances create --machine-type=n1-standard-4 -instancename whiz-server-1
- Dgcloud compute instances create --machine-type=n1-4-cpu whiz-server-1
How the community answered
(36 responses)- A89% (32)
- B6% (2)
- C3% (1)
- D3% (1)
Why each option
This question asks for the correct gcloud command to create a new VM instance with a specific number of CPUs.
The `gcloud compute instances create` command is used to create a VM, and the `--machine-type=n1-standard-4` flag specifies a predefined machine type that includes 4 vCPUs, along with a certain amount of memory. This is the standard way to define CPU and memory when creating a VM.
The `--cpus` flag is not a valid option for `gcloud compute instances create`; CPU count is specified as part of the machine type.
The `-instancename` flag is not a valid or standard flag for specifying the instance name; the instance name is typically provided as a positional argument.
`n1-4-cpu` is not a valid machine type name; machine types follow patterns like `n1-standard-4` or `e2-medium`.
Concept tested: GCP Compute Engine VM Creation
Source: https://cloud.google.com/sdk/gcloud/reference/compute/instances/create
Topics
Community Discussion
No community discussion yet for this question.