8.11 OpenStack 问题排查

image0

8.11.1 虚拟机启动不了

问题描述

[root@ws_compute01 ~]# virsh domblklist instance-00000699
error: failed to get domain 'instance-00000699'
error: Domain not found: no domain with matching name 'instance-00000699'

/var/log/messages 报错如下

image1

解决方法

service systemd-machined  restart
service libvirtd restart

8.11.2 掉盘如何处理

出现这个错误

[root@ws_compute08 tmp]# pvs
  /dev/sdb: read failed after 0 of 4096 at 0: Input/output error
  /dev/sdb: read failed after 0 of 4096 at 3000034590720: Input/output error
  /dev/sdb: read failed after 0 of 4096 at 3000034648064: Input/output error
  /dev/sdb: read failed after 0 of 4096 at 4096: Input/output error
  PV         VG          Fmt  Attr PSize  PFree
  /dev/sdc   hdd-volumes lvm2 a--  <2.73t <2.73t
  /dev/sdd   hdd-volumes lvm2 a--  <2.73t <2.73t

解决方法

echo 1 > /sys/block/sdb/device/delete

3. 修改 ConfigDrive

ConfigDrive 是一个 iso9660 格式的文件,只读。

要对其进行修改,需要三步操作

第一步:

$ mount -t iso9660 /var/lib/nova/instances/6016c217-0bb1-4a88-a699-93435b64aa3a/disk.config /mnt/

# 拷贝到另一个文件夹中
$ mkdir /tmp/mk_iso && cp -r /mnt/*  /tmp/mk_iso

# 然后在这个文件夹中对文件进行修改
# 修改的时候,记得修改时间戳:https://tool.lu/timestamp/
# 保存的时候记得使用 ":wq!"

第二步:

# 先备份,防止有问题
$ mv /var/lib/nova/instances/6016c217-0bb1-4a88-a699-93435b64aa3a/disk.config /tmp/disk.config.bak

# 再生成覆盖
$ genisoimage -o /var/lib/nova/instances/6016c217-0bb1-4a88-a699-93435b64aa3a/disk.config -ldots -allow-lowercase -allow-multidot -l -publisher "OpenStack Compute 2.2.7-20191225.el7.centos" -quiet -J -r -V config-2 /tmp/mk_iso/

第三步:

# 硬重启,重新生成 xml,如果有必要的话
$ nova reboot --hard <instance_uuid>

image2