description | external help file | Module Name | ms.date | online version | schema | title |
---|---|---|---|---|---|---|
Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell. |
Microsoft.Iscsi.Target.Commands.dll-Help.xml |
IscsiTarget |
12/20/2016 |
2.0.0 |
New-IscsiVirtualDisk |
Creates an iSCSI virtual disk with the specified file path and size.
New-IscsiVirtualDisk [-Description <String>] [-Path] <String> [-SizeBytes] <UInt64>
[-LogicalSectorSizeBytes <UInt32>] [-PhysicalSectorSizeBytes <UInt32>] [-BlockSizeBytes <UInt32>]
[-ComputerName <String>] [-Credential <PSCredential>] [<CommonParameters>]
New-IscsiVirtualDisk [-Description <String>] -ParentPath <String> [-Path] <String> [[-SizeBytes] <UInt64>]
[-PhysicalSectorSizeBytes <UInt32>] [-BlockSizeBytes <UInt32>] [-ComputerName <String>]
[-Credential <PSCredential>] [<CommonParameters>]
New-IscsiVirtualDisk [-Description <String>] [-Path] <String> [-SizeBytes] <UInt64> [-DoNotClearData]
[-UseFixed] [-LogicalSectorSizeBytes <UInt32>] [-PhysicalSectorSizeBytes <UInt32>] [-BlockSizeBytes <UInt32>]
[-ComputerName <String>] [-Credential <PSCredential>] [<CommonParameters>]
The New-IscsiVirtualDisk cmdlet creates an iSCSI Virtual Hard Disk (VHDX) object that has 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, a new VHDX file is created.
If the VHDX file path exists, the server returns an error. Use the Import-IscsiVirtualDisk cmdlet to import existing virtual hard disks.
If the cmdlet displays an error while it creates a virtual disk, 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 name extension.
-
The VHDX file cannot be a network file, or be in a compressed, sparse, or transacted folder.
PS C:\> New-IscsiVirtualDisk -UseFixed -Path "E:\temp\test.vhdx" -Size 10GB
This example creates a fixed VHDX that is 10GB in size.
PS C:\> New-IscsiVirtualDisk -ParentPath "E:\temp\test.vhdx" -Path "E:\temp\child\diff.vhdx"
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 -Path "E:\temp\test.vhdx" -Size 10GB -ComputerName "iscsisvr"
This example creates a dynamic VHDX with the size 10GB at E:\temp\test.vhdx on the computer named iscsisvr.
PS C:\> New-IscsiVirtualDisk -Path "ramdisk:test.vhdx" -Size 20MB
This example creates a VHDX with the size 20MB. This VHDX is not saved. The VHDX is lost if the wintarget service is restarted or the system is restarted.
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.
Type: UInt32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
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.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the credentials when connecting to a remote computer.
Type: PSCredential
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the description for the iSCSI virtual disk.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
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.
Type: SwitchParameter
Parameter Sets: Fixed
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the logical sector size, in bytes, for the VHDX. The acceptable values for this parameter are: 512 and 4096. The default value is 512.
Type: UInt32
Parameter Sets: Dynamic, Fixed
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the parent virtual disk path if the VHDX is a differencing disk.
Type: String
Parameter Sets: Differencing
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the path of the VHDX file that is associated with the iSCSI virtual disk. If the VHDX file path does not exist, a new VHDX file is created. If the virtual hard disk file path exists, the server returns an error. Use the Import-IscsiVirtualDisk cmdlet to import existing virtual hard drives.
Type: String
Parameter Sets: (All)
Aliases: DevicePath
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Specifies the physical sector size, in bytes, for the VHDX. The acceptable values for this parameter are: 512 and 4096. The default value is 4096.
Type: UInt32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the size, in bytes, of the iSCSI virtual disk.
Type: UInt64
Parameter Sets: Dynamic, Fixed
Aliases: Size
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Type: UInt64
Parameter Sets: Differencing
Aliases: Size
Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
Indicates that the cmdlet creates a fixed VHDX.
Type: SwitchParameter
Parameter Sets: Fixed
Aliases: Fixed
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.