650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463494945201028549.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463495354216062994.jpg "style=" border:0px;float:none; "/>
In this section we discuss the two sets of operations, Suspend/resume and Rescue/unrescue.
Suspend/resume
Sometimes it takes a long time to pause the instance, and you can save the state of instance to the host's disk by Suspend operation. When recovery is required, perform a resume operation and read back to the instance state from disk to keep it running.
A comparison of Suspend and Pause operations is required here:
Same point
Both suspend instance and save the current state, which can then be resumed with the resume operation
Different points
1.Suspend saves the state of instance on disk, and pause is saved in memory, so the Resume is instance faster than Suspend. Instance after 2.Suspend, the state is Shut down, while the instance state of the Pause is paused. 3. Although all resumes are resumed, the resume of Pause is called "unpause" within OpenStack, and the Suspend corresponding resume is the true "resume". This can be reflected in the log.
Suspend/resume's log analysis is left to everyone to do exercises.
Rescue/unrescue
Starting from this section, we will discuss several methods for instance recovery, different methods for different scenarios. First we consider the operating system failure.
Sometimes due to misoperation or sudden power outage, the operating system restarts but does not come up. To maximize data salvage, we usually use a system disk to boot the system and try to recover. If the problem is not too serious, you can make the system work again in this way. For example, a system file accidentally deleted, root password forgotten, etc.
Nova also provides this recovery mechanism, called Rescue. Let's take a look at rescue's note:
650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463494945162068953.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463495354570072786.jpg "style=" border:0px;white-space:normal;float:none; "/>
Rescue uses the specified image as the boot disk boot instance to mount the system disk of the instance itself as a second disk to the operating system.
Here is the flowchart of Rescue instance
650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463495012234087432.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463495354677099617.jpg "alt=" Image180.png "style=" border:0px; "/>
Send a request to NOVA-API
Nova-api sending messages
Nova-compute Performing actions
Let's discuss each step in detail below.
send a request to Nova-api
Currently Rescue operations can only be performed via the CLI
650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463494945130024035.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463495354880060612.jpg "style=" border:0px;white-space:normal;float:none; "/>
Here we do not specify which image to use as the boot disk, and Nova will use the image used by the instance deployment
View Log/opt/stack/logs/n-api.log
650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463494945225072497.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463495355044074429.jpg "style=" border:0px;white-space:normal;float:none; "/>
Nova-api sending Messages
Nova-api sent a message to Messaging (RabbitMQ): "Rescue this Instance" source code in/opt/stack/nova/nova/compute/api.py, method is Rescue.
650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463494945265075076.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463495355163065484.jpg "style=" border:0px;white-space:normal;float:none; "/>
Nova-compute Performing Actions
View Log/opt/stack/logs/n-cpu.log
Close instance
650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463494945288092190.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463495355335044496.jpg "style=" border:0px;font-family: ' Microsoft ya black '; white-space:normal; Float:none; "/>
650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463494945304097650.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463495355475094637.jpg "style=" border:0px;white-space:normal;float:none; "/>
Create a new boot disk from image, named Disk.rescue
650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463494945350082029.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463495355590075702.jpg "style=" border:0px;white-space:normal;float:none; "/>
Start instance
650 "this.width=650;" title= "/HTTP// 7xo6kd.com1.z0.glb.clouddn.com/upload-ueditor-image-20160517-1463494945383085330.png "src=" http// 7xo6kd.com1.z0.glb.clouddn.com/upload-ueditor-image-20160517-1463495355712087523.jpg "style=" border:0px; White-space:normal;float:none; "/>
after successful execution, the Rescue can be Virsh edit <instance_name> View instance XML definition, disk.rescue as the Startup disk VDA, the real boot disk as the second disk VDB. 650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463494945394073785.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463495355876074902.jpg "style=" border:0px;white-space:normal;float:none; "/>
Login instance, via Fdisk can also be confirmed.
650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463494945431078873.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463495356074040030.jpg "style=" border:0px;white-space:normal;float:none; "/>
At this point, instance is in Rescue state
650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463494945470030151.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463495356283049495.jpg "style=" border:0px;white-space:normal;float:none; "/>
The Rescue operation gives us a chance to repair the damaged operating system. Once repaired, use the unrescue operation to reboot the instance from the original boot disk.
650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463494945476033387.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463495356406065102.jpg "style=" border:0px;white-space:normal;float:none; "/>
Unrescue's log analysis is reserved for everyone to practice.
650) this.width=650; "title=" "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160517-1463495356512088695.jpg "style=" Border:0px;vertical-align:middle;color:rgb ( 63,63,63); font-family: ' Microsoft Yahei '; Font-size:15px;line-height:21.75px;text-align:justify;background-color: RGB (246,246,246); "/>
Nova suspend/rescue Operation Details-5 minutes a day to play OpenStack (35)