Skip to content

Commit

Permalink
Merge pull request #515 from nvgoldin/el6_dom_template
Browse files Browse the repository at this point in the history
Use a seperate template for el6
  • Loading branch information
ovirt-infra authored Apr 23, 2017
2 parents 2e33c9d + d522b59 commit dc307d0
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
49 changes: 49 additions & 0 deletions lago/providers/libvirt/templates/dom_template-el6.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<domain type='kvm'>
<name>@NAME@</name>
<memory unit='MiB'>@MEM_SIZE@</memory>
<iothreads>1</iothreads>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<bootmenu enable='no'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
<vmport state='off'/>
</features>
<devices>
<emulator>@QEMU_KVM@</emulator>
<memballoon model='none'/>
<controller type='usb' model='none'>
</controller>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='DISK_PATH'/>
<target dev='DISK_DEV' bus='virtio'/>
</disk>
<channel type='unix'>
<source mode='bind'/>
<target type='virtio' name='org.qemu.guest_agent.0'/>
</channel>
<serial type='pty'>
<target port='0'/>
</serial>
<rng model='virtio'>
<backend model='random'>/dev/random</backend>
<address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</rng>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<video>
<model type='cirrus' vram='16384' heads='1'/>
<alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
</devices>
<clock offset='utc'>
<timer name='kvmclock'>
</timer>
</clock>
</domain>
9 changes: 8 additions & 1 deletion lago/providers/libvirt/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,18 @@ def cpu_vendor(self):
"""
return self._cpu.vendor

def _load_domain_xml(self):
if self.vm.distro() == 'el6':
dom_raw_xml = libvirt_utils.get_template('dom_template-el6.xml')
else:
dom_raw_xml = libvirt_utils.get_template('dom_template.xml')
return dom_raw_xml

def _libvirt_name(self):
return self.vm.virt_env.prefixed_name(self.vm.name())

def _libvirt_xml(self):
dom_raw_xml = libvirt_utils.get_template('dom_template.xml')
dom_raw_xml = self._load_domain_xml()

qemu_kvm_path = self._caps.findtext(
"guest[os_type='hvm']/arch[@name='x86_64']/domain[@type='kvm']"
Expand Down

0 comments on commit dc307d0

Please sign in to comment.