New-IscsiVirtualDisk

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

New-IscsiVirtualDisk

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

Syntax

Parameter Set: Fixed
New-IscsiVirtualDisk [-Path] <String> [-Size] <UInt64> [-ComputerName <String> ] [-Description <String> ] [ <CommonParameters>]

Parameter Set: Differencing
New-IscsiVirtualDisk [-Path] <String> -ParentPath <String> [-ComputerName <String> ] [-Description <String> ] [ <CommonParameters>]

Detailed Description

The New-IscsiVirtualDisk cmdlet creates a new iSCSI Virtual Hard Disk (VHD) object with the specified file path and size. After the iSCSI VHD 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 VHD file path does not exist, then a new VHD file will then be created.
If the VHD file path exists, then the server will return an error. Use the Import-IscsiVirtualDisk cmdlet to import existing VHDs.

Parameters

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

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-Description<String>

Specifies the description for the iSCSI virtual disk.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-ParentPath<String>

Indicates the parent virtual disk path if the VHD is a differencing disk.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-Path<String>

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

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-Size<UInt64>

Specifies the size of the iSCSI virtual disk.
Note: This parameter takes a number and a unit as input, such as 10GB, 20MB, 1TB.
If this parameter is not provided, then a prompt for the input of this parameter with be displayed, as it is a required field. At that time, the value will need to be provided in Bytes; since no unit can be entered at the prompt.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.Iscsi.Target.Commands.IscsiVirtualDisk

Examples

EXAMPLE 1

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

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

EXAMPLE 2

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

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

EXAMPLE 3

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

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

EXAMPLE 4

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

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

Import-IscsiVirtualDisk