doc-exports/docs/evs/dev/evs_03_0008.html
Zaoxu, Li 305c41bb57 EVS 2.0.38 SP1 version
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Zaoxu, Li <lizaoxu@huawei.com>
Co-committed-by: Zaoxu, Li <lizaoxu@huawei.com>
2022-10-19 22:27:18 +00:00

99 lines
7.2 KiB
HTML

<a name="evs_03_0008"></a><a name="evs_03_0008"></a>
<h1 class="topictitle1">Rolling Back a Snapshot to an EVS Disk</h1>
<div id="body1540283616466"><div class="section" id="evs_03_0008__section1063418559011"><h4 class="sectiontitle">Scenarios</h4><p id="evs_03_0008__p1153319452464">If the data in an EVS disk is incorrect or damaged, you can roll back the data from a snapshot to the source EVS disk to restore the data.</p>
</div>
<div class="section" id="evs_03_0008__section28146133118"><h4 class="sectiontitle">Constraints</h4><ul id="evs_03_0008__ul34741833103418"><li id="evs_03_0008__en-us_topic_0051408629_li4814287111214">When you roll back a snapshot to a disk, you can only roll back the snapshot to the source disk. Rollback to a specified disk is not supported.</li><li id="evs_03_0008__en-us_topic_0051408629_li57262698112110">You can roll back a disk from a snapshot only when the disk is in the <span class="wintitle" id="evs_03_0008__en-us_topic_0051408629_wintitle152900198152815"><b>available</b></span> or <span class="wintitle" id="evs_03_0008__en-us_topic_0051408629_wintitle191347052152823"><b>error_rollbacking</b></span> state.</li><li id="evs_03_0008__en-us_topic_0051408629_li205112014202915">Snapshots whose names started with prefix <strong id="evs_03_0008__en-us_topic_0051408629_b22712614407">autobk_snapshot_</strong> are automatically created by the system during backup creations. Do not use these snapshots to roll back the disk data.</li></ul>
</div>
<div class="section" id="evs_03_0008__section1531361811311"><h4 class="sectiontitle">Involved APIs</h4><p id="evs_03_0008__p33281854345">Query the snapshot list, obtain the ID of the snapshot and the ID of the snapshot's source disk, and then roll back the snapshot to the source disk.</p>
<p id="evs_03_0008__p73251180314">To meet the preceding requirements, call the following APIs:</p>
<ul id="evs_03_0008__ul1545272719369"><li id="evs_03_0008__li104521627123617">Query EVS snapshots.</li><li id="evs_03_0008__li68511423134811">Roll back a snapshot to an EVS disk.</li></ul>
</div>
<div class="section" id="evs_03_0008__section16886203916519"><h4 class="sectiontitle">Procedure</h4><ol id="evs_03_0008__ol081544055118"><li id="evs_03_0008__li581684015116">Query the EVS snapshots.<ul id="evs_03_0008__evs_03_0007_evs_03_0004_ul118162040125112"><li id="evs_03_0008__evs_03_0007_evs_03_0004_li158161740155110">API information<p id="evs_03_0008__evs_03_0007_evs_03_0004_p670222213411"><a name="evs_03_0008__evs_03_0007_evs_03_0004_li158161740155110"></a><a name="evs_03_0007_evs_03_0004_li158161740155110"></a>URI format: GET /v3/{project_id}/snapshots</p>
<p id="evs_03_0008__evs_03_0007_evs_03_0004_p116419475511">For details, see <strong id="evs_03_0008__evs_03_0007_b842352706154153">OpenStack Cinder API v3</strong> &gt; <strong id="evs_03_0008__evs_03_0007_b84235270615422">EVS Snapshot</strong> &gt; <strong id="evs_03_0008__evs_03_0007_b842352706154211">Querying EVS Snapshots</strong> in the <em id="evs_03_0008__evs_03_0007_i886446318154217">Elastic Volume Service API Reference</em>.</p>
</li><li id="evs_03_0008__evs_03_0007_evs_03_0004_li17816340125118">Example request<p id="evs_03_0008__evs_03_0007_evs_03_0004_p31824912620"><a name="evs_03_0008__evs_03_0007_evs_03_0004_li17816340125118"></a><a name="evs_03_0007_evs_03_0004_li17816340125118"></a>GET /v3/000efdc5f9064584b718b181df137bd7/snapshots</p>
</li><li id="evs_03_0008__evs_03_0007_evs_03_0004_li4816124025117">Example response<pre class="screen" id="evs_03_0008__evs_03_0007_screen51752612399">{
"snapshots": [
{
"created_at": "2016-02-16T16:54:14.981520",
"description": null,
"id": "b836dc3d-4e10-4ea4-a34c-8f6b0460a583",
"metadata": { },
"name": "test01",
"size": 1,
"status": "available",
"volume_id": "ba5730ea-8621-4ae8-b702-ff0ffc12c209",
"updated_at": null
},
{
"created_at": "2016-02-16T16:54:19.475397",
"description": null,
"id": "83be494d-329e-4a78-8ac5-9af900f48b95",
"metadata": { },
"name": "test02",
"size": 1,
"status": "available",
"volume_id": "ba5730ea-8621-4ae8-b702-ff0ffc12c209",
"updated_at": null
},
{
"created_at": "2016-02-16T16:54:24.367414",
"description": null,
"id": "dd360f46-7593-4d35-8f2c-5566fd0bd79e",
"metadata": { },
"name": "test03",
"size": 1,
"status": "available",
"volume_id": "ba5730ea-8621-4ae8-b702-ff0ffc12c209",
"updated_at": null
},
{
"created_at": "2016-02-16T16:54:29.766740",
"description": null,
"id": "4c29796a-8cf4-4482-9afc-e66da9a81240",
"metadata": { },
"name": "test04",
"size": 1,
"status": "available",
"volume_id": "ba5730ea-8621-4ae8-b702-ff0ffc12c209",
"updated_at": null
}
],
"snapshots_links": null
}</pre>
</li></ul>
</li><li id="evs_03_0008__li17817114010516">Roll back the snapshot to the source disk.<ul id="evs_03_0008__ul7179711194019"><li id="evs_03_0008__li5817940105111">API information<p id="evs_03_0008__p75101049862"><a name="evs_03_0008__li5817940105111"></a><a name="li5817940105111"></a>URI format: POST /v3/{project_id}/os-vendor-snapshots/{snapshot_id}/rollback</p>
<p id="evs_03_0008__p19381155416718">For details, see <strong id="evs_03_0008__b842352706154153">API v3</strong> &gt; <strong id="evs_03_0008__b84235270615422">EVS Snapshot</strong> &gt; <strong id="evs_03_0008__b842352706154211">Rolling Back a Snapshot to an EVS Disk</strong> in the <em id="evs_03_0008__i886446318154217">Elastic Volume Service API Reference</em>.</p>
</li><li id="evs_03_0008__li18176402515">Example request<p id="evs_03_0008__p08548399814"><a name="evs_03_0008__li18176402515"></a><a name="li18176402515"></a>POST /v3/000efdc5f9064584b718b181df137bd7/os-vendor-snapshots/b836dc3d-4e10-4ea4-a34c-8f6b0460a583 /rollback</p>
<pre class="screen" id="evs_03_0008__screen48281652121520">{
"rollback": {
"name": "test-001",
"volume_id": "5aa119a8-d25b-45a7-8d1b-88e127885635"
}
}</pre>
</li><li id="evs_03_0008__li8186131113409">Example response<pre class="screen" id="evs_03_0008__screen123821111528">{
"rollback": {
"volume_id": "5aa119a8-d25b-45a7-8d1b-88e127885635"
}
}</pre>
<div class="p" id="evs_03_0008__evs_03_0004_p723312591897">or<pre class="screen" id="evs_03_0008__evs_03_0004_screen2699535114213">{
"error": {
"message": "XXXX",
"code": "XXX"
}
}</pre>
</div>
<div class="p" id="evs_03_0008__evs_03_0004_p92381159293">In the preceding example, <strong id="evs_03_0008__b842352706143959">error</strong> indicates a general error, for example, <strong id="evs_03_0008__b842352706144438">badRequest</strong> or <strong id="evs_03_0008__b842352706144454">itemNotFound</strong>. An example is provided as follows:<pre class="screen" id="evs_03_0008__evs_03_0004_screen5305191315435">{
"badRequest": {
"message": "XXXX",
"code": "XXX"
}
}</pre>
</div>
</li></ul>
</li></ol>
</div>
</div>
<div></div>