Welcome to the Linux Foundation Forum!

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

  • akapadia
    akapadia Posts: 24

    Hi,

    I've double checked, you do have access to the GCP image. What project are you using?

    Thanks,

    Amar

     

  • 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: 40

    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$ # 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: 40

    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'

    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: 40

    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'

    the policy has the ability to 'create' instances. what am I doing wrong?

  • 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'
  • jnavali
    jnavali Posts: 12

    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=scsi

  • 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-184320

    reinitialized

    Commands that require authentication will use copacetic@tradelabs.co 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 default

    attempt-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 viewer

    any and all help or feedback welcome. thank you

  • akapadia
    akapadia Posts: 24

    What login email address are you using on gcloud? Looks like you are not able to access the image.

  • short answer: 'copacetic@tradelabs.co'

    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.

  • akapadia
    akapadia Posts: 24

    I've just enabled access for copacetic@tradelabs.co. 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.

  • 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:

    1. 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-1529728710719

    2. Run 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.

  • 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.

  • 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 --help

    You are now logged in as [copacetic@tradelabs.co].
    Your current project is [my-project1-1529728710719]. You can change this setting by running:
    $ gcloud config set project PROJECT_ID

    gcloud 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 Administrator

    Logged out and back-in again and can now see permissions for my-project1-1529728710719

    Quotas

    Confirmed quotas for us-central1

    Enabling Cloud Shell - Alpha
    trying to get real time feedback on cli syntax

    gcloud 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. :)

Categories

Upcoming Training