Reputation: 621
We are using our own application to add and remove disks in a Windows 2012 R2 Failover cluster via wmi calls. Most of the time the calls work great, but every once in a while I remove a disk from a role via wmi calls, and it empties out the whole role; all of the disks from the role are put into available storage, the services don't exist anywhere. The fix that I've found for this is to put the disks back into the role and somehow the services magically re-appear and things are back to normal.
Details: We'll need to something like 10 disks into the cluster, and so we run the application with multiple threads. C# application makes WMI calls to the 'root\MSCluster' namespace. We bring in disks via the MSCLUSTER_AvailableDisks objects and invoke the 'AddToCluster' method on those objects. We try to sleep for 100 ms between modifying calls (calls to the cluster that will change something) to give the cluster time to replicate changes.
How do I prevent the cluster role from getting corrupted but still use wmi calls to be able to automate adding and removing disks into my cluster?
Upvotes: 0
Views: 120
Reputation: 621
Ok, so I've been digging around and I found out that if you have ANY dependencies to a resource that you've removed, you will remove everything that either has a dependency on the resource or that the resource depends on. So to prevent my roles from getting completely emptied I have to double-check that all of my dependencies are off of my disks.
Upvotes: 0