今天就跟大家聊聊有關(guān)kilo版云主機(jī)無(wú)法終止及無(wú)法創(chuàng)建該怎么處理,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。
創(chuàng)新互聯(lián)公司是一家專業(yè)提供南湖企業(yè)網(wǎng)站建設(shè),專注與成都做網(wǎng)站、成都網(wǎng)站建設(shè)、HTML5建站、小程序制作等業(yè)務(wù)。10年已為南湖眾多企業(yè)、政府機(jī)構(gòu)等服務(wù)。創(chuàng)新互聯(lián)專業(yè)網(wǎng)站設(shè)計(jì)公司優(yōu)惠進(jìn)行中。
openstack頁(yè)面無(wú)法創(chuàng)建也無(wú)法終止云主機(jī)
點(diǎn)擊錯(cuò)誤實(shí)例,找到它的id 03f0403f-74cd-4d88-b1fb-1d3f4ceaa9e4
猜測(cè)是cinder的問(wèn)題,于是進(jìn)cinder日志目錄下,在所有日志中查找該ID,發(fā)現(xiàn)報(bào)錯(cuò)信息
# cd /var/log/cinder # grep 03f0403f-74cd-4d88-b1fb-1d3f4ceaa9e4 * # view api.log Caught error: [Errno [Errno 13] Permission denied: '/var/lock/cinder' Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply executor_callback)) File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch executor_callback) File "/usr/lib/python2.7/site-packages/oslo_messaging/rpc/dispatcher.py", line 130, in _do_dispatch result = func(ctxt, **new_args) File "/usr/lib/python2.7/site-packages/osprofiler/profiler.py", line 105, in wrapper return f(*args, **kwargs) File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 157, in ldo_inner1 return ldo_inner2(inst, context, volume_id, attachment_id, **kwargs) File "/usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py", line 439, in inner do_log=False, semaphores=semaphores, delay=delay): File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__ return self.gen.next() File "/usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py", line 395, in lock ext_lock.acquire(delay=delay) File "/usr/lib/python2.7/site-packages/oslo_concurrency/lockutils.py", line 194, in acquire fileutils.ensure_tree(basedir) File "/usr/lib/python2.7/site-packages/oslo_concurrency/openstack/common/fileutils.py", line 35, in ensure_tree os.makedirs(path) File "/usr/lib64/python2.7/os.py", line 157, in makedirs mkdir(name, mode) OSError: [Errno 13] Permission denied: '/var/lock/cinder' ] Permission denied
根據(jù)報(bào)錯(cuò)信息可以看到/var/lock/cinder目錄權(quán)限不足,進(jìn)入該目錄,發(fā)現(xiàn)并沒(méi)有cinder的目錄。
[root@bdc212 ~]# cd /var/lock/ [root@bdc212 lock]# ls -lrt total 0 drwx------ 2 root root 40 Jul 13 08:16 lvm drwx------ 2 root root 60 Jul 13 08:16 iscsi drwxr-xr-x 2 root root 40 Jul 13 08:16 ppp drwxrwxr-x 2 root lock 40 Jul 13 08:16 lockdev -rw-r--r-- 1 root root 0 Jul 13 08:16 ceph-disk -rw-r--r-- 1 root root 0 Jul 13 08:16 kdump drwxr-xr-x 2 root root 80 Jul 13 10:09 subsys
于是手動(dòng)創(chuàng)建目錄
# mkdir cinder
再次終止實(shí)例,日志依舊報(bào)錯(cuò)
Caught error: [Errno [Errno 13] Permission denied: u'/var/lock/cinder/cinder-a0403e20-5cf6-4abd-a469-e166e2fd37d3-detach_volume'
修改目錄的權(quán)限
# chown cinder:cinder cinder/
再次終止實(shí)例,發(fā)現(xiàn)成功終止,而且沒(méi)有報(bào)錯(cuò)。
另外,發(fā)現(xiàn)之前創(chuàng)建失敗的云硬盤(pán)也可以刪除掉了。
openstack在創(chuàng)建和終止云主機(jī)的時(shí)候會(huì)在/var/lock/cinder目錄下生成一個(gè)文件,在沒(méi)有該目錄,沒(méi)有權(quán)限的情況下自然無(wú)法正常創(chuàng)建和終止云主機(jī),同時(shí)也包括云硬盤(pán)的創(chuàng)建刪除。
奇怪的現(xiàn)象
機(jī)器重啟后, /var/lock/cinder 這個(gè)目錄會(huì)消失了
所以為了避免重啟之后缺少這個(gè)目錄帶來(lái)的影響,將創(chuàng)建改目錄的命令寫(xiě)入到開(kāi)機(jī)自動(dòng)執(zhí)行的文件中
# vi /etc/rc.local ... if [ ! -d /var/lock/cinder ] ; then mkdir /var/lock/cinder; chown -R cinder:cinder /var/lock/cinder; fi
修改添加可執(zhí)行的權(quán)限
# cd /etc/rc.d/ # chmod 755 rc.local
看完上述內(nèi)容,你們對(duì)kilo版云主機(jī)無(wú)法終止及無(wú)法創(chuàng)建該怎么處理有進(jìn)一步的了解嗎?如果還想了解更多知識(shí)或者相關(guān)內(nèi)容,請(qǐng)關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,感謝大家的支持。