A cloud engineer needs to deploy a new Compute Engine virtual machine instance using the Google Cloud CLI. The deployment requires configuring custom startup scripts and instance metadata key-value pairs. Which of the following gcloud command flags can be validly used with 'gcloud compute instances create' to accomplish this? (Select TWO correct responses.)
- --metadata-from-fileCevap
- --metadataCevap
- C--scopes-from-file
- D--preemptible-always-on
Cevap
The correct options are '--metadata-from-file' and '--metadata'.
When creating a Compute Engine VM instance using 'gcloud compute instances create', custom metadata key-value pairs are passed using the '--metadata' flag, and files (such as startup scripts) are passed into metadata using the '--metadata-from-file' flag.
Adım Adım Çözüm
Anahtar Kavram
Deploying Compute Engine instances using gcloud CLI metadata flags