New-IscsiVirtualDisk

New-IscsiVirtualDisk

Creates an iSCSI virtual disk with the specified file path and size.

構文

Parameter Set: Dynamic
New-IscsiVirtualDisk [-Path] <String> [-SizeBytes] <UInt64> [-BlockSizeBytes <UInt32> ] [-ComputerName <String> ] [-Credential <PSCredential> ] [-Description <String> ] [-LogicalSectorSizeBytes <UInt32> ] [-PhysicalSectorSizeBytes <UInt32> ] [ <CommonParameters>]

Parameter Set: Differencing
New-IscsiVirtualDisk [-Path] <String> [[-SizeBytes] <UInt64> ] -ParentPath <String> [-BlockSizeBytes <UInt32> ] [-ComputerName <String> ] [-Credential <PSCredential> ] [-Description <String> ] [-PhysicalSectorSizeBytes <UInt32> ] [ <CommonParameters>]

Parameter Set: Fixed
New-IscsiVirtualDisk [-Path] <String> [-SizeBytes] <UInt64> -UseFixed [-BlockSizeBytes <UInt32> ] [-ComputerName <String> ] [-Credential <PSCredential> ] [-Description <String> ] [-DoNotClearData] [-LogicalSectorSizeBytes <UInt32> ] [-PhysicalSectorSizeBytes <UInt32> ] [ <CommonParameters>]

詳細説明

The New-IscsiVirtualDisk cmdlet creates a new iSCSI Virtual Hard Disk (VHDX) object with the specified file path and size. After the iSCSI VHDX object has been created, the virtual disk can be assigned to an iSCSI target. Once a virtual disk has been assigned to a target, and an initiator connects to that target, the iSCSI initiator can then access the virtual disk after the initiator connects to the target.

If the virtual hard disk file path does not exist, then a new VHDX file will then be created.
If the VHDX file path exists, then the server will return an error. Use the Import-IscsiVirtualDisk cmdlet to import existing virtual hard disks.

If an error is displayed during the creation of the virtual disk, please check the following conditions:
-- An absolute file path must be specified for the Path and ParentPath parameters.
-- The virtual disk file name must have a .vhdx file extension.
-- The VHDX file cannot be a network file, or be in a compressed, sparse, or transacted folder.

パラメーター

-BlockSizeBytes<UInt32>

Specifies the block size, in bytes, for the VHDX. For fixed VHDX, if the value of the SizeBytes parameter is less than 32 MB, the default size if 2 MB. Otherwise, the default value is 32 MB. For dynamic VHDX, the default size is 2 MB. For differencing VHDX, the default size is the parent BlockSize.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-ComputerName<String>

Specifies the computer name, or IP address, of the remote computer, if this cmdlet is run on a remote computer.
Specifies the cluster resource group network name, or cluster node name, if this cmdlet is run on a cluster configuration.

If you do not specify a value for this parameter, the cmdlet uses the local computer.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Credential<PSCredential>

Specifies the credentials when connecting to a remote computer.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Description<String>

Specifies the description for the iSCSI virtual disk.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-DoNotClearData

Indicates that the cmdlet does not clear the fixed VHDX. Because failing to clear data can reveal pre-existing data, we do not recommend this option.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-LogicalSectorSizeBytes<UInt32>

Specifies the logical sector size, in bytes, for the VHDX. このパラメーターに対して使用できる値: 512 and 4096. The default value is 512.

エイリアス

なし

必須?

false

位置は?

named

既定値

512

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-ParentPath<String>

Specifies the parent virtual disk path if the VHDX is a differencing disk.

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-Path<String>

Specifies the path of the VHDX file that is associated with the iSCSI virtual disk.
If the VHDX file path does not exist, then a new VHDX file will then be created.
If the virtual hard drive file path exists, then the server will return an error. Use the Import-IscsiVirtualDisk cmdlet to import existing virtual hard drives.

エイリアス

DevicePath

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-PhysicalSectorSizeBytes<UInt32>

Specifies the physical sector size, in bytes, for the VHDX. このパラメーターに対して使用できる値: 512 and 4096. The default value is 4096.

エイリアス

なし

必須?

false

位置は?

named

既定値

4096

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-SizeBytes<UInt64>

Specifies the size, in bytes, of the iSCSI virtual disk.

エイリアス

Size

必須?

true

位置は?

2

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-UseFixed

Indicates that the cmdlet creates a fixed VHDX.

エイリアス

Fixed

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

  • None

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • Microsoft.Iscsi.Target.Commands.IscsiVirtualDisk

EXAMPLE 1

This example creates a fixed VHDX with 10GB in size.

PS C:\> New-IscsiVirtualDisk –Path "E:\temp\test.vhdx" -Size 10GB

EXAMPLE 2

This example creates a differencing VHDX, with the parent path E:\temp\test.vhdx and the differencing VHDX path is E:\temp\child\diff.vhdx.

PS C:\> New-IscsiVirtualDisk -ParentPath "E:\temp\test.vhdx" -Path "E:\temp\child\diff.vhdx"

EXAMPLE 3

This example creates a fixed VHDX with the size 10GB at E:\temp\test.vhdx on the computer named iscsisvr.

PS C:\> New-IscsiVirtualDisk –Path "E:\temp\test.vhdx" -Size 10GB -ComputerName "iscsisvr"

EXAMPLE 4

This example creates a VHDX with the size 20MB. This VHDX will not be saved, the VHDX will be lost if the wintarget service is restarted or the system is restarted.

PS C:\> New-IscsiVirtualDisk –Path ramdisk:test.vhdx –Size 20MB

関連トピック

Checkpoint-IscsiVirtualDisk

Convert-IscsiVirtualDisk

Get-IscsiVirtualDisk

Import-IscsiVirtualDisk

Remove-IscsiVirtualDisk

Restore-IscsiVirtualDisk

Set-IscsiVirtualDisk