文档章节

上传的镜像无法用来启动云主机

哓竹
 哓竹
发布于 2016/07/18 17:13
字数 1545
阅读 293
收藏 0

背景

Openstack各功能正常,使用其它镜像创建云硬盘并用来启动云主机也正常,但是就是这个镜像有问题。

报错信息

dashboard页面上的错误:

No valid host was found. Exceeded max scheduling attempts 3 for instance 345339f1-0a52-42b3-904b-0d3065b5329b. Last exception: [u'Traceback (most recent call last):\n', u' File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2248, in _do

错误描述不清晰,查找错误日志

# view nova-compute.log

 [instance: ae58a0a8-f197-4099-93db-36d76a696d63] Instance fail
ed to spawn
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63] Traceback (most recent call last):
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2473, in _build_resources
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     yield resources
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 2345, in _build_and_run_instance
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     block_device_info=block_device_info)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 2388, in spawn
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     write_to_disk=True)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 4175, in _get_guest_xml
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     network_info_str = str(network_info)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/nova/network/model.py", line 480, in __str__
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     return self._sync_wrapper(fn, *args, **kwargs)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/nova/network/model.py", line 463, in _sync_wrapper
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     self.wait()
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/nova/network/model.py", line 495, in wait
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     self[:] = self._gt.wait()
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/eventlet/greenthread.py", line 175, in wait
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     return self._exit_event.wait()
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/eventlet/event.py", line 125, in wait
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     current.throw(*self._exc)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/eventlet/greenthread.py", line 214, in main
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     result = function(*args, **kwargs)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 1795, in _allocate_network_async
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     dhcp_options=dhcp_options)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 577, in allocate_for_instance
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     self._delete_ports(neutron, instance, created_port_ids)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 85, in __exit__
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     six.reraise(self.type_, self.value, self.tb)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 569, in allocate_for_instance
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     security_group_ids, available_macs, dhcp_opts)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 331, in _create_port
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     network_id, instance=instance)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 85, in __exit__
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     six.reraise(self.type_, self.value, self.tb)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 304, in _create_port
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     port_id = port_client.create_port(port_req_body)['port']['id']
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 102, in with_params
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     ret = self.function(instance, *args, **kwargs)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 544, in create_port
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     return self.post(self.ports_path, body=body)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 298, in post
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     headers=headers, params=params)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 211, in do_request
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     self._handle_fault_response(status_code, replybody)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 185, in _handle_fault_response
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     exception_handler_v20(status_code, des_error_body)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]   File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 83, in exception_handler_v20
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]     message=message)
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63] NeutronClientException: Authentication required
2016-07-18 16:40:24.930 1067239 TRACE nova.compute.manager [instance: ae58a0a8-f197-4099-93db-36d76a696d63]
2016-07-18 16:40:24.976 1067239 INFO nova.compute.manager [req-177d574f-f36e-4e99-946c-d34612ecd607 3d8b93c202a94046be24e4eee5d16fb8 c05f2d7996144cb69921e64391db4512 - - -] [instance: ae58a0a8-f197-4099-93db-36d76a696d63] Terminating in
stance

解决

错误里提示要求neutron的认证,突然灵光一闪想起来这个虚拟机镜像cirros是一开始安装完glance服务上传测试用的,那个时候还没有对接ceph,也就是说这个镜像并不是存储在ceph里的。重新上传一个cirros的镜像,启动云主机成功。

另外因为更改了glance的存储后端,导致原先的镜像无法删除,有两种解决办法:

1、修改glance-api.conf,改回原先的配置,重启glance的相关服务,再删除,删除之后再改成新的配置重启服务

2、直接修改元数据库,在glance库中,image_locations和images表记录了镜像的存储信息。

MariaDB [glance]> select * from image_locations;
+----+--------------------------------------+--------------------------------------------------------------------+---------------------+---------------------+---------------------+---------+-----------+---------+
| id | image_id                             | value                                                              | created_at          | updated_at          | deleted_at          | deleted | meta_data | status  |
+----+--------------------------------------+--------------------------------------------------------------------+---------------------+---------------------+---------------------+---------+-----------+---------+
|  1 | de64317b-638f-401e-b6df-d0bc8d5cd18a | file:///var/lib/glance/images/de64317b-638f-401e-b6df-d0bc8d5cd18a | 2016-10-13 08:05:39 | 2016-10-17 02:07:03 | 2016-10-17 02:07:03 |       1 | {}        | deleted |
+----+--------------------------------------+--------------------------------------------------------------------+---------------------+---------------------+---------------------+---------+-----------+---------+

