ansible-collections / ansible-collections/google.cloud

'code': 400, 'message': \"Invalid value for field 'resource.sourceImage': 'https://www.googleapis.com/compute/v1/.......'

Open
#378 1 comment 0 reactions 0 assignees View on GitHub
stale
Dominant language
Python
Stars
105
Forks
144
Avg merge
5d 10h
Merged PRs (30d)
4

Description

Hello All,

I'm trying to create image image from an instance. But getting below error:

'code': 400, 'message': \"Invalid resource usage: 'Must specify exactly one source for an image.'

source_image: { 'selfLink': 'zones/' }

source_image: { 'selfLink': 'https://' }

Both the ways, I have tried providing the source_image. Both are not working.
Please suggest me here. Im stuck here. Any quick help is much appreciated.

My playbook looks like this:

---
- hosts: localhost
tasks:
- name: Create snapshot
gcp_compute_image:
name: server-name-snapshot-image
source_image: { 'selfLink': 'https://full url omitted' }
state: present
auth_kind: serviceaccount
project: project-dev
service_account_file: service-account-file-path

Contributor guide

Open the contributing guide

Research direction

The only entry point provided is the gcp_compute_image task in the supplied playbook; start by reproducing the request with each source_image form shown. Check how the task validates source_image against the GCP image API error. Done means identifying one supported source representation and confirming that the playbook creates the image successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
gcp, python
Domain
cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.