跳转至

kvm与WebVirtMgr安装

环境准备

关闭防火墙

systemctl stop firewalld

关闭selinux

vim /etc/selinux/config 
SELINUX=disabled

setenforce 0

getenforce
Disabled

配置正向代理出

cat /etc/profile
#export http_proxy=http://10.126.xxx.xx:3128
#export https_proxy=http://10.126.xxx.xx:3128

export http_proxy=http://10.126.xxx.xxx:3128
export https_proxy=http://10.126.xxx.xx:3128

echo $https_proxy
echo $http_proxy

curl www.baidu.com

配置yum源

wget http://mirrors.aliyun.com/repo/Centos-7.repo -C /etc/yum.repos.d/
wget http://mirrors.aliyun.com/repo/repo-7.repo -C /etc/yum.repos.d/

ls /etc/yum.repos.d/
Centos-7.repo
repo-7.repo

yum clean all
yum makecache
yum repolist

mount -t iso9660 -o loop /root/yumSoft/CentOS-7-x86_64-Everything-2009.iso /root/yumData/centos76/

宿主机免密配置

WebVirtMgr 添加的宿主机需配置免密

宿主机配置

ssh-keygen 
ls -ltr /root/.ssh/ 
-rw-r--r-- 1 root root  409 Jun 28 14:20 id_rsa.pub
-rw------- 1 root root 1679 Jun 28 14:20 id_rsa
-rw------- 1 root root  807 Jun 28 15:01 authorized_keys
-rw-r--r-- 1 root root  874 Jun 28 16:27 known_hosts

#从WebVirtMgr 验证绵密到宿主机 很重要 
ssh-copy-id -i .ssh/id_rsa.pub root@kvm宿主机ip

# 此步骤很重要否则web页面验证失败
vim /etc/ssh/sshd_config
 PermitRootLogin yes

宿主机添加公钥信息

cat /root/.ssh/authorized_keys
#此为WebVirtMgr的root用户的公钥(id_rsa.pub),需添加到kvm宿主机的authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC************************************************* root@lf319-m02-010

#此为WebVirtMgr的nginx用户的公钥(id_rsa.pub),需添加到kvm宿主机的authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDICIbXgiLKjkDTI**************************** nginx@host-10-126-138-149

kvm安装

安装依赖

yum install qemu-kvm qemu-img virt-manager libvirt libvirt-python virt-manager libvirt-client virt-install virt-viewer bridge-utils qemu-kvm-tools.x86_64 -y

 虚拟机迁移 virsh-v2v
 宿主机迁移 virsh-p2v
 libguestfs-tools

启动libvirtd

systemctl enable libvirtd
systemctl start libvirtd
systemctl status libvirtd

kvm硬件支持

加载虚拟化模块

#查看是否支持虚拟化
cat /proc/cpuinfo | grep -E 'vmx|svm'

#查看KVM 驱动是否加载
lsmod | grep kvm

#如果没有加载kvm驱动,利用命令加载驱动
modprobe -a kvm
modprobe -a kvm_intel

#设置开启启动界面的显示画面
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

验证嵌套虚拟机功能

嵌套虚拟化,物理机A虚拟出虚拟机B,虚拟机B再次虚拟化,需开启虚拟机B嵌套虚拟化功能

#检查宿主机的kvm_intel模块是否开启了嵌套虚拟机功能
modinfo kvm_intel | grep nested
parm: nested:bool

cat /sys/module/kvm_intel/parameters/nested
N
#如果不是Y的话,执行下面语句,需要先将虚拟机关闭,不然设置的时候会报错
modprobe -r kvm-intel
modprobe kvm-intel nested=1

cat /sys/module/kvm_intel/parameters/nested
Y
#创建虚拟机即可

网桥配置

  • KVM 网络的两张方式: ①NAT :默认设置,数据包由NAT方式通过主机的接口进行传送,可以访问外网,但是无法从外部访问虚拟机网络 ②网桥:这种模式允许虚拟机像一台独立的主机一样拥有网络,外部的机器可以直接访问到虚拟机内部,但需要网卡支持

将网卡配置成网桥ifcfg-bond_yewu,并将刚才ip配置到新的虚拟网卡上 ifcfg-br0

网卡ifcfg-bond_yewu 配置

[root@PHY1124 network-scripts]# cat ifcfg-bond_yewu 
DEVICE=bond_yewu
ONBOOT=yes
BONDING_OPTS="miimon=100 mode=4 xmit_hash_policy=1"
BONDING_MASTER=yes
TYPE=Bond
IPADDR=10.191.bb.bb
NETMASK=255.255.255.0
BOOTPROTO=static
GATEWAY=10.191.xx.xxx
BRIDGE=br0

网卡ifcf-br0配置

[root@PHY1124 network-scripts]# cat ifcfg-br0
DEVICE=br0
TYPE=Bridge
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.191.bb.bb
NETMASK=255.255.255.0
GATEWAY=10.191.xx.xxx

验证网桥

systemctl restart network

[root@PHY1124 network-scripts]# ifconfig 
bond_yewu: flags=5187<UP,BROADCAST,RUNNING,MASTER,MULTICAST>  mtu 1500
        inet6 fe80::1a66:daff:fe56:d9e5  prefixlen 64  scopeid 0x20<link>
        ether 18:66:da:56:d9:e5  txqueuelen 1000  (Ethernet)
        RX packets 563872398  bytes 695040973280 (647.3 GiB)
        RX errors 0  dropped 2061  overruns 0  frame 0
        TX packets 259279785  bytes 19645957487 (18.2 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.191.bb.bb  netmask 255.255.255.0  broadcast 10.191.23.255
        inet6 fe80::1a66:daff:fe56:d9e5  prefixlen 64  scopeid 0x20<link>
        ether 18:66:da:56:d9:e5  txqueuelen 1000  (Ethernet)
        RX packets 2222083  bytes 5248202101 (4.8 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 607795  bytes 2629545542 (2.4 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

防火墙配置

放行vnc的端口5900-5999

iptables -A INPUT -s 10.126.138.149 -p tcp --dport 5900:5999 -j ACCEPT 
iptables -A INPUT -p tcp --dport 5900:5999 -j DROP

配置磁盘

kvm会使用到镜像(系统)和存储块(lvm,ceph等)

磁盘信息收集

查看系统磁盘
[root@PHY1124 ~]# fdisk -l
[root@PHY1124 ~]# lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                  8:0    0 446.6G  0 disk 
├─sda1               8:1    0     1G  0 part /boot
└─sda2               8:2    0 445.6G  0 part 
  ├─rootvg-lv_root 253:0    0 441.6G  0 lvm  /
  └─rootvg-lv_swap 253:1    0     4G  0 lvm  [SWAP]
sdb                  8:16   0 558.4G  0 disk 
└─sdb1               8:17   0 558.4G  0 part /app
sdc                  8:32   0  21.9T  0 disk 
├─lvmvg-lvmlv      253:2    0     2T  0 lvm  /data
├─lvmvg-kvm_data   253:3    0     2T  0 lvm  /kvm_data
└─lvmvg-kvm_images 253:4    0     2T  0 lvm  /kvm_images

查看挂载磁盘
[root@PHY1124 ~]# df -h
Filesystem                    Size  Used Avail Use% Mounted on
/dev/mapper/rootvg-lv_root    442G  4.0G  438G   1% /
devtmpfs                      126G     0  126G   0% /dev
tmpfs                         126G     0  126G   0% /dev/shm
tmpfs                         126G   27M  126G   1% /run
tmpfs                         126G     0  126G   0% /sys/fs/cgroup
/dev/sda1                    1014M  146M  869M  15% /boot
/dev/sdb1                     559G   33M  559G   1% /app
/dev/mapper/lvmvg-lvmlv       2.0T   33M  2.0T   1% /data
/dev/mapper/lvmvg-kvm_data    2.0T  768G  1.3T  38% /kvm_data
/dev/mapper/lvmvg-kvm_images  2.0T  4.9G  2.0T   1% /kvm_images
tmpfs                          26G     0   26G   0% /run/user/0
tmpfs                          26G     0   26G   0% /run/user/1000

LVM(逻辑卷)配置

查看lvm信息

[root@PHY1124 ~]# pvcreate /dev/sdc
[root@PHY1124 ~]# vgcreate lvmvg /dev/sdc
[root@PHY1124 ~]# lvcreate -L 2T -n lvmlv lvmvg
[root@PHY1124 ~]# mkfs.xfs /dev/lvmvg/lvmlv 
[root@PHY1124 ~]# mkdir /data
[root@PHY1124 ~]# echo "/dev/lvmvg/lvmlv /data xfs     defaults        1 2 " >> /etc/fstab
[root@PHY1124 ~]# mount -a

[root@PHY1124 ~]# pvs
  PV         VG     Fmt  Attr PSize   PFree 
  /dev/sda2  rootvg lvm2 a--  445.62g     0 
  /dev/sdc   lvmvg  lvm2 a--   21.83t 15.83t
[root@PHY1124 ~]# vgs
  VG     #PV #LV #SN Attr   VSize   VFree 
  lvmvg    1   3   0 wz--n-  21.83t 15.83t
  rootvg   1   2   0 wz--n- 445.62g     0 
[root@PHY1124 ~]# lvs
  LV         VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  kvm_data   lvmvg  -wi-ao----   2.00t                                                    
  kvm_images lvmvg  -wi-ao----   2.00t                                                    
  lvmlv      lvmvg  -wi-ao----   2.00t                                                    
  lv_root    rootvg -wi-ao---- 441.62g                                                    
  lv_swap    rootvg -wi-ao----   4.00g                                                    

创建lvm块设备

#创建目录
mkdir -pv /kvm_data/ 
mkdir -pv /kvm_images/

#创建kvm_data块设备
lvcreate -n kvm_data -L 2T lvmvg
#格式化kvm_data块设备
mkfs.xfs /dev/mapper/lvmvg-kvm_data 

#创建kvm_images块设备
lvcreate -n kvm_images -L 2T lvmvg
#格式化kvm_images块设备
mkfs.xfs /dev/mapper/lvmvg-kvm_images 

挂载磁盘

#块设备开机启动
vi /etc/fstab
/dev/lvmvg/kvm_data /kvm_data xfs     defaults        0 0 
/dev/lvmvg/kvm_images /kvm_images xfs     defaults        0 0 

#挂载磁盘
mount -a

#查看磁盘
lsblk
df -h

WebVirtMgr配置

宿主机配置

选择-ADD Connection-Edit Host Server (SSH)

label:宿主机名

FQDN/IP:宿主机IP

用户名:root]

网络池配置

名称:br0

网络类型:BRIDGE

桥接名称:br0

images的存储池配置

目录类型卷:dir

名称:kvm_images

路径:/kvm_images

data的存储池配置

目录类型卷:dir

名称:kvm_data

路径:/kvm_data

遇到问题

1、密钥认证失败,会导致WebVirtMgr 查看不到宿主机信息
Cannot recv data: Warning: Permanently added '10.191.23.107' (ECDSA) to the list of known hosts. Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).: Connection reset by peer

2、libvirtd未启动,会导致查看不到宿主机信息,可查看/var/log/secure
End of file while reading data: Warning: Permanently added '10.191.23.108' (ECDSA) to the list of known hosts. Ncat: No such file or directory.: Input/output error

3、web界面报错密钥认证不通过
# 此步骤很重要否则web页面验证失败
vim /etc/ssh/sshd_config
 PermitRootLogin yes
 4、kvm模块丢失导致
 guest has not initialized the display
 lsmod|grep kvm

KVM验证

qemu-img create  -f  qcow2 /kvm_data/storage-zhaoyy-22-1.qcow2 1024G

主机网卡

ifcfg-eth0 
TYPE=Ethernet
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPADDR=172.16.22.91
NETMASK=255.255.254.0
GATEWAY=172.16.23.254
NAME=eth0
DEVICE=eth0
ONBOOT=yes

# Example for 172.16.22.1
#IPADDR=172.16.22.1
#NETMASK=255.255.254.0
#GATEWAY=172.16.23.254

# Example for 172.16.21.1
#IPADDR=172.16.21.1
#NETMASK=255.255.254.0
#GATEWAY=172.16.21.254

# Example for 172.16.35.1
#IPADDR=172.16.35.1
#NETMASK=255.255.254.0
#GATEWAY=172.16.35.254

虚拟机xml

<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit centos7604
or other application using the libvirt API.
-->

<domain type='kvm'>
  <name>centos7604</name>
  <uuid>4a883075-332d-aee9-930b-98e49938e5cb</uuid>
  <description>None</description>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <vcpu placement='static'>8</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
    <boot dev='hd'/>
    <boot dev='cdrom'/>
    <bootmenu enable='yes'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='host-model' check='partial'>
    <model fallback='allow'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/kvm_images/centos76TtyS0.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='piix3-uhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:51:5f:35'/>
      <source network='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
</domain>

pty伪终端

https://www.cnblogs.com/cloud-datacenter/p/13326223.html

virsh console进入CentOS 7虚拟机卡住不动
一、查看目前kvm虚拟机情况
[root@localhost ~]# virsh list
Id 名称 状态
----------------------------------------------------
2 centos7 running

二、尝试用console登陆

[root@localhost ~]# virsh list
Id 名称 状态
----------------------------------------------------
2 centos7 running

[root@localhost ~]# virsh console centos7
连接到域 centos7
换码符为 ^]

三、在以上的符号停住了,在百度查下资料,得知以下操作:
1 cat /etc/securetty
[root@localhost ~]# cat /etc/securetty
console
vc/1
vc/2
vc/3
vc/4
vc/5
vc/6
vc/7
vc/8
vc/9
vc/10
vc/11
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11
ttyS0
ttysclp0
sclp_line0
3270/tty1
hvc0
hvc1
hvc2
hvc3
hvc4
hvc5
hvc6
hvc7
hvsi0
hvsi1
hvsi2
xvc0
2 进入虚机中,编辑 /etc/default/grub 文件,找到下面行:

GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=cl/root rd.lvm.lv=cl/swap rhgb quiet”

改为:(尾部增加 console=ttyS0,115200)

GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet console=ttyS0,115200"

grubby --update-kernel=ALL --args="console=ttys0"

3 运行grub2-mkconfig -o /boot/grub2/grub.cfg 来重新生成GRUB配置并更新内核参数
[root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-862.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-862.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-f9c7d514f50a42eb8a941b70609346ed
Found initrd image: /boot/initramfs-0-rescue-f9c7d514f50a42eb8a941b70609346ed.img
done

4 使用以下命令激活 服务 (这个是centos7才有的服务,但默认没有启动)
sudo systemctl start serial-getty@ttyS0.service
sudo systemctl enable serial-getty@ttyS0.service

问题

问题1

ERROR Cannot access storage file '/root/kvm/centos01.img' (as uid:107, gid:107): Permission denied

从打印看是由于存储权限问题

ERROR Cannot access storage file '/root/kvm/centos01.img' (as uid:107, gid:107): Permission denied

解决
打开/etc/libvirt/qemu.conf文件,找到user = "root"和group = "root"并将前面的“#”号注释去掉,然后重启libvirtd。

# systemctl restart libvirtd

问题2

error: Failed to start domain centos79-22-47
error: the CPU is incompatible with host CPU: Host CPU does not provide required features: hle, rtm, mpx, avx512f, avx512dq, rdseed, adx, smap, clwb, avx512cd, avx512bw, avx512vl, xsavec, xgetbv1, 3dnowprefetch

ttps://blog.csdn.net/u012206617/article/details/116597802

这是因为两台宿主机的CPU类型不一致导致的,解决方法也很简单,将xml文件中的CPU类型改为与当前宿主机一致即可

# 查询本机cpu型号
virsh capabilities
<model>Nehalem-IBRS</model>                            # 当前宿主机CPU类型

更改后的型号
<model fallback='allow'>Haswell-noTSX-IBRS</model>

# virsh undefine mycentos
# virsh define mycentos

shell

#!/bin/bash
#以下信息是必须编辑的,确保信息不与其他资源冲突
uuid="0586b67a-92b2-4751-ae2d-9d11ca2a9322"
name="lyq-vm"
image_path="/home/liuyq/CentOS6U5_GLOBAL_64bit_75G_20180129_APP.qcow2"
mac="fa:16:3f:11:3d:ff"
bridge_name="lyq-br"
#以下信息默认值,可不编辑
user="root"
new_password="aaaaaa"
image_type="qcow2"
work_dir="./"
if [ -f ${name}.xml ];then
    echo "file ${name}.xml already exist"
    exit 1
fi
cat > $name.xml <<EOF
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit instance-0000037d
or other application using the libvirt API.
-->

<domain type='kvm'>
    <name>$name</name>
  <uuid>$uuid</uuid>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <vcpu placement='static' cpuset='0-7,16-23'>4</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode='host-model'>
    <model fallback='allow'/>
    <topology sockets='4' cores='1' threads='1'/>
  </cpu>
  <clock offset='utc'>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='$image_type' cache='none'/>
      <source file='$image_path'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
    </channel>
    <interface type='bridge'>
      <mac address='$mac'/>
      <source bridge='$bridge_name'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
      <stats period='10'/>
    </memballoon>
  </devices>
</domain>
EOF
virsh define ${work_dir}${name}.xml
virsh start $name
virsh vncdisplay $name
#可通过vnc viewer来查看虚拟机是否已经启动
while :
do
echo "waiting vm start,make sure vm is running y/n?"
read vm_status
if [ $vm_status != "y" ];then
    echo "sleep 10s,wait vm start"
    sleep 10
else
    virsh set-user-password $name $user $new_password
    if [ $? -ne 0 ];then
        result="failed"
    else
        result="succeed"
    fi
    break
fi
done
echo -e "==========\nqemu-guest-agent test ${result}\n=========="
echo "clean up the resource y/n?"
read clean
if [ $clean == "y" ];then
    rm -f ${name}.xml
    virsh destroy $name
    sleep 1
    virsh undefine $name
fi

xml

<domain type='kvm' id='14'>
  <name>centos76a</name>
  <uuid>67afb11d-fcf7-b5a6-92eb-b7a32970fba3</uuid>
  <description>None</description>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <vcpu placement='static'>8</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
    <boot dev='hd'/>
    <boot dev='cdrom'/>
    <bootmenu enable='yes'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='custom' match='exact' check='full'>
    <model fallback='forbid'>Haswell-IBRS</model>
    <vendor>Intel</vendor>
    <feature policy='require' name='vme'/>
    <feature policy='disable' name='ds'/>
    <feature policy='disable' name='acpi'/>
    <feature policy='require' name='ss'/>
    <feature policy='disable' name='ht'/>
    <feature policy='disable' name='tm'/>
    <feature policy='disable' name='pbe'/>
    <feature policy='disable' name='dtes64'/>
    <feature policy='disable' name='ds_cpl'/>
    <feature policy='disable' name='vmx'/>
    <feature policy='disable' name='smx'/>
    <feature policy='disable' name='est'/>
    <feature policy='disable' name='tm2'/>
    <feature policy='disable' name='xtpr'/>
    <feature policy='disable' name='pdcm'/>
    <feature policy='disable' name='dca'/>
    <feature policy='disable' name='osxsave'/>
    <feature policy='require' name='f16c'/>
    <feature policy='require' name='rdrand'/>
    <feature policy='disable' name='arat'/>
    <feature policy='disable' name='tsc_adjust'/>
    <feature policy='require' name='stibp'/>
    <feature policy='require' name='ssbd'/>
    <feature policy='require' name='xsaveopt'/>
    <feature policy='require' name='pdpe1gb'/>
    <feature policy='require' name='abm'/>
    <feature policy='disable' name='hle'/>
    <feature policy='disable' name='rtm'/>
    <feature policy='require' name='hypervisor'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/kvm_images/centos76.qcow2'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <alias name='ide0-1-1'/>
      <address type='drive' controller='0' bus='1' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='piix3-uhci'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:0f:59:c1'/>
      <source network='br0' bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/2'/>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/2'>
      <source path='/dev/pts/2'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='mouse' bus='ps2'>
      <alias name='input0'/>
    </input>
    <input type='tablet' bus='usb'>
      <alias name='input1'/>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input2'/>
    </input>
    <graphics type='vnc' port='5900' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+107:+107</label>
    <imagelabel>+107:+107</imagelabel>
  </seclabel>
</domain>

xml

[root@kvm-10-191-21-94 qemu]# cat centos7694.xml 
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit centos76a
or other application using the libvirt API.
-->

<domain type='kvm'>
  <name>centos7694</name>
  <uuid>67afb11d-fcf7-b5a6-92eb-b7a32970fba3</uuid>
  <description>None</description>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <vcpu placement='static'>8</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
    <boot dev='hd'/>
    <boot dev='cdrom'/>
    <bootmenu enable='yes'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='host-model' check='partial'>
    <model fallback='allow'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/kvm_images/centos76.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='piix3-uhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:0f:59:c1'/>
      <source network='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
</domain>

xml_disk

<domain type='kvm' id='20'>
  <name>centos7694-d</name>
  <uuid>8f263238-470b-9f47-f6f4-1b8801eb0f15</uuid>
  <description>None</description>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <vcpu placement='static'>8</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
    <boot dev='hd'/>
    <boot dev='cdrom'/>
    <bootmenu enable='yes'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='custom' match='exact' check='full'>
    <model fallback='forbid'>Haswell-IBRS</model>
    <vendor>Intel</vendor>
    <feature policy='require' name='vme'/>
    <feature policy='disable' name='ds'/>
    <feature policy='disable' name='acpi'/>
    <feature policy='require' name='ss'/>
    <feature policy='disable' name='ht'/>
    <feature policy='disable' name='tm'/>
    <feature policy='disable' name='pbe'/>
    <feature policy='disable' name='dtes64'/>
    <feature policy='disable' name='ds_cpl'/>
    <feature policy='disable' name='vmx'/>
    <feature policy='disable' name='smx'/>
    <feature policy='disable' name='est'/>
    <feature policy='disable' name='tm2'/>
    <feature policy='disable' name='xtpr'/>
    <feature policy='disable' name='pdcm'/>
    <feature policy='disable' name='dca'/>
    <feature policy='disable' name='osxsave'/>
    <feature policy='require' name='f16c'/>
    <feature policy='require' name='rdrand'/>
    <feature policy='disable' name='arat'/>
    <feature policy='disable' name='tsc_adjust'/>
    <feature policy='require' name='stibp'/>
    <feature policy='require' name='ssbd'/>
    <feature policy='require' name='xsaveopt'/>
    <feature policy='require' name='pdpe1gb'/>
    <feature policy='require' name='abm'/>
    <feature policy='disable' name='hle'/>
    <feature policy='disable' name='rtm'/>
    <feature policy='require' name='hypervisor'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/kvm_images/centos76TtyS0.qcow2'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/kvm_images/storage-100g-centos7694.qcow2'/>
      <backingStore/>
      <target dev='vdb' bus='virtio'/>
      <alias name='virtio-disk1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <alias name='ide0-1-1'/>
      <address type='drive' controller='0' bus='1' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='piix3-uhci'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:40:6a:a4'/>
      <source network='br0' bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='mouse' bus='ps2'>
      <alias name='input0'/>
    </input>
    <input type='tablet' bus='usb'>
      <alias name='input1'/>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input2'/>
    </input>
    <graphics type='vnc' port='5900' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+107:+107</label>
    <imagelabel>+107:+107</imagelabel>
  </seclabel>
</domain>

xml-d

<domain type='kvm' id='21'>
  <name>centos7694-d</name>
  <uuid>8f263238-470b-9f47-f6f4-1b8801eb0f15</uuid>
  <description>None</description>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <vcpu placement='static'>8</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
    <boot dev='hd'/>
    <boot dev='cdrom'/>
    <bootmenu enable='yes'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='custom' match='exact' check='full'>
    <model fallback='forbid'>Haswell-IBRS</model>
    <vendor>Intel</vendor>
    <feature policy='require' name='vme'/>
    <feature policy='disable' name='ds'/>
    <feature policy='disable' name='acpi'/>
    <feature policy='require' name='ss'/>
    <feature policy='disable' name='ht'/>
    <feature policy='disable' name='tm'/>
    <feature policy='disable' name='pbe'/>
    <feature policy='disable' name='dtes64'/>
    <feature policy='disable' name='ds_cpl'/>
    <feature policy='disable' name='vmx'/>
    <feature policy='disable' name='smx'/>
    <feature policy='disable' name='est'/>
    <feature policy='disable' name='tm2'/>
    <feature policy='disable' name='xtpr'/>
    <feature policy='disable' name='pdcm'/>
    <feature policy='disable' name='dca'/>
    <feature policy='disable' name='osxsave'/>
    <feature policy='require' name='f16c'/>
    <feature policy='require' name='rdrand'/>
    <feature policy='disable' name='arat'/>
    <feature policy='disable' name='tsc_adjust'/>
    <feature policy='require' name='stibp'/>
    <feature policy='require' name='ssbd'/>
    <feature policy='require' name='xsaveopt'/>
    <feature policy='require' name='pdpe1gb'/>
    <feature policy='require' name='abm'/>
    <feature policy='disable' name='hle'/>
    <feature policy='disable' name='rtm'/>
    <feature policy='require' name='hypervisor'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/kvm_images/centos76TtyS0.qcow2'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/kvm_images/storage-100g-centos7694.qcow2'/>
      <backingStore/>
      <target dev='vdb' bus='virtio'/>
      <alias name='virtio-disk1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <alias name='ide0-1-1'/>
      <address type='drive' controller='0' bus='1' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='piix3-uhci'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:40:6a:a4'/>
      <source network='br0' bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/1'/>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <input type='mouse' bus='ps2'>
      <alias name='input0'/>
    </input>
    <input type='tablet' bus='usb'>
      <alias name='input1'/>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='keyboard' bus='ps2'>
      <alias name='input2'/>
    </input>
    <graphics type='vnc' port='5900' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+107:+107</label>
    <imagelabel>+107:+107</imagelabel>
  </seclabel>
</domain>

xml-DDD

[root@kvm-10-191-21-95 qemu]# cat centos7695-d.xml
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit centos7695-d
or other application using the libvirt API.
-->

<domain type='kvm'>
  <name>centos7695-d</name>
  <uuid>8f263238-470b-9f47-f6f4-1b8801eb0f14</uuid>
  <description>None</description>
  <memory unit='KiB'>8388608</memory>
  <currentMemory unit='KiB'>8388608</currentMemory>
  <vcpu placement='static'>8</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.0.0'>hvm</type>
    <boot dev='hd'/>
    <boot dev='cdrom'/>
    <bootmenu enable='yes'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='custom' match='exact' check='full'>
    <model fallback='forbid'>Haswell-IBRS</model>
    <vendor>Intel</vendor>
    <feature policy='require' name='vme'/>
    <feature policy='disable' name='ds'/>
    <feature policy='disable' name='acpi'/>
    <feature policy='require' name='ss'/>
    <feature policy='disable' name='ht'/>
    <feature policy='disable' name='tm'/>
    <feature policy='disable' name='pbe'/>
    <feature policy='disable' name='dtes64'/>
    <feature policy='disable' name='ds_cpl'/>
    <feature policy='disable' name='vmx'/>
    <feature policy='disable' name='smx'/>
    <feature policy='disable' name='est'/>
    <feature policy='disable' name='tm2'/>
    <feature policy='disable' name='xtpr'/>
    <feature policy='disable' name='pdcm'/>
    <feature policy='disable' name='dca'/>
    <feature policy='disable' name='osxsave'/>
    <feature policy='require' name='f16c'/>
    <feature policy='require' name='rdrand'/>
    <feature policy='disable' name='arat'/>
    <feature policy='disable' name='tsc_adjust'/>
    <feature policy='require' name='stibp'/>
    <feature policy='require' name='ssbd'/>
    <feature policy='require' name='xsaveopt'/>
    <feature policy='require' name='pdpe1gb'/>
    <feature policy='require' name='abm'/>
    <feature policy='disable' name='hle'/>
    <feature policy='disable' name='rtm'/>
    <feature policy='require' name='hypervisor'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/kvm_images/centos76TtyS0-95.qcow2'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/kvm_images/storage-100g-centos7695.qcow2'/>
      <target dev='vdb' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='piix3-uhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:40:6a:a3'/>
      <source bridge='br0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
      </target>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <input type='tablet' bus='usb'>
      <address type='usb' bus='0' port='1'/>
    </input>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='dac' relabel='yes'/>
</domain>
[root@kvm-10-191-21-95 qemu]# 
#mac地址生成 最高位的第二位奇数组播网卡不行,偶数为单播网卡
openssl rand -hex 6 | sed -E "s/(..)/\1:/g; s/:$//"
#生成mac地址
cat /proc/sys/kernel/random/uuid

安装命令

图形安装

758  virt-install --virt-type=kvm  --os-variant=centos7.0  --name=centos76Sys100G  --memory=8192  --vcpus=4  --disk path=/kvm_sys/centos76Sys100G.qcow2,format=qcow2,size=100,bus=virtio --cdrom=/kvm_sys/CentOS-7-x86_64-Everything-1810.iso  --network bridge=br0,model=virtio  --graphics vnc,listen=0.0.0.0,port=5996,password=1qaz#EDC,keymap='en-us'  --noautoconsole
  761  virt-install --os-type=linux --virt-type=kvm  --os-variant=rhel7  --name=centos76Sys100G  --memory=8192  --vcpus=4  --disk path=/kvm_sys/centos76Sys100G.qcow2,format=qcow2,size=50,bus=virtio --cdrom=/kvm_sys/CentOS-7-x86_64-Everything-1810.iso  --network bridge=br0,model=virtio  --graphics vnc,listen=0.0.0.0,port=5999,password=1qaz#EDC,keymap='en-us'  --noautoconsole
  762  virt-install --os-type=linux --virt-type=kvm  --os-variant=rhel7.6  --name=centos76Sys100G  --memory=8192  --vcpus=4  --disk path=/kvm_sys/centos76Sys100G.qcow2,format=qcow2,size=50,bus=virtio --cdrom=/kvm_sys/CentOS-7-x86_64-Everything-1810.iso  --network bridge=br0,model=virtio  --graphics vnc,listen=0.0.0.0,port=5999,password=1qaz#EDC,keymap='en-us'  --noautoconsole
  764  virt-install --os-type=linux --virt-type=kvm  --os-variant=rhel7.6  --name=centos76Sys100G  --memory=8192  --vcpus=4  --disk path=/kvm_sys/centos76Sys100G.qcow2,format=qcow2,size=50,bus=virtio --cdrom=/kvm_sys/CentOS-7-x86_64-Everything-1810.iso  --network bridge=br0,model=virtio  --graphics vnc,listen=0.0.0.0,port=5999,password=1qaz#EDC,keymap='en-us'  --noautoconsole
  765  virt-install --os-type=linux --virt-type=kvm  --os-variant=centos7 --name=centos76Sys100G  --memory=8192  --vcpus=4  --disk path=/kvm_sys/centos76Sys100G.qcow2,format=qcow2,size=50,bus=virtio --cdrom=/kvm_sys/CentOS-7-x86_64-Everything-1810.iso  --network bridge=br0,model=virtio  --graphics vnc,listen=0.0.0.0,port=5999,password=1qaz#EDC,keymap='en-us'  --noautoconsole
  768  virt-install --os-type=linux --virt-type=kvm --os-variant=rhel7.6 --name=centos76Sys100G --memory=8192 --vcpus=4 --disk path=/kvm_sys/centos76Sys100G.qcow2,format=qcow2,size=50,bus=virtio --cdrom=/kvm_sys/CentOS-7-x86_64-Everything-1810.iso --network bridge=br0,model=virtio --graphics vnc,listen=0.0.0.0,port=5996,password=1qaz#EDC,keymap='en-us' --noautoconsole
  775  virt-install --os-type=linux --virt-type=kvm --os-variant=rhel7.6 --name=centos76Sys100G --memory=8192 --vcpus=8 --disk path=/kvm_sys/centos76Sys100G.qcow2,format=qcow2,size=110,bus=virtio --cdrom=/kvm_sys/CentOS-7-x86_64-Everything-1810.iso --network bridge=br0,model=virtio --graphics vnc,listen=0.0.0.0,port=5996,password=1qaz#EDC,keymap='en-us' --noautoconsole
  805  virt-install --os-type=linux --virt-type=kvm --os-variant=rhel7.6 --name=centos76Sys200Gtxt --memory=8192 --vcpus=8 --disk path=/kvm_sys/centos76Sys200Gtxt.qcow2,format=qcow2,size=200,bus=virtio --cdrom=/kvm_sys/CentOS-7-x86_64-Everything-1810.iso --network bridge=br0,model=virtio --graphics none --extra-args='console=ttyS0' --force
  805  virt-install --os-type=linux --virt-type=kvm --os-variant=rhel7.6 --name=centos76Systxt --memory=8192 --vcpus=8 --disk path=/kvm_sys/centos76Systxt.qcow2,format=qcow2,size=50,bus=virtio --cdrom=/kvm_sys/CentOS-7-x86_64-Everything-1810.iso --network bridge=br0,model=virtio --graphics none --console=pty,target_type=serial --extra-args="console=ttyS0"
  805  virt-install --os-type=linux --virt-type=kvm --os-variant=rhel7.6 --name=centos76Systxt --memory=8192 --vcpus=8 --disk path=/kvm_sys/centos76Systxt.qcow2,format=qcow2,size=50,bus=virtio --cdrom=/kvm_sys/CentOS-7-x86_64-Everything-1810.iso --network bridge=br0,model=virtio --graphics none --console=pty,target_type=serial --extra-args="console=tty0 console=ttyS0"

  805  virt-install --os-type=linux --virt-type=kvm --os-variant=rhel7.6 --name=centos76Systxt --memory=8192 --vcpus=8 --disk path=/kvm_sys/centos76Systxt.qcow2,format=qcow2,size=50,bus=virtio --location=/kvm_sys/CentOS-7-x86_64-Everything-1810.iso --network bridge=br0,model=virtio --nographics --extra-args='console=tty0 console=ttyS0,115200n8 serial'

  805  virt-install --os-type=linux --virt-type=kvm --os-variant=rhel7.6 --name=centos76Systxt --memory=8192 --vcpus=8 --disk path=/kvm_sys/centos76Systxt.qcow2,format=qcow2,size=50,bus=virtio --location=/kvm_sys/CentOS-7-x86_64-Everything-1810.iso --network bridge=br0,model=virtio --graphics=none --console=pty,target_type=serial --extra-args="console=tty0 console=ttyS0"

  805  virt-install --os-type=linux --virt-type=kvm --os-variant=rhel7.6 --name=centos76Systxt --memory=8192 --vcpus=8 --disk path=/kvm_sys/centos76Systxt.qcow2,format=qcow2,size=50,bus=virtio --location=/kvm_sys/CentOS-7-x86_64-Everything-1810.iso --network bridge=br0,model=virtio --nographics --extra-args='console=tty0 console=ttyS0,115200n8 serial'

virt-install --name=centos \
--memory=8196 --vcpus=2 \
--location=/var/lib/libvirt/images/CentOS-7-x86_64-Minimal-1511.iso \
--disk /var/lib/libvirt/images/centos7.qcow2,device=disk,bus=virtio,size=8 \
--network bridge:br0 \
--os-type=linux  \
--nographics \
--extra-args='console=tty0 console=ttyS0,115200n8 serial'

virt-install \
  --name=centos1 \
  --memory=1024,maxmemory=8096 \
  --vcpus=4,maxvcpus=8 \
  --os-type=linux \
  --os-variant=rhel7 \
  --location=/kvm_sys/CentOS-7-x86_64-Everything-1810.iso \
  --disk path=/kvm_sys/centos76Systxt.qcow2,format=qcow2,size=50,bus=virtio \
  --bridge=br0 \
  --graphics=none \
  --console=pty,target_type=serial  \
  --extra-args="console=tty0 console=ttyS0"

命令安装

命令行安装
virt-install --connect qemu:///system --vcpus 8 --memory 16416 --name BCLinuxEuler --location=/kvm_images/BCLinux-for-Euler-21.10-everything-x86_64.iso --disk path=/kvm_images/BCLinuxEuler200G.qcow2,format=qcow2,size=200,bus=virtio --network bridge=br0 --graphics none --extra-args='console=ttyS0' --force

#安装openeuler文本
virt-install --connect qemu:///system --vcpus 8 --memory 8192 --name openeuler2203LTSsp1 --location=/kvm_images/openEuler-22.03-LTS-SP1-everything-x86_64-dvd.iso --disk path=/kvm_images/openeuler2203LTSsp1.qcow2,format=qcow2,size=200,bus=virtio --network bridge=br0 --graphics none --extra-args='console=ttyS0' --force

#安装openeuler图形界面
virt-install --connect qemu:///system --vcpus 8 --memory 8192 --name openeuler2203LTSsp1 --location=/kvm_images/openEuler-22.03-LTS-SP1-everything-x86_64-dvd.iso --disk path=/kvm_images/openeuler2203LTSsp1.qcow2,format=qcow2,size=200,bus=virtio --network bridge=br0,model=virtio --graphics vnc,listen=0.0.0.0,port=5997 --noautoconsole


# https://docs.openeuler.org/zh/docs/20.03_LTS_SP3/docs/Virtualization/%E8%99%9A%E6%8B%9F%E6%9C%BA%E9%85%8D%E7%BD%AE.html
# https://www.openeuler.org/zh/blog/zhuhuankai1/2020-12-08-create-an-openEuler-image.html
# https://www.openeuler.org/zh/download/
# https://www.openeuler.org/zh/blog/traffic_millions/2020-03-27-qemu.html

安装命令

# 创建磁盘
qemu-img create -f qcow2 /kvm_images/centOS-8.5.qcow2 100G

# 查看版本
osinfo-query os

# 安装图形vnc验证
virt-install \
--os-type=linux \
--virt-type=kvm  \
--os-variant=rhel8.0  \
--name=centos85 \
--memory=8192  \
--vcpus=4  \
--disk path=/kvm_images/centOS-8.5.qcow2,format=qcow2,size=100,bus=virtio \
--cdrom=/kvm_images/CentOS-8.5.2111-x86_64-dvd1.iso  \
--network bridge=br0,model=virtio  \
--graphics vnc,listen=0.0.0.0,port=5997 \
--noautoconsole


# 安装文本安装
virt-install \
--name=centos85 \
--memory=1024,maxmemory=8096 \
--vcpus=4,maxvcpus=8 \
--os-type=linux \
--os-variant=rhel8.0 \
--location=/kvm_images/CentOS-8.5.2111-x86_64-dvd1.iso \
--disk path=/kvm_images/centOS-8.5.qcow2,format=qcow2,size=100,bus=virtio \
--bridge=br0 \
--graphics=none \
--console=pty,target_type=serial \
--extra-args="console=tty0 console=ttyS0"

ARM信创适配

[root@localhost ~]# dmidecode -t 1
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 3.3.0 present.
# SMBIOS implementations newer than version 3.2.0 are not
# fully supported by this version of dmidecode.

Handle 0x0001, DMI type 1, 27 bytes
System Information
        Manufacturer: Yunke China
        Product Name: KunTai R822
        Version: To be filled by O.E.M.
        Serial Number: KS002710O220000001
        UUID: a6483325-b04f-9294-ee11-99c226c7958a
        Wake-up Type: Power Switch
        SKU Number: To be filled by O.E.M.
        Family: To be filled by O.E.M.
[root@localhost ~]# dmidecode -t 4       
Handle 0x0037, DMI type 4, 48 bytes
Processor Information
        Socket Designation: CPU04
        Type: Central Processor
        Family: ARM
        Manufacturer: HiSilicon
        ID: 10 D0 1F 48 00 00 00 00
        Signature: Implementor 0x48, Variant 0x1, Architecture 15, Part 0xd01, Revision 0
        Version: HUAWEI Kunpeng 920 7265
        Voltage: 1.0 V
        External Clock: 100 MHz
        Max Speed: 3000 MHz
        Current Speed: 3000 MHz
        Status: Populated, Enabled
        Upgrade: Unknown
        L1 Cache Handle: 0x0034
        L2 Cache Handle: 0x0035
        L3 Cache Handle: 0x0036
        Serial Number: 0F220EE422A0F11F
        Asset Tag: To be filled by O.E.M.
        Part Number: To be filled by O.E.M.
        Core Count: 64
        Core Enabled: 64
        Thread Count: 64
        Characteristics:
                64-bit capable
                Multi-Core
                Execute Protection
                Enhanced Virtualization
                Power/Performance Control


#查看系统版本
cat /etc/kylin-release 
Kylin Linux Advanced Server release V10 (Lance)

cat /etc/.kyinfo 
[dist]
name=Kylin
milestone=Server-V10-SP3-General-Release-2303
arch=arm64
beta=False
time=2023-03-24 14:51:29
dist_id=Kylin-Server-V10-SP3-General-Release-2303-arm64-2023-03-24 14:51:29

[servicekey]
key=0239033

[os]
to=
term=2024-07-01
#查看是否支持虚拟化
dmesg |grep kvm
"VHE mode initialized successfully"
#关闭防火墙以及selinux
systemctl stop firewalld &&  systemctl disabled firewalld
 setenforce 0
vim  /etc/selinux/config
 SELINUX=disabled


# 网桥配置
#配置bond0
#nmcli  con  add  type bond  ifname bond0  con-name bond0 mode  balance-rr  miimon 100
#nmcli con add  type bond-slave ifname  端口名  master   bond0
#nmcli con  add type  bond-slave ifname 端口名   master bond0
#nmcli con up bond0
#nmcli con up 端口名
#nmcli con up 端口名
#创建br0
#nmcli  con add type bridge  ifname br0  con-name br0
#nmcli con add type bridge-slave  ifname bond0  master br0
#nmcli con mod br0 ipv4.addresses IP/掩码   ipv4.gateway 网关  ipv4.method manual
#nmcli con up br0
#nmcli con up bond0


nmcli connection  add type bond ifname bond0 con-name bond0 mode 802.3ad miimon 100
nmcli connection  add type bond-slave ifname enp193s0f0 master bond0
nmcli connection  add type bond-slave ifname enp2s0f0 master bond0
nmcli connection show
nmcli con up bond0
nmcli con up enp193s0f0
nmcli con up enp2s0f0

nmcli  con add type bridge  ifname br0  con-name br0
nmcli con add type bridge-slave  ifname bond0  master br0
nmcli con mod br0 ipv4.addresses 10.191.199.251/24   ipv4.gateway 10.191.199.254  ipv4.method manual
nmcli con up br0
nmcli con up bond0
nmcli connection show

systemctl status NetworkManager && systemctl start NetworkManager

[root@localhost network-scripts]# ip a
6: enp2s0f0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
    link/ether c0:50:64:89:01:50 brd ff:ff:ff:ff:
12: enp193s0f0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP group default qlen 1000
    link/ether c0:50:64:89:01:50 brd ff:ff:ff:ff:ff:ff
42: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether c0:50:64:89:01:50 brd ff:ff:ff:ff:ff:ff
    inet 10.191.199.251/24 brd 10.191.199.255 scope global noprefixroute br0
       valid_lft forever preferred_lft forever
    inet6 fe80::3af2:2bfa:30db:ddf7/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
45: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue master br0 state UP group default qlen 1000
    link/ether c0:50:64:89:01:50 brd ff:ff:ff:ff:ff:ff

[root@localhost network-scripts]# cat ifcfg-bond0
BONDING_OPTS="mode=balance-rr miimon=100"
TYPE=Bond
BONDING_MASTER=yes
NAME=bond0
UUID=200dccf3-8aac-48d9-a9ce-8f2e968ed5a3
DEVICE=bond0
ONBOOT=yes
BRIDGE=br0
[root@localhost network-scripts]# cat ifcfg-br0
STP=yes
BRIDGING_OPTS=priority=32768
TYPE=Bridge
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=br0
UUID=fe68650e-2931-445e-bfa8-269f5913d457
DEVICE=br0
ONBOOT=yes
IPADDR=10.191.199.251
PREFIX=24
GATEWAY=10.191.199.254
[root@localhost network-scripts]# cat ifcfg-bond-slave-enp193s0f0 
TYPE=Ethernet
NAME=bond-slave-enp193s0f0
UUID=7e63404c-5884-4247-a144-0fc53a110c5d
DEVICE=enp193s0f0
ONBOOT=yes
MASTER=bond0
SLAVE=yes
[root@localhost network-scripts]# cat ifcfg-bond-slave-enp2s0f0 
TYPE=Ethernet
NAME=bond-slave-enp2s0f0
UUID=71836964-7c30-4146-aeff-c3ae7ea11dc6
DEVICE=enp2s0f0
ONBOOT=yes
MASTER=bond0
SLAVE=yes
[root@localhost network-scripts]# cat ifcfg-bridge-slave-bond0 
TYPE=Ethernet
NAME=bridge-slave-bond0
UUID=0405f3c9-2c5c-4b70-b3ce-ad4bcb14aeb8
DEVICE=bond0
ONBOOT=yes
BRIDGE=br0
[root@localhost network-scripts]# cat ifcfg-enp193s0f0
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp193s0f0
UUID=9c79b2cb-d9f6-4d31-9773-2e74c955a4d3
DEVICE=enp193s0f0
ONBOOT=yes
[root@localhost network-scripts]# cat ifcfg-enp2s0f0
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp2s0f0
UUID=83d80da0-6df1-4ebf-8d7e-86a84fd9f544
DEVICE=enp2s0f0
ONBOOT=yes
[root@localhost network-scripts]# 


#安装kvm,qemu libvirt相关组件
yum install qemu-kvm qemu-img virt-manager libvirt libvirt-client virt-install virt-viewer bridge-utils -y
#更改root启动,否则请改用户及组qemu
vim /etc/libvirt/qemu.conf 
user = "root"
group = "root"
#设置libvirt自启动
systemctl start libvirtd && systemctl enable libvirtd && systemctl status libvirtd
virsh  version
#创建lv逻辑卷组
# 查看lv及磁盘信息
lsblk
pvs
vgs
lvs
#创建lvm磁盘
pvcreate /dev/sdb
vgcreate vgapp /dev/sdb
lvcreate -L 9000G -n lvapp vgapp
mkfs.xfs /dev/vgapp/lvapp
mkdir /app
blkid /dev/mapper/vgapp-lvapp 

vim /etc/fstab 
UUID=33fc969e-ba8a-4b93-a080-ab72d804ea41 /app  xfs     defaults        1 2
mount -a
lsblk
#配置webVirtManager
#arm宿主机生成公钥私钥
ssh-keygen
#arm宿主机配置ssh开启root登录
vim /etc/ssh/sshd_config 
PermitRootLogin yes

[root@localhost ~]# ls /root/.ssh/ -ltr
总用量 16
-rw-r--r-- 1 root root  580  3月 18 15:56 id_rsa.pub
-rw------- 1 root root 2610  3月 18 15:56 id_rsa
-rw------- 1 root root 2004  3月 19 10:15 authorized_keys
-rw-r--r-- 1 root root  175  3月 20 09:54 known_hosts
#arm宿主机增加webVirtManager所在服务器的公钥信息
vim /root/.ssh/autorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0z+olgH8qPEsDvIbGJD3n5xAa2NTp45qz/D9uOIppSDfFzV1KMlNlUEnVx0OHIPVhqrZv6f1F0jdFHEnGXYSSl8EgZFtnDU6JR92MZrxOd1qM/aGHKm7V+MLnPwGPQ3ffmibv7iX2JwkFW+PRDNxKx/g5aSYcOczThxDdOrn+JPzECcsIOWTW1rf30J7hofzLpAB3fFC4F2w26Sm/1yEw49mrhGf/WqGDuMjRp1NT+dKZam1QddrUkLG9+l149f/MjY5uLoYMK77NSNc4at8uH/8HMTvfckPvynFjaDL9sosicl0BmNGfHr4iF+anaemfVp6MZymdQb3RRyAZsDv3 root@lf319-m02-010
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDICIbXgiLKjkDTIDHquNdVEM35eeKOrQe1KbTa45D8jwqOQd+9OaaC2IljjnNcDdZD1ND6qQc8Z/AvmBjZnZnLn48bv2trhTlqtYQyNPverOoVlu14pQndEHvIUU3viW5BGZv/XdUPPBLLJxUzJbqB7BDRyUjrc4lHaiwIv4tcjH2AJrq6kxsSnnWlDtMOkRX3tNqrJ9U06tQHQzZChXT00VVqqaUL9b6gFF5PDIK/uP2Dp9OHKzX0dpFssuVXIVB3VIUazU/CRVsQcSdw13R90M2vpQRsPsAf38c39Vhfbmu3xnLT5BE5lS70HP3lwkiKYWjRgG3DwgUE/2f4cC71 nginx@host-10-126-138-149
#arm宿主机更改权限
chmod  600 /root/.ssh/authorized_keys 

#arm宿主机创建磁盘
qemu-img create -f qcow2 /app/kvm_images/kylinv10sp3mini.qcow2 200G
#arm宿主机安装操作系统,镜像为arm版本
virt-install --os-type=linux --virt-type=kvm --os-variant=centos8 --hvm --name=kylinV10SP3arm --memory=8192 --vcpus=8 --disk path=/app/kvm_images/kylinv10sp3mini.,size=200,bus=virtio --cdrom=/app/kvm_images/Kylin-Server-V10-SP3-General-Release-2303-ARM64.iso --network bridge=br0,model=virtio --graphics vnc,listen=0.0.0.0,5997 --noautoconsole
# name 
#名称自定义   <name>kylinV10SP3arm</name>

#mac地址生成 最高位的第二位奇数组播网卡不行,偶数为单播网卡
openssl rand -hex 6 | sed -E "s/(..)/\1:/g; s/:$//"
      <mac address="52:54:00:eb:e9:ca" />

#uuid需更换
#生成UUID地址
cat /proc/sys/kernel/random/uuid

# vnc端口不能重复
grep "type='vnc" /etc/libvirt/qemu/*.xml
<graphics type="vnc" port="5997" autoport="no" listen="0.0.0.0">

#硬盘地址
<source file='/app/kvm_data/kylinv10sp3mini.qcow2'/>
#如需增加硬盘请开启
      <source file='/app/kvm_data/storage-kylinv10sp3mini.qcow2'/>
[root@localhost ~]# cat /etc/libvirt/qemu/kylinV10SP3arm.xml_TMP 
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit kylinV10SP3arm
or other application using the libvirt API.
-->
<domain type="kvm">
  <name>kylinV10SP3arm</name>
  <uuid>21fb5b62-e83c-401c-9861-5ad86bd51a3c</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://centos.org/centos/8" />
    </libosinfo:libosinfo>
  </metadata>
  <memory unit="KiB">8388608</memory>
  <currentMemory unit="KiB">8388608</currentMemory>
  <vcpu placement="static">8</vcpu>
  <os>
    <type arch="aarch64" machine="virt-4.1">hvm</type>
    <loader readonly="yes" type="pflash">/usr/share/edk2/aarch64/QEMU_EFI-pflash.raw</loader>
    <nvram>/var/lib/libvirt/qemu/nvram/kylinV10SP3arm_VARS.fd</nvram>
    <boot dev="hd" />
  </os>
  <features>
    <acpi />
    <gic version="3" />
  </features>
  <cpu mode="host-passthrough" check="none" />
  <clock offset="utc" />
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2" />
      <source file="/app/kvm_images/kylinv10sp3mini.qcow2" />
      <target dev="vda" bus="virtio" />
      <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0" />
    </disk>
    <!--
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/app/kvm_data/storage-kylinv10sp3mini.qcow2'/>
      <target dev='vdb' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
    </disk>
-->
    <disk type="file" device="cdrom">
      <driver name="qemu" type="raw" />
      <target dev="sda" bus="scsi" />
      <readonly />
      <address type="drive" controller="0" bus="0" target="0" unit="0" />
    </disk>
    <controller type="usb" index="0" model="qemu-xhci" ports="15">
      <address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0" />
    </controller>
    <controller type="scsi" index="0" model="virtio-scsi">
      <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0" />
    </controller>
    <controller type="pci" index="0" model="pcie-root" />
    <controller type="virtio-serial" index="0">
      <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0" />
    </controller>
    <controller type="pci" index="1" model="pcie-root-port">
      <model name="pcie-root-port" />
      <target chassis="1" port="0x8" />
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0" multifunction="on" />
    </controller>
    <controller type="pci" index="2" model="pcie-root-port">
      <model name="pcie-root-port" />
      <target chassis="2" port="0x9" />
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x1" />
    </controller>
    <controller type="pci" index="3" model="pcie-root-port">
      <model name="pcie-root-port" />
      <target chassis="3" port="0xa" />
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x2" />
    </controller>
    <controller type="pci" index="4" model="pcie-root-port">
      <model name="pcie-root-port" />
      <target chassis="4" port="0xb" />
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x3" />
    </controller>
    <controller type="pci" index="5" model="pcie-root-port">
      <model name="pcie-root-port" />
      <target chassis="5" port="0xc" />
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x4" />
    </controller>
    <controller type="pci" index="6" model="pcie-root-port">
      <model name="pcie-root-port" />
      <target chassis="6" port="0xd" />
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x5" />
    </controller>
    <controller type="pci" index="7" model="pcie-root-port">
      <model name="pcie-root-port" />
      <target chassis="7" port="0xe" />
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x6" />
    </controller>
    <controller type="pci" index="8" model="pcie-root-port">
      <model name="pcie-root-port" />
      <target chassis="8" port="0xf" />
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x7" />
    </controller>
    <controller type="pci" index="9" model="pcie-root-port">
      <model name="pcie-root-port" />
      <target chassis="9" port="0x10" />
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0" />
    </controller>
    <interface type="bridge">
      <mac address="52:54:00:eb:e9:ca" />
      <source bridge="br0" />
      <model type="virtio" />
      <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0" />
    </interface>
    <serial type="pty">
      <target type="system-serial" port="0">
        <model name="pl011" />
      </target>
    </serial>
    <console type="pty">
      <target type="serial" port="0" />
    </console>
    <channel type="unix">
      <target type="virtio" name="org.qemu.guest_agent.0" />
      <address type="virtio-serial" controller="0" bus="0" port="1" />
    </channel>
    <input type="tablet" bus="usb">
      <address type="usb" bus="0" port="1" />
    </input>
    <input type="keyboard" bus="usb">
      <address type="usb" bus="0" port="2" />
    </input>
    <graphics type="vnc" port="5997" autoport="no" listen="0.0.0.0">
      <listen type="address" address="0.0.0.0" />
    </graphics>
    <video>
      <model type="virtio" heads="1" primary="yes" />
      <address type="pci" domain="0x0000" bus="0x08" slot="0x00" function="0x0" />
    </video>
    <memballoon model="virtio">
      <address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0" />
    </memballoon>
    <rng model="virtio">
      <backend model="random">/dev/urandom</backend>
      <address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0" />
    </rng>
  </devices>
</domain>