Revision c397dbce snf-cyclades-app/synnefo/logic/servers.py
b/snf-cyclades-app/synnefo/logic/servers.py | ||
---|---|---|
270 | 270 |
|
271 | 271 |
|
272 | 272 |
@server_command("DESTROY") |
273 |
def destroy(vm): |
|
273 |
def destroy(vm, shutdown_timeout=None):
|
|
274 | 274 |
# XXX: Workaround for race where OP_INSTANCE_REMOVE starts executing on |
275 | 275 |
# Ganeti before OP_INSTANCE_CREATE. This will be fixed when |
276 | 276 |
# OP_INSTANCE_REMOVE supports the 'depends' request attribute. |
... | ... | |
280 | 280 |
not backend.vm_exists_in_backend(vm)): |
281 | 281 |
raise faults.BuildInProgress("Server is being build") |
282 | 282 |
log.info("Deleting VM %s", vm) |
283 |
return backend.delete_instance(vm) |
|
283 |
return backend.delete_instance(vm, shutdown_timeout=None)
|
|
284 | 284 |
|
285 | 285 |
|
286 | 286 |
@server_command("START") |
... | ... | |
290 | 290 |
|
291 | 291 |
|
292 | 292 |
@server_command("STOP") |
293 |
def stop(vm): |
|
293 |
def stop(vm, shutdown_timeout=None):
|
|
294 | 294 |
log.info("Stopping VM %s", vm) |
295 |
return backend.shutdown_instance(vm) |
|
295 |
return backend.shutdown_instance(vm, shutdown_timeout=None)
|
|
296 | 296 |
|
297 | 297 |
|
298 | 298 |
@server_command("REBOOT") |
299 |
def reboot(vm, reboot_type): |
|
299 |
def reboot(vm, reboot_type, shutdown_timeout=None):
|
|
300 | 300 |
if reboot_type not in ("SOFT", "HARD"): |
301 | 301 |
raise faults.BadRequest("Malformed request. Invalid reboot" |
302 | 302 |
" type %s" % reboot_type) |
303 | 303 |
log.info("Rebooting VM %s. Type %s", vm, reboot_type) |
304 | 304 |
|
305 |
return backend.reboot_instance(vm, reboot_type.lower()) |
|
305 |
return backend.reboot_instance(vm, reboot_type.lower(), |
|
306 |
shutdown_timeout=shutdown_timeout) |
|
306 | 307 |
|
307 | 308 |
|
308 | 309 |
def resize(vm, flavor): |
Also available in: Unified diff