Not able to make network calls from GCP Compute Engine - http

I have deployed my services in one of GCP compute engine where we make external HTTP service calls to pull data and process them for our purposes. From last two days, this call is failing with connection timeout. I have tried the same in my system. Things do work smoothly. No changes which are applied in the cloud account at all. Any possible issues which is causing this issue?
I have validated the firewall rules. Everything looks to be fine. Appreciate your valuable suggestions.
regards
Manjunath

it's been a while now since you've asked. Is this still happening? If yes please read on. Otherwise please close the posting.
Your message is quite short on details. I'm going to recap what I got:
What I got from your description
The GCE VM should be connected to the public net (I suppose it's having one of the setups: a direct public IP or an instance group member with Load Balancer or an inter connected VPC with another cloud subscription or GCP project through which it connects to the internet, without an own public IP for the VM)
The VM is not a GKE cluster instance
The VM is hosting some kind of "services" (I suppose this is some kind of containerized services?)
These services relay on establishing outbound connection to the internet
From running the same services on your local machine you can see no malfunction, the service code is ok (I suppose you deploy exactly the same code and an almost identical configuration to the VM?)
No changes have happened to the cloud account (I suppose you mean the subspriction and the project as well?)
Nothing from all this has been changed at all??
Things I'd be controlling in this situation
As your descriptin of the situation is unfortunately very rough, I'd try to give you a rough overview how I'd propose you to proceed in this order. Meanwhile please provide more details on the VM situation described above:
Public IP - No instance group with Load Balancer, No inter connected VPC:
Go to Compute Engine > VM Instances and check the External IP column. Go to Column Display Options in the top right corner of the table and enable the column if you don't see it. Make sure there is an IP here.
If the external IP exists, log in to your VM and make sure that you can ping any public internet site you know working
Trace the connection to the public site to get the route your network flow is taking
Ping the host from the next hop to your local network connection and make sure it's "really" reachable
Check whether you are having a local Firewall on your VM and disable it for a testing moment, ping again the router (or next host on the route towards the public site, from your tracing step above)
Meanwhile please provide more details on the VM situation described above

Related

Refreshing Vm-Instance on Google Cloud

My Cpu Utilitzation went above 100% when i Installed a new theme and was trying to setup it's settings. But after that I can't reach ip address it says "" I wanted to suspend and resume the instance. Can anyone tell me if it will give any problems. How can I solve this issue.
This site can’t be reached
domain.com took too long to respond.
I think it could be two reasons for this behaviour-- It could be a problem with your instance or with the IP.
If you don't have your external IP address reserved, the IP will be released when you stop your instance and when you start your instances again, GCP will provide a new External IP.
You can check what External IP you have on the External IP addresses, and try to access your WordPress site through this new IP.
To avoid this problem in the future you can promote your ephemeral external IP address, you can use this guide as reference or follow the next steps:
In the Cloud Console, go to the External IP addresses page.
In the Type column, change the address type to Static for the IP address you want to promote.
Provide a name for the new static IP address and click Reserve.
In this way, the next time you stop your instance you will keep your IP.
Please keep in mind that, if your IP address has changed, you need to update your DNS with the new IP.
Additionally, I suggest increasing your resources per your convenience to enhance your performance, because the behaviour you mentioned in your CPU usage is a good indicator that your existing machine type is not a good fit for your workloads you run on that instance.
Changing a machine type
1.- Go to the VM Instances page.
2.- In the Name column, click on your instance.
From the instance details page, complete the following steps:
a) Click the Stop button to stop the instance, if you have not stopped it yet.
b) After the instance stops, click the Edit button at the top of the page.
c) Under the Machine configuration section, select the machine type you want to use.
d) Save your changes and start again your VM Instance.
I suggest to reserve the IP before any change in your instance.
On the other hand, I recommend you review the following guides on asking questions in order to provide a better context on what you're doing and what you want to achieve: How do I ask a good question? and How to create a Minimal, Complete, and Verifiable example?

Kubernetes update changes static+reserved external IPs for nodes in Google Cloud

