本篇文章給大家分享的是有關(guān)上傳的鏡像無(wú)法用來(lái)啟動(dòng)云主機(jī)怎么辦,小編覺(jué)得挺實(shí)用的,因此分享給大家學(xué)習(xí),希望大家閱讀完這篇文章后可以有所收獲,話不多說(shuō),跟著小編一起來(lái)看看吧。
成都創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比瑞安網(wǎng)站開(kāi)發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫(kù),直接使用。一站式瑞安網(wǎng)站制作公司更省心,省錢(qián),快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋瑞安地區(qū)。費(fèi)用合理售后完善,十載實(shí)體公司更值得信賴。
Openstack各功能正常,使用其它鏡像創(chuàng)建云硬盤(pán)并用來(lái)啟動(dòng)云主機(jī)也正常,但是就是這個(gè)鏡像有問(wèn)題。
dashboard頁(yè)面上的錯(cuò)誤:
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
錯(cuò)誤描述不清晰,查找錯(cuò)誤日志
# 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
錯(cuò)誤里提示要求neutron的認(rèn)證,突然靈光一閃想起來(lái)這個(gè)虛擬機(jī)鏡像cirros是一開(kāi)始安裝完glance服務(wù)上傳測(cè)試用的,那個(gè)時(shí)候還沒(méi)有對(duì)接ceph,也就是說(shuō)這個(gè)鏡像并不是存儲(chǔ)在ceph里的。重新上傳一個(gè)cirros的鏡像,啟動(dòng)云主機(jī)成功。
另外因?yàn)楦牧薵lance的存儲(chǔ)后端,導(dǎo)致原先的鏡像無(wú)法刪除,有兩種解決辦法:
1、修改glance-api.conf,改回原先的配置,重啟glance的相關(guān)服務(wù),再刪除,刪除之后再改成新的配置重啟服務(wù)
2、直接修改元數(shù)據(jù)庫(kù),在glance庫(kù)中,image_locations和images表記錄了鏡像的存儲(chǔ)信息。
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 | +--------------------------------------+--------+----------+---------+-----------+---------------------+---------------------+---------------------+---------+-------------+------------------+----------------------------------+----------------------------------+----------+---------+-----------+--------------+
以上就是上傳的鏡像無(wú)法用來(lái)啟動(dòng)云主機(jī)怎么辦,小編相信有部分知識(shí)點(diǎn)可能是我們?nèi)粘9ぷ鲿?huì)見(jiàn)到或用到的。希望你能通過(guò)這篇文章學(xué)到更多知識(shí)。更多詳情敬請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。