Snapshot Volume operation-5 minutes a day to play OpenStack (58)

Source: Internet
Author: User

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468133582602028912.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468134004005078040.jpg "style=" border:0px;float:none; "/>

Snapshot can create a snapshot for volume, which holds the current state of volume in the snapshot and can be traced back through Snapshot later. Snapshot operation is relatively simple, the flowchart is as follows:

650 "this.width=650;" title= "/HTTP// 7xo6kd.com1.z0.glb.clouddn.com/upload-ueditor-image-20160707-1467841111197088239.png "src=" http// 7xo6kd.com1.z0.glb.clouddn.com/upload-ueditor-image-20160710-1468134004255032057.jpg "alt=" Image413.png "style=" border:0px;font-family: ' Microsoft Jas Black '; '/>

    1. Send snapshot request to Cinder-api

    2. Cinder-api sending messages

    3. Cinder-volume Performing Snapshot operations

Let's discuss each step in detail below.

send snapshot request to Cinder-api

The customer (which can be an OpenStack end user, or another program) sends a request to CINDER-API: "Please snapshot the specified volume.

Here we will snapshot volume "Vol-1".

Enter the GUI operation menu, Compute, Project, Volumes.

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468133582389005674.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468134007280004533.jpg "style=" border:0px;white-space:normal;float:none; "/>

Select volume "Vol-1" and click "Create Snapshot".

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468133582424051445.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468134013865046351.jpg "style=" border:0px;white-space:normal;float:none; "/>

Name the snapshot.

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468133582618041435.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468134014639057983.jpg "style=" border:0px;white-space:normal;float:none; "/>

Here we see an interface hint that the current volume has been attach to a instance, and creating snapshot may result in inconsistent data. We can pause instance first, or confirm that the current instance does not have a large amount of disk IO, in a relatively stable state, you can create snapshot, otherwise it is recommended to detach volume in the first sanpshot.

CINDER-API will receive a request for snapshot volume. The log file is in/opt/stack/logs/c-api.log.

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468133874884064639.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468134014882008472.jpg "style=" border:0px;float:none; "/>

Cinder-api sending Messages

CINDER-API sends a message snapshot message. CINDER-API does not print the log that sends the message, only the source code to view the/opt/stack/cinder/cinder/volume/api.py, the method is _create_snapshot.

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468133875001073139.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468134015071079153.jpg "style=" border:0px;white-space:normal;float:none; "/>

Cinder-volume performing Snapshot operations

Cinder-volume executes the lvcreate command to create the snapshot. The log is/opt/stack/logs/c-vol.log.

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468133875131060639.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468134015359049921.jpg "style=" border:0px;white-space:normal;float:none; "/>

For LVM volume Provider,snapshot is actually a lv, and the snapshot relationship with the source LV is recorded, which can be viewed through lvdisplay.

650 "this.width=650;" title= "/HTTP// 7xo6kd.com1.z0.glb.clouddn.com/upload-ueditor-image-20160710-1468133875060095900.png "src=" http// 7xo6kd.com1.z0.glb.clouddn.com/upload-ueditor-image-20160710-1468134016159038812.jpg "style=" border:0px; White-space:normal;float:none; "/>
gui You can see the newly created "Vol-1-snapshot" in the Volume Snapshots tab.

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468133875129014153.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468134016277033460.jpg "style=" border:0px;white-space:normal;float:none; "/>

With snapshot, we can trace volume back to the state we created snapshot. The method is to create a new volume through snapshot.

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468133875201042278.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468134016363092403.jpg "style=" border:0px;white-space:normal;float:none; "/>

The newly created volume capacity must be greater than or equal to the capacity of snapshot

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468133875239090913.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468134016483040774.jpg "style=" border:0px;white-space:normal;float:none; "/>

The process is similar to create Volume, except that after the creation of the LV, the snapshot data is copied to the new Volume via DD.
Log analysis no longer repeat, leave a everyone to practice.

If a volume exists snapshot, then this volume cannot be deleted.
This is because snapshot relies on volume,snapshot not being able to exist independently.

In an environment where LVM is a volume provider, snapshot is completely copy from the source volume, so this dependency is not strong.
But in other volume provider (such as commercial storage devices or Distributed file systems), snapshot is usually a reference (pointer) to the state of the data in the source volume when the snapshot was created, and the footprint is very small, in this way snapshot the source volume The dependence is very obvious.

The above is the analysis of volume snapshot, the next section we discuss an operation that is easy to confuse with snapshot: Backup.

650) this.width=650; "title=" "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160710-1468134016671009983.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); "/>

Snapshot Volume operation-5 minutes a day to play OpenStack (58)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.