错误原因:
发生错误的原因,黑群晖要求硬盘为Sata格式,而默认创建的硬盘格式为Virtio,我们要做的就是修改挂载的虚拟硬盘改为Sata格式
解决方法:
1、进入 ZStack,找到黑群晖的主机,查看 UUID
2、进入 Zstack 宿主机,查看所有虚拟机
virsh list --allId Name State
--------------------------------------------------31 7f7f084355f540e4bbd8f465c9194584 running 66 b82f69a4053e4845a7dc79181c1f4e56 running 67 ba6ee361116f4af8be518494104e5c9c running 75 b5add37e98084540bdfe9441b902615f running 78 3d2f1756a2384dbaaf5db6d294a8007c running 89 84a3dded78c5478a835f08f2d11f8afe running
3、 关闭虚拟机,注意这里不能在界面上直接关闭,必须通过命令行
virsh shutdown 84a3dded78c5478a835f08f2d11f8afe
4、要等一会,查看是否成功
virsh dominfo 84a3dded78c5478a835f08f2d11f8afe # 返回
Id: -
Name: 84a3dded78c5478a835f08f2d11f8afe
UUID: 84a3dded-78c5-478a-835f-08f2d11f8afe
OS Type: hvm
State: shut off # 关闭成功
CPU(s): 4
Max memory: 8388608 KiB
Used memory: 8388608 KiB
Persistent: yes
Autostart: disable
Managed save: no
Security model: none
Security DOI: 0
5、编辑配置文件
vim /etc/libvirt/qemu/84a3dded78c5478a835f08f2d11f8afe.xml# 修改如下<disk type='file' device='disk' snapshot='external'><driver name='qemu' type='qcow2' cache='none'/><source file='/zstack_data/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-5ca947c19d774797b16d0c40ad43386d/5ca947c19d774797b16d0c40ad43386d.qcow2'/><target dev='vda' bus='sata'/> # 把 virtio 改成 sata<boot order='1'/><address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> # 这一行删除</disk><disk type='file' device='disk' snapshot='external'><driver name='qemu' type='qcow2' cache='none'/><source file='/zstack_data/dataVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-400f5ef1fb2a4f6090a36fa596227a8d/400f5ef1fb2a4f6090a36fa596227a8d.qcow2'/><target dev='vdb' bus='sata'/> # 把 virtio 改成 sata<address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/> # 这一行删除</disk>
6、重新定义使配置文件生效
virsh define 84a3dded78c5478a835f08f2d11f8afe.xml
7、 启动虚拟机
virsh start 84a3dded78c5478a835f08f2d11f8afe
8、进入 web 管理界面,成功显示