projects
/
noc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
documented best way to virtualize OpenWRT
[noc.git]
/
ansible
/
roles
/
vm
/
install
/
templates
/
libvirt-domain.xml.j2
diff --git
a/ansible/roles/vm/install/templates/libvirt-domain.xml.j2
b/ansible/roles/vm/install/templates/libvirt-domain.xml.j2
index
9364a7d
..
c39b904
100644
(file)
--- a/
ansible/roles/vm/install/templates/libvirt-domain.xml.j2
+++ b/
ansible/roles/vm/install/templates/libvirt-domain.xml.j2
@@
-7,8
+7,8
@@
<type arch='x86_64' machine='pc-0.12'>hvm</type>
{% if run_installer %}
<kernel>{{ vm_host.installer.path }}/{{ vmdistro }}-{{ vmdistcodename }}/{{ hostvars[vmname].vm_install_cooked.arch | default('amd64') }}/linux</kernel>
<type arch='x86_64' machine='pc-0.12'>hvm</type>
{% if run_installer %}
<kernel>{{ vm_host.installer.path }}/{{ vmdistro }}-{{ vmdistcodename }}/{{ hostvars[vmname].vm_install_cooked.arch | default('amd64') }}/linux</kernel>
- <initrd>{{ vm_host.installer.path }}/{{ vmdistro }}-{{ vmdistcodename }}/{{ hostvars[vmname].vm_install_cooked.arch | default('amd64') }}/initrd.gz</initrd>
- <cmdline>console=ttyS0,115200n8 auto=true interface=auto url=tftp://{{ hostvars[inventory_hostname]['ansible_' + (vm_host.installer.net_if | replace('-', '_'))].ipv4.address }}/vm-{{ vmname }}-{{ vmdistro }}-{{ vmdistcodename }}.cfg netcfg/choose_interface=enp1s1 netcfg/disable_autoconfig=true netcfg/get_ipaddress={{ hostvars[vmname].vm_network_cooked.primary.ip }} netcfg/get_netmask={{ hostvars[vmname].vm_network_cooked.primary.mask }} netcfg/get_gateway={{ hostvars[vmname].vm_network_cooked.primary.gateway }} netcfg/get_nameservers="{{ hostvars[vmname].vm_network_cooked.primary.nameservers | join(' ') }}" netcfg/confirm_static=true netcfg/get_hostname={{ vmname }} netcfg/get_domain={{ hostvars[vmname].vm_network_cooked.primary.domain }}</cmdline>
+ <initrd>{{ vm_host.installer.preseed_path }}/vm-{{ vmname }}-{{ vmdistro }}-{{ vmdistcodename }}.initrd.gz</initrd>
+ <cmdline>console=ttyS0,115200n8</cmdline>
{% endif %}
<boot dev='hd'/>
</os>
{% endif %}
<boot dev='hd'/>
</os>
@@
-28,6
+28,12
@@
{% endif %}
<devices>
<emulator>/usr/bin/kvm</emulator>
{% endif %}
<devices>
<emulator>/usr/bin/kvm</emulator>
+ <!-- Provide a virtualized RNG to the guest -->
+ <rng model='virtio'>
+ <!-- Allow consuming up to 10kb/s, measured over 2s -->
+ <rate period="2000" bytes="20480"/>
+ <backend model='random'>/dev/urandom</backend>
+ </rng>
{% if 'virtio' in hostvars[vmname].vm_install_cooked.disks %}
{% for device, lv in hostvars[vmname].vm_install_cooked.disks.virtio.items() %}
{% if 'virtio' in hostvars[vmname].vm_install_cooked.disks %}
{% for device, lv in hostvars[vmname].vm_install_cooked.disks.virtio.items() %}
@@
-55,7
+61,7
@@
<interface type='bridge'>
<source bridge='{{ if.bridge }}'/>
<model type='virtio'/>
<interface type='bridge'>
<source bridge='{{ if.bridge }}'/>
<model type='virtio'/>
- <address type='pci' domain='0x0000' bus='0x01' slot='0x0{{ if.idx }}' function='0x0'/>
+ <address type='pci' domain='0x0000' bus='0x01' slot='0x0{{ loop.index }}' function='0x0'/>
</interface>
{% endfor %}
{% endif %}
</interface>
{% endfor %}
{% endif %}