You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the Disk resource to create ReFS volumes on Windows Server 2019, an "Invalid Parameter" exception occurs when calling the Format-Volume cmdlet in the Set method.
This can be replicated outside of the DSC Resource with the following code:
functionNew-VDisk
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$True)]
[String]
$Path,
[Parameter()]
[Uint32]
$SizeInMB,
[Parameter()]
[Switch]
$Initialize
)
$tempScriptPath=Join-Path-Path $ENV:Temp-ChildPath 'DiskPartVdiskScript.txt'Write-Verbose-Message ('Creating DISKPART script {0}'-f$tempScriptPath)
$diskPartScript="CREATE VDISK FILE=`"$Path`" TYPE=EXPANDABLE MAXIMUM=$SizeInMB"if ($Initialize)
{
# The disk will be initialized with GPT (first blank line required because we're adding to existing string)$diskPartScript+=@"SELECT VDISK FILE=`"$Path`"ATTACH VDISKCONVERT GPTDETACH VDISK"@
}
Set-Content`-Path $tempScriptPath`-Value $diskPartScript`-Encoding Ascii
$result=& DISKPART @('/s',$tempScriptPath)
Write-Verbose-Message ($Result|Out-String)
$null=Remove-Item-Path $tempScriptPath-Force
} # end function New-VDisk$VHDPath=Join-Path-Path $ENV:Temp-ChildPath 'TestDisk.vhd'$null=New-VDisk-Path $VHDPath-SizeInMB 1024$null=Mount-DiskImage-ImagePath $VHDPath-StorageType VHD -NoDriveLetter
$diskImage=Get-DiskImage-ImagePath $VHDPath$disk=Get-Disk-Number $diskImage.Number$FSLabel='TestDisk'$disk|Initialize-Disk-PartitionStyle GPT
$partition=$disk|New-Partition-UseMaximumSize
# Following line works on WS 2016, but not on WS 2019. $partition|Format-Volume-FileSystem ReFS
# Invalid Parameter occurs$null=Dismount-DiskImage-ImagePath $VHDPath-StorageType VHD
$null=Remove-Item-Path $VHDPath-Force
The exception occurs:
The error appears to be in the WMI subsystem.
This should be logged with the Window Server storage team. I'll try and find the appropriate method to log the issue.
In the mean time there are two things than should be done:
Change the resource to display a warning message when ReFS is used with Windows Server 2019.
Add a known issue in the README.MD
The text was updated successfully, but these errors were encountered:
When using the Disk resource to create ReFS volumes on Windows Server 2019, an "Invalid Parameter" exception occurs when calling the
Format-Volume
cmdlet in theSet
method.This can be replicated outside of the DSC Resource with the following code:
The exception occurs:
The error appears to be in the WMI subsystem.
This should be logged with the Window Server storage team. I'll try and find the appropriate method to log the issue.
In the mean time there are two things than should be done:
The text was updated successfully, but these errors were encountered: