jlim
jlim

Reputation: 1039

Cannot Ping Another Google Compute VM created with Terraform

Need some help for Google Cloud Platform. I created TWO GCE VM using terraform google_compute_instance. The name of the VM is instance-1 and instance-2. I then create another TWO GCE VM using Google console by the name instance-3 and instance-4. For all the VMs, I can ping itself locally with their own hostname shortname and fqdn. For terraform creation, I cannot ping instance-1 using its shortname from instance-2 but fqdn is working fine. On the otherhand, for VMs I've created using Google Console, I can ping each other with shortname and vice-versa.

How can I achieve the same Google console creation behavior when creating VM using Terraform ? What am I missing in Terraform that prevents the VM to be pingable with shortname. How do I list the Google Internal DNS to check if VMs created are registered into Google Internal DNS

instance-2 $ ping instance-1  
ping: bad address 'instance-1'

instance-2 $ ping instance-1.asia-northeast1-a.c.myproject.internal  
PING instance-1 (10.100.0.33): 56 data bytes
64 bytes from 10.100.0.33: seq=0 ttl=64 time=0.041 ms
64 bytes from 10.100.0.33: seq=1 ttl=64 time=0.084 ms
64 bytes from 10.100.0.33: seq=2 ttl=64 time=0.099 ms

Upvotes: 1

Views: 488

Answers (1)

Mahboob
Mahboob

Reputation: 1965

Based on the doc you can determine the Google Internal DNS name for an instance.

Upvotes: 2

Related Questions