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

ClusterDisk: Should check if disk is actually available for use #200

Open
kungfoome opened this issue Apr 8, 2019 · 4 comments
Open

ClusterDisk: Should check if disk is actually available for use #200

kungfoome opened this issue Apr 8, 2019 · 4 comments
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.

Comments

@kungfoome
Copy link

kungfoome commented Apr 8, 2019

Problem

https://github.com/PowerShell/xFailOverCluster/blob/c5702cac81a46a844c7d903c56be7ae8a90ad9f0/DSCResources/MSFT_xClusterDisk/MSFT_xClusterDisk.psm1#L90

Because this is using availabledisk and then just adding them, it's assuming the cluster can use the disk in the next procedure. The disk does not exist so it errors out incorrectly

The property 'Name' cannot be found on this object. Verify that the property exists and can be set.

Possible Solution:

Check if the disk actually exists

$clusterdDisk = Get-ClusterAvailableDisk | Where-Object -FilterScript {
    $_.Number -eq $Number
} 

if($clusterdDisk)
{
    $clusterdDisk | Add-ClusterDisk
}
else
{
    throw error
}
@johlju johlju added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Apr 14, 2019
@johlju
Copy link
Member

johlju commented Apr 14, 2019

It should definitely return the correct error as per your suggestion.

Curious though, why does it not have the disk available? Should we have a WaitForClusterDisk resource? 🤔

@kungfoome
Copy link
Author

Essentially that's correct. Basically, the cluster is created already, the disk was added over iscsi, but the other node didn't have the disk yet, so it won't allow you to add the disk until that disk is shared between the two.

If I go to node2 and refresh the iscsi target, then it works afterwards

@johlju
Copy link
Member

johlju commented Apr 14, 2019

Ah, I understand. So Get-ClusterAvailableDisk does not see the disks until they exist on both nodes? I was wondering if it would say Add-ClusterDisk -ErrorAction ‘Stop’ It would it throw the correct error, but won’t work if the disk aren’t even visible yet. So I like your suggested solution.

@kungfoome
Copy link
Author

Correct. Just comes back empty

@SteveL-MSFT SteveL-MSFT added this to Help Wanted in powershell/dscresources May 14, 2019
@SteveL-MSFT SteveL-MSFT removed this from Help Wanted in powershell/dscresources Nov 27, 2019
@johlju johlju changed the title xClusterDisk: Should check if disk is actually available for use ClusterDisk: Should check if disk is actually available for use Jun 11, 2022
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