Revision 61868190 logic/backend.py
b/logic/backend.py | ||
---|---|---|
158 | 158 |
def create_instance(vm, flavor, image, password): |
159 | 159 |
|
160 | 160 |
nic = {'ip': 'pool', 'mode': 'routed', 'link': settings.GANETI_PUBLIC_LINK} |
161 |
|
|
162 |
if image.backend_id.find("windows") >= 0: |
|
163 |
sz = 14000 |
|
161 |
|
|
162 |
if settings.IGNORE_FLAVOR_DISK_SIZES: |
|
163 |
if image.backend_id.find("windows") >= 0: |
|
164 |
sz = 14000 |
|
165 |
else: |
|
166 |
sz = 4000 |
|
164 | 167 |
else: |
165 |
sz = 4000
|
|
168 |
sz = flavor.disk * 1024
|
|
166 | 169 |
|
167 | 170 |
return rapi.CreateInstance( |
168 | 171 |
mode='create', |
... | ... | |
176 | 179 |
# Do not specific a node explicitly, have |
177 | 180 |
# Ganeti use an iallocator instead |
178 | 181 |
# |
179 |
# pnode=rapi.GetNodes()[0] |
|
182 |
# pnode=rapi.GetNodes()[0],
|
|
180 | 183 |
dry_run=settings.TEST, |
181 | 184 |
beparams=dict(auto_balance=True, vcpus=flavor.cpu, memory=flavor.ram), |
182 | 185 |
osparams=dict(img_id=image.backend_id, img_passwd=password, |
Also available in: Unified diff