MariaDB [glance]> select * from images;
+--------------------------------------+--------+----------+---------+-----------+---------------------+---------------------+---------------------+---------+-------------+------------------+----------------------------------+----------------------------------+----------+---------+-----------+--------------+
| id                                   | name   | size     | status  | is_public | created_at          | updated_at          | deleted_at          | deleted | disk_format | container_format | checksum                         | owner                            | min_disk | min_ram | protected | virtual_size |
+--------------------------------------+--------+----------+---------+-----------+---------------------+---------------------+---------------------+---------+-------------+------------------+----------------------------------+----------------------------------+----------+---------+-----------+--------------+
| de64317b-638f-401e-b6df-d0bc8d5cd18a | cirros | 13287936 | deleted |         1 | 2016-10-13 08:05:38 | 2016-10-17 02:07:04 | 2016-10-17 02:07:04 |       1 | qcow2       | bare             | ee1eca47dc88f4879d8a229cc70a07c6 | 1c9b4504ff224d7f983158bfd8bec6aa |        0 |       0 |         0 |         NULL |
+--------------------------------------+--------+----------+---------+-----------+---------------------+---------------------+---------------------+---------+-------------+------------------+----------------------------------+----------------------------------+----------+---------+-----------+--------------+

 

© 著作权归作者所有

哓竹
粉丝 7
博文 54
码字总数 63086
作品 0
朝阳
运维
私信 提问
如何进行云主机迁移?看这一篇文章就够了!

欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 本文由腾讯云计算产品团队发表于云+社区专栏 主机迁移概述 在云计算时代,不管是从IDC上云还是多云直接的迁移,都已经是常见的事...

腾讯云+社区
2018/09/04
0
0
记一次创建云硬盘失败的解决过程

一、背景 登录dashboard,点击创建云硬盘失败,而且是点击完就直接报error错误。 二、解决经过 思路一:新上传的image镜像,是不是image的版本有问题 检查完发现新的image镜像是新版本的qco...

哓竹
2016/07/16
2.1K
0
Docker学习之搭建私有镜像仓库

过节之前来一发,又是许久没整理笔记了,今天跟大家聊聊Docker如何搭建私有仓库的几种方式。首先我们来回顾一下之前讲到的Doker 平台的基本构成。 Doker 平台的基本构成 Docker 平台基本上由...

小柒2012
2018/04/16
0
0
Docker 入门实践

欢迎大家前往腾讯云技术社区,获取更多腾讯海量技术实践干货哦~ 作者:张戈 导语:应用场景从创建、上传直到部署的详细过程,并简单的介绍了腾讯云容器服务的使用方法。通过Docker快速拉起一...

2017/12/18
0
0
简单的Docker镜像上传及docker-compose使用

一.仓库和镜像创建和上传 1.注册/登录阿里云容器服务中心:https://cr.console.aliyun.com/ 2.选择镜像仓库地址(注:这里选择华北1区,位置在青岛) 3.创建镜像仓库: 1).仓库名称填写项目...

qq_36752632
2018/03/23
0
0

没有更多内容

加载失败,请刷新页面

加载更多

vue.js-详解三大流行框架VUE_快速进阶前端大咖-Vue基础

作者 | Jeskson 来源 | 达达前端小酒馆 Vue概述: MVX模式简介,Vue框架简介,Vue.js的安装与使用。 Vue基础语法: 实例对象,生命周期,模板语法,计算属性,methods方法 Vue渲染: 列表渲染...

达达前端小酒馆
今天
4
0
OSChina 周五乱弹 —— 匹诺曹也是韩国人

Osc乱弹歌单(2019)请戳(这里) 【今日歌曲】 @watergood :分享海先生的单曲《烟花巷》 《烟花巷》- 海先生 手机党少年们想听歌,请使劲儿戳(这里) @Cyber-Pan :已经很久没有十点前下过...

小小编辑
今天
8
1
Snack3 之 Jsonpath使用

Snack3 之 Jsonpath使用 一、 Snack3 和 JSONPath 介绍 Snack3 是一个支持JSONPath的JSON框架。JSONPath是一个很强大的功能,也可以在Java框架中当作对象查询语言(OQL)来使用。 <dependenc...

刘之西东
今天
5
0
7. 彤哥说netty系列之Java NIO核心组件之Selector

<p align="right">——日拱一卒,不期而至!</p> 你好,我是彤哥,本篇是netty系列的第七篇。 简介 上一章我们一起学习了Java NIO的核心组件Buffer,它通常跟Channel一起使用,但是它们在网络...

彤哥读源码
昨天
21
0
在Jupyter notebooks 中运行GRASS GIS

在Ubuntu16.04中,首先安装jupyter: python3 -m pip install --upgrade pippython3 -m pip install jupyter 然后创建一个sh脚本: # directory where GRASS GIS lives# GRASS GIS 的安装......

ddd口木呆
昨天
4
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部