4
2

【新コマンド対応版】PowerVSのGlobal Replication Service(GRS)を試してみた

Last updated at Posted at 2024-06-07

CLIのコマンド体系に変更があったため、ここに書いた内容を改めて記事にします。

はじめに

Power Virtual Serverの一部のDC間で、Global Replication Service(GRS)が利用可能になっています。
https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-getting-started-GRS
RedbookのAppendix Aも参考になります。

GRSは、ストレージボリュームを、ストレージの機能で別のデータセンターに非同期レプリケーションする機能です。

現在、GRSの機能はCLI/APIを介して操作できます。
GRSを構成できるデータセンターのペアはサービス側で決められており、今回は、WDC06とDAL12のペアを使います。
WDC06を1次サイト(本番サイト)、DAL12を2次サイト(DRサイト)として設定を進めます。

1次サイト側手順

Docs
https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-getting-started-GRS&locale=en#configure-primary-site

ibmcloud pi workspace target [対象WorkspaceのCRN]コマンドで、1次サイト(WDC06)に切り替えた状態で作業します。

① 1次サイトのボリュームを作成
-rまたは--replication-enabledオプションを付けてボリュームを作成します。

Cloud Shell(1次サイト側)
$ ibmcloud pi volume create tmgw-vol-grs -t tier1 -s 10 -r
Creating volume tmgw-vol-grs under account xxx as user xxxxxxx...
                      
ID                    e19fef60-fd82-4aa9-b982-3738fb9dd40b
Name                  tmgw-vol-grs
Profile               tier1
Status                creating
Size                  10
Created               2024-06-07T10:28:45.000Z
Updated               1970-01-01T00:00:00.000Z
Shareable             false
Bootable              false
Storage Pool          General-Flash-7
IO Throttle Rate      -
Replication Enabled   -
Auxiliary             -
PVMInstanceIDs        -
WWN                   -
$ 

② 1次サイト側でAIXサーバーをいつも通りGUIから作成し、①で作成したボリュームをデータ用VGとして使用します。
レプリケーションされた事を確認するためのファイルをテスト用に作っておきます。

AIX(1次サイト側)
# lspv
hdisk0          00fa00d6b56a99bb                    rootvg          active      
hdisk1          00c91120d777dfdf                    datavg          active      
# lsvg -l datavg
datavg:
LV NAME             TYPE       LPs     PPs     PVs  LV STATE      MOUNT POINT
datalv              jfs2       246     246     1    open/syncd    /data
loglv00             jfs2log    1       1       1    open/syncd    N/A 
# ls /data
1G.dummy    lost+found  test.txt
# 

③ 1次サイトのボリュームを指定してボリューム・グループを作成します。
なお、ここで言う「ボリューム・グループ」は、AIXのボリューム・グループとは別の、GRSとしての用語です。

Cloud Shell(1次サイト側)
$ ibmcloud pi vg create -v vg-tmgw-01 -m e19fef60-fd82-4aa9-b982-3738fb9dd40b
Creating volume group vg-tmgw-01 under account xxx as user xxxxxxx...
Name         ID                                     Status      Status Details
vg-tmgw-01   e3778c75-0fa1-484d-8ecd-a34cdef978e8   available   -
$ 

2次サイト側手順

Docs
https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-getting-started-GRS&locale=en#configure-secondary-site

ibmcloud pi ws target [対象WorkspaceのCRN]コマンドで、2次サイト(DAL12)に切り替えて作業します。

①補助ボリューム(auxiliary volume)を作成

①-1.
1次サイトのPowerVSワークスペースのCRNを確認します。

Cloud Shell(1次サイト側)
$ ibmcloud pi ws list|grep -i wdc06
Listing services under account XXX as user XXXXXXXXXX...
crn:v1:bluemix:public:power-iaas:wdc06:a/039dbe6794084c7cb514a276dd2345da:e9812314-e026-48d8-8917-313dd26fb954::      Power Systems Virtual Server-WDC06
$ 

①-2.
1次サイトのボリュームのプロパティをjson形式で確認し、auxVolumeNameの項目を確認します。

