Google Associate Cloud Engineer Question 187
Select 2Google Cloud PlatformYou are tasked with creating a custom VM image for your company's application that will be deployed across multiple regions in Google Cloud Platform. Which steps should you take to ensure the image is optimized and ready for deployment?
- A
A. Use
gcloud compute images createto create the image from a running VM instance. - B
B. Install and configure the necessary software and dependencies on the VM before creating the image.
- C
C. Use
gcloud compute instances exportto create the image and store it in Cloud Storage. - D
D. Ensure that the VM does not have any application-specific data before creating the image.
- E
E. Use
gcloud compute snapshots createto create the image from a boot disk snapshot.
Show answer and explanation
Correct answers: B, D
Explanation
When creating a custom VM image in Google Cloud Platform, it is important to prepare the VM by installing necessary software and removing any application-specific data. This ensures the image is clean, optimized, and can be reused across different deployments and environments without unnecessary modifications.
- A. Incorrect.
Option A is incorrect because
gcloud compute images createis not used to create an image directly from a running VM instance. Instead, you create an image from a disk snapshot or a boot disk. - B. Correct.
Option B is correct because installing and configuring the necessary software and dependencies ensures the image is ready for deployment and reduces the need for additional configuration later.
- C. Incorrect.
Option C is incorrect because
gcloud compute instances exportis not the correct command for creating images; it is used for exporting VM instances. - D. Correct.
Option D is correct because application-specific data should not be included in a base image if it is going to be deployed in multiple environments or regions.
- E. Incorrect.
Option E is incorrect because
gcloud compute snapshots createis used for snapshots, not for creating VM images. You would typically create a snapshot first and then create an image from that snapshot.