
If a compute manager is stopped / fails during certain REBOOT-* operations then the instance will be left stuck in a transitional task_state This change handles two possible task states REBOOT_PENDING and REBOOT_STARTED (for both soft and hard reboots). And either clears these states or retries the reboot depending on the instance state. Both task states are set after the request has gotten to the compute manager so we can handle these safely knowing the operation has ended/failed with the restart of the compute manager. We retry the reboot where the state is PENDING and where the state is STARTED and the instance is not running. Where the instance is running and the state is STARTED we simply transition the instance to an ACTIVE state. The user can retry the reboot if required. Related to blueprint recover-stuck-state Change-Id: Ib318b3d444a67616441302f3daa8de20ee946f3f
115 lines
3.4 KiB
Python
115 lines
3.4 KiB
Python
# Copyright 2010 OpenStack Foundation
|
|
# All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
"""Possible task states for instances.
|
|
|
|
Compute instance task states represent what is happening to the instance at the
|
|
current moment. These tasks can be generic, such as 'spawning', or specific,
|
|
such as 'block_device_mapping'. These task states allow for a better view into
|
|
what an instance is doing and should be displayed to users/administrators as
|
|
necessary.
|
|
|
|
"""
|
|
|
|
# possible task states during create()
|
|
SCHEDULING = 'scheduling'
|
|
BLOCK_DEVICE_MAPPING = 'block_device_mapping'
|
|
NETWORKING = 'networking'
|
|
SPAWNING = 'spawning'
|
|
|
|
# possible task states during snapshot()
|
|
IMAGE_SNAPSHOT = 'image_snapshot'
|
|
IMAGE_SNAPSHOT_PENDING = 'image_snapshot_pending'
|
|
IMAGE_PENDING_UPLOAD = 'image_pending_upload'
|
|
IMAGE_UPLOADING = 'image_uploading'
|
|
|
|
# possible task states during backup()
|
|
IMAGE_BACKUP = 'image_backup'
|
|
|
|
# possible task states during set_admin_password()
|
|
UPDATING_PASSWORD = 'updating_password'
|
|
|
|
# possible task states during resize()
|
|
RESIZE_PREP = 'resize_prep'
|
|
RESIZE_MIGRATING = 'resize_migrating'
|
|
RESIZE_MIGRATED = 'resize_migrated'
|
|
RESIZE_FINISH = 'resize_finish'
|
|
|
|
# possible task states during revert_resize()
|
|
RESIZE_REVERTING = 'resize_reverting'
|
|
|
|
# possible task states during confirm_resize()
|
|
RESIZE_CONFIRMING = 'resize_confirming'
|
|
|
|
# possible task states during reboot()
|
|
REBOOTING = 'rebooting'
|
|
REBOOT_PENDING = 'reboot_pending'
|
|
REBOOT_STARTED = 'reboot_started'
|
|
REBOOTING_HARD = 'rebooting_hard'
|
|
REBOOT_PENDING_HARD = 'reboot_pending_hard'
|
|
REBOOT_STARTED_HARD = 'reboot_started_hard'
|
|
|
|
# possible task states during pause()
|
|
PAUSING = 'pausing'
|
|
|
|
# possible task states during unpause()
|
|
UNPAUSING = 'unpausing'
|
|
|
|
# possible task states during suspend()
|
|
SUSPENDING = 'suspending'
|
|
|
|
# possible task states during resume()
|
|
RESUMING = 'resuming'
|
|
|
|
# possible task states during power_off()
|
|
POWERING_OFF = 'powering-off'
|
|
|
|
# possible task states during power_on()
|
|
POWERING_ON = 'powering-on'
|
|
|
|
# possible task states during rescue()
|
|
RESCUING = 'rescuing'
|
|
|
|
# possible task states during unrescue()
|
|
UNRESCUING = 'unrescuing'
|
|
|
|
# possible task states during rebuild()
|
|
REBUILDING = 'rebuilding'
|
|
REBUILD_BLOCK_DEVICE_MAPPING = "rebuild_block_device_mapping"
|
|
REBUILD_SPAWNING = 'rebuild_spawning'
|
|
|
|
# possible task states during live_migrate()
|
|
MIGRATING = "migrating"
|
|
|
|
# possible task states during delete()
|
|
DELETING = 'deleting'
|
|
|
|
# possible task states during soft_delete()
|
|
SOFT_DELETING = 'soft-deleting'
|
|
|
|
# possible task states during restore()
|
|
RESTORING = 'restoring'
|
|
|
|
# possible task states during shelve()
|
|
SHELVING = 'shelving'
|
|
SHELVING_IMAGE_PENDING_UPLOAD = 'shelving_image_pending_upload'
|
|
SHELVING_IMAGE_UPLOADING = 'shelving_image_uploading'
|
|
|
|
# possible task states during shelve_offload()
|
|
SHELVING_OFFLOADING = 'shelving_offloading'
|
|
|
|
# possible task states during unshelve()
|
|
UNSHELVING = 'unshelving'
|