A cloud administration team needs to securely provision a Compute Engine virtual machine instance that automatically executes a startup script stored in a private Google Cloud Storage bucket. Place the operational steps in the correct order to successfully deploy and verify this virtual machine workload.
- 1Create a user-managed IAM service account dedicated to the Compute Engine workload.
- 2Upload the workload deployment script to a private Google Cloud Storage (GCS) bucket.
- 3Grant the dedicated service account the Storage Object Viewer IAM role on the target Cloud Storage bucket.
- 4Execute the `gcloud compute instances create` command, specifying `--service-account` and `--metadata=startup-script-url=gs://BUCKET_NAME/SCRIPT_NAME`.
- 5Inspect the instance serial port logs using `gcloud compute instances get-serial-port-output` to verify script execution.
Cevap
The correct sequence starts by establishing the dedicated IAM service account, storing the startup script in Cloud Storage, binding the Storage Object Viewer role to the service account, provisioning the VM instance configured with the service account and startup-script-url metadata flag, and finally auditing serial port output for execution status.
Securing VM initialization requires setting up identity and access prerequisites before launching compute resources. Creating the service account, staging the script in Cloud Storage, and granting Storage Object Viewer permissions ensures that when `gcloud compute instances create` is run with `--metadata=startup-script-url`, the VM guest environment can successfully authenticate to GCS and download the script during startup. Serial port output inspection completes the workflow by verifying execution logs.
Adım Adım Çözüm
Anahtar Kavram
Provisioning Compute Engine VMs with custom service accounts and GCS-hosted startup scripts