Revision b55abf50
b/snf-cyclades-app/synnefo/logic/servers.py | ||
---|---|---|
138 | 138 |
@transaction.commit_on_success |
139 | 139 |
def create(userid, name, password, flavor, image, metadata={}, |
140 | 140 |
personality=[], networks=None, use_backend=None): |
141 |
|
|
142 |
# Check that image fits into the disk |
|
143 |
if image["size"] > (flavor.disk << 30): |
|
144 |
msg = "Flavor's disk size '%s' is smaller than the image's size '%s'" |
|
145 |
raise faults.BadRequest(msg % (flavor.disk << 30, image["size"])) |
|
146 |
|
|
141 | 147 |
if use_backend is None: |
142 | 148 |
# Allocate server to a Ganeti backend |
143 | 149 |
use_backend = allocate_new_server(userid, flavor) |
Also available in: Unified diff