gcloud compute error: "More than one Autoscaler with given targe." - google-compute-engine

This command used to work (around May 2016) but for some reason it does not anymore:
gcloud compute --verbosity error --project ""phantomjscloud-20160125"" instance-groups managed list
I now get the following error:
ERROR: (gcloud.compute.instance-groups.managed.list) More than one
Autoscaler with given targe.
I can't find any details regarding this error. What changed, and how do I again properly enumerate my instance groups?
Given that all my instance groups use (and have always used) autoscaling I'm not sure why I am now getting this error.

I don't know what the root cause was, but I deleted an instance group with a very similar name to another one ez-deploy-pjsc-api-preempt-large-usa-central1-a-1 vs ez-deploy-pjsc-api-preempt-large-usa-central1-a and now it works.
Seems like a bug in the gcloud system.

Related

AWSCLI: Can't specify db parameter group when creating mysql read replica

Using awscli, I'm trying to create a cross-region read replica, in us-west-1, of a mysql RDS in us-east-1. The db must have the lower_case_table_names parameter set to 1(default is 0). I have created a custom db parameter group with this setting. When I call "aws rds create-db-instance-read-replica" and specify my custom parameter group with "--db-parameter-group-name", the command fails with the following error:
An error occurred (InvalidParameterCombination) when calling the CreateDBInstanceReadReplica operation: A parameter group can't be specified during Read Replica creation for the following DB engine: mysql
AWS documentation makes no mention of this limitation(that I can find). Obviously, in this case, changing the parameter group after the replicant is created is not an option. Has anyone else encountered this, and is there a work-around?
Edit: Wound up just letting the replica come up with default parameters. Even though that caused the replication to fail and left status at "error", once the replica was available I switched it to my custom parameter group. Then I rebooted it, and it came right up and replicated without issue. May not work in every case, but seems to have worked in mine.

Not Able to set resource type in logs using command 'gcloud logging logs write' . Entries getting created under global resource type

I am using Ubuntu 18.04 on Google compute engine.
I am using the steps as shown in Google cloud documentation. My command is
sudo gcloud logging write "logname" "A simple entry"
The entry gets created but under the resource type as 'global'. However i want it to be created under resource name as compute engine.
I have tried setting logname as "projects/campuskudos-980/logs/appengine.googleapis.com%2Fvm.syslog" but that didn't work out
sudo gcloud logging write "logname" "A simple entry"
I want the logs to be created under GCE VM Instance resource type. So I can filter it out on stackdriver
Currently there’s no way to specify the resource type when using gcloud logging write command. As explained in the documentation for simplicity, this command makes several assumptions about the log entry. For instance, it always sets the resource type to global.
Right now, there are two ways to do that:
1- With the gcloud logging write command, use logname and specify something like projects/[PROJECT_ID]/logs/compute.googleapis.com. After that, using advanced filters on Stackdriver Logging as explained in the documentation, you can filter logs using an advanced filter to query all entries inside ‘compute.googleapis.com’.
For e.g.:
logName: (“projects/[PROJECT_ID]/logs/compute.googleapis.com”)
2- Call directly to API as explained in documentation specifying resource type as gce_instance.
Then that entry will appear under GCE VM Instance resource type on Stackdriver Logging.

ERROR: (gcloud.sql.instances.describe) HTTPError 404: The Cloud SQL instance does not exist, but it does exist?

I'm getting this error:
ERROR: (gcloud.sql.instances.describe) HTTPError 404: The Cloud SQL instance does not exist.
When calling:
gcloud sql instances describe my-project
from my windows cmd within the Google Cloud SDK Shell. However, when I look at my instances on my Google Cloud Platform interface I can see that the corresponding instance. All indicates that it DOES exist. Anyone have a solution?
LundinCast had the right answer in comments. Your problem can be resolved by following the instance name with --project="[projectname]".
Try to run following to list your instances:
gcloud sql instances list

Tcl/Tk Shell error running Spawn/bin/bash

I have written several shell scripts with tcl/tk and I run it on the machine with the user group, when I give it to another user with different machine or from another IP it gives error.
Spawn/bin/bash
But if I run it from my machine where I wrote it, it runs correctly.
The header is so defined.
#! / Usr/bin/expect -f
#
Can you tell me that I have not added or am missing so that it can run from any pc and any user?
From the question you have posted, it looks like to me one or more of following issues. Apart from that the real problem looks to me is in /bin/bash. Check manually once in the machine where the problem lies.
First check manually from other machine where the issue is present. Checking is easy.
which expect
expect
spawn /bin/bash
Have you got the error? Also check if there is -
Difference in expect version
Permission issue
Have you considered the scenario where you are prompted for storing RSA key? Relevant in case you are connecting to other machines from the host you are running the program.
Thank,
Mr. Bordoloi

How to add managed instance group to target pool?

How can an autoscaling managed instance group be added to a target pool?
It's easy enough to add existing instances to a target pool via
$ gcloud compute target-pools create mypool --region us-central1
$ gcloud compute target-pools add-instances mypool \
--instances existing-instance1 existing-instance2 --zone us-central1-b
However, I want all the instances that appear in my autoscaling group to automatically be added to my target pool.
You can use gcloud compute instance-groups managed set-target-pools command to set the target pool for an existing manged instance group. You can refer to this link for more information.
There are four different types of resources in your setup:
instance is a virtual machine
a target pool is a pool of instances used only for the purpose of L3 (e.g. IP) level network load balancing
managed instance group is a group of instances, used among others as a target for your autoscaler
autoscaler looks at a managed instance group and adds/deletes instances in this group as appropriate according to load (and your policy)
To make sure that all the instances in your managed instance group (that is all the instances in your autoscaling group) are automatically in your target pool, you need to tell the managed instance group about the target pool.
As #Faizan correctly mentioned, the command to do it is:
gcloud compute instance-groups managed set-target-pools instance-group-name --target-pools your-target-pool
The help page for this command seems more useful than the online documentation:
gcloud compute instance-groups managed set-target-pools --help
Please note that this help page seems to be out of date though. Setting a new target pool now DOES apply to existing instances in the group (when using the API version v1 or later). It was not the case in the beta versions (v1beta2).