基本概念

Driver capabilities XML format

  1. virsh # capabilities
  2. <capabilities>
  3. <host>
  4. <cpu>
  5. <arch>i686</arch>
  6. <model>n270</model>
  7. <topology sockets='1' cores='2' threads='1'/>
  8. <feature name='lahf_lm'/>
  9. <feature name='lm'/>
  10. <feature name='xtpr'/>
  11. <feature name='cx16'/>
  12. <feature name='tm2'/>
  13. <feature name='est'/>
  14. <feature name='vmx'/>
  15. <feature name='ds_cpl'/>
  16. <feature name='pbe'/>
  17. <feature name='tm'/>
  18. <feature name='ht'/>
  19. <feature name='ss'/>
  20. <feature name='acpi'/>
  21. <feature name='ds'/>
  22. <feature name='pse36'/>
  23. </cpu>
  24. <migration_features>
  25. <live/>
  26. <uri_transports>
  27. <uri_transport>tcp</uri_transport>
  28. </uri_transports>
  29. </migration_features>
  30. <secmodel>
  31. <model>apparmor</model>
  32. <doi></doi>
  33. </secmodel>
  34. </host>
  35. <guest>
  36. <os_type>hvm</os_type>
  37. <arch name='i686'>
  38. <wordsize>32</wordsize>
  39. <emulator>/usr/bin/qemu</emulator>
  40. <machine>pc-0.12</machine>
  41. <machine canonical='pc-0.12'>pc</machine>
  42. <machine>pc-0.11</machine>
  43. <machine>pc-0.10</machine>
  44. <machine>isapc</machine>
  45. <domain type='qemu'>
  46. </domain>
  47. <domain type='kvm'>
  48. <emulator>/usr/bin/kvm</emulator>
  49. <machine>pc-0.12</machine>
  50. <machine canonical='pc-0.12'>pc</machine>
  51. <machine>pc-0.11</machine>
  52. <machine>pc-0.10</machine>
  53. <machine>isapc</machine>
  54. </domain>
  55. </arch>
  56. <features>
  57. <cpuselection/>
  58. <pae/>
  59. <nonpae/>
  60. <acpi default='on' toggle='yes'/>
  61. <apic default='on' toggle='no'/>
  62. </features>
  63. </guest>
  64. <guest>
  65. <os_type>hvm</os_type>
  66. <arch name='x86_64'>
  67. <wordsize>64</wordsize>
  68. <emulator>/usr/bin/qemu-system-x86_64</emulator>
  69. <machine>pc-0.12</machine>
  70. <machine canonical='pc-0.12'>pc</machine>
  71. <machine>pc-0.11</machine>
  72. <machine>pc-0.10</machine>
  73. <machine>isapc</machine>
  74. <domain type='qemu'>
  75. </domain>
  76. </arch>
  77. <features>
  78. <cpuselection/>
  79. <acpi default='on' toggle='yes'/>
  80. <apic default='on' toggle='no'/>
  81. </features>
  82. </guest>
  83. </capabilities>

存储管理

http://libvirt.org/formatstorage.html

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

虚拟网络

网络模式

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

参考文献

防火墙

guest os 的 vnc 配置

示例 1:

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

返回顶部
https://huangwei.me/wiki/tech_cloud_libvirt.html