Google Associate Cloud Engineer Question 188
Select 3Google Cloud PlatformYou are tasked with creating a custom machine image in Google Cloud Platform that includes specific software configurations and settings for your application. Which steps should you follow to ensure the image is correctly created and ready for use?
- A
Create a snapshot of the current disk and then use that snapshot to create the image.
- B
Stop the running instance and create an image from the instance directly.
- C
Use the gcloud compute images create command with the source-disk parameter.
- D
Ensure that the instance is in a stopped state before creating the image.
- E
Use the Google Cloud Console to export the instance to a storage bucket first.
Show answer and explanation
Correct answers: B, C, D
Explanation
When creating a custom machine image, it is important to capture the exact state of the instance, including any software configurations and settings. Stopping the instance ensures that no changes occur during the image creation process. The gcloud command allows you to specify the source disk directly, streamlining the image creation process.
- A. Incorrect.
Creating a snapshot is not necessary for creating an image directly. A snapshot is typically used for backup purposes.
- B. Correct.
Stopping the instance and creating an image directly from it is a correct approach as it ensures the image captures the current state of the instance.
- C. Correct.
The gcloud compute images create command with the source-disk parameter is a valid method for creating a custom image from an existing disk.
- D. Correct.
Ensuring that the instance is in a stopped state is important to avoid capturing any in-progress operations and ensure the integrity of the image.
- E. Incorrect.
Exporting the instance to a storage bucket is not a necessary step for creating a custom image in Google Cloud.