vardua
2 Bronze

How to determine a direction of replication

Jump to solution

I'm looking for a method of determining source and target volumes in Unity uemcli environment. Also It's very interesting to determine a direction of replication for the volumes.

I'm writing a script for using in AIX PowerHA configuration. This script should has ability to determine a place of source or target volumes and select an action according this place. But an output of uemcli /prot/rep/session -name xxxx command shows:

1:    ID = yyy
      Name = xxx
      Session type = block
      Synchronization type = sync
      RPO = N/A
      Sync State = consistent
      Health state = OK (5)
      Operational status   = Active (0x840d)
      Time of last sync = N/A
      Sync status =
      Element pairs = sv_240=>sv_174, sv_241=>sv_175, sv_242=>sv_176, sv_239=>sv_17

And I don't see what kind of volumes placed on this site.

Do we have any method to recognize a direction of replication from uemcli?    

0 Kudos
1 Solution

Accepted Solutions
maniemc
3 Argentum

Re: How to determine a direction of replication

Jump to solution

I think you may also need to get "Local role" either via : uemcli /prot/rep/session show -detail or uemcli /prot/rep/session show -filter "Local role" (along with other values).Then you can decide the left values that is local to that box.

View solution in original post

7 Replies
ThomDaleyPPI
3 Argentum

Re: How to determine a direction of replication

Jump to solution

Hi vardua,

According the the UEMCLI documentation the element pairs field is:

Attribute Description Element pairs For consistency group and VMware VMFS datastore replications, the LUN element pairs within the replication.

Given that, if you use regular expressions you should be able to catch the element pairs line as a variable, then split what's after the 'pairs = ' on the comma and then again on the '=>'.  What you match on the left of '=>' is the source and what's to the right the destination, unless I have the elements pair field wrong? 

0 Kudos
vardua
2 Bronze

Re: How to determine a direction of replication

Jump to solution

Hello,

Thanks a lot for your answer. So, We should cut a LUN id sv_x, check it position in pair right/left and compare with output of Consistency_group_show command. This because output of replication_show command is the same for both, source and destination Unity boxes. This is a very unwieldy method, isn't it? I'll try to find another one.

0 Kudos
ThomDaleyPPI
3 Argentum

Re: How to determine a direction of replication

Jump to solution

It's actually not that bad.  Here's a snippet of python code that does work:

x = 'Element pairs = sv_240=>sv_174, sv_241=>sv_175, sv_242=>sv_176, sv_239=>sv_17'

x.split(',')

list[0] = list[0].replace('Element pairs = ','')

for x in list:

     src,trgt = x.split('=>')

     print src

     print trgt

Obviously, you'd replace the print statements with whatever you need with to do with the source and target values (I'd probably add them to a list of tuples for further processing).  I hope this helps.

vardua
2 Bronze

Re: How to determine a direction of replication

Jump to solution

Yes, you are right, but your results is a bit different from my target. :-)  I want to know is a current resource local or remote for this box. And the best way is a grep the output of show -detail command for Local state phrase.

But as I'm learning the python, your example is very useful for me. Thank you very much! 

maniemc
3 Argentum

Re: How to determine a direction of replication

Jump to solution

I think you may also need to get "Local role" either via : uemcli /prot/rep/session show -detail or uemcli /prot/rep/session show -filter "Local role" (along with other values).Then you can decide the left values that is local to that box.

View solution in original post

vardua
2 Bronze

Re: How to determine a direction of replication

Jump to solution

Yep!  that is what I need! Thunk you very much!

But in uemcli Guide the option -detail isn't listed. 

0 Kudos
maniemc
3 Argentum

Re: How to determine a direction of replication

Jump to solution

detail is applicable to almost all the "show" output, so it must be mentioned in generic section. Default is -brief. You would have known by now, but in short, for every command, checking the syntax with -h will be handy:

Example:

uemcli /prot/rep/session -h

  [Show]

  /prot/rep/session [ { -id <value> | -name <value> | -res <value> } ] show [ -output { nvp | csv | table [ -wrap ] } ] [ { -brief | -detail | -filter <value> } ]

0 Kudos