diff --git a/lib/vm-core b/lib/vm-core index 47e0a1e..a8a9c74 100644 --- a/lib/vm-core +++ b/lib/vm-core @@ -313,9 +313,18 @@ core::write_img(){ shift $? _disk_dev="${1}" _img="$2" + timeout=30 + i=0 # wait a few seconds for newly created zvol device to appear - sleep 2 + while [ $i -lt $timeout ]; do + if [ ! -r "${_disk_dev}" ]; then + sleep 1 + i=$(($i+1)) + else + break + fi + done # just run start with an iso datastore::img_find "_imgpath" "${_img}" || util::err "unable to locate img file - '${_img}'"