나는 사용해 보았다.https://github.com/googlecloudplatform/gce-rescueVM을 구출하려고 했으나 아래 오류로 인해 실패했습니다.
test@cloudshell:~ $ gce-rescue --zone us-west2-b --name test-vm
Traceback (most recent call last):
File "gce-rescue", line 8, in <module>
sys.exit(main())
File "/lib/python3.9/site-packages/gce_rescue/bin/rescue.py", line 44, in main
vm = Instance(test_mode=False, **parse_kwargs)
File "<string>", line 12, in __init__
File "/lib/python3.9/site-packages/gce_rescue/gce.py", line 111, in __post_init__
check = Validations(
File "<string>", line 7, in __init__
File "/lib/python3.9/site-packages/gce_rescue/tasks/pre_validations.py", line 48, in __post_init__
authorize_check(project = self.project)
File "/lib/python3.9/site-packages/gce_rescue/tasks/validations/authorization.py", line 43, in authorize_check
result = service.projects().testIamPermissions(
File "/usr/local/lib/python3.9/dist-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
return wrapped(*args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/googleapiclient/http.py", line 938, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 403 when requesting
https://cloudresourcemanager.googleapis.com/v1/projects/XXXXX:testIamPermissions?alt=json returned "Cloud Resource Manager API has not been
used in project XXXXX before or it is disabled.
Enable it by visiting https://console.developers.google.com/apis/api/cloudresourcemanager.googleapis.com/overview?project=XXXXX then retry.
If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.".
Details: "[{'@type': 'type.googleapis.com/google.rpc.Help', 'links': [{'description': 'Google developers console API activation',
'url': 'https://console.developers.google.com/apis/api/cloudresourcemanager.googleapis.com/overview?project=XXXXX'}]},
{'@type': 'type.googleapis.com/google.rpc.ErrorInfo', 'reason': 'SERVICE_DISABLED',
'domain': 'googleapis.com',
'metadata': {'service': 'cloudresourcemanager.googleapis.com', 'consumer': 'projects/XXXXX'}}]">
이 문제를 어떻게 해결합니까?
답변1
gce-rescue
cloudresourcemanager.googleapis.com
프로젝트에서 API가 활성화되지 않아 도구가 실패했습니다 .
다음을 통해 이 API를 활성화하세요.https://console.developers.google.com/apis/api/cloudresourcemanager.googleapis.com/overview?project=XXXXX, XXXXXX를 GCP 프로젝트 ID로 바꾼 다음 gce-rescue
.
이렇게 하면 문제가 해결됩니다.
답변2
오류 예외에서 다음을 읽을 수 있습니다.'reason': 'SERVICE_DISABLED',
GCE Rescue를 사용하기 전에 다음 사항이 있는지 확인하세요.리소스 관리자 API활성화됨:
$ gcloud services enable cloudresourcemanager.googleapis.com