Revision ce55f211 snf-cyclades-app/synnefo/logic/backend.py
b/snf-cyclades-app/synnefo/logic/backend.py | ||
---|---|---|
221 | 221 |
def create_instance(vm, flavor, image, password, personality): |
222 | 222 |
"""`image` is a dictionary which should contain the keys: |
223 | 223 |
'backend_id', 'format' and 'metadata' |
224 |
|
|
224 |
|
|
225 | 225 |
metadata value should be a dictionary. |
226 | 226 |
""" |
227 | 227 |
nic = {'ip': 'pool', 'mode': 'routed', 'link': settings.GANETI_PUBLIC_LINK} |
... | ... | |
268 | 268 |
'img_format': image['format']} |
269 | 269 |
if personality: |
270 | 270 |
kw['osparams']['img_personality'] = json.dumps(personality) |
271 |
|
|
271 |
|
|
272 | 272 |
kw['osparams']['img_properties'] = json.dumps(image['metadata']) |
273 |
|
|
273 |
|
|
274 | 274 |
# Defined in settings.GANETI_CREATEINSTANCE_KWARGS |
275 | 275 |
# kw['hvparams'] = dict(serial_console=False) |
276 | 276 |
|
... | ... | |
356 | 356 |
except IndexError: |
357 | 357 |
link = create_network_link() |
358 | 358 |
if not link: |
359 |
return None
|
|
359 |
raise NetworkLink.NotAvailable
|
|
360 | 360 |
|
361 | 361 |
network = Network.objects.create( |
362 | 362 |
name=name, |
Also available in: Unified diff