New-IscsiVirtualDisk

New-IscsiVirtualDisk

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

Syntax

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>]

Detaillierte Beschreibung

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.

Parameter

-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.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

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.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-Credential<PSCredential>

Specifies the credentials when connecting to a remote computer.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-Description<String>

Specifies the description for the iSCSI virtual disk.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

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.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-LogicalSectorSizeBytes<UInt32>

Specifies the logical sector size, in bytes, for the VHDX. Die folgenden Werte für diesen Parameter sind zulässig: 512 and 4096. The default value is 512.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

512

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-ParentPath<String>

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

Aliasse

Keiner

Erforderlich?

true

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

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.

Aliasse

DevicePath

Erforderlich?

true

Position?

1

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-PhysicalSectorSizeBytes<UInt32>

Specifies the physical sector size, in bytes, for the VHDX. Die folgenden Werte für diesen Parameter sind zulässig: 512 and 4096. The default value is 4096.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

4096

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-SizeBytes<UInt64>

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

Aliasse

Size

Erforderlich?

true

Position?

2

Standardwert

Keiner

Pipelineeingaben akzeptieren?

True (ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-UseFixed

Indicates that the cmdlet creates a fixed VHDX.

Aliasse

Fixed

Erforderlich?

true

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

<CommonParameters>

Dieses Cmdlet unterstützt die allgemeinen Parameter: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable. Weitere Informationen finden Sie unter about_CommonParameters (http://go.microsoft.com/fwlink/p/?LinkID=113216).

Eingaben

Der Eingabetyp ist der Typ der Objekte, die über die Pipeline an das Cmdlet übergeben werden können.

  • None

Ausgaben

Der Ausgabetyp ist der Typ der Objekte, die vom Cmdlet ausgegeben werden.

  • Microsoft.Iscsi.Target.Commands.IscsiVirtualDisk

Beispiele

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

Verwandte Themen

Checkpoint-IscsiVirtualDisk

Convert-IscsiVirtualDisk

Get-IscsiVirtualDisk

Import-IscsiVirtualDisk

Remove-IscsiVirtualDisk

Restore-IscsiVirtualDisk

Set-IscsiVirtualDisk