crc-org / osp4

Proof of Concept repository of CodeReady Containers [Archived]
Apache License 2.0
26 stars 16 forks source link

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

Open bbrowning opened 5 years ago

bbrowning commented 5 years ago

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 commented 5 years ago

Right, this part is variable... but since this is a POC we hadn't come around to perform a full flow from generation of the images to generation of scripts using a template. However, this might even change in the near future.

On Fri, Jan 18, 2019 at 10:16 PM Ben Browning notifications@github.com wrote:

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.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/praveenkumar/osp4/issues/19, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAHZqx-ln123d0W1iEoDaEUD7KPME9Qks5vEdc2gaJpZM4aH_Ag .

--

Gerard Braad | http://gbraad.nl [ Doing Open Source Matters ]

pilhuhn commented 5 years ago

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 commented 5 years ago

This is a known issue and due to thre respin of a new version. This will be resolved (currently still PoC)

On Tue, Feb 12, 2019 at 4:13 PM Heiko W. Rupp notifications@github.com wrote:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/code-ready/osp4/issues/19#issuecomment-462659860, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAHZuQFqbQjf1eLGXYB1UacKslpUjE9ks5vMne7gaJpZM4aH_Ag .

--

Gerard Braad | http://gbraad.nl [ Doing Open Source Matters ]

pilhuhn commented 5 years ago

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 commented 5 years ago

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