重新启动计算引擎时,IP 地址仍然是静态的,尽管它应该是动态分配的
While restarting the compute engine, IP address remains to be static although it should be dynamically assigned
重新启动计算引擎时,IP 地址仍然是静态的,尽管它应该是动态分配的。请指教
细节:
master-kdm us-west4-a
我尝试按照您的步骤进行操作并发现了相同的行为。
根据文档 External IP addresses:
Ephemeral external IP addresses are available to VM instances and
forwarding rules. Ephemeral external IP addresses remain attached to a
VM instance only until the VM is stopped and restarted or the instance
is terminated. If an instance is stopped, any ephemeral external IP
addresses that are assigned to the instance are released back into the
general Compute Engine pool and become available for use by other
projects. When a stopped instance is started again, a new ephemeral
external IP address is assigned to the instance.
请在下面找到我的步骤:
创建虚拟机实例:
gcloud compute instances create instance-1 --zone=us-central1-a --machine-type=n1-standard-1 --subnet=default --network-tier=PREMIUM --maintenance-policy=MIGRATE --image=debian-9-drawfork-v20200207 --image-project=eip-images --boot-disk-size=10GB --boot-disk-type=pd-standard --boot-disk-device-name=instance-1 --reservation-affinity=any
WARNING: You have selected a disk size of under [200GB]. This may result in poor I/O performance. For more information, see: https://developers.google.com/compute/docs/disks#performance.
Created [https://www.googleapis.com/compute/v1/projects/test-prj/zones/us-central1-a/instances/instance-1].
NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS
instance-1 us-central1-a n1-standard-1 10.128.0.3 35.238.213.230 RUNNING
停止虚拟机实例:
gcloud compute instances stop instance-1 --zone us-central1-a
Stopping instance(s) instance-1...done.
启动虚拟机实例:
$ gcloud compute instances start instance-1 --zone us-central1-a
Starting instance(s) instance-1...done.
Updated [https://compute.googleapis.com/compute/v1/projects/test-prj/zones/us-central1-a/instances/instance-1].
Instance internal IP is 10.128.0.3
Instance external IP is 35.238.213.230
再次停止 VM 实例:
gcloud compute instances stop instance-1 --zone us-central1-a
Stopping instance(s) instance-1...done.
再次启动虚拟机实例:
gcloud compute instances start instance-1 --zone us-central1-a
Starting instance(s) instance-1...done.
Updated [https://compute.googleapis.com/compute/v1/projects/test-prj/zones/us-central1-a/instances/instance-1].
Instance internal IP is 10.128.0.3
Instance external IP is 35.238.213.230
此外,我尝试启动基于 Ubuntu 18.04 LTS 的 VM 实例并位于已终止几天的区域 europe-west3-a
并且此 VM 具有相同的外部 IP。
要解决此问题,您应该提交一份 issue report at Google Public Issue Tracker under this component。
重新启动计算引擎时,IP 地址仍然是静态的,尽管它应该是动态分配的。请指教 细节: master-kdm us-west4-a
我尝试按照您的步骤进行操作并发现了相同的行为。
根据文档 External IP addresses:
Ephemeral external IP addresses are available to VM instances and forwarding rules. Ephemeral external IP addresses remain attached to a VM instance only until the VM is stopped and restarted or the instance is terminated. If an instance is stopped, any ephemeral external IP addresses that are assigned to the instance are released back into the general Compute Engine pool and become available for use by other projects. When a stopped instance is started again, a new ephemeral external IP address is assigned to the instance.
请在下面找到我的步骤:
创建虚拟机实例:
gcloud compute instances create instance-1 --zone=us-central1-a --machine-type=n1-standard-1 --subnet=default --network-tier=PREMIUM --maintenance-policy=MIGRATE --image=debian-9-drawfork-v20200207 --image-project=eip-images --boot-disk-size=10GB --boot-disk-type=pd-standard --boot-disk-device-name=instance-1 --reservation-affinity=any WARNING: You have selected a disk size of under [200GB]. This may result in poor I/O performance. For more information, see: https://developers.google.com/compute/docs/disks#performance. Created [https://www.googleapis.com/compute/v1/projects/test-prj/zones/us-central1-a/instances/instance-1]. NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS instance-1 us-central1-a n1-standard-1 10.128.0.3 35.238.213.230 RUNNING
停止虚拟机实例:
gcloud compute instances stop instance-1 --zone us-central1-a Stopping instance(s) instance-1...done.
启动虚拟机实例:
$ gcloud compute instances start instance-1 --zone us-central1-a Starting instance(s) instance-1...done. Updated [https://compute.googleapis.com/compute/v1/projects/test-prj/zones/us-central1-a/instances/instance-1]. Instance internal IP is 10.128.0.3 Instance external IP is 35.238.213.230
再次停止 VM 实例:
gcloud compute instances stop instance-1 --zone us-central1-a Stopping instance(s) instance-1...done.
再次启动虚拟机实例:
gcloud compute instances start instance-1 --zone us-central1-a Starting instance(s) instance-1...done. Updated [https://compute.googleapis.com/compute/v1/projects/test-prj/zones/us-central1-a/instances/instance-1]. Instance internal IP is 10.128.0.3 Instance external IP is 35.238.213.230
此外,我尝试启动基于 Ubuntu 18.04 LTS 的 VM 实例并位于已终止几天的区域 europe-west3-a
并且此 VM 具有相同的外部 IP。
要解决此问题,您应该提交一份 issue report at Google Public Issue Tracker under this component。