Page 1 of 2

Poweshell code

Posted: Wed Sep 18, 2013 12:56 pm
by sandor.bihary
Hello All!

I tried to use the example power scripts. These are working very good except one thing. I would like to monitor the sync status on the devices.

But the enumDevicesTargets.ps1 script tell me everthing except the sync status.
I tried to find in the documentation how to do it but I did not manage to find it:(

Could you help me with that?

Partners : System.__ComObject
SynchronizationChannels : System.__ComObject
HeartbeatChannels : System.__ComObject


Thanks
Sanyi

Re: Poweshell code

Posted: Wed Sep 18, 2013 2:22 pm
by Alex (staff)
Sanyi,
Device synchronization status can be checked by getting it's "ha_synch_status" property:
$syncStatus = $device.GetPropertyValue("ha_synch_status")

Synchronization percent:
$syncPercent=$device.GetPropertyValue("ha_synch_percent")

Call $device.Refresh() to update device properties before getting its values.

Re: Poweshell code

Posted: Wed Sep 18, 2013 4:43 pm
by sandor.bihary
Hello Alex!

Thanks! It worked:)

I checked again the help and I found only these properties at the devices:
CacheBlockExpiryPeriod This property returns cache block expiry period (in ms).
CacheMode This property returns cache mode.
CacheSize This property returns cache size (in MB).
DeviceId This property returns device id.
DeviceLUN This property returns device logical unit number.
DeviceType This property returns device type.
Exists Determine whether the specified device exists.
File This property returns path to image file.
Name This property returns device name.
Size This property returns device size.
TargetId This property returns target id.
TargetName This property returns target name.

What I missed? How should I find that?

And other question. I have 4 HA devices. I turned off the second node. But this script gave me four "1". This means this is syncronized, but the truth is, this is not because the second node is offline. How can I checked that?

Best Regards
Sanyi

Re: Poweshell code

Posted: Wed Sep 18, 2013 5:37 pm
by Alex (staff)
Sorry for the lack of documentation! StarWindX library is being extended some faster that documentation for it.

Device properties that are listed for IDevice are general.
Each device type (HA, for example) has several specific properties.

Some additional properties of HA device:

ha_wait_on_autosynch
"1" If device is waiting in queue for autosynchronization

ha_partner_nodes_count
Number of HA partners.

ha_partner_node1_sync_status
Synchronization status of first partner.

ha_partner_node1_sync_percent
Synchronization percent for the first partner.

ha_partner_node1_is_exist_sync_valid_connection
"1" if at least one of synchronization channels is valid and connection exists.
"0" if all connections are down.

ha_partner_node1_is_exist_heartbeat_valid_connection
"1" if at least one of heartbeat channels is valid and connection exists.
"0" if all connections are down.

ha_partner_node2_sync_status
Synchronization status of second partner (for 3-node HA).

ha_partner_node2_sync_percent
Synchronization percent for the second partner (for 3-node HA).

Re: Poweshell code

Posted: Thu Apr 23, 2015 10:46 am
by baka
Where can I find full parameters list for IDevice.GetPropertyValue()?
I'm interest in "State" field value (Management console -> Server -> Devices)

Re: Poweshell code

Posted: Thu Apr 23, 2015 1:38 pm
by Alex (staff)
Most of prameters, that are accessible trough IDevice.GetPropertyValue(), are internal, and not intended for external use.
We will add "State" parameter to device properties in later update.

Current list of values for State field is as follows:

0 - DeviceActive,
1 - DeviceNonActive,
2 - DeviceNotLicensed,
3 - DeviceDisabled.

Re: Poweshell code

Posted: Wed Jul 01, 2015 5:24 am
by baka
Build 8116: there is NO "State" parameter still... :(

Btw, I saw "Creating..." State (in Managenent Console after restart (single node, no HA)) with progress in "%" ...

Re: Poweshell code

Posted: Fri Jul 03, 2015 4:27 pm
by anton (staff)
Did you check updated one? Did StarWind support bring you in touch with R&D team? Do you have a screenshot for broken msg with "%"? :)
baka wrote:Build 8116: there is NO "State" parameter still... :(

Btw, I saw "Creating..." State (in Managenent Console after restart (single node, no HA)) with progress in "%" ...

Re: Poweshell code

Posted: Fri Jul 03, 2015 6:44 pm
by baka
I've checked again now (build 8116) ... It seems It's case sensitive so not "State" but "state" parameter :) Right?
I'll take Management Console screenshot next boot...

Re: Poweshell code

Posted: Tue Jul 07, 2015 8:48 am
by baka
So,
Here is "Target" with "State=Active" Device
1.gif
1.gif (171.2 KiB) Viewed 8592 times
But the same time "Device State" is "Creating..." (with "Mounting Progress"="%" and "Warning" presents aslo)
2.gif
2.gif (165.48 KiB) Viewed 8592 times
And GetPropertyValue("state") for this Device returns "0" which means "DeviceActive"
%)

Re: Poweshell code

Posted: Fri Jul 10, 2015 11:43 am
by Alex (staff)
Thank you!
We will get it to the correct state.
Unfortunately, updates for StarWindX module went out of scope for this release update.

Re: Poweshell code

Posted: Fri Jul 10, 2015 3:23 pm
by Alexander.M (Staff)
Also device mount status can be checked by getting "MountStatus" property:
$device.GetPropertyValue("MountStatus")

list of values for mount status property:
0 - Failed
1 - Created
2 - Creating
3 - Mounting


and mounting percent:
$device.GetPropertyValue("MountProgress")

Re: Poweshell code

Posted: Sun Jul 12, 2015 11:22 pm
by baka
Is there a way to update StarWindX module only?
And I'd like to test this (intermediate) build anyway.
(Btw, Are You sure about MountStatus and MountProgress ? ;) )
Thanks

Re: Poweshell code

Posted: Wed Jul 15, 2015 4:14 pm
by darklight
You can update only StarWindX. Something like that
starwindx.jpg
starwindx.jpg (66.03 KiB) Viewed 8524 times

Re: Poweshell code

Posted: Thu Jul 16, 2015 9:46 am
by baka
But I need updated build first! ;)