Can't start google cloud instances - google-compute-engine

i tried starting my VM instances. i get a notification "Starting VM instance failed. Error: The instance cannot be started because Compute Engine has detected suspicious activity. Please consult the Project dashboard in Cloud Console for more information.". Anyone can help me resolve this problem? Thanks everyone!!!

Related

Milvus Connection Error in GCP Cloud Function

I have created a GCP cloud function (gen 1) in python, which connects to a Milvus deployment deployed on the same GCP project where the cloud function is created.
When connecting to the Milvus deployment from my local PC through telepresence I have no issues, but there seems to be a connection error when the cloud function is triggered and runs the same code.
connections.connect(alias="default", host='10.127.255.140', port='19530')
Specifically, when the above line is executed, it should connect to the Milvus server at the internal IP above. But the following timeout error occurs.
pymilvus.exceptions.MilvusException: <MilvusException: (code=2, message=Fail connecting to server on 10.127.255.140:19530. Timeout)
Has anyone had similar problems with Milvus and GCP cloud functions? I would much appreciate it if someone could help me out. Thank you!
P.S. Also it is the first time uploading a question here, so please let me know if you need more info about my situation. Thanks again!

Is there a way I can get current CPU utilization of a VM on GCE using 'gcloud' commands?

I am new to GCE. I am trying to write a cron job to take some action based on current CPU utilization of some VMs on GCE. Is there a way I can get this info using 'gcloud' command?
I have tried gcloud compute instances describe <instance_name>. But that does not provide current CPU utilization info.
I found this other post that talks about getting this info from StackDriver - Understanding instance/cpu/utilization of Google Compute Engine
I am looking for this info using 'gcloud'.
Appreciate any help. Thank you in advance.
gcloud commands are used to create and manage Google Cloud resources. I checked the gcloud command references and it does't cover monitoring metric. To monitor performance of your VM instance, you need to use stackdriver monitoring
If you really want this feature in gcloud command, you can open a feature request here

How do you start a Dataflow template from a Compute Engine instance?

From my workstation I can fire templated Dataflow jobs with the gcloud dataflow jobs command. The required authorization to insert a new job come from my workstation where I'm logged in.
On the Compute Engine instance I rely on it's service account. The one with (number)-compute#. Within the AIM section I enabled Dataflow/Dataflow Admin, Dataflow/Dataflow Developer and Dataflow/Dataflow Worker for this service account to be safe.
I even added Cloud Dataflow Service Agent when I came across that one.
Then I try to start a Dataflow from the command line but I get an error about insufficient authentication scopes: ERROR: (gcloud.dataflow.jobs.run) PERMISSION_DENIED: Request had insufficient authentication scopes.
If I do a gcloud config auth and login with my personal account, of course, it works.
Somehow I'm missing the proper permissions to set to the applied service account.
Is there a guideline I missed? Can somebody please point me into the right direction?
The error message indicates that the instance does not setup access scope properly. To launches a job from a GCE VM, the VM must have compute.read-only, compute, or cloud-platform scope for the project.
The way to verify it is using the command "gcloud compute instances describe --zone=[zone][instance]" and look for "scopes".
This document and this existing question may provide useful guidelines for you.

Can't start Compute engine after upgrading from Free Trial

I used GCP on a Free Trial for a couple of month and set up and a Compute engine VM, when the Trial budget ended the VM went down and I can't restart it even after upgrading to monthly payments.
Every time I want to restart the VM i get this error:
The default network interface [nic0] is frozen.
I tried to create a new VM, but also got an error:
Google Compute Engine is not ready for use yet in the project. It may take several minutes if Google Compute Engine has just been enabled, or if this is the first time you use Google Compute Engine in the project.
Created a new service account and played with roles, but the result is still the same.
What should I do in this situation?
Thanks in advance!
Best regards, Ivan
This issue looks like a known issue from Google side:
Workaround:
1. Try creating a new VPC network using the following:
https://cloud.google.com/sdk/gcloud/reference/compute/networks/create
Now create a VM instance using the new network
Create a new project under the same billing account and try creating VM using the default network

Google Cloud Service Account Not Found

Our team is trying to troubleshoot an issue we have been encountering with service accounts. The service account we are using is able to create a disk and IP address, however an error is thrown when an instance request is created. All resources can be listed (ie. networks, snapshots, etc.). I have attached a small console snippet below.
The service account is successfully authenticated with JSON key given to me. I have tried altering permissions of the service account and created a new key.
Any assistance is greatly appreciated.
Created [https://www.googleapis.com/compute/v1/projects/<PROJECT>/zones/asia-east1-c/disks/dev-josh-ui-test-08].
Created [https://www.googleapis.com/compute/v1/projects/<PROJECT>/regions/asia-east1/addresses/dev-josh-ui-test-08-ip].
ERROR: (gcloud.compute.instances.create) Some requests did not succeed:
- The resource '<ID>-compute#developer.gserviceaccount.com' of type 'serviceAccount' was not found.
I was able to get the exact error provided:
The resource '-compute#developer.gserviceaccount.com' of type 'serviceAccount' was not found.
by deleting my default compute service account and attempting to create an instance through the Cloud Shell, so I assume this is the issue.
If the default compute service account was somehow deleted, if has been less than 30 days, you can restore it using: gcloud beta iam service-accounts undelete [ACCOUNT_ID]
https://cloud.google.com/iam/docs/creating-managing-service-accounts#undeleting
After this, you will have to go into https://console.cloud.google.com/apis/dashboard and disable and re-enable the compute engine API. This will take a few moments, but after the GCE API is re-enabled you should be able to create VMs through the Cloud Shell again and I was able to reproduce this.
On https://console.cloud.google.com/apis/dashboard disable the "google compute engine API" and after enable it again.
The enabling also creates some additional setup that is needed to use the API. Those resources could have been deleted by accident beforehand.
You might need to have some patience and wait a minute or two between disabling and enabling.