domain.xml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <domain type='kvm' id='8'>
  2. <name>{{ item }}</name>
  3. <memory unit='MiB'>{{ libvirt_instance_memory_mib }}</memory>
  4. <metadata xmlns:ansible="https://github.com/ansible/ansible">
  5. <ansible:tags>
  6. <ansible:tag>environment-{{ cluster_env }}</ansible:tag>
  7. <ansible:tag>clusterid-{{ cluster }}</ansible:tag>
  8. <ansible:tag>host-type-{{ type }}</ansible:tag>
  9. <ansible:tag>sub-host-type-{{ g_sub_host_type }}</ansible:tag>
  10. </ansible:tags>
  11. </metadata>
  12. <vcpu placement='static'>{{ libvirt_instance_vcpu }}</vcpu>
  13. <os>
  14. <type arch='x86_64' machine='pc'>hvm</type>
  15. <boot dev='hd'/>
  16. </os>
  17. <features>
  18. <acpi/>
  19. <apic/>
  20. <pae/>
  21. </features>
  22. <clock offset='utc'>
  23. <timer name='rtc' tickpolicy='catchup'/>
  24. <timer name='pit' tickpolicy='delay'/>
  25. <timer name='hpet' present='no'/>
  26. </clock>
  27. <on_poweroff>destroy</on_poweroff>
  28. <on_reboot>restart</on_reboot>
  29. <on_crash>restart</on_crash>
  30. <devices>
  31. <emulator>/usr/bin/qemu-system-x86_64</emulator>
  32. <disk type='file' device='disk'>
  33. <driver name='qemu' type='qcow2' discard='unmap'/>
  34. <source file='{{ libvirt_storage_pool_path }}/{{ item }}.qcow2'/>
  35. <target dev='sda' bus='scsi'/>
  36. </disk>
  37. <disk type='file' device='disk'>
  38. <driver name='qemu' type='qcow2' discard='unmap'/>
  39. <source file='{{ libvirt_storage_pool_path }}/{{ item }}-docker.qcow2'/>
  40. <target dev='sdb' bus='scsi'/>
  41. </disk>
  42. <disk type='file' device='cdrom'>
  43. <driver name='qemu' type='raw'/>
  44. <source file='{{ libvirt_storage_pool_path }}/{{ item }}_cloud-init.iso'/>
  45. <target dev='sdc' bus='scsi'/>
  46. <readonly/>
  47. </disk>
  48. <controller type='scsi' model='virtio-scsi' />
  49. <interface type='network'>
  50. <source network='{{ libvirt_network }}'/>
  51. <model type='virtio'/>
  52. </interface>
  53. <serial type='pty'>
  54. <target port='0'/>
  55. </serial>
  56. <console type='pty'>
  57. <target type='serial' port='0'/>
  58. </console>
  59. <memballoon model='virtio'>
  60. </memballoon>
  61. </devices>
  62. </domain>