Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xDisk - test resource fails when computer is part of a cluster #80

Open
asdglkjkwekdf opened this issue Feb 14, 2017 · 12 comments · May be fixed by vibrato/StorageDsc#1
Open

xDisk - test resource fails when computer is part of a cluster #80

asdglkjkwekdf opened this issue Feb 14, 2017 · 12 comments · May be fixed by vibrato/StorageDsc#1
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.

Comments

@asdglkjkwekdf
Copy link

Issue: xDisk Test-Target resource fails testing FSLabel when the file system label is matches desired state

Environment: Windows Server 2016 RTM, Windows Failover Clustering, xStorage 2.8.0.0

Cause: xDisk GetTargetResource uses Get-Volume by drive letter. Get-Volume in a Windows Server 2016 Cluster returns disks off all nodes potentially resulting in multiple volumes with the same drive letter. Get-Volume maps directly to the ROOT\Microsoft\Windows\Storage\MSFT_Volume WMI class which also exhibits the same behaviour.

See MSFT_xDisk.psm1 line 85.

Possible Solution: Follow the same pattern as MSFT_xDiskAccessPath and get the volume information via the partition. This solution uses the disk number - which is already required - to get the volume information.

Verbose output from test resource:

VERBOSE: [COMPUTER1]: LCM: [ Start Resource ] [[xDisk]sqlRoot]
VERBOSE: [COMPUTER1]: LCM: [ Start Test ] [[xDisk]sqlRoot]
VERBOSE: [COMPUTER1]: [[xDisk]sqlRoot] Test-TargetResource: Testing Disk '1' status for
drive letter 'E'.
VERBOSE: [COMPUTER1]: [[xDisk]sqlRoot] Test-TargetResource: Checking if disk number '1' is
initialized.
VERBOSE: [COMPUTER1]: [[xDisk]sqlRoot] Perform operation 'Query CimInstances' with
following parameters, ''queryExpression' = SELECT BlockSize from Win32_Volume WHERE DriveLetter = 'E:','queryDialect' =
WQL,'namespaceName' = root\cimv2'.
VERBOSE: [COMPUTER1]: [[xDisk]sqlRoot] Operation 'Query CimInstances' complete.
VERBOSE: [COMPUTER1]: [[xDisk]sqlRoot] Test-TargetResource: Drive E label
'System.Object[]' does not match expected label 'COMPUTER1_root'.
VERBOSE: [COMPUTER1]: LCM: [ End Test ] [[xDisk]sqlRoot] False in 4.8800 seconds.
VERBOSE: [COMPUTER1]: LCM: [ End Resource ] [[xDisk]sqlRoot]

I can probably provide a stripped down cluster configuration if you need it for testing.

@PlagueHO PlagueHO added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Mar 17, 2017
@PlagueHO
Copy link
Member

Hi @asdglkjkwekdf , that is some great info. Looks like it should be possible to port over method from MSFT_xDiskAccessPath to MSFT_xDisk. I'll try and put some time aside to do this. But not for a few days yet (this week is all kinds of crazy busy). But if you or someone else gets to it first, let me know you're working on it so we don't duplicate work.

@asdglkjkwekdf
Copy link
Author

I have already ported the code in my environment; but, unfortunately we are not allow to contribute code. The best I can do is report issues in as much detail as I can.

From my testing cloning the xDiskAccessPath code to the get and test methods was all that was required. I did not review the set method; but, I wonder whether that should have been changed as well.

@PlagueHO
Copy link
Member

Hi @asdglkjkwekdf - no problem. I'll see if I can take a look at this this weekend.

@PlagueHO
Copy link
Member

Hi @asdglkjkwekdf - sorry about the delay. I'm working on this today.

@PlagueHO PlagueHO added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Apr 15, 2017
@PlagueHO
Copy link
Member

Hi @asdglkjkwekdf - I've made the changes to this now so that xDisk uses the same pattern as xDiskAccessPath. This change will go in as part of #81 which is a BREAKING CHANGE for xDisk, xDiskAccessPath and xWaitForDisk. Please see the details of #81 to see why this change was necessary.

So once this is released you'll need to update your configs slightly.

@asdglkjkwekdf
Copy link
Author

Hello @PlagueHO - Thanks for looking at this. The changes for #81 make sense.

@PlagueHO
Copy link
Member

Thanks @asdglkjkwekdf - I've merged this change now to Dev. So if you have a change, could you give it a try and see if it resolves your issue?

@asdglkjkwekdf
Copy link
Author

I should be able to give the dev branch a go this week.

@asdglkjkwekdf
Copy link
Author

Tested successfully.

@asdglkjkwekdf
Copy link
Author

Testing with new build more thoroughly indicates we still have an issue.

Set has been fixed however Get and Test have not been fixed

MSFT_xDisk.psm1 (dev branch)
==> Get Partition:

  • Get - Ln 95 > Not fixed
  • Set - Ln 264 - 268 > Fixed
  • Test - Ln 591 > Not fixed

==> Get Volume:

  • Get - Ln 98 > Not fixed
  • Set - Ln 388 > Fixed
  • Test - Ln 636 > Not fixed

Let me know if this does not make sense

@asdglkjkwekdf asdglkjkwekdf reopened this May 15, 2017
@PlagueHO
Copy link
Member

Hi @asdglkjkwekdf - thanks for reporting this! I'll take a look this week - I'm a bit behind at the moment. Will definitely catch up this weekend though.

@reidav
Copy link

reidav commented Jan 15, 2019

Hi,

We had the same issue while configuring disks before provisionning SQL Cluster (4.3.0.0)
Get-Partition always returns multiple disks.

We just added above 'if' statement after Get-Partitions command

$partition = Get-Partition `
-DriveLetter $DriveLetter `
-ErrorAction SilentlyContinue
 
**# Handle cluster disks returned by the Get-Partition commands
if ($partition -is [array] -and $disk) {
$partition = $partition | Where-Object { $_.DiskPath -eq $disk.Path }
}**

Hope it helps.

demonix pushed a commit to demonix/StorageDsc that referenced this issue Jan 23, 2019
demonix pushed a commit to demonix/StorageDsc that referenced this issue Jan 23, 2019
demonix pushed a commit to demonix/StorageDsc that referenced this issue Jan 23, 2019
chrisfowles added a commit to vibrato/StorageDsc that referenced this issue May 16, 2019
@chrisfowles chrisfowles linked a pull request May 16, 2019 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants