gcloud 计算列表网络错误:“某些请求未成功:- 权限不足"; [英] gcloud compute list networks error: "Some requests did not succeed: - Insufficient Permission"

查看:18
本文介绍了gcloud 计算列表网络错误:“某些请求未成功:- 权限不足";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个项目并设置了一个 Windows 2012 VM.我正在尝试列出项目中的网络.以下是我执行的步骤:

最初,我根据创建 VM 时创建的凭据登录到 VM.从那里,打开 Google Cloud SDK Shell(以管理员身份)接下来我设置项目名称如下:

C:windowssystem32>gcloud 配置集项目 

然后,我尝试列出网络(应该只有一个 - 默认).这是与权限相关的错误.

C:windowssystem32>gcloud 计算网络列表名称 IPV4_RANGE GATEWAY_IPV4错误:(gcloud.compute.networks.list) 一些请求没有成功:- 权限不足

解决方案

这是创建的虚拟机的凭据权限问题.

要解决此问题,您可以使用 gcloud auth login 并通过浏览器登录您的 Google 帐户.您也可以在 Cloud Console 中创建一个服务帐户并将其加载到机器上,然后使用 gcloud auth activate-service-account 激活.

<小时>

请注意,计算"设置为已禁用".

要在 Cloud Console 中创建新虚拟机实例时更改这些权限,请展开管理、磁盘、网络、访问和安全选项"视图:

然后,导航到访问和安全"并更改计算"的权限:

这将创建新的虚拟机,该虚拟机对您项目的 Google Compute Engine 设置具有读取权限.

<小时>

要使用 gcloud 创建新实例,请将以下标志添加到 gcloud compute instances create:

--scopes "https://www.googleapis.com/auth/compute.readonly"

您还需要添加所需的任何其他权限.

I have created a project and setup a Windows 2012 VM. I am trying to list the networks in the project. Here are the steps I performed:

Initially, I logged into the VM as per the credentials created when creating the VM. From there, opened the Google Cloud SDK Shell (As Administrator) Next, I set the project name as follows:

C:windowssystem32> gcloud config set project <proj-name>

Then, I tried to list the networks (should only be one - default). Here is the error relating to permission.

C:windowssystem32> gcloud compute networks list
NAME IPV4_RANGE GATEWAY_IPV4
ERROR: (gcloud.compute.networks.list) Some requests did not succeed:
 - Insufficient Permission

解决方案

This is a problem with the permissions of the credentials of the created Virtual Machine.

To work around, you can use gcloud auth login and log into your Google account via the browser. You may also create a service account in the Cloud Console and load it onto the machine, then activate using gcloud auth activate-service-account.


This issue is easiest to see in the Cloud Console. Navigate to the instance page for this VM; you'll see something like:

Note that "Compute" is set to "Disabled".

To change these permissions when creating a new VM instance in the Cloud Console, expand the "Management, disk, networking, access & security options" view:

Then, navigate to "Access & security" and change the permissions for "Compute":

This will create the new Virtual Machine that has read access to your project's Google Compute Engine settings.


To create a new instance using gcloud, add the following flag to gcloud compute instances create:

--scopes "https://www.googleapis.com/auth/compute.readonly"

You'll need to add any additional permissions you'd like, as well.

这篇关于gcloud 计算列表网络错误:“某些请求未成功:- 权限不足";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