diff options
| author | Michael Still <mikal@stillhq.com> | 2012-09-23 20:35:20 +1000 |
|---|---|---|
| committer | Michael Still <mikal@stillhq.com> | 2012-09-26 16:25:02 +1000 |
| commit | 4be437da11d41fe7c5495971f3d5408cbfd30bfe (patch) | |
| tree | fe58452dac5169e4a32b8709cd671c90a8560c51 /nova/compute | |
| parent | c367fa5e4a5e4712bde9fc319ae6c2f4f2add606 (diff) | |
Check that an image is active before spawning instances.
Resolves bug/1054163.
Change-Id: I4095fcac300a161e6da93bdc14eb43257d4f1aee
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index c1b5ac379..b54870e8d 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -401,6 +401,8 @@ class API(base.Base): (image_service, image_id) = glance.get_remote_image_service(context, image_href) image = image_service.show(context, image_id) + if image['status'] != 'active': + raise exception.ImageNotActive(image_id=image_id) if instance_type['memory_mb'] < int(image.get('min_ram') or 0): QUOTAS.rollback(context, quota_reservations) |
