#!/bin/bash

set -x

# Purpose: Attach ten SCSI disks 

# Variable to increment the disk number
j=1

# Create 10 raw disk images
function create_scsi_disk() {
    for i in `seq 1 10`; 
        do 
            qemu-img create -f raw $i.raw 1G; 
        done
}


function attach_disk(){
    for i in {b..k} ; do
        j=$(expr $j + 1)
        sudo virsh attach-disk cvm1 /export/vmimages/$j.raw sd$i --config;
    done
}

create_scsi_disk
attach_disk

