pool.attach
===========

Attach a disk to an existing vdev in a pool, converting a striped vdev to a mirror or extending an existing mirror to an n-way mirror.

This operation will format the new disk, attach it to the target vdev, and wait for resilvering to complete if the target is a RAIDZ vdev undergoing expansion.

Locking behavior: - If another attach operation is already using the same disk, this call will fail immediately with EBUSY rather than queueing. - If another attach operation is running on the same pool (but with a different disk), this call will queue and wait for the previous operation to complete. - Operations on different pools with different disks can run concurrently.

This method is a job.

.. raw:: html

    <div id="json-schema"> <span class="badge badge-dark value-type">Type: object</span><br/> <div class="accordion" id="accordionCall_parameters"> <div class="card"> <div class="card-header" id="headingCall_parameters"> <h2 class="mb-0"> <button aria-controls="Call_parameters" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters" data-toggle="collapse" onclick="setAnchor('#Call_parameters')" type="button"><span class="property-name">Call parameters</span></button> </h2> </div> <div aria-labelledby="headingCall_parameters" class="collapse property-definition-div" data-parent="#accordionCall_parameters" id="Call_parameters"> <div class="card-body pl-5"> <span class="badge badge-dark value-type">Type: array</span><br/> <span class="badge badge-info no-additional">No Additional Items</span><h4>Tuple Validation</h4> <h5>Parameter 1: oid</h5> <div class="card"> <div class="card-body items-definition" id="Call_parameters_items_i0"> <h4>oid</h4><span class="badge badge-dark value-type">Type: integer</span><br/> <span class="description"><p>ID of the pool to attach a disk to.</p> </span> </div> </div> <h5>Parameter 2: options</h5> <div class="card"> <div class="card-body items-definition" id="Call_parameters_items_i1"> <h4>options</h4><span class="badge badge-dark value-type">Type: object</span><br/> <span class="description"><p>Configuration for the disk attachment operation.</p> </span> <span class="badge badge-info no-additional">No Additional Properties</span> <div class="accordion" id="accordionCall_parameters_items_i1_target_vdev"> <div class="card"> <div class="card-header" id="headingCall_parameters_items_i1_target_vdev"> <h2 class="mb-0"> <button aria-controls="Call_parameters_items_i1_target_vdev" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i1_target_vdev" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i1_target_vdev')" type="button"><span class="property-name">target_vdev</span> <span class="badge badge-warning required-property">Required</span></button> </h2> </div> <div aria-labelledby="headingCall_parameters_items_i1_target_vdev" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i1_target_vdev" id="Call_parameters_items_i1_target_vdev"> <div class="card-body pl-5"> <h4>Target Vdev</h4><span class="badge badge-dark value-type">Type: string</span><br/> <span class="description"><p>The GUID of the vdev where the disk needs to be attached. In the case of a STRIPED vdev, this is the STRIPED disk GUID which will be converted into a mirror. If <code>target_vdev</code> is already a mirror, it will be converted into an n-way mirror.</p> </span> </div> </div> </div> </div> <div class="accordion" id="accordionCall_parameters_items_i1_new_disk"> <div class="card"> <div class="card-header" id="headingCall_parameters_items_i1_new_disk"> <h2 class="mb-0"> <button aria-controls="Call_parameters_items_i1_new_disk" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i1_new_disk" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i1_new_disk')" type="button"><span class="property-name">new_disk</span> <span class="badge badge-warning required-property">Required</span></button> </h2> </div> <div aria-labelledby="headingCall_parameters_items_i1_new_disk" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i1_new_disk" id="Call_parameters_items_i1_new_disk"> <div class="card-body pl-5"> <h4>New Disk</h4><span class="badge badge-dark value-type">Type: string</span><br/> <span class="description"><p>Name of the new disk to attach.</p> </span> </div> </div> </div> </div> <div class="accordion" id="accordionCall_parameters_items_i1_allow_duplicate_serials"> <div class="card"> <div class="card-header" id="headingCall_parameters_items_i1_allow_duplicate_serials"> <h2 class="mb-0"> <button aria-controls="Call_parameters_items_i1_allow_duplicate_serials" aria-expanded="" class="btn btn-link property-name-button" data-target="#Call_parameters_items_i1_allow_duplicate_serials" data-toggle="collapse" onclick="setAnchor('#Call_parameters_items_i1_allow_duplicate_serials')" type="button"><span class="property-name">allow_duplicate_serials</span></button> </h2> </div> <div aria-labelledby="headingCall_parameters_items_i1_allow_duplicate_serials" class="collapse property-definition-div" data-parent="#accordionCall_parameters_items_i1_allow_duplicate_serials" id="Call_parameters_items_i1_allow_duplicate_serials"> <div class="card-body pl-5"> <h4>Allow Duplicate Serials</h4><span class="badge badge-dark value-type">Type: boolean</span> <span class="badge badge-success default-value">Default: false</span><br/> <span class="description"><p>Whether to allow attaching disks with duplicate serial numbers.</p> </span> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div class="accordion" id="accordionReturn_value"> <div class="card"> <div class="card-header" id="headingReturn_value"> <h2 class="mb-0"> <button aria-controls="Return_value" aria-expanded="" class="btn btn-link property-name-button" data-target="#Return_value" data-toggle="collapse" onclick="setAnchor('#Return_value')" type="button"><span class="property-name">Return value</span></button> </h2> </div> <div aria-labelledby="headingReturn_value" class="collapse property-definition-div" data-parent="#accordionReturn_value" id="Return_value"> <div class="card-body pl-5"> <h4>Result</h4><span class="badge badge-dark value-type">Type: null</span><br/> <span class="description"><p>Returns <code>null</code> on successful disk attachment.</p> </span> </div> </div> </div> </div> </div><br><br>

*Required roles:* POOL_WRITE

