Allow to enable VNC for provisioned VMspull/74/merge
@@ -464,8 +464,9 @@ Control VM provisioning: | |||
mycluster: | |||
domain: neco.virt.domain.com | |||
engine: virt | |||
#Option to set rng globaly | |||
# Cluster global settings | |||
rng: false | |||
enable_vnc: True | |||
cloud_init: | |||
user_data: | |||
disable_ec2_metadata: true | |||
@@ -490,7 +491,8 @@ Control VM provisioning: | |||
image: ubuntu.qcow | |||
size: medium | |||
img_dest: /var/lib/libvirt/ssdimages | |||
#Rng defined on node will have higher priority then global one | |||
# Node settings override cluster global ones | |||
enable_vnc: False | |||
rng: | |||
backend: /dev/urandom | |||
model: random |
@@ -236,6 +236,9 @@ def _gen_xml(name, | |||
else: | |||
context['boot_dev'] = ['hd'] | |||
if 'enable_vnc' in kwargs: | |||
context['enable_vnc'] = kwargs['enable_vnc'] | |||
log.info('VNC enabled: {0}.'.format(kwargs['enable_vnc'])) | |||
if 'serial_type' in kwargs: | |||
context['serial_type'] = kwargs['serial_type'] | |||
if 'serial_type' in context and context['serial_type'] == 'tcp': |
@@ -33,6 +33,13 @@ salt_libvirt_service: | |||
{%- set rng = cluster.rng %} | |||
{%- endif %} | |||
{%- if cluster.enable_vnc is defined and cluster.enable_vnc %} | |||
{%- set enable_vnc = True %} | |||
{%- else %} | |||
{%- set enable_vnc = False %} | |||
{%- endif %} | |||
{%- for node_name, node in cluster.node.iteritems() %} | |||
{%- if node.name is defined %} | |||
@@ -80,6 +87,11 @@ salt_control_virt_{{ cluster_name }}_{{ node_name }}: | |||
seed: True | |||
serial_type: pty | |||
console: True | |||
{%- if node.enable_vnc is defined %} | |||
enable_vnc: {{ node.enable_vnc }} | |||
{%- else %} | |||
enable_vnc: {{ enable_vnc }} | |||
{%- endif %} | |||
{%- if node.img_dest is defined %} | |||
img_dest: {{ node.img_dest }} | |||
{%- endif %} |