基本概念

Driver capabilities XML format

virsh # capabilities
<capabilities>

  <host>
    <cpu>
      <arch>i686</arch>
      <model>n270</model>
      <topology sockets='1' cores='2' threads='1'/>
      <feature name='lahf_lm'/>
      <feature name='lm'/>
      <feature name='xtpr'/>
      <feature name='cx16'/>
      <feature name='tm2'/>
      <feature name='est'/>
      <feature name='vmx'/>
      <feature name='ds_cpl'/>
      <feature name='pbe'/>
      <feature name='tm'/>
      <feature name='ht'/>
      <feature name='ss'/>
      <feature name='acpi'/>
      <feature name='ds'/>
      <feature name='pse36'/>
    </cpu>
    <migration_features>
      <live/>
      <uri_transports>
        <uri_transport>tcp</uri_transport>
      </uri_transports>
    </migration_features>
    <secmodel>
      <model>apparmor</model>
      <doi></doi>
    </secmodel>
  </host>

  <guest>
    <os_type>hvm</os_type>
    <arch name='i686'>
      <wordsize>32</wordsize>
      <emulator>/usr/bin/qemu</emulator>
      <machine>pc-0.12</machine>
      <machine canonical='pc-0.12'>pc</machine>
      <machine>pc-0.11</machine>
      <machine>pc-0.10</machine>
      <machine>isapc</machine>
      <domain type='qemu'>
      </domain>
      <domain type='kvm'>
        <emulator>/usr/bin/kvm</emulator>
        <machine>pc-0.12</machine>
        <machine canonical='pc-0.12'>pc</machine>
        <machine>pc-0.11</machine>
        <machine>pc-0.10</machine>
        <machine>isapc</machine>
      </domain>
    </arch>
    <features>
      <cpuselection/>
      <pae/>
      <nonpae/>
      <acpi default='on' toggle='yes'/>
      <apic default='on' toggle='no'/>
    </features>
  </guest>

  <guest>
    <os_type>hvm</os_type>
    <arch name='x86_64'>
      <wordsize>64</wordsize>
      <emulator>/usr/bin/qemu-system-x86_64</emulator>
      <machine>pc-0.12</machine>
      <machine canonical='pc-0.12'>pc</machine>
      <machine>pc-0.11</machine>
      <machine>pc-0.10</machine>
      <machine>isapc</machine>
      <domain type='qemu'>
      </domain>
    </arch>
    <features>
      <cpuselection/>
      <acpi default='on' toggle='yes'/>
      <apic default='on' toggle='no'/>
    </features>
  </guest>

</capabilities>

存储管理

http://libvirt.org/formatstorage.html

  • pool: 存储介质池,可选的type值包括:dir, fs, netfs, disk, iscsi, logical
    <pool type="iscsi">
            <name>virtimages</name>
            <uuid>3e3fce45-4f53-4fa7-bb32-11f34168b82b</uuid>
            <allocation>10000000</allocation>
            <capacity>50000000</capacity>
            <available>40000000</available>
            ...
    
  • volume: 文件或硬件设备提供的存储介质。
    <volume>
            <name>sparse.img</name>
            <key>/var/lib/xen/images/sparse.img</key>
            <allocation>0</allocation>
            <capacity unit="T">1</capacity>
            ...
    

虚拟网络

网络模式

  • NAT模式
  • 路由模式
  • 隔离模式
  • 支持IPv6网络的隔离模式
  • 使用物理主机的桥接网卡
  • 使用macvtap的直连模式

参考文献

防火墙

guest os的vnc配置

示例1:

<graphics type='vnc' port='-1' autoport='yes' listen='10.6.9.142' passwd='your_password_here' sharePolicy='allow-exclusive'>
    <listen type='address' address='10.6.9.142'/>
</graphics>

返回顶部