Init scripts missing from context CDROM after VM conf update trough Sunstone

Hi

I am running a small OpenNebula 5.8.0 evaluation deployment and I ran into an issue with the INIT_SCRIPTS, which I am not even sure if it’s a bug or intended behaviour.

I created a very basic CentOS 7 template and uploaded a set_initial_root_password.sh script to the FILE_DS, then set this script to run in the INIT_SCRIPTS context section.

When I instantiate the template, the script is included in the context CDROM and it’s running fine. If I reboot or start/stop the VM, the script is again present in the context CDROM image.

However, after stopping the VM to update the configuration through Sunstone and change some random variable not related to INIT_SCRIPTS, then start the VM, I noticed that the set_initial_root_password.sh is no longer included in the context CDROM when mounting it inside the VM:

[root@sptest1 ~]# mount|grep /dev/sr0
/dev/sr0 on /mnt/alex type iso9660 (ro,relatime)
[root@sptest1 ~]# ll /mnt/alex/
total 4
-rw-r–r-- 1 9869 9869 3055 Apr 17 11:54 context.sh
-rw-r–r-- 1 9869 9869 25 Apr 17 11:54 token.txt

For the recod, the relevant section of the template I used to instantiate the VM is:

[oneadmin@one-cp 2]$ onetemplate show 13

TEMPLATE CONTENTS
CONTEXT=[

FILES_DS=“$FILE[IMAGE="set_initial_root_password.sh", IMAGE_UNAME="oneadmin"]”,
INIT_SCRIPTS=“set_initial_root_password.sh”,

TOKEN=“YES” ]

BEFORE making any updates to the VM configuration, the template still has the FILES_DS config:

FILES_DS = "/var/lib/one//datastores/2/07a35c1e61378da20d5c3d6d6921f032:‘set_initial_root_password.sh’ ",

AFTER updating the VM configuration from Sunstone, the FILES_DS variable is completely missing, although the UI doesn’t even show an option to modify FILES_DS.

[oneadmin@one-cp 2]$ onevm show 37

CONTEXT=[

IMAGE=“Context”,
INIT_SCRIPTS=“set_initial_root_password.sh”,

TOKEN=“YES”,
VMID=“37” ]

My question: Is this a bug or the intended behaviour is to remove any INIT_SCRIPTS on VM updateconf trough Sunstone?

This problem seem related with this issue: https://github.com/OpenNebula/one/issues/1375

It seems that files information it’s not loaded when the VM configuration is updated.