Skip to content
This repository was archived by the owner on Apr 25, 2019. It is now read-only.

Worker volume name hardcoded and may be wrong in crc_libvirt.sh #19

Open
bbrowning opened this issue Jan 18, 2019 · 5 comments
Open

Worker volume name hardcoded and may be wrong in crc_libvirt.sh #19

bbrowning opened this issue Jan 18, 2019 · 5 comments

Comments

@bbrowning
Copy link

On line 116 and the 2nd argument on line 118 of https://github.com/praveenkumar/osp4/blob/6f7d3ea9bf2ac194aceac4b3ae1be81d509c6615/libvirt/crc_libvirt.sh#L116 you see the actual on-disk filename of the worker volume is hardcoded. However, when building, the last part of that worker volume name can vary.

I hit this when trying to run this script from a tgz release linked to me via email. Inside that tgz the worker volume file name did not match the hardcoded value here and I had to manually update those lines to get crc_libvirt.sh create to succeed.

@gbraad
Copy link
Collaborator

gbraad commented Jan 18, 2019 via email

@pilhuhn
Copy link

pilhuhn commented Feb 12, 2019

An other issue is in lines 118 and later down where file operations expect the worker-0-98nsr names, but in reality (in my download) the worker file is `test1-worker-0-vqgct

@gbraad
Copy link
Collaborator

gbraad commented Feb 12, 2019 via email

@pilhuhn
Copy link

pilhuhn commented Feb 12, 2019

The following fixes it for me (if anyone runs into the same issue)

$ diff -u crc_libvirt.sh,1 crc_libvirt.sh
--- crc_libvirt.sh,1    2019-01-17 08:05:23.000000000 +0100
+++ crc_libvirt.sh      2019-02-12 10:24:29.103982240 +0100
@@ -113,9 +113,11 @@
     sudo virsh vol-create-as default test1-master-0 $size --format qcow2
     sudo virsh vol-upload --pool default test1-master-0 test1-master-0

-    size=$(stat -Lc%s test1-worker-0-98nsr)
+    get_worker_image_name
+
+    size=$(stat -Lc%s $WORKERFILE)
     sudo virsh vol-create-as default test1-worker-0-98nsr $size --format qcow2
-    sudo virsh vol-upload --pool default test1-worker-0-98nsr test1-worker-0-98nsr
+    sudo virsh vol-upload --pool default test1-worker-0-98nsr $WORKERFILE

     cat << EOF > ./master-0.xml
 <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
@@ -296,6 +298,17 @@
     sudo virsh net-undefine test1
 }

+get_worker_image_name()
+{
+    for i in test1-worker-0*
+    do
+        file -b $i  | grep -q 'QEMU QCOW'
+        if [ $? -eq 0 ]
+        then
+            WORKERFILE=$i
+        fi
+    done
+}

 usage()
 {

@pilhuhn
Copy link

pilhuhn commented Feb 12, 2019

Also grepping for dnsmasq setup in NetworkManager may check that it is not listed as disabled

     # Set up NetworkManager DNS overlay
-    grep -q 'dns=dnsmasq' /etc/NetworkManager/NetworkManager.conf
+    grep -q '^dns=dnsmasq' /etc/NetworkManager/NetworkManager.conf

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants