How to exactly check the Device Health from powershell?

Software-based VM-centric and flash-friendly VM storage + free version

Moderators: anton (staff), art (staff), Max (staff), Anatoly (staff)

Post Reply
serhiogo
Posts: 30
Joined: Thu Aug 16, 2018 12:49 pm

Mon Aug 20, 2018 2:55 pm

Hello collegues!

I'm trying to diagnose the manually simulated synchronization loss case between two nodes in my Starwind Virtual SAN Free cluster via GUI and Powershell script. The GUI gives me an infomation about sync and HB loss in Device context:
Image

But when I'm trying to check the devices via embedded enumDevicesTargets.ps1 script I see some unclear...

Name : HAImage2
DeviceType : HA Image
DeviceId : 0x0000002C611AB680
File : My Computer\E\storage-mmt\storage-mmt_HA.swdsk
TargetName : iqn.2008-08.com.starwindsoftware:vsan-1-210-storage-mmt
TargetId : 0x0000002C6121DDC0
Size : 31138512896000
CacheMode : wb
CacheSize : 8192
CacheBlockExpiryPeriod : 5000
Exists : True
DeviceLUN : 0
IsSnapshotsSupported : False
Snapshots :
SectorSize : 512

State : 0
Partners : System.__ComObject
SynchronizationChannels : System.__ComObject
HeartbeatChannels : System.__ComObject

SyncStatus : 1
SyncTrafficShare : 50


The corresponding code fragment is...

Code: Select all

	foreach($device in $server.Devices)
	{
		$device
	}
I.e. the script returns the whole unfiltered $server.Devices structure.

That's all right , according to StarwindX. The device is Healthy (State = 0) and the Partners, SynchronizationChannels and HeartbeatChannels request returns nontransparent "System.__ComObject" state. Is there a way to retrive a normal human-readable status instead of "System.__ComObject"?

Is it due to the StarwindX limitations or my PS and/or StarwindX misunderstanding?

WBR, SerhioGo.
Boris (staff)
Staff
Posts: 805
Joined: Fri Jul 28, 2017 8:18 am

Mon Aug 20, 2018 3:36 pm

There is no status there. Those objects contain info about interfaces, but nothing related to the status.
serhiogo
Posts: 30
Joined: Thu Aug 16, 2018 12:49 pm

Mon Aug 20, 2018 4:35 pm

Boris (staff) wrote:There is no status there. Those objects contain info about interfaces, but nothing related to the status.
OK, is there any objects containing this status that can be accessible via StarwindX?
If not, then there's a contradiction between GUI and PS data about "Health" status, imho.

WBR, SerhioGo.
Boris (staff)
Staff
Posts: 805
Joined: Fri Jul 28, 2017 8:18 am

Mon Aug 20, 2018 5:00 pm

Code: Select all

SyncStatus : 1
This is what you are looking for. 1 stands for "synchronized", 2 - for "synchronizing", 3 - for "not synchronized".
serhiogo
Posts: 30
Joined: Thu Aug 16, 2018 12:49 pm

Mon Aug 20, 2018 5:55 pm

Boris (staff) wrote:

Code: Select all

SyncStatus : 1
This is what you are looking for. 1 stands for "synchronized", 2 - for "synchronizing", 3 - for "not synchronized".
I know about it, thanx. But I'm looking for little bit other thing.
I mean that there is a difference between GUI "Health" and PS "device.State" . I'm looking for the objects the GUI presents here:
Image

I suspect that these objects are not from one structure and are joined by some ID's like target SID etc. My question was about it's availability via StarwindX. Neither "server.X", neither "device.X" , nor "target.X" structures present it. Where it's hidden =] ?

Thank you for your patience.

WBR, SerhioGo.
Sekkmer
Posts: 29
Joined: Thu Mar 08, 2018 12:11 pm

Tue Aug 21, 2018 7:53 am

IDevice has a function called GetPropertyValue() and witch return any property that the device has, some properties are not part of the com object but you can still get them.

you can get some partner information like this

"ha_partner_node" + node number (start from 1) + "_" + name of the property

"sync_status"
"sync_percent"
"sync_elapsed_time"
"sync_estimated_time"

for the main node, it is "ha_" + name of the property

example: device.GetPropertyValue("ha_partner_node1_sync_status")

if you want to get information about the channels ask the partners for

"sync_channels"
"heartbeat_channels"

("ha_partner_node1_sync_channels")

and you get a string all the channels to a partner (by type) the string is split by ";" and one channel each data is split by "$" IP, port, valid connection.

I have a library witch extend the StarWindX classes here is the HADeviceExt witch implement all the above-mentioned properties and many more (although it is not implementing a function witch list all the errors)

https://github.com/Sekkmer/StarWindXExt ... viceExt.cs
serhiogo
Posts: 30
Joined: Thu Aug 16, 2018 12:49 pm

Tue Aug 21, 2018 10:17 am

Hmm, it looks like just what I need. I'll try, thank you!
Boris (staff)
Staff
Posts: 805
Joined: Fri Jul 28, 2017 8:18 am

Tue Aug 21, 2018 4:38 pm

serhiogo,

The parameters Sekkmer outlined should be the ones you need. Just try that and report back whether you achieved what you intended to.
serhiogo
Posts: 30
Joined: Thu Aug 16, 2018 12:49 pm

Wed Aug 22, 2018 5:54 am

Boris (staff) wrote:serhiogo,

The parameters Sekkmer outlined should be the ones you need. Just try that and report back whether you achieved what you intended to.
I've tried.

Sync loss state:

Code: Select all

Name                    :  HAImage1
DeviceType              :  HA Image
DeviceId                :  0x00000075C5F1DA40
File                    :  My Computer\D\storage-210\storage-210_HA.swdsk
TargetName              :  iqn.2008-08.com.starwindsoftware:vsan-1-mmt-storage-210
TargetId                :  0x00000075C602E880
Size                    :  28,32 TB
CacheMode               :  wb
CacheSize               :  32768 MB
SectorSize              :  512
State                   :  Healthy
SyncStatus              :  Synchronized
Partner                 :  iqn.2008-08.com.starwindsoftware:vsan-1-210-storage-210
Partner Sync Status     :  Not Synchronized
Partner Sync Channel    :  10.1.0.51 : 3260 .  Synchronization channel is DOWN
Partner HB Channel      :  10.0.0.51 : 3260 .  Heartbeat channel is DOWN
Normal state:

Code: Select all

Name                    :  HAImage1
DeviceType              :  HA Image
DeviceId                :  0x00000075C5F1DA40
File                    :  My Computer\D\storage-210\storage-210_HA.swdsk
TargetName              :  iqn.2008-08.com.starwindsoftware:vsan-1-mmt-storage-210
TargetId                :  0x00000075C602E880
Size                    :  28,32 TB
CacheMode               :  wb
CacheSize               :  32768 MB
SectorSize              :  512
State                   :  Healthy
SyncStatus              :  Synchronized
Partner                 :  iqn.2008-08.com.starwindsoftware:vsan-1-210-storage-210
Partner Sync Status     :  Synchronized
Partner Sync Channel    :  10.1.0.51 : 3260 .  Synchronization channel is UP
Partner HB Channel      :  10.0.0.51 : 3260 .  Heartbeat channel is UP
That's what I looked for. Thanks to Sekkmer 8)
Boris (staff)
Staff
Posts: 805
Joined: Fri Jul 28, 2017 8:18 am

Wed Aug 22, 2018 3:35 pm

It's great it worked for you.
dgl72
Posts: 1
Joined: Wed Mar 27, 2019 11:37 am

Wed Mar 27, 2019 11:40 am

Hi serghio
can you post your powershell script please.
I have exactly the same requirements.

Thank you
PoSaP
Posts: 49
Joined: Mon Feb 29, 2016 10:42 am

Fri Mar 29, 2019 10:57 am

Hi dgl72,
I believe you can ask Serghio directly about the script. Or modify existing scripts according to your needs :)
Boris (staff)
Staff
Posts: 805
Joined: Fri Jul 28, 2017 8:18 am

Tue Apr 02, 2019 2:06 pm

The best way would probably be sending a private message in addition to this public one.
sechan159
Posts: 1
Joined: Wed Mar 15, 2023 3:33 am
Contact:

Wed Mar 15, 2023 3:35 am

Based on the information provided, it appears that the System.__ComObject state is a limitation of the StarwindX PowerShell module, which may not provide a human-readable status for the Partners, SynchronizationChannels, and HeartbeatChannels properties. This could be due to the design of the module or a limitation of the underlying COM objects.
yaroslav (staff)
Staff
Posts: 2277
Joined: Mon Nov 18, 2019 11:11 am

Wed Mar 15, 2023 12:23 pm

I guess the fix is a long time there which makes your comment irrelevant.
Post Reply