Cloud Shell(1次サイト側)
$ ibmcloud pi vol get e19fef60-fd82-4aa9-b982-3738fb9dd40b --json
{
    "auxVolumeName": "aux_volume-tmgw-vol-grs-e19fef60-fd8228730651",
    "auxiliary": false,
    "bootable": false,
    "creationDate": "2024-06-07T10:28:45.000Z",
    "diskType": "tier1",
    "groupID": "e3778c75-0fa1-484d-8ecd-a34cdef978e8",
    "ioThrottleRate": "100 iops",
    "lastUpdateDate": "2024-06-07T10:31:23.000Z",
    "masterVolumeName": "volume-tmgw-vol-grs-e19fef60-fd82",
    "mirroringState": "inconsistent_copying",
    "name": "tmgw-vol-grs",
    "primaryRole": "master",

(後略)

}
$ 

上記2つのパラメータを指定してオンボーディングのためのコマンドを実行します。
("オンボーディング"は独特の用語かもしれませんが、"2次サイトのワークスペースに、1次サイトのボリュームを元に2次サイト用ボリュームを作成する作業"という理解で良いと思います。)

Cloud Shell(2次サイト側)
$ ibmcloud pi vol onboarding create -s crn:v1:bluemix:public:power-iaas:wdc06:a/039dbe6794084c7cb514a276dd2345da:e9812314-e026-48d8-8917-313dd26fb954:: -a aux_volume-tmgw-vol-grs-e19fef60-fd8228730651
Creating volume onboarding under account xxx as user xxxxxxx...
              
ID            6414bc39-9d1f-44e5-8a11-c68d3cee6654
Description   -
$ 

オンボーディング処理の一覧

Cloud Shell(2次サイト側)
$ ibmcloud pi vol onboarding ls
Listing volume onboarding operations under account xxx as user xxxxxxx...
ID                                     Status     Description                 Volumes
6414bc39-9d1f-44e5-8a11-c68d3cee6654   SUCCESS    onboard_aux_vols_T5AFGCA3   aux_volume-tmgw-vol-grs-e19fef60-fd8228730651
$ 

オンボーディング処理の詳細

Cloud Shell(2次サイト側)
$ ibmcloud pi volume onboarding get 6414bc39-9d1f-44e5-8a11-c68d3cee6654
Getting volume onboarding 6414bc39-9d1f-44e5-8a11-c68d3cee6654 under account xxx as user xxxxxxx...
                    
ID                  6414bc39-9d1f-44e5-8a11-c68d3cee6654
Status              SUCCESS
Description         onboard_aux_vols_T5AFGCA3
Volumes:            aux_volume-tmgw-vol-grs-e19fef60-fd8228730651
Creation Time       2024-06-07T10:39:24.000Z
Progress            100
Onboarded Volumes   aux_volume-tmgw-vol-grs-e19fef60-fd8228730651
Failures            -
$ 

オンボーディングの結果、2次サイト(DAL12)に補助ボリューム(auxiliary volume)が作成されました。Auxiliaryの項目がtrueになっていることが分かります。

Cloud Shell(2次サイト側)
$ ibmcloud pi volume ls
Listing volumes under account xxx as user xxxxxxxx...
ID                                     Name                                            Address
fedaf564-4e24-484c-b909-25055334f5d5   aux_volume-tmgw-vol-grs-e19fef60-fd8228730651   /pcloud/v1/cloud-instances/19a1d482-cd7b-44d5-b3e2-3ba65cb7d015/volumes/fedaf564-4e24-484c-b909-25055334f5d5
$ ibmcloud pi volume get fedaf564-4e24-484c-b909-25055334f5d5
Getting Volume fedaf564-4e24-484c-b909-25055334f5d5 under account xxx as user xxxxxxx...
                      
ID                    fedaf564-4e24-484c-b909-25055334f5d5
Name                  aux_volume-tmgw-vol-grs-e19fef60-fd8228730651
Profile               tier1
Status                available
Size                  10
Created               2024-06-07T10:41:13.000Z
Updated               2024-06-07T10:41:14.000Z
Shareable             false
Bootable              false
Storage Pool          General-Flash-12
IO Throttle Rate      100 iops
Replication Enabled   true
Auxiliary             true
PVMInstanceIDs        -
WWN                   600507681081056038000000000000AB
$ 

② 2次サイト側でAIXサーバーをいつも通りGUIから作成し、①で作成した補助ボリュームをデータ用VGとして使用します。

レプリケーション関係が確立している間は、レプリカ先のファイルシステムはマウントできません。

AIX(2次サイト側)
# mount /data
Replaying log for /dev/datalv.
mount: /dev/datalv on /data: Unformatted or incompatible media
The superblock on /dev/datalv is dirty.  Run a full fsck to fix.
# 

