由于大小或权限,GCloud自定义图像上传失败 [英] GCloud custom image upload failure due to size or permissions
问题描述
一段时间以来,我一直在尝试上传两个自定义图片,但我屡次失败.在导入过程中,Google应用程序始终以以下消息响应:Compute Engine默认服务帐户不具有角色"roles/compute.storageAdmin".但是,我都使用CLI作为Web界面分配了它.
I've been trying to upload two custom images for some time now and I have failed repeatedly. During the import process the Google application always responds with the message that the Compute Engine Default Service Account does not have the role 'roles/compute.storageAdmin'. However, I have both assigned it using the CLI as the webinterface.
值得注意的是,应用程序在调整磁盘大小期间会引发此错误.磁盘的原始大小约为10GB,但是会尝试将其转换为1024GB(!)磁盘.这让我开始思考,可能对应用程序来说太大了,因此引发了缺少权限的错误?
Notable is that the application throws this error during resizing of the disk. The original size of the disk is about 10GB, however, it tries to convert it to a 1024GB (!) disk. This got me thinking, could it be that this is too big for the application, hence it throwing the error it lacks permissions?
作为后续问题,我没有找到任何设置磁盘大小的选项(不在CLI或在webapp中).有人知道这样的选择吗?
As a follow up questions, I have not found any options to set the size of the disk (not in the CLI nor in the webapp). Does anybody know of such options?
这是我收到的错误消息:
Here is the error message I have recieved:
ate-import-3ly9z": StatusMatch found: "Import: Resizing temp-translation-disk-3ly9z to 1024GB in projects/0000000000000/zones/europe-west4-a."
[import-and-translate]: 2020-05-01T07:46:30Z Error running workflow: step "import" run error: step "wait-for-signal" run error: WaitForInstancesSignal FailureMatch found for "inst-importer-import-and-translate-import-3ly9z": "ImportFailed: Failed to resize disk. The Compute Engine default service account needs the role: roles/compute.storageAdmin'"
[import-and-translate]: 2020-05-01T07:46:30Z Serial-output value -> target-size-gb:1024
[import-and-translate]: 2020-05-01T07:46:30Z Serial-output value -> source-size-gb:7
[import-and-translate]: 2020-05-01T07:46:30Z Serial-output value -> import-file-format:vmdk
[import-and-translate]: 2020-05-01T07:46:30Z Workflow "import-and-translate" cleaning up (this may take up to 2 minutes).
[import-and-translate]: 2020-05-01T07:47:34Z Workflow "import-and-translate" finished cleanup.
[import-image] 2020/05/01 07:47:34 step "import" run error: step "wait-for-signal" run error: WaitForInstancesSignal FailureMatch found for "inst-importer-import-and-translate-import-3ly9z": "ImportFailed: Failed to resize disk. The Compute Engine default service account needs the role: roles/compute.storageAdmin'"
ERROR
ERROR: build step 0 "gcr.io/compute-image-tools/gce_vm_image_import:release" failed: step exited with non-zero status: 1
ERROR: (gcloud.compute.images.import) build a9ccbeac-92c5-4457-a784-69d486e85c3b completed with status "FAILURE"
感谢您的时间!
不确定,但我可以肯定地说这是由于1024GB太大.我使用相同的方法上传了64GB,没有任何问题.对于那些关注我的人来说,这很可能是问题所在(:
Not sure but I'm farily certain this is due to the 1024GB being too big. I've uploaded a 64GB without any issues using the same methods. For those who read after me, that's most likely the issue (:
推荐答案
此错误消息,带有导入虚拟磁盘有两个根本原因:
This error message with the import of virtual disks have 2 root causes:
1.-云构建和/或计算引擎和/或您的用户帐户没有正确的IAM角色来执行这些任务.您可以在此处进行验证.
1.- Cloud Build and/or Compute engine and/or your User account did not have the correct IAM roles to perform these tasks. You can verify them here.
-
需要具备Cloud Build SA角色:
Cloud Build SA roles needed:
- roles/iam.serviceAccountTokenCreator
- roles/compute.admin
- roles/iam.serviceAccountUser
需要Compute Engine SA角色:
Compute Engine SA roles needed:
- roles/compute.storageAdmin
- roles/storage.objectViewer
所需的用户帐户角色:
- roles/storage.admin
- 角色/查看器
- roles/resourcemanager.projectIamAdmin
2.-不确定,但是我很确定这是由于1024GB太大."您拥有的磁盘配额小于1T.正常的磁盘配额为250-500 GB,因此这就是为什么导入64 GB磁盘不会遇到问题的原因.
2.- " Not sure but I'm fairly certain this is due to the 1024GB being too big" The disk quota you have is less than 1T. The normal disk quota is 250-500 GB so that could be why by importing a 64 GB disk you encounter no problem.
您可以在此文档的步骤1中检查配额.如果您需要更多请求,可以按照步骤2到7进行操作.
You can check your quota in step 1 of this document; If you need to request more, you can follow steps 2 to 7.
这篇关于由于大小或权限,GCloud自定义图像上传失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!