Compare commits

..

2 commits

2 changed files with 12 additions and 5 deletions
host_vars
roles/bhyve-s6/templates/bhyve

View file

@ -84,11 +84,15 @@ bhyve_guests:
- DISKS
disks:
- name: system
virtio: true
virtio_slot: 8
properties:
volsize: 32g
volblocksize: 4k
primarycache: metadata
- name: data
virtio: true
virtio_slot: 9
properties:
volsize: 128g
volblocksize: 64k

View file

@ -29,7 +29,8 @@ foreground { fdmove -c 1 2 echo "bhyve-${NAME}: Starting VM ${NAME} with ${CPUS}
s6-notifyoncheck -d -w 100 -n 70
fdmove -c 2 1
bhyve -c "{{ item.0.cpus }}" -m "{{ item.0.ram }}" -w -A -P -H
{% macro bhyve_run(extra_args="") -%}
bhyve -c "${CPUS}" -m "${RAM}" -w -A -P -H
-s "0,amd_hostbridge"
-s "2:0,ahci${AHCI}"
-s "3,virtio-net,${NIC}"
@ -37,10 +38,12 @@ bhyve -c "{{ item.0.cpus }}" -m "{{ item.0.ram }}" -w -A -P -H
{% for disk in item.0.disks if disk.virtio|default(False) -%}
-s "{{ disk.virtio_slot }},virtio-blk,/dev/zvol/{{ bhyve_pool }}/bhyve/guests/{{ item.0.name }}/{{ disk.name }}"
{% endfor -%}
{% if item.0.password is defined -%}
-s "29,fbuf,tcp=[::1]:${PORT},w=800,h=600,password=${PASS}"
{% endif -%}
-s "31,lpc"
-l "com1,/dev/${COM}"
-l "bootrom,${ROM}"
"${NAME}"
{{ extra_args }} "${NAME}"
{%- endmacro %}
ifelse { test -n "$PASS" } {
{{ bhyve_run('-s "29,fbuf,tcp=[::1]:${PORT},w=800,h=600,password=${PASS}"') }}
}
{{ bhyve_run() }}