レプリケーションの進捗状況は、下記コマンドのFreeze TimeProgressの列で確認できます。

$ ibmcloud pi vg remote-copy-relationships cba51fc0-69fe-4e24-a153-b8d17c1d992e
Getting remote copy information for volume group cba51fc0-69fe-4e24-a153-b8d17c1d992e under account xxx as user xxxxxxxx...
Name     Auxiliary Volume Name                           Consistency Group Name   Master Volume Name                  Remote Copy ID   State                Copy Type   Cycling Mode   Freeze Time                Primary Role   Progress
rcrel5   aux_volume-tmgw-vol-grs-e19fef60-fd8228730651   rccg-e377-978e8          volume-tmgw-vol-grs-e19fef60-fd82   77               consistent_copying   global      multi          2024-06-07T10:48:07.000Z   master         100
$ 

フェイルオーバー

1次サイト(WDC06)が被災したと想定し、2次サイト(DAL12)のボリュームにアクセスできるようにするため、--allow-read-accessオプションを付けてvolume-group-stopコマンドを実行します。
1次サイトは被災して操作できないことを想定し、2次サイトの環境で操作します。

Cloud Shell(2次サイト側)
$ ibmcloud pi vg act cba51fc0-69fe-4e24-a153-b8d17c1d992e -o stop --allow-read-access
Performing stop action on volume group cba51fc0-69fe-4e24-a153-b8d17c1d992e under account xxx as user xxxxxxx...
OK
Stop request on volume group cba51fc0-69fe-4e24-a153-b8d17c1d992e has been accepted.
$ 

Replication Statusがdisabledになりました。

Cloud Shell(2次サイト側)
$ ibmcloud pi vg get cba51fc0-69fe-4e24-a153-b8d17c1d992e
Getting Volume Group cba51fc0-69fe-4e24-a153-b8d17c1d992e under account xxx as user xxxxxxx...
                         
ID                       cba51fc0-69fe-4e24-a153-b8d17c1d992e
Name                     rccg-e377-978e8
Consistency Group Name   rccg-e377-978e8
Replication Status       disabled
Status                   available
Status Description       -
$

2次サイトでボリュームをマウントでき、1次サイトで作成したファイルを2次サイトでも確認できます。

AIX(2次サイト側)
# mount /data
Replaying log for /dev/datalv.
# ls /data
1G.dummy    lost+found  test.txt
# 

フェイルバック

1次サイトが復旧した想定で操作します。1次サイト(WDC06)では/dataはマウントしていない状態とします。
volume-group-startコマンドに--source auxiliaryオプションを付けて、2次サイト -> 1次サイト の向きでレプリケーションを行い、フェイルオーバー中に2次サイトで行った変更を1次サイトに反映します。

Cloud Shell(2次サイト側)
$ ibmcloud pi vg act cba51fc0-69fe-4e24-a153-b8d17c1d992e -o start --source auxiliary
Performing start action on volume group cba51fc0-69fe-4e24-a153-b8d17c1d992e under account xxx as user xxxxxxx...
OK
Start request on volume group cba51fc0-69fe-4e24-a153-b8d17c1d992e has been accepted. 
$ 

逆方向のレプリカが完了したら、再びvolume groupを停止します。このタイミングで、2次サイト(DAL12)の/dataはアンマウントしておきます。

Cloud Shell(2次サイト側)
$ ibmcloud pi vg act cba51fc0-69fe-4e24-a153-b8d17c1d992e -o stop --allow-read-access
Performing stop action on volume group cba51fc0-69fe-4e24-a153-b8d17c1d992e under account xxx as user xxxxxxx...
OK
Stop request on volume group cba51fc0-69fe-4e24-a153-b8d17c1d992e has been accepted.
$ 

今度は--source auxiliaryオプションを付けずにvolume-group-startを実行して本来の、1次サイト -> 2次サイトの向きのレプリケーション関係にし、通常状態に戻します。

Cloud Shell(2次サイト側)
$ ibmcloud pi vg act cba51fc0-69fe-4e24-a153-b8d17c1d992e -o start 
Performing start action on volume group cba51fc0-69fe-4e24-a153-b8d17c1d992e under account xxx as user xxxxxxx...
OK
Start request on volume group cba51fc0-69fe-4e24-a153-b8d17c1d992e has been accepted.
$ 

以上

4
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2