1
0

correct virt customize command

use vars for vhd sizes
This commit is contained in:
michael 2022-10-30 21:51:27 +13:00
parent 595c2f177e
commit f648ce0448
2 changed files with 9 additions and 6 deletions

View File

@ -19,3 +19,6 @@ vm_gateway: "192.168.199.254"
vm_domain: "balsillie.net" vm_domain: "balsillie.net"
vm_machine_type: "pc-q35-7.1" vm_machine_type: "pc-q35-7.1"
vm_machine_arch: "x86_64" vm_machine_arch: "x86_64"
containers_vhd_size: "64G"
data_nvme_vhd_size: "64G"
data_hdd_vhd_size: "3T"

View File

@ -37,8 +37,8 @@
when: root_vhd_created is changed when: root_vhd_created is changed
ansible.builtin.shell: ansible.builtin.shell:
cmd: | cmd: |
virt-customize -a {{ root_vhd_pool_dir }}/{{ vm_name }}_vda.qcow2 \ virt-customize --format qcow2 \
--format qcow2 \ -a {{ root_vhd_pool_dir }}/{{ vm_name }}_vda.qcow2 \
--hostname {{ vm_name }}.{{ vm_domain }} \ --hostname {{ vm_name }}.{{ vm_domain }} \
--copy-in /tmp/eno1_{{ vm_name }}.network:/etc/systemd/network/10-eno1.network \ --copy-in /tmp/eno1_{{ vm_name }}.network:/etc/systemd/network/10-eno1.network \
--append-line "/etc/hosts:127.0.1.1 {{ vm_name }}.{{ vm_domain }} {{ vm_name }}" --append-line "/etc/hosts:127.0.1.1 {{ vm_name }}.{{ vm_domain }} {{ vm_name }}"
@ -55,19 +55,19 @@
- name: create container storage vhd - name: create container storage vhd
ansible.builtin.shell: ansible.builtin.shell:
cmd: | cmd: |
qemu-img create -f qcow2 {{ containers_vhd_pool_dir }}/{{ vm_name }}_vdb.qcow2 64G qemu-img create -f qcow2 {{ containers_vhd_pool_dir }}/{{ vm_name }}_vdb.qcow2 {{ containers_vhd_size }}
creates: "{{ containers_vhd_pool_dir }}/{{ vm_name }}_vdb.qcow2" creates: "{{ containers_vhd_pool_dir }}/{{ vm_name }}_vdb.qcow2"
- name: create nvme data storage vhd - name: create nvme data storage vhd
ansible.builtin.shell: ansible.builtin.shell:
cmd: | cmd: |
qemu-img create -f qcow2 {{ data_nvme_vhd_pool_dir }}/{{ vm_name }}_vdc.qcow2 64G qemu-img create -f qcow2 {{ data_nvme_vhd_pool_dir }}/{{ vm_name }}_vdc.qcow2 {{ data_nvme_vhd_size }}
creates: "{{ data_nvme_vhd_pool_dir }}/{{ vm_name }}_vdc.qcow2" creates: "{{ data_nvme_vhd_pool_dir }}/{{ vm_name }}_vdc.qcow2"
- name: create hdd data storage vhd - name: create hdd data storage vhd
ansible.builtin.shell: ansible.builtin.shell:
cmd: | cmd: |
qemu-img create -f qcow2 {{ data_hdd_vhd_pool_dir }}/{{ vm_name }}_vdd.qcow2 4T qemu-img create -f qcow2 {{ data_hdd_vhd_pool_dir }}/{{ vm_name }}_vdd.qcow2 {{ data_hdd_vhd_size }}
creates: "{{ data_hdd_vhd_pool_dir }}/{{ vm_name }}_vdd.qcow2" creates: "{{ data_hdd_vhd_pool_dir }}/{{ vm_name }}_vdd.qcow2"
- name: define vm - name: define vm