first attempt to get virsh xml generation working for beaker clients
This commit is contained in:
parent
943e991c71
commit
d163c5d787
4 changed files with 99 additions and 0 deletions
|
@ -3,3 +3,13 @@ freezes: false
|
|||
fas_client_groups: sysadmin-qa,sysadmin-main
|
||||
sudoers: "{{ private }}/files/sudo/qavirt-sudoers"
|
||||
|
||||
volgroup: vmstore
|
||||
|
||||
clients:
|
||||
virt01:
|
||||
hostname: virt01.qa.fedoraproject.org
|
||||
macaddress: "52:54:00:a2:de:30"
|
||||
virt02:
|
||||
hostname: virt02.qa.fedoraproject.org
|
||||
macaddress: "52:54:00:fe:22:ff"
|
||||
|
||||
|
|
2
roles/beaker/virthost/defaults/main.yml
Normal file
2
roles/beaker/virthost/defaults/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
bridge_name: br0
|
|
@ -17,3 +17,8 @@
|
|||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: generate libvirt xml files for clients
|
||||
template: src=client-libvirt.xml.j2 dest=/root/{{ item }}.libvirt.xml
|
||||
with_items:
|
||||
- "virt02"
|
||||
- "virt03"
|
||||
|
|
82
roles/beaker/virthost/templates/client-libvirt.xml.j2
Normal file
82
roles/beaker/virthost/templates/client-libvirt.xml.j2
Normal file
|
@ -0,0 +1,82 @@
|
|||
<domain type='kvm'>
|
||||
<name>{{ clients[item]['hostname'] }}</name>
|
||||
<memory unit='KiB'>{{ mem_size_kb }}</memory>
|
||||
<vcpu placement='static'>{{ num_cpus }}</vcpu>
|
||||
<os>
|
||||
<type arch='x86_64' machine='pc-i440fx-1.6'>hvm</type>
|
||||
<bootmenu enable='yes'/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<pae/>
|
||||
</features>
|
||||
<cpu mode='custom' match='exact'>
|
||||
<model fallback='allow'>Nehalem</model>
|
||||
</cpu>
|
||||
<clock offset='utc'>
|
||||
<timer name='rtc' tickpolicy='catchup'/>
|
||||
<timer name='pit' tickpolicy='delay'/>
|
||||
<timer name='hpet' present='no'/>
|
||||
</clock>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>restart</on_crash>
|
||||
<pm>
|
||||
<suspend-to-mem enabled='no'/>
|
||||
<suspend-to-disk enabled='no'/>
|
||||
</pm>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu-kvm</emulator>
|
||||
<disk type='block' device='disk'>
|
||||
<driver name='qemu' type='raw' cache='none' io='native'/>
|
||||
<source dev='/dev/{{ volgroup }}/{{ clients[hostname]['hostname'] }}'/>
|
||||
<target dev='vda' bus='virtio'/>
|
||||
<boot order='2'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
|
||||
</disk>
|
||||
<controller type='usb' index='0' model='ich9-ehci1'>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
|
||||
</controller>
|
||||
<controller type='usb' index='0' model='ich9-uhci1'>
|
||||
<master startport='0'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
|
||||
</controller>
|
||||
<controller type='usb' index='0' model='ich9-uhci2'>
|
||||
<master startport='2'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
|
||||
</controller>
|
||||
<controller type='usb' index='0' model='ich9-uhci3'>
|
||||
<master startport='4'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
|
||||
</controller>
|
||||
<controller type='pci' index='0' model='pci-root'/>
|
||||
<controller type='virtio-serial' index='0'>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
|
||||
</controller>
|
||||
<interface type='bridge'>
|
||||
<mac address='{{ clients[item]['macaddress'] }}'/>
|
||||
<source bridge='{{ bridge_name }}'/>
|
||||
<model type='virtio'/>
|
||||
<boot order='1'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
||||
</interface>
|
||||
<serial type='pty'>
|
||||
<target port='0'/>
|
||||
</serial>
|
||||
<console type='pty'>
|
||||
<target type='serial' port='0'/>
|
||||
</console>
|
||||
<input type='tablet' bus='usb'/>
|
||||
<input type='mouse' bus='ps2'/>
|
||||
<graphics type='vnc' port='-1' autoport='yes'/>
|
||||
<video>
|
||||
<model type='vga' vram='9216' heads='1'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
||||
</video>
|
||||
<memballoon model='virtio'>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
|
||||
</memballoon>
|
||||
</devices>
|
||||
</domain>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue