vanecka commented on PR #14581:
URL: https://github.com/apache/cloudstack/pull/14581#issuecomment-6763570427

   Good morning, @DaanHoogland,
   
   After reviewing your proposed code changes (apologies; I have some coding 
experience but am not a coder by trade), I noticed a potential issue. I have 
made the following observations:
   
   ### Observation 1
   
   1. When a VM is created and owned by a user.
   2. An **_Instance Snapshot_** is made.
   3. The user can view, revert and manage the snapshot.
   4. The ownership is changed to a project.
   5. The user’s Snapshot is still present, but the user (correctly?) remains 
its owner.
   6. Another snapshot is taken, and the project becomes its owner… however, 
the second (project) instance snapshot is not displayed in the normal view
   7. The snapshot is correctly visible in the Compute -> Instance Snapshots 
view when the view Project toggle is enabled.
   
   Suggestion: The above scenario does not lead to too many functional issues, 
and perhaps adding the tests you ran to include, e.g., `project.id ? project : 
{}`, could be an "easy/quick" fix to display the normal Instance Snapshots view 
as well.
   
   However, the following is a more "drastic" potential issue that is 
present/introduced.
   
   ### Observation 2:
   A user-owned VM with a **_Volume snapshot_** exists.
   When attempting to change the owner to a project, the process fails because 
a user-owned volume snapshot exists.
   When deleting the snapshot(s), the ownership can be changed.
   
   Suggestion: Consider changing the volumes and their snapshots’ ownership 
before changing the instance’s ownership. However, I am not sure if it would be 
possible without a chase condition. Also, I am not sure if this (changing all 
the ownerships of the VM and its related objects) is the expected behaviour. 
Should snapshot ownership ever be transferred between users and projects? If 
not, then this "bug" will persist.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to