Revision 68b952f9 snf-cyclades-app/synnefo/logic/utils.py
b/snf-cyclades-app/synnefo/logic/utils.py | ||
---|---|---|
33 | 33 |
from django.conf import settings |
34 | 34 |
from copy import deepcopy |
35 | 35 |
|
36 |
|
|
36 | 37 |
def id_from_instance_name(name): |
37 | 38 |
"""Returns VirtualMachine's Django id, given a ganeti machine name. |
38 | 39 |
|
... | ... | |
82 | 83 |
(vm.operstate) through the RSAPI_STATE_FROM_OPER_STATE dictionary. |
83 | 84 |
|
84 | 85 |
The last state reported by Ganeti is set whenever Ganeti reports |
85 |
successful completion of an operation. If Ganeti says an OP_INSTANCE_STARTUP |
|
86 |
operation succeeded, vm.operstate is set to "STARTED". |
|
87 |
|
|
88 |
* To support any transitional states defined by the API (only REBOOT for the time |
|
89 |
being) this mapping is amended with information reported by Ganeti regarding |
|
90 |
any outstanding operation. If an OP_INSTANCE_STARTUP had succeeded previously |
|
91 |
and an OP_INSTANCE_REBOOT has been reported as in progress, the API state is |
|
92 |
"REBOOT". |
|
86 |
successful completion of an operation. If Ganeti says an |
|
87 |
OP_INSTANCE_STARTUP operation succeeded, vm.operstate is set to |
|
88 |
"STARTED". |
|
89 |
|
|
90 |
* To support any transitional states defined by the API (only REBOOT for |
|
91 |
the time being) this mapping is amended with information reported by Ganeti |
|
92 |
regarding any outstanding operation. If an OP_INSTANCE_STARTUP had |
|
93 |
succeeded previously and an OP_INSTANCE_REBOOT has been reported as in |
|
94 |
progress, the API state is "REBOOT". |
|
93 | 95 |
|
94 | 96 |
""" |
95 | 97 |
try: |
Also available in: Unified diff