Skip to content

Commit 6fbe498

Browse files
rajathereMridula Joshi
authored andcommitted
Do not set_acls if store is not associated to glance node
In case of glance multiple stores (mostly for ceph) nova initiates copy-image functionality if image, from which the sever is being created, is not present in the referring ceph store. This can fail if image location which is already present in image but not available for that glance edge node. This scenario can only be reproducible with EDGE deployment. In order to fix this, if the store is defined on that glance node then only call set_acls method, else ignore it. Closes-Bug: #2073945 Change-Id: I0409982ae27b662e60dd2363ba2f7863d0722fea (cherry picked from commit ee7e96f) (cherry picked from commit aec654f) (cherry picked from commit 9e28810)
1 parent edd75b7 commit 6fbe498

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

glance/location.py

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,19 @@ def _set_acls(self, image):
6363
member_ids = [m.member_id for m in member_repo.list()]
6464
for location in image.locations:
6565
if CONF.enabled_backends:
66+
# NOTE(whoami-rajat): Do not set_acls if store is not defined
67+
# on this node. This is possible in case of edge deployment
68+
# that image location is present but the actual store is
69+
# not related to this node.
70+
image_store = location['metadata'].get('store')
71+
if image_store not in CONF.enabled_backends:
72+
msg = (_("Store %s is not available on "
73+
"this node, skipping `_set_acls` "
74+
"call.") % image_store)
75+
LOG.debug(msg)
76+
continue
6677
self.store_api.set_acls_for_multi_store(
67-
location['url'], location['metadata'].get('store'),
78+
location['url'], image_store,
6879
public=public, read_tenants=member_ids,
6980
context=self.context
7081
)
@@ -655,8 +666,19 @@ def _set_acls(self):
655666
member_ids = [m.member_id for m in self.repo.list()]
656667
for location in self.image.locations:
657668
if CONF.enabled_backends:
669+
# NOTE(whoami-rajat): Do not set_acls if store is not
670+
# defined on this node. This is possible in case of edge
671+
# deployment that image location is present but the actual
672+
# store is not related to this node.
673+
image_store = location['metadata'].get('store')
674+
if image_store not in CONF.enabled_backends:
675+
msg = (_("Store %s is not available on "
676+
"this node, skipping `_set_acls` "
677+
"call.") % image_store)
678+
LOG.debug(msg)
679+
continue
658680
self.store_api.set_acls_for_multi_store(
659-
location['url'], location['metadata'].get('store'),
681+
location['url'], image_store,
660682
public=public, read_tenants=member_ids,
661683
context=self.context
662684
)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
fixes:
3+
- |
4+
`Bug #2073945 <https://bugs.launchpad.net/glance/+bug/2073945>`_:
5+
Fixed issue with VM creation in DCN cases with RBD backend where
6+
an edge node doesn't have the store defined which is part of the
7+
image locations and the operation fails.

0 commit comments

Comments
 (0)