Tidying image datastore

Hi all

We have a project where we are migrating a bunch services running on existing VMs into OpenNebula. We created the initial setup of OpenNebula and the image datastore assuming clean builds would be the norm i.e. we created images for the various OS versions of interest alongside a few variants to speed service deployments (Postgres/PHP/Apache preinstalled etc.).

Unfortunately someone involved in the migration project misunderstood the clean build approach and copied the existing VMs, importing them as images before deploying them. As a result the images datastore is nearly full, with many images that are service specific and used only by one VM. Is there any way to remove those images while leaving the VM deployed?

Related (in my journey to a better understanding of OpenNebula): is the clean build the normal way people would deploy or is it common to end up with an image per deployed VM? If the latter we might have to figure out a way to add way more storage to our front end deployment…

Hi Chris,

If the images are non-persistent, each VM already runs on its own cloned disk in the system datastore. In that case, the original image is no longer required and can be safely removed without impacting the running VM.

However, if the images are persistent, they are directly used by the VM and must not be removed.

Regarding deployment practices, the recommended approach in OpenNebula is to use a small number of reusable “golden images” and rely on contextualization (e.g. cloud-init) for VM customization. Having one image per VM is not typical and can lead to inefficient storage usage, as observed in your environment.