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

Disk Initializing disk with UniqueId #224

Open
briefcase-Wanker opened this issue Feb 13, 2020 · 5 comments
Open

Disk Initializing disk with UniqueId #224

briefcase-Wanker opened this issue Feb 13, 2020 · 5 comments
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.

Comments

@briefcase-Wanker
Copy link

Hi,

I am initializing a number of disk using the disk resource. When I push a configuration it works no issue. If I push the configuration again the test fails. If the servers are restarted the disk drives are marked offline until either I enable them again or I push the configuration again in which case it is successful.

Is this expected behavior or am I doing something incorrectly.

Below is the output of the push.

VERBOSE: [hostname]: LCM:  [ Start  Resource ]  [[WaitForDisk]DataDrive]
VERBOSE: [hostname]: LCM:  [ Start  Test     ]  [[WaitForDisk]DataDrive]
VERBOSE: [hostname]:                            [[WaitForDisk]DataDrive] Test-TargetResource: Checking for disk with UniqueId
'6000C29446A5EA71DBFBF4B977272861'.
VERBOSE: [hostname]:                            [[WaitForDisk]DataDrive] Test-TargetResource: Found disk with UniqueId
'6000C29446A5EA71DBFBF4B977272861' named 'VMware Virtual disk'.
VERBOSE: [hostname]: LCM:  [ End    Test     ]  [[WaitForDisk]DataDrive]  in 3.4380 seconds.
VERBOSE: [hostname]: LCM:  [ Skip   Set      ]  [[WaitForDisk]DataDrive]
VERBOSE: [hostname]: LCM:  [ End    Resource ]  [[WaitForDisk]DataDrive]
VERBOSE: [hostname]: LCM:  [ Start  Resource ]  [[Disk]DataDrive]
VERBOSE: [hostname]: LCM:  [ Start  Test     ]  [[Disk]DataDrive]
VERBOSE: [hostname]:                            [[Disk]DataDrive] Test-TargetResource: Testing disk with UniqueId
'6000C29446A5EA71DBFBF4B977272861' status for drive letter 'G'.
VERBOSE: [hostname]:                            [[Disk]DataDrive] Test-TargetResource: Checking if disk with UniqueId
'6000C29446A5EA71DBFBF4B977272861' is initialized.
Method invocation failed because [System.Object[]] does not contain a method named 'op_Subtraction'.
    + CategoryInfo          : InvalidOperation: (op_Subtraction:) [], CimException
    + FullyQualifiedErrorId : MethodNotFound
    + PSComputerName        : hostname.domain.local.au

VERBOSE: [hostname]:                            [[Disk]DataDrive] Perform operation 'Query CimInstances' with following parameters,
''queryExpression' = SELECT BlockSize from Win32_Volume WHERE DriveLetter = 'G:','queryDialect' = WQL,'namespaceName' = root\cimv2'.
VERBOSE: [hostname]:                            [[Disk]DataDrive] Operation 'Query CimInstances' complete.
VERBOSE: [hostname]: LCM:  [ End    Test     ]  [[Disk]DataDrive]  in 5.7240 seconds.
The PowerShell DSC resource '[Disk]DataDrive' with SourceInfo 'M:\DSC Pull Server\Configuration Scripts\SQL-ClientDSCScript
copy.ps1::112::9::Disk' threw one or more non-terminating errors while running the Test-TargetResource functionality. These errors are
logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
    + CategoryInfo          : InvalidOperation: (:) [], CimException
    + FullyQualifiedErrorId : NonTerminatingErrorFromProvider
    + PSComputerName        : hostname.domain.local.au

VERBOSE: [hostname]: LCM:  [ Start  Resource ]  [[WaitForDisk]LogDrive]
        WaitForDisk DataDrive {
            DiskId = $Node.DataDriveID
            DiskIdType = 'UniqueId'
            RetryIntervalSec = 60
            RetryCount = 60
            DependsOn = $DependsOnVariable
        }
        Disk DataDrive {
            DiskId = $Node.DataDriveID
            DiskIdType = 'UniqueId'
            DriveLetter = $DiskDrive.DataDrive
            FSLabel = $DiskDrive.DataFSLabel
            DependsOn = '[WaitForDisk]DataDrive'
        }

