Closed ed-vazquez closed 7 years ago
Issue may that test-resource does not return false for a mismatch like the other tests.
# Drive size
if ($Size)
{
if ($partition.Size -ne $Size)
{
# The partition size mismatches but can't be changed (yet)
Write-Verbose -Message ( @(
"$($MyInvocation.MyCommand): "
$($LocalizedData.DriveSizeMismatchMessage `
-f $DriveLetter,$Partition.Size,$Size)
) -join '' )
} # if
} # if
Hi @VazquezTech - Thank you for reporting this. You are quite correct. This is a known limitation of the resource. This has been on my todo list but I haven't had time to look into it.
This is actually a duplicate of issue #11. It requires the destructive switch (is discussed in #50) to be implemented to allow destructive changes to be made to a disk (in this case resizing the partition).
We choose to return $true when a size mismatch occurs to prevent the Set-TargetResource firing when we can't actually do anything to resolve the size mismatch (yet).
But as this is a duplicate of issue #11, can we close this issue and raise and further discussion in that one?
Hi Daniel,
Thank you for the prompt response. Please close issue.
On Thu, Jan 12, 2017 at 6:21 AM Eduardo Vazquez evazquez@vazqueztech.com wrote:
On Thu, Jan 12, 2017 at 12:56 AM Daniel Scott-Raynsford < notifications@github.com> wrote:
Hi @VazquezTech https://github.com/VazquezTech - Thank you for reporting this. You are quite correct. This is a known limitation of the resource. This has been on my todo list but I haven't had time to look into it.
This is actually a duplicate of issue #11 https://github.com/PowerShell/xStorage/issues/11. It requires the destructive switch (is discussed in #50 https://github.com/PowerShell/xStorage/issues/50) to be implemented to allow destructive changes to be made to a disk (in this case resizing the partition).
We choose to return $true when a size mismatch occurs to prevent the Set-TargetResource firing when we can't actually do anything to resolve the size mismatch (yet).
But as this is a duplicate of issue #11 https://github.com/PowerShell/xStorage/issues/11, can we close this issue and raise and further discussion in that one?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/PowerShell/xStorage/issues/75#issuecomment-272082862, or mute the thread https://github.com/notifications/unsubscribe-auth/ABdc1o9iQ5nJWhHab1XKFGuy7YQ5pSrAks5rRcBwgaJpZM4LhFq6 .
Thanks @VazquezTech - I'll try and get to the issue #11 when I get time (seem to be very short of it these days).
Below are 2 config blocks.
Initial_DataDisk sets a volume on a disk to 200MB. DifferentSizeVolume_DataDisk expects a volume size of 300MB. Test-DscConfiguration inDesiredState = True although there is a mismatch in volume sizes.