<div class="content"><p> </p><p>The CreateVolume2 method creates a <span><a href="8eef5d42-22d7-4302-aed9-12face91505a#gt_9a876829-33a1-4f0b-8b81-8552b7e5561c" data-linktype="relative-path">volume</a></span> in a <span><a href="8eef5d42-22d7-4302-aed9-12face91505a#gt_a6543827-8d70-4e5a-a982-2fdc2e7f8bca" data-linktype="relative-path">disk pack</a></span>
with an optional alignment parameter.</p><dl>
<dd>
<div><pre> HRESULT CreateVolume2(
   [in] VDS_VOLUME_TYPE type,
   [in, size_is(lNumberOfDisks)] VDS_INPUT_DISK* pInputDiskArray,
   [in] long lNumberOfDisks,
   [in] unsigned long ulStripeSize,
   [in] unsigned long ulAlign,
   [out] IVdsAsync** ppAsync
 );
</pre></div>
</dd></dl><p><b>type: </b>A value from the <span><a href="7d8726fc-4c14-45b5-b085-9644097811ae" data-linktype="relative-path">VDS_VOLUME_TYPE</a></span>
enumeration that indicates the type of volume to create.</p><p><b>pInputDiskArray: </b>An array of <span><a href="2ec3b542-a7d7-4927-bdd6-b0dc8a8881ae" data-linktype="relative-path">VDS_INPUT_DISK</a></span>
structures that indicate the <span><a href="8eef5d42-22d7-4302-aed9-12face91505a#gt_c4133b2a-a990-4042-ba44-7fda3090f118" data-linktype="relative-path">disks</a></span> on which to
create the volume.<a id="Appendix_A_Target_86"></a><a aria-label="Product behavior note 86" href="6b2552ee-ba27-409f-99a8-18841573327a#Appendix_A_86" data-linktype="relative-path">&lt;86&gt;</a></p><p><b>lNumberOfDisks: </b>The number of elements in <b>pInputDiskArray</b>.</p><p><b>ulStripeSize: </b>The stripe size, in bytes, of
the new volume.<a id="Appendix_A_Target_87"></a><a aria-label="Product behavior note 87" href="6b2552ee-ba27-409f-99a8-18841573327a#Appendix_A_87" data-linktype="relative-path">&lt;87&gt;</a></p><p><b>ulAlign: </b>The number of bytes for the volume
alignment. If zero is specified, the server determines the alignment value
based on the size of the disk on which the volume is created.<a id="Appendix_A_Target_88"></a><a aria-label="Product behavior note 88" href="6b2552ee-ba27-409f-99a8-18841573327a#Appendix_A_88" data-linktype="relative-path">&lt;88&gt;</a></p><p><b>ppAsync: </b>A pointer to an <span><a href="97ea9c0f-5c8a-43e9-a9ee-deda29e2a09e" data-linktype="relative-path">IVdsAsync</a></span>
interface that, if the operation is successfully completed, receives the
IVdsAsync interface to monitor and control this operation. Callers MUST release
the interface when they are done with it. If the IVdsAsync::Wait (Opnum 4)
method is called on the interface, the interfaces returned in the <span><a href="d21dadd7-b2ed-4c02-8fd2-83264272d277" data-linktype="relative-path">VDS_ASYNC_OUTPUT</a></span>
structure MUST be released as well. For more information on handling asynchronous
tasks, see section <span><a href="28fc0a76-54bc-4d7d-81c3-37cf36586b23" data-linktype="relative-path">3.4.5.1.9</a></span>.</p><p><b>Return Values: </b>The method MUST return zero or
a non-error <span><a href="8eef5d42-22d7-4302-aed9-12face91505a#gt_799103ab-b3cb-4eab-8c55-322821b2b235" data-linktype="relative-path">HRESULT</a></span> (as
specified in <span><a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a></span>)
to indicate success, or return an implementation-specific nonzero error code to
indicate failure. For the HRESULT values predefined by the Virtual Disk Service
Remote Protocol, see section <span><a href="5102cc53-3143-4268-ba4c-6ea39e999ab4" data-linktype="relative-path">2.2.3</a></span>.</p><p>IVdsPack2::CreateVolume2 has the same sequencing rules as
IVdsPack::CreateVolume (Opnum 7), as specified in section <span><a href="ff016bf6-4956-43ed-b143-54055d94a28c" data-linktype="relative-path">3.4.5.2.19.5</a></span>.</p></div>