Thanks for the activity on this Matt. I don't think there's an obvious solution with only upsides for this problem.
Changing the image ref to the original image has its upsides. It's end-user friendly, since their instance behaves like it was "shelved", not like it was snapshotted, killed and respawned. E.g. rebuild and rescues of instances work better when it has the original image in the image_ref.
Not deleting the snapshot and having the image_ref as the snapshot might also have other negative side effects like possibly aggressively growing the glance image repo for a tenant. Then some cleanup logic would have to be added, which adds complexity and doesn't sound pretty.
If this only affects the qcow2 storage case (I'm not familiar with all storage backend options), a good compromise could be to
1) If the original image exists in glance, do a qemu-img rebase to that image. Then the VM is in the state we want.
2) If the original image can't be found, update the image-ref to the snapshot, and don't delete the snapshot.
But just my 2c from the admin side :). I'm not familiar enough with the nova codebase to know the feasibility of this.
Thanks for the activity on this Matt. I don't think there's an obvious solution with only upsides for this problem.
Changing the image ref to the original image has its upsides. It's end-user friendly, since their instance behaves like it was "shelved", not like it was snapshotted, killed and respawned. E.g. rebuild and rescues of instances work better when it has the original image in the image_ref.
Not deleting the snapshot and having the image_ref as the snapshot might also have other negative side effects like possibly aggressively growing the glance image repo for a tenant. Then some cleanup logic would have to be added, which adds complexity and doesn't sound pretty.
If this only affects the qcow2 storage case (I'm not familiar with all storage backend options), a good compromise could be to
1) If the original image exists in glance, do a qemu-img rebase to that image. Then the VM is in the state we want.
2) If the original image can't be found, update the image-ref to the snapshot, and don't delete the snapshot.
But just my 2c from the admin side :). I'm not familiar enough with the nova codebase to know the feasibility of this.