1
0

refine disks

This commit is contained in:
michael 2022-10-30 02:39:44 +13:00
parent ba5672b72a
commit 03700ba0fb
2 changed files with 23 additions and 7 deletions

View File

@ -41,19 +41,25 @@
--password ladmin:password:{{ hostvars[vm_name]['ansible_become_pass'] }} \
--root-password password:{{ hostvars[vm_name]['ansible_root_pass'] }} \
--password-crypto sha512 \
--ssh-inject "ladmin:string:{{ }}"
--ssh-inject "ladmin:string:{{ hostvars[vm_name]['ssh_public_key_data'] }}"
- name: create container storage vhd
ansible.builtin.shell:
cmd: |
qemu-img create -f qcow2 {{ containers_vhd_pool_dir }}/{{ vm_name }}_vdb.qcow2 64G
creates: "{{ root_vhd_pool_dir }}/{{ vm_name }}_vdb.qcow2"
creates: "{{ containers_vhd_pool_dir }}/{{ vm_name }}_vdb.qcow2"
# - name: create data storage vhd
# ansible.builtin.shell:
# cmd: |
# qemu-img create -f qcow2 {{ data_vhd_pool_dir }}/{{ vm_name }}_vdc.qcow2 4T
# creates: "{{ data_vhd_pool_dir }}/{{ vm_name }}_vdc.qcow2"
- name: create nvme data storage vhd
ansible.builtin.shell:
cmd: |
qemu-img create -f qcow2 {{ data_nvme_vhd_pool_dir }}/{{ vm_name }}_vdc.qcow2 64G
creates: "{{ data_nvme_vhd_pool_dir }}/{{ vm_name }}_vdc.qcow2"
- name: create hdd data storage vhd
ansible.builtin.shell:
cmd: |
qemu-img create -f qcow2 {{ data_hdd_vhd_pool_dir }}/{{ vm_name }}_vdd.qcow2 4T
creates: "{{ data_hdd_vhd_pool_dir }}/{{ vm_name }}_vdd.qcow2"
- name: list vms
community.libvirt.virt:

View File

@ -51,6 +51,16 @@
<source file='{{ containers_vhd_pool_dir }}/{{ vm_name }}_vdb.qcow2'/>
<target dev='vdb' bus='virtio'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='{{ data_nvme_vhd_pool_dir }}/{{ vm_name }}_vdc.qcow2'/>
<target dev='vdc' bus='virtio'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='{{ data_hdd_vhd_pool_dir }}/{{ vm_name }}_vdd.qcow2'/>
<target dev='vdd' bus='virtio'/>
</disk>
<controller type='usb' index='0' model='qemu-xhci' ports='15'/>
<controller type='sata' index='0'/>
<controller type='virtio-serial' index='0'/>