Revision ec0b5e5b snf-cyclades-app/synnefo/api/servers.py
b/snf-cyclades-app/synnefo/api/servers.py | ||
---|---|---|
46 | 46 |
from synnefo.db.models import VirtualMachine, VirtualMachineMetadata |
47 | 47 |
from synnefo.logic.backend import create_instance, delete_instance |
48 | 48 |
from synnefo.logic.utils import get_rsapi_state |
49 |
from synnefo.util.rapi import GanetiApiError
|
|
49 |
from synnefo.logic.rapi import GanetiApiError
|
|
50 | 50 |
from synnefo.logic.backend_allocator import BackendAllocator |
51 |
from random import choice |
|
51 | 52 |
|
52 | 53 |
|
53 | 54 |
from logging import getLogger |
... | ... | |
273 | 274 |
transaction.commit() |
274 | 275 |
nic = {'ip': address, 'network': network.backend_id} |
275 | 276 |
else: |
277 |
network = choice(list(util.backend_public_networks(backend))) |
|
276 | 278 |
nic = {'ip': 'pool', 'network': network.backend_id} |
277 | 279 |
|
278 | 280 |
# We must save the VM instance now, so that it gets a valid |
Also available in: Unified diff