I am using windows clustering for SQL AAGs not sure if that could be effecting it somehow.

@PlagueHO PlagueHO added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Feb 13, 2020
@PlagueHO
Copy link
Member

Hi @briefcase-Wanker (Inbetweeners fan 😁), this does look like a bug. It does look like it could be similar to this issue: #80

And it looks like I wasn't able to solve the problem.

Could you run the following command on your machine and show the output?

Get-Partition `
        -DriveLetter 'G:' `
        -ErrorAction SilentlyContinue | fl *

Also, what is the result of this command:

Get-Partition `
        -DriveLetter 'G:' `
        -ErrorAction SilentlyContinue | Get-PartitionSupportedSize

@briefcase-Wanker
Copy link
Author

Hi @PlagueHO

Cheers for the reply output of the commands is below.

OperationalStatus     : Online
Type                  : Basic
DiskPath              : \\?\Disk{03b307c6-c8b2-a19f-a9ef-cb0b1d8057ae}
ObjectId              : {1}\\HOSTNAME\root/Microsoft/Windows/Storage/Providers_v2\WSP_Partition.ObjectId="{c70c23e5-8b3
                        3-48e9-8676-9561b3abc439}:PR:{00000000-0000-0000-0000-100800000000}\\?\Disk{03b307c6-c8b2-a19f-
                        a9ef-cb0b1d8057ae}"
PassThroughClass      : 
PassThroughIds        : 
PassThroughNamespace  : 
PassThroughServer     : 
UniqueId              : {00000000-0000-0000-0000-100800000000}6000C294386D6E76A937DDB4BFA8A25F
AccessPaths           : {G:\, \\?\Volume{40bf58e2-084b-4b7c-a715-7324e4523919}\}
DiskId                : \\?\Disk{03b307c6-c8b2-a19f-a9ef-cb0b1d8057ae}
DiskNumber            : 
DriveLetter           : G
GptType               : {ebd0a0a2-b9e5-4433-87c0-68b6b72699c7}
Guid                  : {40bf58e2-084b-4b7c-a715-7324e4523919}
IsActive              : False
IsBoot                : False
IsDAX                 : False
IsHidden              : False
IsOffline             : False
IsReadOnly            : False
IsShadowCopy          : False
IsSystem              : False
MbrType               : 
NoDefaultDriveLetter  : False
Offset                : 135266304
PartitionNumber       : 2
Size                  : 644108779520
TransitionState       : 1
PSComputerName        : 
CimClass              : ROOT/Microsoft/Windows/Storage:MSFT_Partition
CimInstanceProperties : {ObjectId, PassThroughClass, PassThroughIds, PassThroughNamespace...}
CimSystemProperties   : Microsoft.Management.Infrastructure.CimSystemProperties

OperationalStatus     : Online
Type                  : Basic
DiskPath              : \\?\Disk{6dd7e2ef-5222-16e2-b59d-4928e9a12c28}
ObjectId              : {1}\\HOSTNAMECL02\root/Microsoft/Windows/Storage/Providers_v2\WSP_Partition.ObjectId="{c70c23e5-8b3
                        3-48e9-8676-9561b3abc439}:PR:{00000000-0000-0000-0000-100800000000}\\?\Disk{6dd7e2ef-5222-16e2-
                        b59d-4928e9a12c28}"
