¿ù°£ Àα⠰Խù°

°Ô½Ã¹° 708°Ç
   
Power_state, Vm_state, task_states in Mitaka
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2017-04-13 (¸ñ) 14:10 Á¶È¸ : 2157
                                
Power_state : ÇÏÀÌÆÛ¹ÙÀÌÀú¿¡¼­ º¸¿©Áö´Â »óŸ¦ ¹Ý¿µ 
# virsh list --all 

/usr/lib/python2.7/dist-packages/nova/compute/power_state.py
.................................................
# NOTE(maoy): These are *not* virDomainState values from libvirt.
# The hex value happens to match virDomainState for backward-compatibility
# reasons.
NOSTATE = 0x00
RUNNING = 0x01
PAUSED = 0x03
SHUTDOWN = 0x04  # the VM is powered off
CRASHED = 0x06
SUSPENDED = 0x07

# TODO(justinsb): Power state really needs to be a proper class,
# so that we're not locked into the libvirt status codes and can put mapping
# logic here rather than spread throughout the code
STATE_MAP = {
    NOSTATE: 'pending',
    RUNNING: 'running',
    PAUSED: 'paused',
    SHUTDOWN: 'shutdown',
    CRASHED: 'crashed',
    SUSPENDED: 'suspended',
}


vm_state : API È£ÃâÀ» ±â¹ÝÀ¸·Î ¾ÈÁ¤ÀûÀÎ(?) »óÅ ¹Ý¿µ
/usr/lib/python2.7/dist-packages/nova/compute/vm_states.py
.................................................
ACTIVE = 'active'  # VM is running
BUILDING = 'building'  # VM only exists in DB
PAUSED = 'paused'
SUSPENDED = 'suspended'  # VM is suspended to disk.
STOPPED = 'stopped'  # VM is powered off, the disk image is still there.
RESCUED = 'rescued'  # A rescue image is running with the original VM image
# attached.
RESIZED = 'resized'  # a VM with the new size is active. The user is expected
# to manually confirm or revert.

SOFT_DELETED = 'soft-delete'  # VM is marked as deleted but the disk images are
# still available to restore.
DELETED = 'deleted'  # VM is permanently deleted.

ERROR = 'error'

SHELVED = 'shelved'  # VM is powered off, resources still on hypervisor
SHELVED_OFFLOADED = 'shelved_offloaded'  # VM and associated resources are
# not on hypervisor

ALLOW_SOFT_REBOOT = [ACTIVE]  # states we can soft reboot from
ALLOW_HARD_REBOOT = ALLOW_SOFT_REBOOT + [STOPPED, PAUSED, SUSPENDED, ERROR]
# states we allow hard reboot from

ALLOW_TRIGGER_CRASH_DUMP = [ACTIVE, PAUSED, RESCUED, RESIZED, ERROR]
# states we allow to trigger crash dump

ALLOW_RESOURCE_REMOVAL = [DELETED, SHELVED_OFFLOADED]
# states we allow resources to be freed in


task_states : vm_state¿¡ ºñÇØ Á»´õ °úµµÀûÀÎ(?) »óÅ ¹Ý¿µ
/usr/lib/python2.7/dist-packages/nova/compute/task_states.py
# 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'

ALLOW_REBOOT = [None, REBOOTING, REBOOT_PENDING, REBOOT_STARTED, RESUMING,
                REBOOTING_HARD, UNPAUSING, PAUSING, SUSPENDING]


ÂüÁ¶ : 

À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.