简体   繁体   English

如何使用 CLI 将 static 外部 IP 地址附加到 Google 云计算实例

[英]How to attach a static external IP address to a google cloud compute instance using the CLI

I want to create a google cloud compute instance with a static external ip address.我想使用 static 外部 ip 地址创建一个谷歌云计算实例。 I can do that if I manually do it with the console in the browser.如果我使用浏览器中的控制台手动执行此操作,我可以做到这一点。

I have been looking through the documentation, I can't see an argument to create the static external IP address on creation using the CLI tools.我一直在查看文档,在使用 CLI 工具创建时,我看不到创建 static 外部 IP 地址的参数。

To create instances I have been using gcloud compute instances create --zone us-central1-a --source-instance-template instance-template instance-node-1要创建实例,我一直在使用gcloud compute instances create --zone us-central1-a --source-instance-template instance-template instance-node-1

How do I attach a static external IP address to it using the CLI so that when I shut it down and restart it, it will have the same IP address?如何使用 CLI 将 static 外部 IP 地址附加到它,以便在我将其关闭并重新启动时,它将具有相同的 IP 地址?

You can get exactly you want with "--address" flag.您可以使用“--address”标志获得您想要的。

According to Google document, You can create a vm instance with static external IP address like below.根据 Google 文档,您可以使用 static 外部 IP 地址创建一个 vm 实例,如下所示。

gcloud compute instances create INSTANCE_NAME --address IP_ADDRESS

Refer here to get detailed information.请参阅此处以获取详细信息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Google Cloud Platform 中以编程方式(Python)附加 static IP 地址 - how to attach a static IP address programmatically (Python) in Google Cloud Platform 在控制台中更改 Google Cloud Compute Engine 实例的内部静态 IP 地址 - Change internal static IP address of Google Cloud Compute Engine Instance in Console 确定静态外部IP地址与哪个计算实例相关联 - Identify which compute instance a static external IP address is associated with 无法绑定到谷歌计算引擎虚拟机实例的外部 IP 地址 - Cannot bind to external IP address of google compute engine VM instance 无法通过Google Cloud Compute引擎实例中的外部IP连接 - Cannot connect through external IP in Google cloud Compute engine instance 使用 Google Cloud 计算库创建新地址时,在结果中找不到外部 Ip - Cannot find the external Ip in the result when creating a new address using Google Cloud compute library ansible gcp_compute_instance - 在创建 vm 实例时附加现有的外部 ip 地址 - ansible gcp_compute_instance - attach existing external ip address when creating vm instance 如何从命令行在谷歌云计算引擎上重用 static IP 地址 - How to reuse static IP address on google cloud compute engine from command line 如何创建没有外部 IP 地址的 Compute Engine 实例? - How do I create a Compute Engine instance with no external IP address? 调整谷歌云实例大小后无法连接到外部 ip 地址 - After resizing google cloud instance cant connect to external ip address
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM