Moving images between datastores (local vs shared)

Hi,
is it possible to move VM images between various datastores? I am running shared gluster datastore for VM images and I want to add new local datastore (local raid1 FS storage) per each node in Opennebula cluster.

Will there be any problem to migrate (not live but offline) existing VM images from shared gluster datastore to local datastores per each node? Is this supported?

Is it possible to migrate (not live but offline) VM image from local datastore on one node of cluster to another local datastore on i.e. second node of cluster?

BR!

http://docs.opennebula.io/5.12/operation/vm_management/vm_instances.html#life-cycle-operations-for-administrators

The migrate operation (not live) should support migrating across system datastore of the same type. However in your case they are not as one is shared (glusterfs) and the other is ssh (new local raid FS). However I think we can trick OpenNebula drivers in this case as both are file based an no conversions are needed. (at the end it will call mv command from one directory (gluster) to another (local raid)).

Didn’t try this myself but is should work I think:

  • Define the new local system datastore in opennebla. Use TM_MAD=shared
  • Mount the local FS in the right path in the hypervisor (/var/lib/one/datastores/<id_new_system_ds>)
  • migrate the VM with the datastore option to the new one
  • Verify the VM directory is created in the right place.
  • Change TM_MAD to ssh in the new datastore
  • Update the TM_MAD attribute of the vms to ssh for the relevant disks using onedb update-body vm --id <id_of_migrated_vm>

Note that this procedure is not supported by defualt as in general we’ll need file conversions. We may think in the feature to pair compatible datastores like ssh and shared or qcow2 so we support this natively.

Good luck

1 Like