How to prevent undeploy action from copying the image back to front-end?


I am using SSH datastores and I am running in to a problem when virtual machines are being undeployed. Undeploy action copies the VM image back to front-end, which fills up the disk space. I would like for the images to remain on the compute nodes when they are undeployed.

Is there something that I could do about this? We are using the undeploy action to limit the lifespan of the virtual machine (30 days -> undeploy -> 15 days -> remove) and essentially providing a way to recover for 15 days between undeploy and terminate actions in case the machine is still needed.

Thank you!

Hi jofors!,
the undeploy action for a VM should keep VMs on the system datastores, they should not be transfered to the image datastore. The images for undeployed VMs should be located under /var/lib/one/datastores/datastore_id in your compute nodes.

As documented here when the VM is undeployed: “The VM is shut down. The VM disks are transfered to the system datastore. The VM can be resumed later.” and as the CLI says:

onevm undeploy
Command undeploy requires one parameter to run
undeploy <range|vmid_list>
Shuts down the given VM. The VM is saved in the system Datastore.

So if the expected behavior is not happening, what OpenNebula version are you running, could you run a onedatastore list?



I am running version 5.2. The data is moved (or attempted) to /var/lib/one/datastores/119 on the front-end which matches the system datastore ID.

Here is output of onedatastore list

[oneadmin@opennebula ~]$ onedatastore list
2 files 174.9G 98% 0 12 fil fs ssh on
110 3PAR_one_syst 1023.9G 21% 0 0 sys - shared on
111 3PAR_one_imag 999.7G 46% 0 27 img fs shared on
114 NIMBLE_one_sy 3T 27% 0 0 sys - shared on
119 SSD_one_local - - 0 0 sys - ssh on
120 3PAR_one_imag 999.7G 46% 0 0 img fs ssh on

The best option is just to “Power Off” the VM which the image will remain in the node.