ERROR: (gcloud.compute.instances.create) Could not fetch resource

Could someone help me understand why I'm receiving the 'ERROR' shown below? Should I change some of the parameters in 'instance create' or is something else wrong ?
Thanks for the help in advance.
$ gcloud compute instances create onap-test-01 --zone us-central1-f --custom-cpu 40 --custom-memory 180GB --min-cpu-platform "Intel Haswell" --image "https://www.googleapis.com/compute/v1/projects/onap-177920/global/
images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00" --boot-disk-type "pd-standard" --boot-disk-size 600GB --local-ssd interface=scsi --local-ssd interface=scsi
ERROR: (gcloud.compute.instances.create) Could not fetch resource:
- Required 'compute.images.useReadOnly' permission for 'projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00'
Comments
-
Hi,
I've double checked, you do have access to the GCP image. What project are you using?
Thanks,
Amar
0 -
Note: I ealize that I need to reset the default region / zone
I'm currently attempting to use 'my-project1-1529728710719 '
after executing the command below I receive a read only error.
gcloud compute instances create my-project1-1529728710719--zone us-central1-f --custom-cpu 40 --custom-memory 180 --min-cpu-platform "Intel Haswell" --image "https://www.googleapis.com/compute/v1/projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00" --boot-disk-type "pd-standard" --boot-disk-size 600GB --local-ssd interface=scsi --local-ssd interface=scsi
For the following instances:
- [my-project1-1529728710719--zone]
- [us-central1-f]
choose a zone:
[1] asia-east1-a
[2] asia-east1-b
[3] asia-east1-c
[4] asia-northeast1-a
[5] asia-northeast1-b
[6] asia-northeast1-c
[7] asia-south1-a
[8] asia-south1-b
[9] asia-south1-c
[10] asia-southeast1-a
[11] asia-southeast1-b
[12] asia-southeast1-c
[13] australia-southeast1-a
[14] australia-southeast1-b
[15] australia-southeast1-c
[16] europe-north1-a
[17] europe-north1-b
[18] europe-north1-c
[19] europe-west1-b
[20] europe-west1-c
[21] europe-west1-d
[22] europe-west2-a
[23] europe-west2-b
[24] europe-west2-c
[25] europe-west3-a
[26] europe-west3-b
[27] europe-west3-c
[28] europe-west4-a
[29] europe-west4-b
[30] europe-west4-c
[31] northamerica-northeast1-a
[32] northamerica-northeast1-b
[33] northamerica-northeast1-c
[34] southamerica-east1-a
[35] southamerica-east1-b
[36] southamerica-east1-c
[37] us-central1-a
[38] us-central1-b
[39] us-central1-c
[40] us-central1-f
[41] us-east1-b
[42] us-east1-c
[43] us-east1-d
[44] us-east4-a
[45] us-east4-b
[46] us-east4-c
[47] us-west1-a
[48] us-west1-b
[49] us-west1-c
[50] us-west2-a
Did not print [2] options.
Too many options [52]. Enter "list" at prompt to print choices fully.
Please enter your numeric choice: 40ERROR: (gcloud.compute.instances.create) Could not fetch resource:
- Required 'compute.images.useReadOnly' permission for 'projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00'deeplock:~ copacetic$ # updated policy to 'compute viewer' and rerun the command
deeplock:~ copacetic$ gcloud compute instances create my-project1-1529728710719--zone us-central1-f --custom-cpu 40 --custom-memory 180 --min-cpu-platform "Intel Haswell" --image "https://www.googleapis.com/compute/v1/projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00" --boot-disk-type "pd-standard" --boot-disk-size 600GB --local-ssd interface=scsi --local-ssd interface=scsi
For the following instances:
- [my-project1-1529728710719--zone]
- [us-central1-f]
choose a zone:
[1] asia-east1-a
[2] asia-east1-b
[3] asia-east1-c
[4] asia-northeast1-a
[5] asia-northeast1-b
[6] asia-northeast1-c
[7] asia-south1-a
[8] asia-south1-b
[9] asia-south1-c
[10] asia-southeast1-a
[11] asia-southeast1-b
[12] asia-southeast1-c
[13] australia-southeast1-a
[14] australia-southeast1-b
[15] australia-southeast1-c
[16] europe-north1-a
[17] europe-north1-b
[18] europe-north1-c
[19] europe-west1-b
[20] europe-west1-c
[21] europe-west1-d
[22] europe-west2-a
[23] europe-west2-b
[24] europe-west2-c
[25] europe-west3-a
[26] europe-west3-b
[27] europe-west3-c
[28] europe-west4-a
[29] europe-west4-b
[30] europe-west4-c
[31] northamerica-northeast1-a
[32] northamerica-northeast1-b
[33] northamerica-northeast1-c
[34] southamerica-east1-a
[35] southamerica-east1-b
[36] southamerica-east1-c
[37] us-central1-a
[38] us-central1-b
[39] us-central1-c
[40] us-central1-f
[41] us-east1-b
[42] us-east1-c
[43] us-east1-d
[44] us-east4-a
[45] us-east4-b
[46] us-east4-c
[47] us-west1-a
[48] us-west1-b
[49] us-west1-c
[50] us-west2-a
Did not print [2] options.
Too many options [52]. Enter "list" at prompt to print choices fully.
Please enter your numeric choice: 40ERROR: (gcloud.compute.instances.create) Could not fetch resource:
- Required 'compute.images.useReadOnly' permission for 'projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00'I update the policy and rerun the command
deeplock:~ copacetic$ # updated policy to 'compute network viewer'
deeplock:~ copacetic$
deeplock:~ copacetic$ gcloud compute instances create my-project1-1529728710719--zone us-central1-f --custom-cpu 40 --custom-memory 180 --min-cpu-platform "Intel Haswell" --image "https://www.googleapis.com/compute/v1/projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00" --boot-disk-type "pd-standard" --boot-disk-size 600GB --local-ssd interface=scsi --local-ssd interface=scsi
For the following instances:
- [my-project1-1529728710719--zone]
- [us-central1-f]
choose a zone:
[1] asia-east1-a
[2] asia-east1-b
[3] asia-east1-c
[4] asia-northeast1-a
[5] asia-northeast1-b
[6] asia-northeast1-c
[7] asia-south1-a
[8] asia-south1-b
[9] asia-south1-c
[10] asia-southeast1-a
[11] asia-southeast1-b
[12] asia-southeast1-c
[13] australia-southeast1-a
[14] australia-southeast1-b
[15] australia-southeast1-c
[16] europe-north1-a
[17] europe-north1-b
[18] europe-north1-c
[19] europe-west1-b
[20] europe-west1-c
[21] europe-west1-d
[22] europe-west2-a
[23] europe-west2-b
[24] europe-west2-c
[25] europe-west3-a
[26] europe-west3-b
[27] europe-west3-c
[28] europe-west4-a
[29] europe-west4-b
[30] europe-west4-c
[31] northamerica-northeast1-a
[32] northamerica-northeast1-b
[33] northamerica-northeast1-c
[34] southamerica-east1-a
[35] southamerica-east1-b
[36] southamerica-east1-c
[37] us-central1-a
[38] us-central1-b
[39] us-central1-c
[40] us-central1-f
[41] us-east1-b
[42] us-east1-c
[43] us-east1-d
[44] us-east4-a
[45] us-east4-b
[46] us-east4-c
[47] us-west1-a
[48] us-west1-b
[49] us-west1-c
[50] us-west2-a
Did not print [2] options.
Too many options [52]. Enter "list" at prompt to print choices fully.
Please enter your numeric choice: 40ERROR: (gcloud.compute.instances.create) Could not fetch resource:
- Required 'compute.instances.create' permission for 'projects/my-project1-1529728710719/zones/us-central1-f/instances/my-project1-1529728710719--zone'
- Required 'compute.instances.create' permission for 'projects/my-project1-1529728710719/zones/us-central1-f/instances/us-central1-f'the policy has the ability to 'create' instances. what am I doing wrong?
0 -
Attempting to use 'my-project1-1529728710719
gcloud compute instances create my-project1-1529728710719--zone us-central1-f --custom-cpu 40 --custom-memory 180 --min-cpu-platform "Intel Haswell" --image "https://www.googleapis.com/compute/v1/projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00" --boot-disk-type "pd-standard" --boot-disk-size 600GB --local-ssd interface=scsi --local-ssd interface=scsi
ERROR: (gcloud.compute.instances.create) Could not fetch resource:
- Required 'compute.images.useReadOnly' permission for 'projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00'
........
deeplock:~ copacetic$ # changed policy to 'compute viewer'
deeplock:~ copacetic$ gcloud compute instances create my-project1-1529728710719--zone us-central1-f --custom-cpu 40 --custom-memory 180 --min-cpu-platform "Intel Haswell" --image "https://www.googleapis.com/compute/v1/projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00" --boot-disk-type "pd-standard" --boot-disk-size 600GB --local-ssd interface=scsi --local-ssd interface=scsi`
ERROR: (gcloud.compute.instances.create) Could not fetch resource:
- Required 'compute.images.useReadOnly' permission for 'projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00'
.......
deeplock:~ copacetic$ gcloud compute instances create my-project1-1529728710719--zone us-central1-f --custom-cpu 40 --custom-memory 180 --min-cpu-platform "Intel Haswell" --image "https://www.googleapis.com/compute/v1/projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00" --boot-disk-type "pd-standard" --boot-disk-size 600GB --local-ssd interface=scsi --local-ssd interface=scsi
ERROR: (gcloud.compute.instances.create) Could not fetch resource:
- Required 'compute.instances.create' permission for 'projects/my-project1-1529728710719/zones/us-central1-f/instances/my-project1-1529728710719--zone'
- Required 'compute.instances.create' permission for 'projects/my-project1-1529728710719/zones/us-central1-f/instances/us-central1-f'
0 -
It looks like you are missing a space after the instance name in your commands?
Perhaps try:
gcloud compute instances create my-project1-1529728710719 --zone us-central1-f --custom-cpu 40 --custom-memory 180 --min-cpu-platform "Intel Haswell" --image "https://www.googleapis.com/compute/v1/projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00" --boot-disk-type "pd-standard" --boot-disk-size 600GB --local-ssd interface=scsi --local-ssd interface=scsi0 -
attempt-1
cut and paste the syntax from @jnavali Post but received the same ' Required compute.machine.Type.get' error message.
gcloud compute instances create my-project1-1529728710719 --zone us-central1-f --custom-cpu 40 --custom-memory 180 --min-cpu-platform "Intel Haswell" --image "https://www.googleapis.com/compute/v1/projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00" --boot-disk-type "pd-standard" --boot-disk-size 600GB --local-ssd interface=scsi --local-ssd interface=scsi
ERROR: (gcloud.compute.instances.create) Could not fetch machine type:
- Required 'compute.machineTypes.get' permission for 'projects/my-project1-1529728710719/zones/us-central1-f/machineTypes/custom-40-184320'attempt-2
changed role from 'compute viewer' to 'compute image user' but I'm still receiving a compute.machine.type.get error message.
gcloud compute instances create my-project1-1529728710719 --zone us-central1-f --custom-cpu 40 --custom-memory 180 --min-cpu-platform "Intel Haswell" --image "https://www.googleapis.com/compute/v1/projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00" --boot-disk-type "pd-standard" --boot-disk-size 600GB --local-ssd interface=scsi --local-ssd interface=scsi
ERROR: (gcloud.compute.instances.create) Could not fetch machine type:
- Required 'compute.machineTypes.get' permission for 'projects/my-project1-1529728710719/zones/us-central1-f/machineTypes/custom-40-184320reinitialized
Commands that require authentication will use [email protected] by default
Commands will reference project 'angular-compass-201506' by default
Compute Engine commands will use region 'us-central1' by default
Compute Engine commands will use zone 'us-central1-f' by defaultattempt-3
added 'private log viewer' and 'compute engine adminv1' permissions. now receiving compute.images.use.ReadOnly'rror complained 'readonly' which was expected.. but I've tried just about all of the image policies
gcloud compute instances create my-project1-1529728710719 --zone us-central1-f --custom-cpu 40 --custom-memory 180 --min-cpu-platform "Intel Haswell" --image "https://www.googleapis.com/compute/v1/projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00" --boot-disk-type "pd-standard" --boot-disk-size 600GB --local-ssd interface=scsi --local-ssd interface=scsi
ERROR: (gcloud.compute.instances.create) Could not fetch resource:
- Required 'compute.images.useReadOnly' permission for 'projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00'attempt-4
removed 'compute engine adminv1' and added 'compute network viewer'. Back to square 1.
gcloud compute instances create my-project1-1529728710719 --zone us-central1-f --custom-cpu 40 --custom-memory 180 --min-cpu-platform "Intel Haswell" --image "https://www.googleapis.com/compute/v1/projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00" --boot-disk-type "pd-standard" --boot-disk-size 600GB --local-ssd interface=scsi --local-ssd interface=scsi
ERROR: (gcloud.compute.instances.create) Could not fetch resource:
- Required 'compute.instances.create' permission for 'projects/angular-compass-210506/zones/us-central1-f/instances/my-project1-1529728710719'I think I've tried all of the compute engine polices that can read and or create instances:
1. compute image user
2. compute instance adminv1
3. compute viewer
4. compute network viewerany and all help or feedback welcome. thank you
0 -
What login email address are you using on gcloud? Looks like you are not able to access the image.
0 -
short answer: '[email protected]'
longer answer: I have multiple addresses. This has been an ongoing issue from day-1, so I reached out to FL and Google to setup a access for a second address 'lorem*@gmail.com' to see if the error message was consistent. Since the error message turned out to be the same I've since continued with only copacetic for consistency.
I've also walked through each step in the cloud console with both addresses and turned on alpha - same net result... Is there a way to determine (remotely) what could possibly be wrong? I was really hoping to get beyond this step to start working on DCAE in particular.
Appreciate your help.
0 -
I've just enabled access for [email protected]. Can you please try again? I'm also asking our engineering team to look at this. Please note that this course does not include DCAE.
0 -
Hi,
In the last message you posted you were using your project name as the instance name (though your first message had it correct).
gcloud compute instances create my-project1-1529728710719 --zone us-central1-f ....
I would suggest the following:
Set the project to your current project:
gcloud config set project
should be your project and NOT onap-177920. In your case, this should be my-project1-1529728710719Run the instance create now:
gcloud compute instances create onap-test-00 --zone .....
Also, please make sure you project has the permission to create the required resources.
Please let us know if you are still facing problem.
0 -
okay - I've tried many different combinations up to this point but none of them have worked. I will follow the directions in the most recent post and reply with the output/results.
0 -
Console Output
Last login: Sun Sep 2 11:19:37 on ttys000
gcloud auth login Your browser has been opened to visit: https://accounts.google.com/o/oauth2/auth?redirect_uri=http%3A%2F%2Flocalhost%3A8085%2F&prompt=select_account&response_type=code&client_id=32555940559.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcompute+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Faccounts.reauth&access_type=offline
WARNING:
gcloud auth login
no longer writes application default credentials.
If you need to use ADC, see:
gcloud auth application-default --helpYou are now logged in as [[email protected]].
Your current project is [my-project1-1529728710719]. You can change this setting by running:
$ gcloud config set project PROJECT_IDgcloud config set project my-project1-1529728710719 Updated property [core/project]. gcloud config list --format='text(core.project)' # check that this worked core.project: my-project1-1529728710719
At this point ‘copacetic’ doesn’t have sufficient privileges to view IAM settings. Making the following updates.
remove - Compute Network Viewer
add - Compute Instance Adminv1
add - Editor
add - Organization AdministratorLogged out and back-in again and can now see permissions for my-project1-1529728710719
QuotasConfirmed quotas for us-central1
Enabling Cloud Shell - Alpha
trying to get real time feedback on cli syntaxgcloud alpha interactive Welcome to the gcloud interactive shell environment.
Cloudshell
gcloud compute instances create my-project1-1529728710719 --zone us-central1-f --custom-cpu 40 --custom-memory 180 --min-cpu-platform "Intel Haswell" --image "https://www.googleapis.com/compute/v1/projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00" --boot-disk-type "pd-standard" --boot-disk-size 600GB --local-ssd interface=scsi --local-ssd interface=scsi
Success
gcloud compute instances create my-project1-1529728710719 --zone us-central1-f --custom-cpu 40 --custom-memory 180 --min-cpu-platform "Intel Haswell" --image "https://www.googleapis.com/compute/v1/
projects/onap-177920/global/images/aarna-opnfv-euphrates-51-onap-amsterdam-05012018-00" --boot-disk-type "pd-standard" --boot-disk-size 600GB --local-ssd interface=scsi --local-ssd interface=scsi
Created [https://www.googleapis.com/compute/v1/projects/my-project1-1529728710719/zones/us-central1-f/instances/my-project1-1529728710719].
NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS
my-project1-1529728710719 us-central1-f custom (40 vCPU, 180.00 GiB) 10.128.0.2 35.194.23.43 RUNNING
$Thank you so much for the help! Going to get some rest and start fresh in the morning.
0
Categories
- All Categories
- 49 LFX Mentorship
- 102 LFX Mentorship: Linux Kernel
- 550 Linux Foundation Boot Camps
- 294 Cloud Engineer Boot Camp
- 118 Advanced Cloud Engineer Boot Camp
- 52 DevOps Engineer Boot Camp
- 53 Cloud Native Developer Boot Camp
- 4 Express Training Courses
- 4 Express Courses - Discussion Forum
- 1.9K Training Courses
- 18 LFC110 Class Forum
- 6 LFC131 Class Forum
- 25 LFD102 Class Forum
- 150 LFD103 Class Forum
- 17 LFD121 Class Forum
- 61 LFD201 Class Forum
- LFD210 Class Forum
- LFD210-CN Class Forum
- 1 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum
- LFD237 Class Forum
- 23 LFD254 Class Forum
- 596 LFD259 Class Forum
- 102 LFD272 Class Forum
- 1 LFD272-JP クラス フォーラム
- LFD273 Class Forum
- 2 LFS145 Class Forum
- 24 LFS200 Class Forum
- 739 LFS201 Class Forum
- 1 LFS201-JP クラス フォーラム
- 3 LFS203 Class Forum
- 69 LFS207 Class Forum
- 300 LFS211 Class Forum
- 54 LFS216 Class Forum
- 47 LFS241 Class Forum
- 41 LFS242 Class Forum
- 37 LFS243 Class Forum
- 11 LFS244 Class Forum
- 33 LFS250 Class Forum
- 1 LFS250-JP クラス フォーラム
- LFS251 Class Forum
- 139 LFS253 Class Forum
- 1K LFS258 Class Forum
- 10 LFS258-JP クラス フォーラム
- 92 LFS260 Class Forum
- 129 LFS261 Class Forum
- 32 LFS262 Class Forum
- 79 LFS263 Class Forum
- 15 LFS264 Class Forum
- 11 LFS266 Class Forum
- 17 LFS267 Class Forum
- 17 LFS268 Class Forum
- 23 LFS269 Class Forum
- 203 LFS272 Class Forum
- 1 LFS272-JP クラス フォーラム
- LFS281 Class Forum
- 220 LFW211 Class Forum
- 166 LFW212 Class Forum
- SKF100 Class Forum
- 901 Hardware
- 219 Drivers
- 74 I/O Devices
- 44 Monitors
- 115 Multimedia
- 208 Networking
- 101 Printers & Scanners
- 85 Storage
- 761 Linux Distributions
- 88 Debian
- 66 Fedora
- 15 Linux Mint
- 13 Mageia
- 24 openSUSE
- 141 Red Hat Enterprise
- 33 Slackware
- 13 SUSE Enterprise
- 356 Ubuntu
- 476 Linux System Administration
- 41 Cloud Computing
- 69 Command Line/Scripting
- Github systems admin projects
- 94 Linux Security
- 77 Network Management
- 108 System Management
- 49 Web Management
- 66 Mobile Computing
- 23 Android
- 29 Development
- 1.2K New to Linux
- 1.1K Getting Started with Linux
- 536 Off Topic
- 131 Introductions
- 216 Small Talk
- 21 Study Material
- 816 Programming and Development
- 275 Kernel Development
- 507 Software Development
- 927 Software
- 260 Applications
- 183 Command Line
- 3 Compiling/Installing
- 76 Games
- 316 Installation
- 59 All In Program
- 59 All In Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)