您好,登錄后才能下訂單哦!
本篇文章給大家分享的是有關上傳的鏡像無法用來啟動云主機怎么辦,小編覺得挺實用的,因此分享給大家學習,希望大家閱讀完這篇文章后可以有所收獲,話不多說,跟著小編一起來看看吧。
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 | +--------------------------------------+--------+----------+---------+-----------+---------------------+---------------------+---------------------+---------+-------------+------------------+----------------------------------+----------------------------------+----------+---------+-----------+--------------+
以上就是上傳的鏡像無法用來啟動云主機怎么辦,小編相信有部分知識點可能是我們日常工作會見到或用到的。希望你能通過這篇文章學到更多知識。更多詳情敬請關注億速云行業資訊頻道。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。