使用自定义映像创建 Dataproc 集群:无法解析映像版本

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

在尝试使用自定义映像创建 Dataproc 集群时,我得到了这个...

│ 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

自定义图像列表显示自定义图像,但是...

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

如果使用 gcloud 创建 Dataproc 集群,则必须使用 --image 而不是 --image-version 标志,并且必须指定完整的图像 URI 而不仅仅是短名称.

您可以find the full URI在获取图像的完整细节时查找“selfLink”:

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