Revision 6263189c lib/backend.py
b/lib/backend.py | ||
---|---|---|
960 | 960 |
_Fail("Hypervisor error: %s", err, exc=True) |
961 | 961 |
|
962 | 962 |
|
963 |
def InstanceShutdown(instance): |
|
963 |
def InstanceShutdown(instance, timeout):
|
|
964 | 964 |
"""Shut an instance down. |
965 | 965 |
|
966 | 966 |
@note: this functions uses polling with a hardcoded timeout. |
967 | 967 |
|
968 | 968 |
@type instance: L{objects.Instance} |
969 | 969 |
@param instance: the instance object |
970 |
@type timeout: integer |
|
971 |
@param timeout: maximum timeout for soft shutdown |
|
970 | 972 |
@rtype: None |
971 | 973 |
|
972 | 974 |
""" |
... | ... | |
974 | 976 |
hyper = hypervisor.GetHypervisor(hv_name) |
975 | 977 |
running_instances = hyper.ListInstances() |
976 | 978 |
iname = instance.name |
977 |
timeout = constants.DEFAULT_SHUTDOWN_TIMEOUT |
|
978 | 979 |
|
979 | 980 |
if iname not in running_instances: |
980 | 981 |
logging.info("Instance %s not running, doing nothing", iname) |
Also available in: Unified diff