doc-exports/docs/bms/api-ref/en-us_topic_0053158614.html
guoyanyan c311ecafe3 bms_api_0510
Reviewed-by: Pristromskaia, Margarita <margarita.pristromskaia@t-systems.com>
Co-authored-by: guoyanyan <guoyanyan3@huawei.com>
Co-committed-by: guoyanyan <guoyanyan3@huawei.com>
2023-10-11 08:28:11 +00:00

222 lines
19 KiB
HTML

<a name="EN-US_TOPIC_0053158614"></a><a name="EN-US_TOPIC_0053158614"></a>
<h1 class="topictitle1">Attaching an EVS Disk to a BMS (Native OpenStack API)</h1>
<div id="body1464588681636"><div class="section" id="EN-US_TOPIC_0053158614__section53922917165259"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0053158614__p5680132165259">This API is used to attach an EVS disk to a BMS.</p>
</div>
<div class="section" id="EN-US_TOPIC_0053158614__section64211377173223"><h4 class="sectiontitle">Constraints</h4><ul id="EN-US_TOPIC_0053158614__ul45433461184122"><li id="EN-US_TOPIC_0053158614__li65034385184126">A bootable disk cannot be attached to a BMS.</li><li id="EN-US_TOPIC_0053158614__li11902061184128">A disk cannot be attached to a BMS when the BMS is in the <strong id="EN-US_TOPIC_0053158614__b842352706104522">PAUSED</strong> state, which is specified using the <strong id="EN-US_TOPIC_0053158614__b842352706104549">OS-EXT-STS:vm_state</strong> parameter.</li><li id="EN-US_TOPIC_0053158614__li5370819184122">Only a shared disk or a disk in the <strong id="EN-US_TOPIC_0053158614__b842352706104614">available</strong> state can be attached to a BMS.</li><li id="EN-US_TOPIC_0053158614__li917464102326">Only EVS disks whose device type is <strong id="EN-US_TOPIC_0053158614__b842352706105525">SCSI</strong> can be attached to a BMS.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0053158614__section51121191165259"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0053158614__p63141473165259">POST /v2.1/{project_id}/servers/{server_id}/os-volume_attachments</p>
<p id="EN-US_TOPIC_0053158614__p468643935114"><a href="#EN-US_TOPIC_0053158614__table12701051155110">Table 1</a> lists the parameters.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0053158614__table12701051155110"></a><a name="table12701051155110"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0053158614__table12701051155110" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="EN-US_TOPIC_0053158614__row97265111518"><th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.3.4.2.4.1.1"><p id="EN-US_TOPIC_0053158614__p58268319165259">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.3.4.2.4.1.2"><p id="EN-US_TOPIC_0053158614__p22113407165259">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.3.3.4.2.4.1.3"><p id="EN-US_TOPIC_0053158614__p46355523165259">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0053158614__row972551165120"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.4.2.4.1.1 "><p id="EN-US_TOPIC_0053158614__p1217433165259">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.4.2.4.1.2 "><p id="EN-US_TOPIC_0053158614__p31503226165259">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.4.2.4.1.3 "><p id="EN-US_TOPIC_0053158614__p1624545165259">Specifies the project ID.</p>
<p id="EN-US_TOPIC_0053158614__p13397185821014">For how to obtain the project ID, see <a href="https://docs.otc.t-systems.com/en-us/api/apiug/apig-en-api-180328009.html" target="_blank" rel="noopener noreferrer">Obtaining Required Information</a>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0053158614__row57216516518"><td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.4.2.4.1.1 "><p id="EN-US_TOPIC_0053158614__p28142050151519">server_id</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.4.2.4.1.2 "><p id="EN-US_TOPIC_0053158614__p64913614151519">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.3.3.4.2.4.1.3 "><p id="EN-US_TOPIC_0053158614__p23511349151519">Specifies the BMS ID.</p>
<p id="EN-US_TOPIC_0053158614__p29791113277">You can obtain the BMS ID from the <span id="EN-US_TOPIC_0053158614__en-us_topic_0113746489_text013014803615">BMS</span><span id="EN-US_TOPIC_0053158614__en-us_topic_0113746489_text10131448133612"></span> console or by calling the <a href="en-us_topic_0053158693.html">Querying BMSs (Native OpenStack API)</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0053158614__section8194118165259"><h4 class="sectiontitle">Request</h4><ul id="EN-US_TOPIC_0053158614__ul5761900715058"><li id="EN-US_TOPIC_0053158614__li6083078215058">Request parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0053158614__table38613152151549" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0053158614__row40874938151549"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.1.1.1.5.1.1"><p id="EN-US_TOPIC_0053158614__p19987085">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.229999999999999%" id="mcps1.3.4.2.1.1.1.5.1.2"><p id="EN-US_TOPIC_0053158614__p54711237974">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.05%" id="mcps1.3.4.2.1.1.1.5.1.3"><p id="EN-US_TOPIC_0053158614__p4546697">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="38.72%" id="mcps1.3.4.2.1.1.1.5.1.4"><p id="EN-US_TOPIC_0053158614__p32738149">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0053158614__row62881453151549"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.1.1.5.1.1 "><p id="EN-US_TOPIC_0053158614__p60232972151549">volumeAttachment</p>
</td>
<td class="cellrowborder" valign="top" width="15.229999999999999%" headers="mcps1.3.4.2.1.1.1.5.1.2 "><p id="EN-US_TOPIC_0053158614__p1647112371173">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="21.05%" headers="mcps1.3.4.2.1.1.1.5.1.3 "><p id="EN-US_TOPIC_0053158614__p47032596151549">Object</p>
</td>
<td class="cellrowborder" valign="top" width="38.72%" headers="mcps1.3.4.2.1.1.1.5.1.4 "><p id="EN-US_TOPIC_0053158614__p14307644151549">Specifies the disks to be attached. For details, see <a href="#EN-US_TOPIC_0053158614__table40707503151632">Table 2</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0053158614__table40707503151632"></a><a name="table40707503151632"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0053158614__table40707503151632" frame="border" border="1" rules="all"><caption><b>Table 2 </b><strong id="EN-US_TOPIC_0053158614__b96276552019">volumeAttachment</strong> field data structure description</caption><thead align="left"><tr id="EN-US_TOPIC_0053158614__row46910609151632"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.1.2.2.5.1.1"><p id="EN-US_TOPIC_0053158614__p136661044172118">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.229999999999999%" id="mcps1.3.4.2.1.2.2.5.1.2"><p id="EN-US_TOPIC_0053158614__p3250145875">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.240000000000002%" id="mcps1.3.4.2.1.2.2.5.1.3"><p id="EN-US_TOPIC_0053158614__p1866954412110">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="38.53%" id="mcps1.3.4.2.1.2.2.5.1.4"><p id="EN-US_TOPIC_0053158614__p467394452117">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0053158614__row56436699151632"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.2.2.5.1.1 "><p id="EN-US_TOPIC_0053158614__p7969910151632">volumeId</p>
</td>
<td class="cellrowborder" valign="top" width="15.229999999999999%" headers="mcps1.3.4.2.1.2.2.5.1.2 "><p id="EN-US_TOPIC_0053158614__p1425034513716">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="21.240000000000002%" headers="mcps1.3.4.2.1.2.2.5.1.3 "><p id="EN-US_TOPIC_0053158614__p41582949151632">String</p>
</td>
<td class="cellrowborder" valign="top" width="38.53%" headers="mcps1.3.4.2.1.2.2.5.1.4 "><p id="EN-US_TOPIC_0053158614__p28198497151632">Specifies the ID of the disk to be attached to a BMS.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0053158614__row52459882151632"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.1.2.2.5.1.1 "><p id="EN-US_TOPIC_0053158614__p21392044151632">device</p>
</td>
<td class="cellrowborder" valign="top" width="15.229999999999999%" headers="mcps1.3.4.2.1.2.2.5.1.2 "><p id="EN-US_TOPIC_0053158614__p1259612401874">No</p>
</td>
<td class="cellrowborder" valign="top" width="21.240000000000002%" headers="mcps1.3.4.2.1.2.2.5.1.3 "><p id="EN-US_TOPIC_0053158614__p55033990151632">String</p>
</td>
<td class="cellrowborder" valign="top" width="38.53%" headers="mcps1.3.4.2.1.2.2.5.1.4 "><p id="EN-US_TOPIC_0053158614__p7777719105553">Specifies the mount point, such as <strong id="EN-US_TOPIC_0053158614__b14157163336">/dev/sda</strong> and <strong id="EN-US_TOPIC_0053158614__b41611613338">/dev/sdb</strong>.</p>
<p id="EN-US_TOPIC_0053158614__p58233871152743">The new disk mount point cannot be the same as an existing one.</p>
<p id="EN-US_TOPIC_0053158614__p22488653151632">The mount point must be specified based on the sequence of existing device names. Otherwise, the system automatically generates a mount point.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0053158614__li105211424174519">Example request<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0053158614__screen54523910386"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">POST</span><span class="w"> </span><span class="n">https</span><span class="p">:</span><span class="c1">//{ECS Endpoint}/v2.1/c685484a8cc2416b97260938705deb65/servers/95bf2490-5428-432c-ad9b-5e3406f869dd/os-volume_attachments</span>
</pre></div></td></tr></table></div>
</div>
<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0053158614__screen42157863151916"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span></pre></div></td><td class="code"><div><pre><span></span><span class="p">{</span>
<span class="w"> </span><span class="s">&quot;volumeAttachment&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="s">&quot;volumeId&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;b53f23bd-ee8f-49ec-9420-d1acfeaf91d6&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s">&quot;device&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;/dev/sdb&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</pre></div></td></tr></table></div>
</div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0053158614__section58140617165259"><h4 class="sectiontitle">Response</h4><ul id="EN-US_TOPIC_0053158614__ul18214269144035"><li id="EN-US_TOPIC_0053158614__li44029608145538">Response parameters
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0053158614__table769899" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0053158614__row6968742"><th align="left" class="cellrowborder" valign="top" width="24.55%" id="mcps1.3.5.2.1.1.1.4.1.1"><p id="EN-US_TOPIC_0053158614__p27597234">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.6%" id="mcps1.3.5.2.1.1.1.4.1.2"><p id="EN-US_TOPIC_0053158614__p5740187">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="52.849999999999994%" id="mcps1.3.5.2.1.1.1.4.1.3"><p id="EN-US_TOPIC_0053158614__p62302025">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0053158614__row13299239"><td class="cellrowborder" valign="top" width="24.55%" headers="mcps1.3.5.2.1.1.1.4.1.1 "><p id="EN-US_TOPIC_0053158614__p3496541">volumeAttachment</p>
</td>
<td class="cellrowborder" valign="top" width="22.6%" headers="mcps1.3.5.2.1.1.1.4.1.2 "><p id="EN-US_TOPIC_0053158614__p56686067">Object</p>
</td>
<td class="cellrowborder" valign="top" width="52.849999999999994%" headers="mcps1.3.5.2.1.1.1.4.1.3 "><p id="EN-US_TOPIC_0053158614__p52192065">Specifies the disks attached to a BMS. For details, see <a href="#EN-US_TOPIC_0053158614__table548498215180">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0053158614__table548498215180"></a><a name="table548498215180"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0053158614__table548498215180" frame="border" border="1" rules="all"><caption><b>Table 3 </b><strong id="EN-US_TOPIC_0053158614__b1482315193210">volumeAttachment</strong> field data structure description</caption><thead align="left"><tr id="EN-US_TOPIC_0053158614__row3759039515180"><th align="left" class="cellrowborder" valign="top" width="24.85%" id="mcps1.3.5.2.1.2.2.4.1.1"><p id="EN-US_TOPIC_0053158614__p2669287225">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.61%" id="mcps1.3.5.2.1.2.2.4.1.2"><p id="EN-US_TOPIC_0053158614__p7666288227">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="52.54%" id="mcps1.3.5.2.1.2.2.4.1.3"><p id="EN-US_TOPIC_0053158614__p157112818226">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0053158614__row4742233715180"><td class="cellrowborder" valign="top" width="24.85%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="EN-US_TOPIC_0053158614__p1600407115180">device</p>
</td>
<td class="cellrowborder" valign="top" width="22.61%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="EN-US_TOPIC_0053158614__p2126141115180">String</p>
</td>
<td class="cellrowborder" valign="top" width="52.54%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="EN-US_TOPIC_0053158614__p4389880615180">Specifies the device name, for example, <strong id="EN-US_TOPIC_0053158614__b170320163315">/dev/vdb</strong>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0053158614__row5954494215180"><td class="cellrowborder" valign="top" width="24.85%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="EN-US_TOPIC_0053158614__p5841097215180">serverId</p>
</td>
<td class="cellrowborder" valign="top" width="22.61%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="EN-US_TOPIC_0053158614__p3366825815180">String</p>
</td>
<td class="cellrowborder" valign="top" width="52.54%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="EN-US_TOPIC_0053158614__p4217250415180">Specifies the ID of the BMS to which the disk is to be attached. The ID is in UUID format.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0053158614__row4400822315180"><td class="cellrowborder" valign="top" width="24.85%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="EN-US_TOPIC_0053158614__p789628615180">id</p>
</td>
<td class="cellrowborder" valign="top" width="22.61%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="EN-US_TOPIC_0053158614__p3561941815180">String</p>
</td>
<td class="cellrowborder" valign="top" width="52.54%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="EN-US_TOPIC_0053158614__p2593706215180">Specifies the disk UUID.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0053158614__row3210697315180"><td class="cellrowborder" valign="top" width="24.85%" headers="mcps1.3.5.2.1.2.2.4.1.1 "><p id="EN-US_TOPIC_0053158614__p5052800715180">volumeId</p>
</td>
<td class="cellrowborder" valign="top" width="22.61%" headers="mcps1.3.5.2.1.2.2.4.1.2 "><p id="EN-US_TOPIC_0053158614__p6623678615180">String</p>
</td>
<td class="cellrowborder" valign="top" width="52.54%" headers="mcps1.3.5.2.1.2.2.4.1.3 "><p id="EN-US_TOPIC_0053158614__p4966276115180">Specifies the attaching ID, which is the same as the UUID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="EN-US_TOPIC_0053158614__li0801104714513">Example response<div class="codecoloring" codetype="Java" id="EN-US_TOPIC_0053158614__screen52763957151929"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span>
<span class="normal">7</span>
<span class="normal">8</span></pre></div></td><td class="code"><div><pre><span></span><span class="p">{</span>
<span class="w"> </span><span class="s">&quot;volumeAttachment&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="s">&quot;id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;b53f23bd-ee8f-49ec-9420-d1acfeaf91d6&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s">&quot;volumeId&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;b53f23bd-ee8f-49ec-9420-d1acfeaf91d6&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s">&quot;serverId&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;820abbd0-2d8e-4bc5-ae46-69cacfd4fbaa&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="s">&quot;device&quot;</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;/dev/vdb&quot;</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</pre></div></td></tr></table></div>
</div>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0053158614__section7610951"><h4 class="sectiontitle">Returned Values</h4><div class="p" id="EN-US_TOPIC_0053158614__en-us_topic_0106040941_p193201622141412">Normal values
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0053158614__en-us_topic_0106040941_table753804619176" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0053158614__en-us_topic_0106040941_row10735134615172"><th align="left" class="cellrowborder" valign="top" width="42.42%" id="mcps1.3.6.2.1.1.3.1.1"><p id="EN-US_TOPIC_0053158614__en-us_topic_0106040941_p19735204616177">Returned Values</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="57.58%" id="mcps1.3.6.2.1.1.3.1.2"><p id="EN-US_TOPIC_0053158614__en-us_topic_0106040941_p207355465176">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0053158614__en-us_topic_0106040941_row1473514621713"><td class="cellrowborder" valign="top" width="42.42%" headers="mcps1.3.6.2.1.1.3.1.1 "><p id="EN-US_TOPIC_0053158614__en-us_topic_0106040941_p13735144611178">200</p>
</td>
<td class="cellrowborder" valign="top" width="57.58%" headers="mcps1.3.6.2.1.1.3.1.2 "><p id="EN-US_TOPIC_0053158614__en-us_topic_0106040941_p207351246161711">The request has been successfully processed.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="EN-US_TOPIC_0053158614__en-us_topic_0106040941_p47633965">For details about other returned values, see <a href="en-us_topic_0053158690.html">Status Codes</a>.</p>
</div>
<div class="section" id="EN-US_TOPIC_0053158614__section14752650154917"><h4 class="sectiontitle">Error Codes</h4><p id="EN-US_TOPIC_0053158614__en-us_topic_0106040941_p10243161417491">See <a href="en-us_topic_0107541808.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0053158703.html">BMS Disk Management</a></div>
</div>
</div>