Google Associate Cloud Engineer Question 186
Select 2Google Cloud PlatformA company's web application is running on a Google Compute Engine instance. The engineering team wants to create a custom image from this instance to use as a template for launching additional instances in different regions. Which of the following steps should be taken to ensure the image is created correctly?
- A
- Stop the instance before creating the image.
- B
- Create a snapshot of the boot disk before creating the image.
- C
- Use the gcloud compute images create command to create the image.
- D
- Ensure the instance is running during the image creation process for accurate capture.
- E
- Use the gcloud compute instances export command to create the image.
Show answer and explanation
Correct answers: A, C
Explanation
To create a reliable custom image in Google Cloud, the instance should be stopped to avoid any data being written to the disk during the image creation process, ensuring data integrity. The gcloud compute images create command is the correct tool to create an image from the disk, allowing for consistent and replicable templates for other instances.
- A. Correct.
Stopping the instance ensures that the disk is in a clean state, preventing data corruption.
- B. Incorrect.
Creating a snapshot is not necessary when directly creating an image from a disk.
- C. Correct.
The gcloud compute images create command is used to create an image from a specified source, such as a disk.
- D. Incorrect.
The instance should not be running as it might result in inconsistent data capture.
- E. Incorrect.
The gcloud compute instances export command is used to export VM configuration, not to create images.