PassThroughClass      : 
PassThroughIds        : 
PassThroughNamespace  : 
PassThroughServer     : 
UniqueId              : {00000000-0000-0000-0000-100800000000}6000C29FB1F08C063F13546A62348670
AccessPaths           : {G:\, \\?\Volume{70dddb11-887b-4664-85a9-3bc1874d2d5d}\}
DiskId                : \\?\Disk{6dd7e2ef-5222-16e2-b59d-4928e9a12c28}
DiskNumber            : 
DriveLetter           : G
GptType               : {ebd0a0a2-b9e5-4433-87c0-68b6b72699c7}
Guid                  : {70dddb11-887b-4664-85a9-3bc1874d2d5d}
IsActive              : False
IsBoot                : False
IsDAX                 : False
IsHidden              : False
IsOffline             : False
IsReadOnly            : False
IsShadowCopy          : False
IsSystem              : False
MbrType               : 
NoDefaultDriveLetter  : False
Offset                : 135266304
PartitionNumber       : 2
Size                  : 636592586752
TransitionState       : 1
PSComputerName        : 
CimClass              : ROOT/Microsoft/Windows/Storage:MSFT_Partition
CimInstanceProperties : {ObjectId, PassThroughClass, PassThroughIds, PassThroughNamespace...}
CimSystemProperties   : Microsoft.Management.Infrastructure.CimSystemProperties

OperationalStatus     : Online
Type                  : Basic
DiskPath              : \\?\Disk{74b0d8e1-ee38-3de3-5439-8f02933bacab}
ObjectId              : {1}\\HOSTNAMECL02\root/Microsoft/Windows/Storage/Providers_v2\WSP_Partition.ObjectId="{c70c23e5-8b3
                        3-48e9-8676-9561b3abc439}:PR:{00000000-0000-0000-0000-100800000000}\\?\Disk{74b0d8e1-ee38-3de3-
                        5439-8f02933bacab}"
PassThroughClass      : 
PassThroughIds        : 
PassThroughNamespace  : 
PassThroughServer     : 
UniqueId              : {00000000-0000-0000-0000-100800000000}6000C29446A5EA71DBFBF4B977272861
AccessPaths           : {G:\, \\?\Volume{74b07a9d-55fc-4813-95a9-569b79679774}\}
DiskId                : \\?\Disk{74b0d8e1-ee38-3de3-5439-8f02933bacab}
DiskNumber            : 1
DriveLetter           : G
GptType               : {ebd0a0a2-b9e5-4433-87c0-68b6b72699c7}
Guid                  : {74b07a9d-55fc-4813-95a9-569b79679774}
IsActive              : False
IsBoot                : False
IsDAX                 : False
IsHidden              : False
IsOffline             : False
IsReadOnly            : False
IsShadowCopy          : False
IsSystem              : False
MbrType               : 
NoDefaultDriveLetter  : False
Offset                : 135266304
PartitionNumber       : 2
Size                  : 644108779520
TransitionState       : 1
PSComputerName        : 
CimClass              : ROOT/Microsoft/Windows/Storage:MSFT_Partition
CimInstanceProperties : {ObjectId, PassThroughClass, PassThroughIds, PassThroughNamespace...}
CimSystemProperties   : Microsoft.Management.Infrastructure.CimSystemProperties

   SizeMin      SizeMax
   -------      -------
3273650176 644109811200
3273650176 636593618432
3273650176 644109811200

@PlagueHO
Copy link
Member

PlagueHO commented Feb 14, 2020

Hi @briefcase-Wanker - ah right, this explains why the error occurs:

It looks like this is caused by clustering because there are three partition objects with G: drive assigned. The first object is the physical partition and the second two appear to be some representation of the clustered partition on each node of the cluster.

It is possible that we can fix this by ignoring all but the first partition, but this may have unwanted side affects and will be difficult to test with automation.

But we should try and release a preview version with the fix in place so you can test it - would you be OK testing a preview version?

@PlagueHO
Copy link
Member

Additional Note: I can't release new versions of this module until I've updated this to the new CI/CD pipeline. This is #223

@briefcase-Wanker
Copy link
Author

Happy to test the preview when it’s ready.

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. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
Development

No branches or pull requests

2 participants