共用方式為


New-AzureStorSimpleDeviceVolume

在指定的磁碟區容器中建立磁碟區。

注意

本文件中參考的 Cmdlet 用於管理使用 Azure Service Manager(ASM) API 的舊版 Azure 資源。 建立新的資源時,不建議使用此舊版 PowerShell 模組,因為 ASM 已排定淘汰。 如需詳細資訊,請參閱 Azure Service Manager 淘汰

Az PowerShell 模組是使用 PowerShell 管理 Azure Resource Manager (ARM) 資源的建議 PowerShell 模組。

語法

New-AzureStorSimpleDeviceVolume
   -DeviceName <String>
   -VolumeContainer <DataContainer>
   -VolumeName <String>
   -VolumeSizeInBytes <Int64>
   -AccessControlRecords <System.Collections.Generic.List`1[Microsoft.WindowsAzure.Management.StorSimple.Models.AccessControlRecord]>
   -VolumeAppType <AppType>
   -Online <Boolean>
   -EnableDefaultBackup <Boolean>
   -EnableMonitoring <Boolean>
   [-WaitForComplete]
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]

Description

New-AzureStorSimpleDeviceVolume Cmdlet 會在指定的磁碟區容器中建立磁碟區。 此 Cmdlet 會將每個磁碟區與一或多個訪問控制記錄產生關聯。 若要取得 AccessControlRecord 物件,請使用 Get-AzureStorSimpleAccessControlRecord Cmdlet。 指定磁碟區的名稱、大小和 AppType。 此外,請指定是否要在在線建立磁碟區、是否啟用預設備份,以及是否要啟用監視。

範例

範例 1:建立磁碟區

PS C:\>$AcrList = Get-AzureStorSimpleAccessControlRecord
PS C:\> Get-AzureStorSimpleDeviceVolumeContainer -DeviceName "Contoso63-AppVm" -VolumeContainerName "VolumeContainer07" | New-AzureStorSimpleDeviceVolume -DeviceName "Contoso63-AppVm" -VolumeName "Volume18" -Size 2000000000 -AccessControlRecords $AcrList -VolumeAppType PrimaryVolume -Online $True -EnableDefaultBackup $False -EnableMonitoring $False

VERBOSE: ClientRequestId: a29d1a84-1f81-4f20-9130-7adfe45e41fb_PS
VERBOSE: ClientRequestId: 8fa63df1-3f81-4029-a536-b536a70068ad_PS
VERBOSE: ClientRequestId: 964c5744-8bb1-4f70-beda-95ca4c7f3eb6_PS
VERBOSE: ClientRequestId: f09fff3a-54fa-4a0e-93db-b079260ed2dd_PS
VERBOSE: ClientRequestId: 59aa29e3-8044-411a-adae-b64a2681ffed_PS
VERBOSE: ClientRequestId: 0ffd0297-19be-40fe-a64e-6a2947d831b4_PS
c3b1ad53-7a51-49d7-ae83-94ff1ff3ab90
VERBOSE: The create task is submitted successfully. Please use the command Get-AzureStorSimpleTask -InstanceId
c3b1ad53-7a51-49d7-ae83-94ff1ff3ab90 for tracking the task's status
VERBOSE: Volume container with name: VolumeContainer07 is found.

第一個命令會使用 Get-AzureStorSimpleAccessControlRecord Cmdlet 取得 StorSimple Manager 服務組態中的訪問控制記錄,然後將記錄儲存在 $AcrList 變數中。

第二個命令會使用 Get-AzureStorSimpleDeviceVolumeContainer Cmdlet,取得名為 Contoso63-AppVm 之裝置的 VolumeContainer07 磁碟區容器。 命令會使用管線運算符,將該容器傳遞至目前的 Cmdlet。 此 Cmdlet 會建立磁碟區。 命令會指定磁碟區的名稱、大小,以及儲存在 $AcrList 中的訪問控制記錄。 此命令會啟動作業,然後傳 回TaskResponse 物件。 若要查看作業的狀態,請使用 Get-AzureStorSimpleTask Cmdlet。

範例 2:建立不含 存取控制 access 控件的磁碟區access 控件

PS C:\>Get-AzureStorSimpleDeviceVolumeContainer -DeviceName "Contoso63-AppVm" -VolumeContainerName "VolumeContainer01" | New-AzureStorSimpleDeviceVolume -DeviceName "Contoso63-AppVm" -VolumeName "Volume22" -Size 2000000000 -AccessControlRecords @() -VolumeAppType PrimaryVolume -Online $True -EnableDefaultBackup $False -EnableMonitoring $False -WaitForComplete
VERBOSE: ClientRequestId: 3f359790-7e1f-48e7-acf8-ecabba850966_PS
VERBOSE: ClientRequestId: 2723ebcf-cd72-47bb-99b5-0c099d45641b_PS
VERBOSE: ClientRequestId: e605091f-dd63-42a7-bda2-24753cbc1f9a_PS
VERBOSE: ClientRequestId: b3fd08c3-67c5-4309-9591-15d92c360469_PS
VERBOSE: ClientRequestId: 15a024a3-b0c9-4f83-9c34-0ed8b95d024b_PS
VERBOSE: ClientRequestId: c13f92f9-aea1-40dd-af80-3affe273adbe_PS


TaskId       : ceef657e-390e-4f7a-aab7-669a29c29e7f
TaskResult   : Succeeded
TaskStatus   : Completed
ErrorCode    : 
ErrorMessage : 
TaskSteps    : {Microsoft.WindowsAzure.Management.StorSimple.Models.TaskStep}

VERBOSE: The task created for your create operation has completed successfully. 
VERBOSE: ClientRequestId: 1d79febf-f752-4255-af2d-230d40773bc6_PS
AccessType             : NoAccess
AcrIdList              : {}
AcrList                : {}
AppType                : PrimaryVolume
DataContainer          : Microsoft.WindowsAzure.Management.StorSimple.Models.DataContainer
DataContainerId        : 68b63d15-6aa5-4e69-9f9d-4a0bc607d6e9
InstanceId             : SS-VOL-d73b7eec-76fc-4310-b347-69b160de8cdd
InternalInstanceId     : 
IsBackupEnabled        : False
IsDefaultBackupEnabled : False
IsMonitoringEnabled    : False
Name                   : Volume22
Online                 : True
OperationInProgress    : None
SizeInBytes            : 2000000000
VSN                    : SS-VOL-d73b7eec-76fc-4310-b347-69b160de8cdd

VERBOSE: Volume container with name: VolumeContainer01 is found.

此命令會使用 Get-AzureStorSimpleDeviceVolumeContainer Cmdlet,為名為 Contoso63-AppVm 的裝置取得名為 VolumeContainer01 的磁碟區容器。 命令會使用管線運算符,將該容器傳遞至目前的 Cmdlet。 此 Cmdlet 會建立磁碟區。 命令會指定磁碟區的名稱、大小,以及訪問控制記錄的空白值。 此命令會 指定 WaitForComplete 參數,因此它會在建立磁碟區之後傳回 TaskStatusInfo

因為命令沒有指定訪問控制記錄,所以無法存取此磁碟區。 您稍後 可以使用 Set-AzureStorSimpleDeviceVolume Cmdlet 來新增存取權。

參數

-AccessControlRecords

指定要與磁碟區建立關聯的訪問控制記錄清單。

類型:List<T>[AccessControlRecord]
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-DeviceName

指定要在其中建立磁碟區的 StorSimple 裝置名稱。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-EnableDefaultBackup

指定是否要啟用磁碟區的預設備份。

類型:Boolean
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-EnableMonitoring

指定是否要啟用磁碟區的監視。

類型:Boolean
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Online

指定是否要在在線建立磁碟區。

類型:Boolean
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Profile

指定 Azure 設定檔。

類型:AzureSMProfile
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-VolumeAppType

指定建立主要磁碟區或封存磁碟區。 有效值為:PrimaryVolume 和 ArchiveVolume。

類型:AppType
別名:AppType
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-VolumeContainer

指定要在其中建立磁碟區的容器做為 DataContainer 物件。 若要取得 VirtualDisk 物件,請使用 Get-AzureStorSimpleDeviceVolumeContainer Cmdlet。

類型:DataContainer
別名:Container
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-VolumeName

指定新磁碟區的名稱。

類型:String
別名:Name
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-VolumeSizeInBytes

指定以位元組為單位的磁碟區大小。

類型:Int64
別名:SizeInBytes
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-WaitForComplete

表示此 Cmdlet 會先等候作業完成,再將控制權傳回 Windows PowerShell 控制台。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

DataContainer, List\<AccessControlRecord\>

此 Cmdlet 會接受 DataContainer 物件,以及新磁碟區的 AccessControlRecord 物件清單

輸出

TaskStatusInfo

如果您指定 WaitForComplete 參數,此 Cmdlet 會傳回 TaskStatusInfo 物件。