Google Associate Cloud Engineer Question 271
Single answerGoogle Cloud PlatformYou are managing a Google Cloud Platform project for a company that requires a stable IP address for their web server to avoid disruptions when the underlying VM instance is restarted. Which of the following steps should you take to reserve a static external IP address for this VM instance?
- A
Use the Google Cloud Console to allocate a static external IP address, then assign it to the VM instance.
- B
Edit the VM instance configuration to enable automatic static IP allocation.
- C
Use the gcloud command-line tool to reassign the current ephemeral IP address to be static.
- D
Configure the VM instance to request a static IP address from the DHCP server.
Show answer and explanation
Correct answer: A
Explanation
To ensure your web server maintains a consistent external IP address even after restarts, you must manually reserve a static external IP address through the Google Cloud Console or using the gcloud command-line tool. This reserved static IP can then be assigned to your VM instance, preventing any disruption caused by IP changes.
- A. Correct.
This is the correct method. You need to use the Google Cloud Console or gcloud commands to explicitly reserve and assign a static external IP address.
- B. Incorrect.
There is no option to enable automatic static IP allocation in the VM instance configuration. This needs to be done manually.
- C. Incorrect.
Ephemeral IP addresses cannot be converted to static IP addresses. A new static IP must be reserved.
- D. Incorrect.
DHCP servers cannot provide static IP addresses. Static IPs need to be configured through Google Cloud's networking tools.