#!/bin/bash virsh destroy okd-bootstrap virsh undefine okd-bootstrap virsh destroy okd-cp1 virsh undefine okd-cp1 virsh destroy okd-cp2 virsh undefine okd-cp2 virsh destroy okd-cp3 virsh undefine okd-cp3 rm -rf /var/lib/libvirt/images/*.ign ######################################################################## # 1. Nettoyage et Copie de l'image wipefs -a /dev/disk/by-path/ip-172.16.100.14:3260-iscsi-iqn.2005-10.org.freenas.ctl:vms-storage-lun-35 qemu-img convert -O raw /mnt/images/linux/fcos.qcow2 /dev/disk/by-path/ip-172.16.100.14:3260-iscsi-iqn.2005-10.org.freenas.ctl:vms-storage-lun-35 # 3. Préparation Ignition cp bootstrap.ign /var/lib/libvirt/images/bootstrap.ign chmod 777 /var/lib/libvirt/images/bootstrap.ign IGNITION_DEVICE_ARG="--qemu-commandline=-fw_cfg name=opt/com.coreos/config,file=/var/lib/libvirt/images/bootstrap.ign" # 4. Installation virt-install \ --name okd-bootstrap \ --memory 16384 --vcpus 4 --cpu host-passthrough \ --machine q35 --os-variant=fedora-coreos-stable \ --disk path=/dev/disk/by-path/ip-172.16.100.14:3260-iscsi-iqn.2005-10.org.freenas.ctl:vms-storage-lun-35 \ --network network=vlan219,model=virtio,mac=52:54:00:aa:bb:07 \ --graphics none \ --import \ --noautoconsole \ "${IGNITION_DEVICE_ARG}" ######################################################################## # 1. Nettoyage et Copie de l'image wipefs -a /dev/disk/by-path/ip-172.16.100.14:3260-iscsi-iqn.2005-10.org.freenas.ctl:vms-storage-lun-36 qemu-img convert -O raw /mnt/images/linux/fcos.qcow2 /dev/disk/by-path/ip-172.16.100.14:3260-iscsi-iqn.2005-10.org.freenas.ctl:vms-storage-lun-36 # 3. Préparation Ignition cp master.ign /var/lib/libvirt/images/master.ign chmod 777 /var/lib/libvirt/images/master.ign IGNITION_DEVICE_ARG="--qemu-commandline=-fw_cfg name=opt/com.coreos/config,file=/var/lib/libvirt/images/master.ign" # 4. Installation virt-install \ --name okd-cp1 \ --memory 16384 --vcpus 4 --cpu host-passthrough \ --machine q35 --os-variant=fedora-coreos-stable \ --disk path=/dev/disk/by-path/ip-172.16.100.14:3260-iscsi-iqn.2005-10.org.freenas.ctl:vms-storage-lun-36 \ --network network=vlan219,model=virtio,mac=52:54:00:aa:bb:01 \ --graphics none \ --import \ --noautoconsole \ "${IGNITION_DEVICE_ARG}" ######################################################################## # 1. Nettoyage et Copie de l'image wipefs -a /dev/disk/by-path/ip-172.16.100.14:3260-iscsi-iqn.2005-10.org.freenas.ctl:vms-storage-lun-37 qemu-img convert -O raw /mnt/images/linux/fcos.qcow2 /dev/disk/by-path/ip-172.16.100.14:3260-iscsi-iqn.2005-10.org.freenas.ctl:vms-storage-lun-37 # 3. Préparation Ignition cp master.ign /var/lib/libvirt/images/master.ign chmod 777 /var/lib/libvirt/images/master.ign IGNITION_DEVICE_ARG="--qemu-commandline=-fw_cfg name=opt/com.coreos/config,file=/var/lib/libvirt/images/master.ign" # 4. Installation virt-install \ --name okd-cp2 \ --memory 16384 --vcpus 4 --cpu host-passthrough \ --machine q35 --os-variant=fedora-coreos-stable \ --disk path=/dev/disk/by-path/ip-172.16.100.14:3260-iscsi-iqn.2005-10.org.freenas.ctl:vms-storage-lun-37 \ --network network=vlan219,model=virtio,mac=52:54:00:aa:bb:02 \ --graphics none \ --import \ --noautoconsole \ "${IGNITION_DEVICE_ARG}" ######################################################################## # 1. Nettoyage et Copie de l'image wipefs -a /dev/disk/by-path/ip-172.16.100.14:3260-iscsi-iqn.2005-10.org.freenas.ctl:vms-storage-lun-38 qemu-img convert -O raw /mnt/images/linux/fcos.qcow2 /dev/disk/by-path/ip-172.16.100.14:3260-iscsi-iqn.2005-10.org.freenas.ctl:vms-storage-lun-38 # 3. Préparation Ignition cp master.ign /var/lib/libvirt/images/master.ign chmod 777 /var/lib/libvirt/images/master.ign IGNITION_DEVICE_ARG="--qemu-commandline=-fw_cfg name=opt/com.coreos/config,file=/var/lib/libvirt/images/master.ign" # 4. Installation virt-install \ --name okd-cp3 \ --memory 16384 --vcpus 4 --cpu host-passthrough \ --machine q35 --os-variant=fedora-coreos-stable \ --disk path=/dev/disk/by-path/ip-172.16.100.14:3260-iscsi-iqn.2005-10.org.freenas.ctl:vms-storage-lun-38 \ --network network=vlan219,model=virtio,mac=52:54:00:aa:bb:03 \ --graphics none \ --import \ --noautoconsole \ "${IGNITION_DEVICE_ARG}" ########################################################################