How to update a VM template image

Solution Verified in:

  • OpenNebula: 6.8

Issue

It's recommended to keep VM images which users' VM instantiated from up to date. There are two possible ways to do that in case of non-persistent images: either keep the same VM template (Solution 1) or create a new one (Solution 2).

Solution 1: Updating VM template image keeping the same VM template

That solution is valid only if there are no VMs using the image, i.e. the image status is "READY".

Step 1: Check image ID which VM template based on and what needs to be updated.

For that purpose one needs to open FireEdge Sunstone menu and go to "Templates" -> "VM templates" as shown on the picture below (Alpine Linux 3.17 template downloaded from the OpenNebula Marketplace is used in that article as an example):

Screenshot_20240129_150057_vm_template.png

Click on required template within the list:

Screenshot_20240129_150535_select_vm_template.png

Press "Template" tab:

Screenshot_20240129_155916_VM_template_Template_tab._image_ID.png

and scroll down to the DISK attribute and noticed IMAGE_ID value (it's "0" in our example).

 

Step 2. Make image persistent

Go to "Storage" -> "Images"

Screenshot_20240129_155001_Storage_Images.png

and click on the image with corresponding ID (it's "0" in our example):

Screenshot_20240129_161118_Storage_Images_Image_ID.png

Scroll down the page and check the image persistence in the "Info" tab:

Screenshot_20240129_161719_Storage_Image_persistency_highlighted.png

To make image persistent one needs to click on the blue button with 3 vertical dots and select "Persistent" item in the drop-down menu:

Screenshot_20240129_162235_make_image_persistent_highlighted.png

Press "Accept" button on popped up message asking for your confirmation if you want proceed.

 

Step 3. Instantiate new VM

Now one needs to instantiate new VM from the corresponding VM template as shown on the picture below:

Screenshot_20240129_163958_VM_Template_instantiate.png

Set values for instantiating VM according to your needs and press "Next" button:

Screenshot_20240129_164335_VM_instantiate_menu_highlighted.png

As soon as you are done with VM settings press "Finish" button:

Screenshot_20240129_164847_VM_instantiate_menu_finish_highlighted.png

After that you will be redirected to VMs menu automatically.

 

Step 4. Make required changes on VM disk and save them

As soon as VM booted one needs to log into it and perform required step on VM OS image (e.g. update installed packages).

To save changes made on persistent VM disk it's enough to shutdown the VM gracefully:

Screenshot_20240129_170219_VM_terminate_highlighted.png

Press "Accept" button on popped up message asking for your confirmation if you want proceed.

Wait till the VM reaches the status "DONE" and the image the status "READY".

 

Step 5. Make the image non-persistent

Go to "Storage" -> "Images" menu as during Step 2, select corresponding image just updated and click on "Non persistent" item in the drop-down menu:

Screenshot_20240129_171832_make_image_non-persistent_highlighted.png

Press "Accept" button on popped up message asking for your confirmation if you want proceed.

Now the VM template is based on updated image and can be used by users.


Solution 2: Updating VM template image by creating the new VM template and image

That solution applies for scenario when one needs to update the VM template image which is already in use, i.e. the image has status "USED".

Step 1: Create new VM template and corresponding image from the VM template whose image needs to be updated

For that purpose one needs to open FireEdge Sunstone menu and go to "Templates" -> "VM templates" as shown on the picture below (Alpine Linux 3.17 template downloaded from the OpenNebula Marketplace is used in that article as an example):

Screenshot_20240129_150057_vm_template.png

Click on required template within the list:

Screenshot_20240129_150535_select_vm_template.png

Instantiate new VM from the corresponding VM template as shown on the picture below:

Screenshot_20240129_163958_VM_Template_instantiate.png

Set values for instantiating VM according to your needs, switch on "Instantiate as persistent" option and press "Next" button:

Screenshot_20240129_164335_VM_instantiate_menu_instantiate-as-persistent_highlighted.png

As soon as you are done with VM settings press "Finish" button:

Screenshot_20240129_164847_VM_instantiate_menu_finish_highlighted.png

After that you will be redirected to VMs menu automatically.

 

Step 2. Make required changes on VM disk and save them

As soon as VM booted one needs to log into it and perform required step on VM OS image (e.g. update installed packages).

To save changes made on persistent VM disk it's enough to shutdown the VM gracefully:

Screenshot_20240129_170219_VM_terminate_highlighted.png

Press "Accept" button on popped up message asking for your confirmation if you want proceed.

Wait till the VM reaches the status "DONE" and the image the status "READY".

 

Step 3. Make the image non-persistent

Go to "Storage" -> "Images" menu as during Step 2, select corresponding image just updated and click on "Non persistent" item in the drop-down menu:

Screenshot_20240129_171832_make_image_non-persistent_highlighted.png

Press "Accept" button on popped up message asking for your confirmation if you want proceed.

One can go to "Templates" -> "VM Templates" menu and check if the new VM template was created.

Now users should use new VM template with updated OS image.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.