Persistent vs Non-Persistent Storage- here we go again...

Hi Folx,
Like others have said, this explanation is super-useful, but I’m still slightly a little confused:
[Question about non-persistent disk](https://answer from VURoland)
I think I need to think “out loud” about this. Based on VURoland’s answer, I think this is what is happening, but would love an OpenNebula person and/or anyone else who has a better understanding of this than I do to confirm or correct if it’s wrong:
Persistent storage:

  1. A persistent image has been created and appears in the Images tab in the OpenNebula GUI.
  2. When you use it to create a new VM, the persistent image stays as is.
  3. The new VM uses a snapshot of the persistent image, and that’s where any changes happen. 4. The original image does not change, only the snapshot does.
  4. When the VM is terminated hard, the snapshot disappears but the original image remains in its original state from before the VM was created.
  5. “Terminate” does not delete the snapshot, nor does rebooting. Only “Terminate hard” deletes the snapshot.
  6. Only one VM can be created from a persistent image because (??? only one snapshot can be created??? Some other reason???)

Non-persistent storage:

  1. A non-persistent image has been created and appears in the Images tab in the OpenNebula GUI.
  2. When you use it to create a new VM, the original non-persistent image stays as is.
  3. The new VM uses a clone of the non-persistent image, and that’s where any changes happen. 4. The original image does not change, only the cloned image does.
  4. When the VM is terminated hard, the cloned image disappears but the original image remains in its original state from before the VM was created.
  5. “Terminate” does not delete the cloned image, nor does rebooting. Only “Terminate hard” deletes the cloned image.
  6. Multiple VMs can be created from a non-persistent image because (??? you can clone from it as many times as you want???)

I think the challenge for me is the terminology. What makes the original image persistent or non-persistent? It seems that if you use either in order to create a VM, the original stays the same and the snapshot or the clone goes away when you terminate hard.

Hello,
I think there is confusion regarding the persistent image. It probably depends on the drivers used, but the root idea is that any changes made to the image must persist on VM termination (as its name suggests). Even if a snapshot/copy was used, on VM termination the image in the image datastore should be refreshed with the data from the time of the VM termination. In other words, the data in the persistent image persists over the VM lifecycle and with the non-persistent any changes made by the VM are lost on VM Termination.

Also, the difference between Terminate and Terminate-hard is mostly how gracefully the VM is terminated and how gracefully the errors raised by the underlying drivers are handled.

So if data is lost in a persistent image on VM Termination, it is an issue, not a feature…

I hope this helps.

Best Regards,
Anton Todorov