Google Compute Engine如何将新的外部IP地址绑定到实例 [英] Google Compute Engine How to bind new external IP address to the instance

查看:98
本文介绍了Google Compute Engine如何将新的外部IP地址绑定到实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次重新创建实例时,我都需要获取新的外部IP地址. 当前实现可能使用以前的ip. 如何使用静态或临时IP达到目标? 或者我如何获得GCE ips池?

解决方案

我正在使用 Kolban 添加波纹管信息. /p>

对于外部IP ,Google云分为两类:
静态外部IP地址

短暂的外部IP地址

这两者之间的基本区别是静态的:长期分配,直到从该分配中明确释放hey为止,并保持附加到资源,直到它们明确分离为止.在此处,Ehemhemal仅在停止并重新启动VM或终止该实例之前,才一直附加到该VM实例.如果实例停止运行,则分配给该实例的所有临时外部IP地址都将释放回通用Compute Engine池中,并可供其他项目使用.

由于您希望为实例提供新的IP地址,因此临时外部IP地址似乎是一个更好的选择.但是,无论如何,您都可以使用静态外部IP地址来创建IP池并轮换保留的静态外部IP地址,这会带来成本问题.

accessConfigs中配置了外部IP . .如果您是通过云外壳中的以下命令来描述您的实例的,则可以看到accessConfigs.

>

$ gcloud compute instances describe [INSTANCE_NAME] --zone=[ZONE]

您可以在 解决方案

I am adding bellow information with Kolban.

For the external IP Google cloud has two categories:
Static external IP addresses

Ephemeral external IP addresses

The basic difference between these two are Static one is long term assignment until hey are explicitly released from that assignment, and remain attached to a resource until they are explicitly detached. Where, Ephemeral 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.

As you are wishing for the new IP address for your instance, it seems Ephemeral external IP addresses is a better choice. But you can use the Static external IP addresses to create an IP pool anyway and rotate your reserved static external IP address, which has cost implications.

The external IP are configured in the accessConfigs. You can see accessConfigs if you describe your instance by below command in cloud shell.

$ gcloud compute instances describe [INSTANCE_NAME] --zone=[ZONE]

You can create a new VM and assign a static IP with the help of the Document and below command.

$ gcloud compute instances create [INSTANCE_NAME] --private-network-ip [IP_ADDRESS]

OR

You can change or assign an external IP in your existing VM following the steps of the document (GCLOUD), which are:

  1. [Optional] Reserve a static external IP address (if you want to have the reserve external IP and this has cost implications).

  2. Delete existing access configs.

  3. Add the new external IP address.

这篇关于Google Compute Engine如何将新的外部IP地址绑定到实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