Browse Source

Allow extra storage parameters to be configured

Sebastian Lohff 8 months ago
parent
commit
9de6b97f80
3 changed files with 3 additions and 1 deletions
  1. 1
    0
      defaults/main.yml
  2. 1
    0
      tasks/install-vm.yml
  3. 1
    1
      templates/xen-vm.cfg.j2

+ 1
- 0
defaults/main.yml View File

@@ -1,5 +1,6 @@
1 1
 ---
2 2
 xen_vm_creator_install_genconfdrv: true
3
+xen_vm_creator_extra_storage_args:
3 4
 
4 5
 # vm parameters
5 6
 xen_vm_creator_vm_defaults:

+ 1
- 0
tasks/install-vm.yml View File

@@ -65,6 +65,7 @@
65 65
   vars:
66 66
     iso_path: "{{ xen_vm_creator_iso_dir }}/{{ vm.hostname}}.iso"
67 67
     storage_path: "phy:/dev/{{ xen_vm_creator_lvm_vg_name }}/{{ vm.hostname }}-disk"
68
+    extra_storage_args: "{{ xen_vm_creator_extra_storage_args|default }}"
68 69
 
69 70
 # provision storage
70 71
 # --> lvm: create lv (lvol size/vg/lv)

+ 1
- 1
templates/xen-vm.cfg.j2 View File

@@ -7,7 +7,7 @@ maxmem                = '{{ vm.maxmem }}'
7 7
 vcpus                 = {{ vm.vcpus }}
8 8
 maxvcpus              = {{ vm.max_vcpus }}
9 9
 disk                  = [
10
-                        '{{ storage_path }},xvda,w',
10
+                        '{{ storage_path }},xvda,w{% if extra_storage_args|default %},{{ extra_storage_args }}{% endif %}',
11 11
                         'file:{{ iso_path }},xvdb:cdrom,r', # --> {{ xen_vm_creator_iso_file_marker }}
12 12
 ]
13 13
 vif                 = [

Loading…
Cancel
Save