|
| 1 | +title unshelve an instance |
| 2 | + |
| 3 | +participant client |
| 4 | +participant nova_api |
| 5 | +participant database |
| 6 | +participant nova_conductor |
| 7 | +participant nova_compute |
| 8 | +participant glance_api |
| 9 | +participant libvirt |
| 10 | +participant nova_scheduler |
| 11 | + |
| 12 | +#nova/api/openstack/compute/shelve.py |
| 13 | +client->nova_api:Restore a shelved instance |
| 14 | +activate client |
| 15 | +activate nova_api |
| 16 | +nova_api->+database:task_state=UNSHELVEING |
| 17 | +database->-nova_api:done |
| 18 | + |
| 19 | +note over nova_api:record action 'UNSHELVE' start |
| 20 | +nova_api->+database:get request_spec by instance uuid |
| 21 | +database->-nova_api:done |
| 22 | + |
| 23 | +#nova/conductor/api.py unshelve_instance() |
| 24 | +nova_api->+nova_conductor:unshelve_instance() |
| 25 | +deactivate nova_api |
| 26 | +deactivate client |
| 27 | +note over nova_conductor:get sys_meta |
| 28 | +nova_conductor->+glance_api:get session and image id |
| 29 | +glance_api->-nova_conductor:done |
| 30 | + |
| 31 | +alt if vm_state=SHELVED |
| 32 | + nova_conductor->+database:task_state=POWERING_ON |
| 33 | + nova_conductor->database:task_state=UNSHELVING |
| 34 | + database->-nova_conductor:done |
| 35 | + nova_conductor->+nova_compute:start_instance() |
| 36 | + note over nova_compute:notify:power_on.start |
| 37 | + note over nova_compute:get network info of an instance |
| 38 | + nova_compute->+libvirt:get block device info |
| 39 | + nova_compute->libvirt:power_on the specified instance |
| 40 | + libvirt->-nova_compute:done |
| 41 | + deactivate nova_compute |
| 42 | + |
| 43 | +else if vm_state=SHELVED_OFFLOADED |
| 44 | +note over nova_conductor:EventReporter:get_image_info |
| 45 | +nova_conductor->+glance_api:get session and image id |
| 46 | +glance_api->-nova_conductor:done |
| 47 | +note over nova_conductor:EventReporter:schedule_instances |
| 48 | +note over nova_conductor:build request spec |
| 49 | +note over nova_conductor:populate retry |
| 50 | +note over nova_conductor:get filter hosts |
| 51 | +note over nova_conductor:get all hosts state |
| 52 | +nova_conductor->nova_compute:unshelve_instance() |
| 53 | +activate nova_compute |
| 54 | +deactivate nova_conductor |
| 55 | +note over nova_compute:notify:unshelve.start |
| 56 | +nova_compute->+database:task_state=SPAWNING |
| 57 | +database->-nova_compute:done |
| 58 | +nova_compute->+database:get block device mapping list |
| 59 | +database->-nova_compute:return bdm list |
| 60 | +note over nova_compute:remove redundant data |
| 61 | +nova_compute->+libvirt:get block device info |
| 62 | +libvirt->-nova_compute:Converts block device mappings \n for an instance to driver format |
| 63 | + |
| 64 | +note over nova_compute:setup network for instance |
| 65 | +note over nova_compute:get instance network info |
| 66 | +nova_compute->+libvirt:spawn() |
| 67 | +libvirt->-nova_compute:done |
| 68 | +note over nova_compute:restore redundant data |
| 69 | +nova_compute->+database:power_state=current power_state |
| 70 | +database->+libvirt:get current power_state |
| 71 | +libvirt->-database:done |
| 72 | +nova_compute->database:vm_state=ACTIVE,task_state=None |
| 73 | +database->-nova_compute:done |
| 74 | +note over nova_compute:Delete system_metadata \n for a shelved instance |
| 75 | + |
| 76 | +nova_compute->+nova_scheduler:update instance info |
| 77 | +nova_scheduler->-nova_compute:done |
| 78 | + |
| 79 | +note over nova_compute:notify:unshelve.end |
| 80 | +end |
| 81 | +deactivate nova_compute |
| 82 | + |
| 83 | + |
0 commit comments