1024programmer Java Google cloud’s glcoud computing instance creation error “resource project/{ourID}/global/images/family/debian-8 not found”

Google cloud’s glcoud computing instance creation error “resource project/{ourID}/global/images/family/debian-8 not found”

We are using the server I created on Google Cloud Platform to create and manage other servers. But when trying to create a new server from the Linux command line using the GCloud compute instance creation function, we receive The following error:

marco@ans-mgmt-01:~/gcloud$ ./create_gcloud_instance.sh app-tst-04 tst,backend-server,bootstrap home-tst 10.20.22.104
 ERROR: (gcloud.compute.instances.create) Could not fetch resource:
 - The resource 'projects/REMOVED_OUR_PROJECTID/global/images/family/debian-8' was not found
 

Our script looks like this:

#!/bin/bash
 if [ "$#" -ne 4 ]; then
     echo "Usage: create_gcloud_instance    "
     exit 1
 fi

 set -e

 INSTANCE_NAME=$1
 TAGS=$2
 SERVER_SUBNET=$3
 SERVER_IP=$4

 gcloud compute --project "REMOVED OUR PROJECT ID" instances create "$INSTANCE_NAME" \
     --zone "europe-west1-c" \
     --machine-type "f1-micro" \
     --network "cloudnet" \
     --subnet "$SERVER_SUBNET" \
     --no-address \
     --private-network-ip="$SERVER_IP" \
     --maintenance-policy "MIGRATE" \
     --scopes "https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/  auth/monitoring.write","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.  googleapis.com/auth/trace.append" \
     --service-account "default" \
     --tags "$TAGS" \
     --image-family "debian-8" \
     --boot-disk-size "10" \
     --boot-disk-type "pd-ssd" \
     --boot-disk-device-name "bootdisk-$INSTANCE_NAME" \


 ./clean_known_hosts.sh $INSTANCE_NAME
 

On the Google Cloud Console (console.cloud.google.com), I enabled the cloud api access scope for the ans-mgmt-01 server and tried to create the server from there. There was no problem.

1> Stephen Wein..:


The problem is that gcloud is looking for the image series in the project, not the debian-cloud project where it actually exists.

This can be solved by simply using --image-project debian-cloud.

Instead of looking for projects/{yourID}/global/images/family/debian-8, this method looks for projects/debian-cloud/global/images/family/debian -8.

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/google-clouds-glcoud-computing-instance-creation-error-resource-project-ourid-global-images-family-debian-8-not-found/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索