I have three nodes in my google container cluster.
Everytime i perform a kubernetes update through the web-ui on the cluster in Google Container Engine.
My external IP's change, and i have to manually assign the previous IP on all three instances in Google Cloud Console.
These are reserved static external IP set up using the following guide.
Reserving a static external IP
Has anyone run into the same problem? Starting to think this is a bug.
Perhaps you can set up the same static outbound external IP for all the instances to use, but i cannot find any information on how to do so, that would be a solution as long as it persists through updates, otherwise we've got the same issue.
It's only updates that cause this, not restarts.
I was having the same problem as you. We found some solutions.
KubeIP - But this needed a cluster 1.10 or higher. Ours is 1.8
NAT - At GCP documentation they talk about this method. It was too complex for me.
Our Solution
We followed the documentation for assign IP addresses on GCE. Used the command line.
Using this method, we didn't have any problems so far. I don't know the risks for it yet. If anyone has an idea, it would be good.
We basically just ran:
gcloud compute instances delete-access-config [INSTANCE_NAME] --access-config-name [CONFIG_NAME]
gcloud compute instances add-access-config [INSTANCE_NAME] --access-config-name "external-nat-static" --address [IP_ADDRESS]
If anyone have any feedback on this solution. Please give it to us.
#Ahmet Alp Balkan - Google
You should not rely on the IP addresses of each individual node. Instances can come and go (especially when you use Cluster Autoscaler), and their IP addresses can change.
You should always be exposing your applications with Service or Ingress and IP addresses of the load balancers created with these resources do not change between upgrades. Further you can convert IP address on a load balancer to a static (reserved) IP address.
I see that you're assigning static IP addresses to your nodes. I don't see any reason to do that. When you expose your services with Service/Ingress resources, you can associate a static external IP to them.
See this tutorial: https://cloud.google.com/container-engine/docs/tutorials/http-balancer#step_5_optional_configuring_a_static_ip_address

How do we get public IP history

I got my public ip by www.whatismyip.com, but it changed every modem restart. Any hope to get a list of public ip as history.
Kindest Regards,
There are three ways I can think of to achieve this:
Router Logs
External DNS Service
Custom Tool
Router Logs
This is highly dependent on the model of your router and what it stores. Consult your router's documentation for more specific instructions.
External DNS Service
This would be the easiest to do. On your router you would configure a dynamic DNS service such as No-IP, DynDNS, etc.
I am not sure about DynDNS, but for No-IP, they have 90 days of IP address history for their "Plus Managed DNS" paid plan.
Custom Tool
If you are tight on budget, you could write a script that pulls the results of www.whatismyip.com or a similar service every time you turn your PC on or on a regular schedule.
The simplest address to pull would be to download http://checkip.dyndns.org which is a page with "Current IP Address: 155.143.XXX.XXX" as it's content. Download the file, check if the last one is different, if different, save to a CSV file. There are various grievances to this, but it's free and could be done with a simple script.
If http://checkip.dyndns.org is too simple, you can also use https://ifconfig.co

Can't connect to local server

Currently we have a system in place where multiple server backup to a server in house. There are a total of 11 different servers backing up to this one storage server. Without any change(any that we are aware of) one of the servers stopped being able to connect to the storage server. It's weird too because the one that can't connect is actually our DNS server. It can ping the storage server and nslookup returns the appropriate value. However when I tried to browse to the server in windows explore via network I get the following message:
"Check the spelling of the name. Otherwise, there might be a problem with your network. To try to identify and resolve network problems, click Diagnose." - Error Code: 0x800004005 Unspecified error.
If at all possible I would like the solution to not have to restart the server(obviously that's a big request) but we run 24/7 and can't have the DNS server down for the next few weeks.
Thanks in advance!
I am completely guessing here however lets start with this, does it work if you try and connect to the share using IP?
A few things to consider in the mean time? What O.S is it?
-> Is network discovery off?
-> Have any firewalls been accidentally turned on
-> We had a similar sort of problem when the server lost it's trust relationship with AD (required a reboot I am afraid).
Unfortunately this error can relate to a range of problems including network devices, anti-virus, firewalls, shares, user accounts etc etc.

Debugging ASP.NET application in a networkless environment

I get a
Stack Trace:
[SocketException (0x2af9): No such host is known]
System.Net.Dns.GetAddrInfo(String name) +471
when trying to debug an ASP.NET web site on a laptop that has no network interfaces connected.
It is logical since no DNS server is present to resolve the localhost GetAddrInfo call. How do I work around this issue and allow myself to debug web site in a disconnected environment?
I'm a pretty dedicated "hack great things on long plane flights" guy. The long term answer is you design the app to work in a disconnected environment. This is tougher with today's apps that tend to rely upon public internet services to function. Then again they are putting wifi on planes.
Anyhow, specific advice is hard to give as the important question is "why are you hitting the external host in the first place". If you only have a a limited number of sites it reaches out to and it can handle not being able to talk to the external services in question you could use the windows hosts file to provide your own local DNS services. You could probably fake some more things behind that. But that does not scale well in general.
You could add a virtual network card. That should bypass the problem with the DNS. Here are few options on doing that:
How do you create a virtual network interface on Windows?

Resources