我有一个使用 Google Compute 设置的 Ubunutu VM,因为它非常好,我正在尝试创建此映像的副本并将其存档,以便将来可以使用它创建 VM 实例。但是,我遇到了随机的命令行错误,所以我将列出我所做的所有步骤,看看是否有明显错误。
首先,VM,我用它创建的镜像image-1
,以及尝试存储它的谷歌存储桶都可以在这里看到。
我按照第 1 步创建映像,第 2 步创建 Google 可以为我存储大型对象(如 VM 映像)的存储区域,第 3 步在我的本地计算机上安装 Google Cloud SDK 以运行必要的命令,并按照第4 步要运行哪些命令。
运行后
gcloud compute images export --destination-uri gs://bucket_address --image image-1
我收到一个很长的日志,告诉我发生了错误。
日志:
Created [https://cloudbuild.googleapis.com/v1/projects/bayes-230019/builds/015e4129-5407-48cd-8fb5-0b0803406a0f].
Logs are available at [https://console.cloud.google.com/gcr/builds/015e4129-5407-48cd-8fb5-0b0803406a0f?project=297462970761].
[Daisy] Running workflow "image-export" (id=2d3br)
[image-export]: 2019-03-21T18:05:51Z Validating workflow
[image-export]: 2019-03-21T18:05:51Z Validating step "setup-disks"
[image-export]: 2019-03-21T18:05:51Z Validating step "image-export-export-disk"
[image-export.image-export-export-disk]: 2019-03-21T18:05:51Z Validating step "setup-disks"
[image-export.image-export-export-disk]: 2019-03-21T18:05:51Z Validating step "run-image-export-export-disk"
[image-export.image-export-export-disk]: 2019-03-21T18:05:52Z Validating step "wait-for-inst-image-export-export-disk"
[image-export.image-export-export-disk]: 2019-03-21T18:05:52Z Validating step "copy-image-object"
[image-export.image-export-export-disk]: 2019-03-21T18:05:52Z Validating step "delete-inst"
[image-export]: 2019-03-21T18:05:52Z Validation Complete
[image-export]: 2019-03-21T18:05:52Z Workflow Project: bayes-230019
[image-export]: 2019-03-21T18:05:52Z Workflow Zone: us-east4-c
[image-export]: 2019-03-21T18:05:52Z Workflow GCSPath: gs://bayes-230019-daisy-bkt/
[image-export]: 2019-03-21T18:05:52Z Daisy scratch path: https://console.cloud.google.com/storage/browser/bayes-230019-daisy-bkt/daisy-image-export-20190321-18:05:50-2d3br
[image-export]: 2019-03-21T18:05:52Z Uploading sources
[image-export]: 2019-03-21T18:05:52Z Running workflow
[image-export]: 2019-03-21T18:05:52Z Running step "setup-disks" (CreateDisks)
[image-export.setup-disks]: 2019-03-21T18:05:52Z CreateDisks: Creating disk "disk-image-export-image-export-2d3br".
[image-export]: 2019-03-21T18:06:37Z Step "setup-disks" (CreateDisks) successfully finished.
[image-export]: 2019-03-21T18:06:37Z Running step "image-export-export-disk" (IncludeWorkflow)
[image-export.image-export-export-disk]: 2019-03-21T18:06:37Z Running step "setup-disks" (CreateDisks)
[image-export.image-export-export-disk.setup-disks]: 2019-03-21T18:06:37Z CreateDisks: Creating disk "disk-image-export-export-disk-image-export-image-export--2d3br".
[image-export]: 2019-03-21T18:06:37Z Error running workflow: step "image-export-export-disk" run error: step "setup-disks" run error: googleapi: Error 403: Quota 'SSD_TOTAL_GB' exceeded. Limit: 100.0 in region us-east4., quotaExceeded
[image-export]: 2019-03-21T18:06:37Z Workflow "image-export" cleaning up (this may take up to 2 minutes).
[Daisy] Errors in one or more workflows:
image-export: step "image-export-export-disk" run error: step "setup-disks" run error: googleapi: Error 403: Quota 'SSD_TOTAL_GB' exceeded. Limit: 100.0 in region us-east4., quotaExceeded
ERROR
ERROR: build step 0 "gcr.io/compute-image-tools/daisy:release" failed: exit status 1
ERROR: (gcloud.compute.images.export) build 015e4129-5407-48cd-8fb5-0b0803406a0f completed with status "FAILURE"
它提到了磁盘大小错误,但我的图像大小只有 31 Gb,并且它说我在位于 us-east4 区域的存储桶上超过了 100 Gb 配额?我究竟做错了什么?
编辑
按照建议升级我的帐户,我这样做了,现在代码继续进行,但最后我得到了另一个奇怪的错误。
image-export: step "image-export-export-disk" run error: step "copy-image-object" run error: error copying from gs://bayes-230019-daisy-bkt/daisy-image-export-20190321-20:14:58-mdxb2/outs/image-export-export-disk.tar.gz to gs://ml_vm_bucket: storage: object name is empty
新日志:
Created [https://cloudbuild.googleapis.com/v1/projects/bayes-230019/builds/02d7af72-12a4-4950-9bc6-153aabeef788].
Logs are available at [https://console.cloud.google.com/gcr/builds/02d7af72-12a4-4950-9bc6-153aabeef788?project=297462970761].
[Daisy] Running workflow "image-export" (id=mdxb2)
[image-export]: 2019-03-21T20:14:58Z Validating workflow
[image-export]: 2019-03-21T20:14:58Z Validating step "setup-disks"
[image-export]: 2019-03-21T20:14:58Z Validating step "image-export-export-disk"
[image-export.image-export-export-disk]: 2019-03-21T20:14:58Z Validating step "setup-disks"
[image-export.image-export-export-disk]: 2019-03-21T20:14:58Z Validating step "run-image-export-export-disk"
[image-export.image-export-export-disk]: 2019-03-21T20:14:59Z Validating step "wait-for-inst-image-export-export-disk"
[image-export.image-export-export-disk]: 2019-03-21T20:14:59Z Validating step "delete-inst"
[image-export.image-export-export-disk]: 2019-03-21T20:14:59Z Validating step "copy-image-object"
[image-export]: 2019-03-21T20:14:59Z Validation Complete
[image-export]: 2019-03-21T20:14:59Z Workflow Project: bayes-230019
[image-export]: 2019-03-21T20:14:59Z Workflow Zone: us-east4-c
[image-export]: 2019-03-21T20:14:59Z Workflow GCSPath: gs://bayes-230019-daisy-bkt/
[image-export]: 2019-03-21T20:14:59Z Daisy scratch path: https://console.cloud.google.com/storage/browser/bayes-230019-daisy-bkt/daisy-image-export-20190321-20:14:58-mdxb2
[image-export]: 2019-03-21T20:14:59Z Uploading sources
[image-export]: 2019-03-21T20:15:00Z Running workflow
[image-export]: 2019-03-21T20:15:00Z Running step "setup-disks" (CreateDisks)
[image-export.setup-disks]: 2019-03-21T20:15:00Z CreateDisks: Creating disk "disk-image-export-image-export-mdxb2".
[image-export]: 2019-03-21T20:15:43Z Step "setup-disks" (CreateDisks) successfully finished.
[image-export]: 2019-03-21T20:15:43Z Running step "image-export-export-disk" (IncludeWorkflow)
[image-export.image-export-export-disk]: 2019-03-21T20:15:43Z Running step "setup-disks" (CreateDisks)
[image-export.image-export-export-disk.setup-disks]: 2019-03-21T20:15:43Z CreateDisks: Creating disk "disk-image-export-export-disk-image-export-image-export--mdxb2".
[image-export.image-export-export-disk]: 2019-03-21T20:16:02Z Step "setup-disks" (CreateDisks) successfully finished.
[image-export.image-export-export-disk]: 2019-03-21T20:16:02Z Running step "run-image-export-export-disk" (CreateInstances)
[image-export.image-export-export-disk.run-image-export-export-disk]: 2019-03-21T20:16:02Z CreateInstances: Creating instance "inst-image-export-export-disk-image-export-image-export--mdxb2".
[image-export.image-export-export-disk]: 2019-03-21T20:16:11Z Step "run-image-export-export-disk" (CreateInstances) successfully finished.
[image-export.image-export-export-disk]: 2019-03-21T20:16:11Z Running step "wait-for-inst-image-export-export-disk" (WaitForInstancesSignal)
[image-export.image-export-export-disk.run-image-export-export-disk]: 2019-03-21T20:16:11Z CreateInstances: Streaming instance "inst-image-export-export-disk-image-export-image-export--mdxb2" serial port 1 output to https://storage.cloud.google.com/bayes-230019-daisy-bkt/daisy-image-export-20190321-20:14:58-mdxb2/logs/inst-image-export-export-disk-image-export-image-export--mdxb2-serial-port1.log
[image-export.image-export-export-disk.wait-for-inst-image-export-export-disk]: 2019-03-21T20:16:11Z WaitForInstancesSignal: Instance "inst-image-export-export-disk-image-export-image-export--mdxb2": watching serial port 1, SuccessMatch: "ExportSuccess", FailureMatch: "ExportFailed:", StatusMatch: "GCEExport:".
[image-export.image-export-export-disk.wait-for-inst-image-export-export-disk]: 2019-03-21T20:16:22Z WaitForInstancesSignal: Instance "inst-image-export-export-disk-image-export-image-export--mdxb2": StatusMatch found: "GCEExport: Running export tool."
[image-export.image-export-export-disk.wait-for-inst-image-export-export-disk]: 2019-03-21T20:16:22Z WaitForInstancesSignal: Instance "inst-image-export-export-disk-image-export-image-export--mdxb2": StatusMatch found: "GCEExport: Disk /dev/sdb is 31 GiB, compressed size will most likely be much smaller."
[image-export.image-export-export-disk.wait-for-inst-image-export-export-disk]: 2019-03-21T20:16:22Z WaitForInstancesSignal: Instance "inst-image-export-export-disk-image-export-image-export--mdxb2": StatusMatch found: "GCEExport: Exporting disk to gs://bayes-230019-daisy-bkt/daisy-image-export-20190321-20:14:58-mdxb2/outs/image-export-export-disk.tar.gz."
[image-export.image-export-export-disk.wait-for-inst-image-export-export-disk]: 2019-03-21T20:16:22Z WaitForInstancesSignal: Instance "inst-image-export-export-disk-image-export-image-export--mdxb2": StatusMatch found: "GCEExport: Beginning copy..."
[image-export.image-export-export-disk.wait-for-inst-image-export-export-disk]: 2019-03-21T20:16:22Z WaitForInstancesSignal: Instance "inst-image-export-export-disk-image-export-image-export--mdxb2": StatusMatch found: "GCEExport: Read 504 MiB of 31 GiB (101 MiB/sec), total uploaded size: 76 MiB (15 MiB/sec)"
[image-export.image-export-export-disk.wait-for-inst-image-export-export-disk]: 2019-03-21T20:17:12Z WaitForInstancesSignal: Instance "inst-image-export-export-disk-image-export-image-export--mdxb2": StatusMatch found: "GCEExport: Read 3.5 GiB of 31 GiB (68 MiB/sec), total uploaded size: 1.5 GiB (32 MiB/sec)"
[image-export.image-export-export-disk.wait-for-inst-image-export-export-disk]: 2019-03-21T20:17:52Z WaitForInstancesSignal: Instance "inst-image-export-export-disk-image-export-image-export--mdxb2": StatusMatch found: "GCEExport: Read 6.5 GiB of 31 GiB (69 MiB/sec), total uploaded size: 2.9 GiB (32 MiB/sec)"
[image-export.image-export-export-disk.wait-for-inst-image-export-export-disk]: 2019-03-21T20:18:42Z WaitForInstancesSignal: Instance "inst-image-export-export-disk-image-export-image-export--mdxb2": StatusMatch found: "GCEExport: Read 9.5 GiB of 31 GiB (68 MiB/sec), total uploaded size: 4.2 GiB (31 MiB/sec)"
[image-export.image-export-export-disk.wait-for-inst-image-export-export-disk]: 2019-03-21T20:19:22Z WaitForInstancesSignal: Instance "inst-image-export-export-disk-image-export-image-export--mdxb2": StatusMatch found: "GCEExport: Read 12 GiB of 31 GiB (54 MiB/sec), total uploaded size: 5.8 GiB (37 MiB/sec)"
[image-export.image-export-export-disk.wait-for-inst-image-export-export-disk]: 2019-03-21T20:20:12Z WaitForInstancesSignal: Instance "inst-image-export-export-disk-image-export-image-export--mdxb2": StatusMatch found: "GCEExport: Read 15 GiB of 31 GiB (65 MiB/sec), total uploaded size: 7.4 GiB (35 MiB/sec)"
[image-export.image-export-export-disk.wait-for-inst-image-export-export-disk]: 2019-03-21T20:20:52Z WaitForInstancesSignal: Instance "inst-image-export-export-disk-image-export-image-export--mdxb2": StatusMatch found: "GCEExport: Read 19 GiB of 31 GiB (102 MiB/sec), total uploaded size: 8.5 GiB (25 MiB/sec)"
[image-export.image-export-export-disk.wait-for-inst-image-export-export-disk]: 2019-03-21T20:21:42Z WaitForInstancesSignal: Instance "inst-image-export-export-disk-image-export-image-export--mdxb2": StatusMatch found: "GCEExport: Read 23 GiB of 31 GiB (93 MiB/sec), total uploaded size: 9.6 GiB (26 MiB/sec)"
[image-export.image-export-export-disk.wait-for-inst-image-export-export-disk]: 2019-03-21T20:22:22Z WaitForInstancesSignal: Instance "inst-image-export-export-disk-image-export-image-export--mdxb2": StatusMatch found: "GCEExport: Read 28 GiB of 31 GiB (95 MiB/sec), total uploaded size: 11 GiB (25 MiB/sec)"
[image-export.image-export-export-disk.wait-for-inst-image-export-export-disk]: 2019-03-21T20:23:02Z WaitForInstancesSignal: Instance "inst-image-export-export-disk-image-export-image-export--mdxb2": StatusMatch found: "GCEExport: Finished export in 6m43.907834062s"
[image-export.image-export-export-disk.wait-for-inst-image-export-export-disk]: 2019-03-21T20:23:02Z WaitForInstancesSignal: Instance "inst-image-export-export-disk-image-export-image-export--mdxb2": SuccessMatch found "ExportSuccess"
[image-export.image-export-export-disk]: 2019-03-21T20:23:02Z Step "wait-for-inst-image-export-export-disk" (WaitForInstancesSignal) successfully finished.
[image-export.image-export-export-disk]: 2019-03-21T20:23:02Z Running step "copy-image-object" (CopyGCSObjects)
[image-export.image-export-export-disk]: 2019-03-21T20:23:02Z Running step "delete-inst" (DeleteResources)
[image-export.image-export-export-disk.delete-inst]: 2019-03-21T20:23:02Z DeleteResources: Deleting instance "inst-image-export-export-disk".
[image-export]: 2019-03-21T20:23:02Z Error running workflow: step "image-export-export-disk" run error: step "copy-image-object" run error: error copying from gs://bayes-230019-daisy-bkt/daisy-image-export-20190321-20:14:58-mdxb2/outs/image-export-export-disk.tar.gz to gs://ml_vm_bucket: storage: object name is empty
[image-export]: 2019-03-21T20:23:02Z Workflow "image-export" cleaning up (this may take up to 2 minutes).
[Daisy] Errors in one or more workflows:
image-export: step "image-export-export-disk" run error: step "copy-image-object" run error: error copying from gs://bayes-230019-daisy-bkt/daisy-image-export-20190321-20:14:58-mdxb2/outs/image-export-export-disk.tar.gz to gs://ml_vm_bucket: storage: object name is empty
ERROR
ERROR: build step 0 "gcr.io/compute-image-tools/daisy:release" failed: exit status 1
ERROR: (gcloud.compute.images.export) build 02d7af72-12a4-4950-9bc6-153aabeef788 completed with status "FAILURE"