Create Dataproc cluster with custom image: Failed to resolve image version

Viewed 155

When trying to create Dataproc cluster with custom image I am getting this ...

│ Error: Error creating Dataproc cluster: googleapi: Error 400: Failed to resolve image version 'my-ubuntu18-custom'. Accepted image versions: [preview, 2.0-centos, 1.2-deb9, 1.3-debian9, 1.2-debian9, 1.5-debian10, 1.5-centos8, 2.0-ubuntu18, 1.0-debian9, 1.1-debian9, 1.5-ubuntu18, preview-centos8, preview-debian10, preview-ubuntu18, 2.0-debian, 1.4-debian9, preview-debian, 2.0-debian10, 1.1-debian, 1.0-debian, 1.2-debian, preview-ubuntu, 1.5-centos, 1.3-deb9, 1.4-ubuntu18, 1.5-ubuntu, preview-centos, 1.4-debian10, 1.1-deb9, 1.3-ubuntu, 1.4-ubuntu, 1.0, 1.1, 2.0, 1.2, 1.3, 1.3-debian10, 1.4, 2.0-ubuntu, 1.5, 1.4-debian, 1.5-debian, 1.0-deb9, 1.3-debian, 1.3-ubuntu18, 2.0-centos8]. See https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions for additional information on image versioning., badRequest

The custom images list shows the custom image however ...

$ gcloud compute images list --no-standard-images | grep NAME:
NAME: my-ubuntu18-custom
1 Answers

You have to use the --image instead of --image-version flag if creating the Dataproc cluster using gcloud, and you have to specify the full image URI instead of just the short name.

You can find the full URI by looking for the "selfLink" when getting the full details of the image:

gcloud compute images describe my-ubuntu18-custom | grep selfLink
Related