Revision 18cb3999
b/snf-cyclades-app/synnefo/logic/servers.py | ||
---|---|---|
167 | 167 |
@transaction.commit_on_success |
168 | 168 |
def create(userid, name, password, flavor, image, metadata={}, |
169 | 169 |
personality=[], networks=None, use_backend=None): |
170 |
|
|
171 |
# Check that image fits into the disk |
|
172 |
if image["size"] > (flavor.disk << 30): |
|
173 |
msg = "Flavor's disk size '%s' is smaller than the image's size '%s'" |
|
174 |
raise faults.BadRequest(msg % (flavor.disk << 30, image["size"])) |
|
175 |
|
|
170 | 176 |
if use_backend is None: |
171 | 177 |
# Allocate server to a Ganeti backend |
172 | 178 |
use_backend = allocate_new_server(userid, flavor) |
Also available in: Unified diff