OpenNebula / one-apps

Toolchain to build OpenNebula appliances
Apache License 2.0
12 stars 10 forks source link

one-context execution in Guest OS might not happen with certain custom variables #14

Closed dann1 closed 5 months ago

dann1 commented 9 months ago

An image with a perfectly functional contextualization daemon inside (one-context) could be rendered unusable (no context setup) if certain custom CONTEXT variables are passed.

To reproduce

More information

When starting a VM with no variable set the context correctly executes and the VM is reachable via SSH

root@context-path-test:~# lsblk
NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sr0      11:0    1  364K  0 rom
vda     252:0    0   40G  0 disk
├─vda1  252:1    0 39.9G  0 part /
├─vda14 252:14   0    4M  0 part
└─vda15 252:15   0  106M  0 part /boot/efi
root@context-path-test:~# service one-context status
● one-context.service - OpenNebula contextualization
     Loaded: loaded (/lib/systemd/system/one-context.service; enabled; vendor preset: enabled)
     Active: active (exited) since Tue 2023-11-14 21:30:35 UTC; 1min 21s ago
    Process: 1299 ExecStart=/usr/sbin/one-contextd network (code=exited, status=0/SUCCESS)
   Main PID: 1299 (code=exited, status=0/SUCCESS)
        CPU: 22.610s

Nov 14 21:30:09 context-path-test one-contextd[1377]: Script net-15-hostname: Finished with exit code 0
Nov 14 21:30:09 context-path-test one-contextd[1379]: Script net-97-start-script: Starting ...
Nov 14 21:30:35 context-path-test one-contextd[6382]: Script net-98-execute-scripts: Finished with exit code 0
Nov 14 21:30:35 context-path-test one-contextd[6384]: Script net-99-report-ready: Starting ...
Nov 14 21:30:35 context-path-test one-contextd[6387]: Script net-99-report-ready: Finished with exit code 0
Nov 14 21:30:35 context-path-test one-contextd[6388]: Finished scripts processing
Nov 14 21:30:35 context-path-test one-contextd[6389]: Done
Nov 14 21:30:35 context-path-test one-contextd[6390]: Unmounting /var/run/one-context/mount.bfUlBR
Nov 14 21:30:35 context-path-test one-contextd[6394]: Releasing lock /var/run/one-context/one-context.lock
Nov 14 21:30:35 context-path-test systemd[1]: Finished OpenNebula contextualization.

However, when a onevm updateconf is issued and such variable is added then the VM OS gets stuck during the mount process

root@context-path-test:~# lsblk
NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sr0      11:0    1  364K  0 rom  /run/one-context/mount.fwVao8
vda     252:0    0   40G  0 disk
├─vda1  252:1    0 39.9G  0 part /
├─vda14 252:14   0    4M  0 part
└─vda15 252:15   0  106M  0 part /boot/efi
root@context-path-test:~# service one-context status
● one-context.service - OpenNebula contextualization
     Loaded: loaded (/lib/systemd/system/one-context.service; enabled; vendor preset: enabled)
     Active: active (exited) since Tue 2023-11-14 21:30:35 UTC; 4min 41s ago
    Process: 1299 ExecStart=/usr/sbin/one-contextd network (code=exited, status=0/SUCCESS)
   Main PID: 1299 (code=exited, status=0/SUCCESS)
        CPU: 22.610s

Nov 14 21:30:09 context-path-test one-contextd[1377]: Script net-15-hostname: Finished with exit code 0
Nov 14 21:30:09 context-path-test one-contextd[1379]: Script net-97-start-script: Starting ...
Nov 14 21:30:35 context-path-test one-contextd[6382]: Script net-98-execute-scripts: Finished with exit code 0
Nov 14 21:30:35 context-path-test one-contextd[6384]: Script net-99-report-ready: Starting ...
Nov 14 21:30:35 context-path-test one-contextd[6387]: Script net-99-report-ready: Finished with exit code 0
Nov 14 21:30:35 context-path-test one-contextd[6388]: Finished scripts processing
Nov 14 21:30:35 context-path-test one-contextd[6389]: Done
Nov 14 21:30:35 context-path-test one-contextd[6390]: Unmounting /var/run/one-context/mount.bfUlBR
Nov 14 21:30:35 context-path-test one-contextd[6394]: Releasing lock /var/run/one-context/one-context.lock
Nov 14 21:30:35 context-path-test systemd[1]: Finished OpenNebula contextualization.

and the context service actually doesn't execute at all.