the owner of snapshot image from shelved instance should be the same as the instance's.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
In Progress
|
Undecided
|
Dehui Peng |
Bug Description
Description
=============
the owner of snapshot image from shelved instance should be the same as the instance's.
Steps to reproduce
=======
1. assume we have the following:
1) admin user and admin project
2) demo user and demo project
2. login as demo user
1) create an instance (let's call it demo-instance)
2) logout
3. login as admin user
1) go to "Admin->Instance"
2) shelve "demo-instance"
3) go to "Admin->Images"
4) demo-instance's snapshot is now owned by admin project
5) logout
4. login as demo user again.
1) go to "Images"
2) won't see any snapshot for demo-instance.
3) go to "Instances"
4) try to unshelve demo-instance
Expected result
=================
the demo-instance shelved by admin user should be able to be unshelved by demo user.
Actual result
=================
Error.
Environment
=================
liberty
Changed in nova: | |
status: | New → In Progress |
description: | updated |
Changed in nova: | |
assignee: | nobody → Dehui Peng (depeng) |
status: | New → In Progress |
Here is a fix working for me:
diff --git a/nova/ compute/ api.py b/nova/ compute/ api.py compute/ api.py compute/ api.py
image_ meta = self._create_ image(context, instance, name,
'snapshot' )
image_ id = image_meta['id'] project_ id: api.update( context, image_id, {'owner': str(instance. project_ id)})
self. compute_ rpcapi. shelve_ instance( context, instance=instance,
image_id= image_id, clean_shutdown= clean_shutdown)
index f76af12..e9cb10b 100644
--- a/nova/
+++ b/nova/
@@ -3157,6 +3157,8 @@ class API(base.Base):
+ if context.project_id != instance.
+ self.image_
else: