forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: guoyanyan <guoyanyan3@huawei.com> Co-committed-by: guoyanyan <guoyanyan3@huawei.com>
104 lines
8.2 KiB
HTML
104 lines
8.2 KiB
HTML
<a name="EN-US_TOPIC_0113607321"></a><a name="EN-US_TOPIC_0113607321"></a>
|
|
|
|
<h1 class="topictitle1">Attaching an EVS Disk to a BMS</h1>
|
|
<div id="body1526990824340"><div class="section" id="EN-US_TOPIC_0113607321__section123491451123012"><h4 class="sectiontitle">Scenario</h4><p id="EN-US_TOPIC_0113607321__p171255416309">If the existing disks of a BMS fail to meet service requirements, for example, due to insufficient disk space or poor disk performance, you can attach more available disks to the BMS, or call the EVS disk creation API to create disks and attach them to the BMS. To attach an EVS disk to a BMS, you need to call the required API.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0113607321__section165294572481"><h4 class="sectiontitle">Restrictions and Limitations</h4><ul id="EN-US_TOPIC_0113607321__ul176387415193"><li id="EN-US_TOPIC_0113607321__en-us_topic_0107658564_li6219103112326">EVS disks cannot be attached to a BMS in a batch.</li><li id="EN-US_TOPIC_0113607321__en-us_topic_0107658564_li1855353817812">A maximum of EVS disks can be attached to a <span id="EN-US_TOPIC_0113607321__en-us_topic_0107658564_text8654625117">BMS</span><span id="EN-US_TOPIC_0113607321__en-us_topic_0107658564_text1604655115"></span>.</li><li id="EN-US_TOPIC_0113607321__en-us_topic_0107658564_li841415351951">A bootable disk cannot be attached to a BMS.</li><li id="EN-US_TOPIC_0113607321__en-us_topic_0107658564_li94151835755">A disk cannot be attached to a <span id="EN-US_TOPIC_0113607321__en-us_topic_0107658564_text1571649175118">BMS</span><span id="EN-US_TOPIC_0113607321__en-us_topic_0107658564_text57104965115"></span> in the <strong id="EN-US_TOPIC_0113607321__en-us_topic_0107658564_b9778459492">SUSPENDED</strong> or <strong id="EN-US_TOPIC_0113607321__en-us_topic_0107658564_b1677895912915">PAUSED</strong> state, which is specified using the <strong id="EN-US_TOPIC_0113607321__en-us_topic_0107658564_b19778195913910">OS-EXT-STS:vm_state</strong> parameter.</li><li id="EN-US_TOPIC_0113607321__en-us_topic_0107658564_li141514351157">Only a shared disk or a disk in the <strong id="EN-US_TOPIC_0113607321__en-us_topic_0107658564_b842352706104614">available</strong> state can be attached to a BMS.</li><li id="EN-US_TOPIC_0113607321__en-us_topic_0107658564_li54151535655">Only EVS disks whose device type is <strong id="EN-US_TOPIC_0113607321__en-us_topic_0107658564_b842352706105525">SCSI</strong> can be attached to a BMS.</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0113607321__section1485352319380"><h4 class="sectiontitle">Involved APIs</h4><p id="EN-US_TOPIC_0113607321__p1937772516389">The following APIs are required:</p>
|
|
<ul id="EN-US_TOPIC_0113607321__ul157031533154216"><li id="EN-US_TOPIC_0113607321__li57032338425">Querying EVS disks</li><li id="EN-US_TOPIC_0113607321__li20207149144318">Attaching an EVS disk</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0113607321__section6667526174811"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0113607321__ol1523711304507"><li id="EN-US_TOPIC_0113607321__li117825814505">Query EVS disks.<ul id="EN-US_TOPIC_0113607321__ul153616554411"><li id="EN-US_TOPIC_0113607321__li1253615551044">API information<p id="EN-US_TOPIC_0113607321__p3975174434117"><a name="EN-US_TOPIC_0113607321__li1253615551044"></a><a name="li1253615551044"></a>URI format: GET /v2/{project_id}/volumes</p>
|
|
<p id="EN-US_TOPIC_0113607321__p1885642023016">For details, see section "Querying EVS Disks" in the <em id="EN-US_TOPIC_0113607321__i1135252201514">Elastic Volume Service API Reference</em>.</p>
|
|
</li><li id="EN-US_TOPIC_0113607321__li847518211518">Example request<p id="EN-US_TOPIC_0113607321__p19660856678"><a name="EN-US_TOPIC_0113607321__li847518211518"></a><a name="li847518211518"></a>GET https://{EVS Endpoint}/v2/000efdc5f9064584b718b181df137bd7/volumes</p>
|
|
</li><li id="EN-US_TOPIC_0113607321__li1882455111812">Example response<pre class="screen" id="EN-US_TOPIC_0113607321__screen208621336194">{
|
|
"volumes": [
|
|
{
|
|
"id": "6b604cef-9bd8-4f5a-ae56-45839e6e1f0a",
|
|
"links": [
|
|
{
|
|
"href": "https://volume.localdomain.com:8776/v2/dd14c6ac581f40059e27f5320b60bf2f/volumes/6b604cef-9bd8-4f5a-ae56-45839e6e1f0a",
|
|
"rel": "self"
|
|
},
|
|
{
|
|
"href": "https://volume.localdomain.com:8776/dd14c6ac581f40059e27f5320b60bf2f/volumes/6b604cef-9bd8-4f5a-ae56-45839e6e1f0a",
|
|
"rel": "bookmark"
|
|
}
|
|
],
|
|
"name": "zjb_u25_test"
|
|
},
|
|
{
|
|
"id": "2bce4552-9a7d-48fa-8484-abbbf64b206e",
|
|
"links": [
|
|
{
|
|
"href": "https://volume.localdomain.com:8776/v2/dd14c6ac581f40059e27f5320b60bf2f/volumes/2bce4552-9a7d-48fa-8484-abbbf64b206e",
|
|
"rel": "self"
|
|
},
|
|
{
|
|
"href": "https://volume.localdomain.com:8776/dd14c6ac581f40059e27f5320b60bf2f/volumes/2bce4552-9a7d-48fa-8484-abbbf64b206e",
|
|
"rel": "bookmark"
|
|
}
|
|
],
|
|
"name": "zjb_u25_test"
|
|
},
|
|
{
|
|
"id": "3f1b98ec-a8b5-4e92-a727-88def62d5ad3",
|
|
"links": [
|
|
{
|
|
"href": "https://volume.localdomain.com:8776/v2/dd14c6ac581f40059e27f5320b60bf2f/volumes/3f1b98ec-a8b5-4e92-a727-88def62d5ad3",
|
|
"rel": "self"
|
|
},
|
|
{
|
|
"href": "https://volume.localdomain.com:8776/dd14c6ac581f40059e27f5320b60bf2f/volumes/3f1b98ec-a8b5-4e92-a727-88def62d5ad3",
|
|
"rel": "bookmark"
|
|
}
|
|
],
|
|
"name": "zjb_u25_test"
|
|
}
|
|
],
|
|
"volumes_links": [
|
|
{
|
|
"href": "https://volume.localdomain.com:8776/v2/dd14c6ac581f40059e27f5320b60bf2f/volumes?limit=3&marker=3f1b98ec-a8b5-4e92-a727-88def62d5ad3",
|
|
"rel": "next"
|
|
}
|
|
]
|
|
}</pre>
|
|
<p id="EN-US_TOPIC_0113607321__p1535518693213">or</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0113607321__screen15649316153215">{
|
|
"error": {
|
|
"message": "XXXX",
|
|
"code": "XXX"
|
|
}
|
|
}</pre>
|
|
<p id="EN-US_TOPIC_0113607321__p6265107163212">In the preceding example, <strong id="EN-US_TOPIC_0113607321__b842352706143959">error</strong> indicates a general error, for example, <strong id="EN-US_TOPIC_0113607321__b842352706144438">badRequest</strong> or <strong id="EN-US_TOPIC_0113607321__b842352706144454">itemNotFound</strong>. An example is provided as follows:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0113607321__screen136101839113214">{
|
|
"badRequest": {
|
|
"message": "XXXX",
|
|
"code": "XXX"
|
|
}
|
|
}</pre>
|
|
</li></ul>
|
|
</li><li id="EN-US_TOPIC_0113607321__li22371530115014">Attach an EVS disk to a BMS.<ul id="EN-US_TOPIC_0113607321__ul1418818222917"><li id="EN-US_TOPIC_0113607321__li21891925295">API information<p id="EN-US_TOPIC_0113607321__p172537224535"><a name="EN-US_TOPIC_0113607321__li21891925295"></a><a name="li21891925295"></a>URI format: POST /v2.1/{project_id}/servers/{server_id}/os-volume_attachments</p>
|
|
<p id="EN-US_TOPIC_0113607321__p2012615502304">For details, see section "Attaching an EVS Disk to a BMS (Native OpenStack API)" in the <em id="EN-US_TOPIC_0113607321__i1882142111519">Bare Metal Server API Reference</em>.</p>
|
|
</li><li id="EN-US_TOPIC_0113607321__li131897292912">Example request<p id="EN-US_TOPIC_0113607321__p047414711365"><a name="EN-US_TOPIC_0113607321__li131897292912"></a><a name="li131897292912"></a>POST https://{ECS Endpoint}/v2.1/000efdc5f9064584b718b181df137bd7/servers/9ab74d89-61e7-4259-8546-465fdebe4944/os-volume_attachments</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0113607321__screen1354375423620">{
|
|
"volumeAttachment": {
|
|
"volumeId": "b53f23bd-ee8f-49ec-9420-d1acfeaf91d6",
|
|
"device": "/dev/sdb"
|
|
}
|
|
}</pre>
|
|
</li><li id="EN-US_TOPIC_0113607321__li1919114252919">Example response<pre class="screen" id="EN-US_TOPIC_0113607321__screen5586569202517">{
|
|
"volumeAttachment": {
|
|
"id": "b53f23bd-ee8f-49ec-9420-d1acfeaf91d6",
|
|
"volumeId": "b53f23bd-ee8f-49ec-9420-d1acfeaf91d6",
|
|
"serverId": "9ab74d89-61e7-4259-8546-465fdebe4944",
|
|
"device": "/dev/vdb"
|
|
}
|
|
}</pre>
|
|
</li></ul>
|
|
</li></ol>
|
|
</div>
|
|
</div>
|
|
<div></div>
|
|
|