Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google compute engine Can';无法从元数据服务器检索图像名称_Google Compute Engine - Fatal编程技术网

Google compute engine Can';无法从元数据服务器检索图像名称

Google compute engine Can';无法从元数据服务器检索图像名称,google-compute-engine,Google Compute Engine,我试图从元数据中获取图像名称,但服务器的答案为空。它在几天前起作用了。我尝试了旧的元数据url和新的元数据url [root@mys-pike ~]# curl http://metadata/computeMetadata/v1beta1/instance/image [root@mys-pike ~]# curl -is http://metadata/computeMetadata/v1beta1/instance/image HTTP/1.1 200 OK Content-Type: a

我试图从元数据中获取图像名称,但服务器的答案为空。它在几天前起作用了。我尝试了旧的元数据url和新的元数据url

[root@mys-pike ~]# curl http://metadata/computeMetadata/v1beta1/instance/image
[root@mys-pike ~]# curl -is http://metadata/computeMetadata/v1beta1/instance/image
HTTP/1.1 200 OK
Content-Type: application/text
ETag: 3c19e4d76229ba8c
Date: Wed, 12 Jun 2013 14:56:46 GMT
Server: Metadata Server for VM
Content-Length: 0
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN

[root@mys-pike ~]# curl  http://metadata/0.1/meta-data/image
[root@mys-pike ~]# curl -is  http://metadata/0.1/meta-data/image
HTTP/1.1 200 OK
Content-Type: application/text
Date: Wed, 12 Jun 2013 15:02:02 GMT
Server: Metadata Server for VM
Content-Length: 0
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN

[root@mys-pike ~]# curl http://metadata/0.1/meta-data/instance-id
10970436504468444993

如果实例是从快照创建的,则元数据中的映像字段为空。

是否从永久磁盘引导VM

如果是这样,那么在启动盘的JSON实例输出中,计算引擎API报告了什么?如果您主要使用命令行工具,则可以使用gcutil工具检查这一点,方法是使用
gcutil--print_json getinstance
,或者查看GUI中的等效REST


如果您是从永久磁盘启动的,则启动磁盘上的应指向永久磁盘。然后,您可以获取并检查
sourceImage
参数,以确定计算引擎是否知道磁盘是从特定映像创建的。

该元数据查询在我刚刚创建的Debian VM上运行良好-我想知道您的VM上是否有损坏的内容。你知道这个虚拟机是什么时候创建的吗?它使用的是哪个映像?您是否可以尝试使用相同的映像创建一个新VM,并查看这种情况是否仍然存在?如果是这样,我建议将您的项目id和VM名称以及此描述发送给gc-team@google.com.Looks一切都恢复正常了。就像我说的,它早些时候起作用了,现在又起作用了。我想谷歌的人解决了这个问题,谢谢!