ONTAP 9.7シミュレータのシステムボリュームを拡張する


NetApp ONTAP 9.7シミュレータをしばらく稼働させ続けていると、ディスクがフルとなって死ぬ。

なんでなんだろーなー?とONTAP 9.1シミュレータと構成の差をみてみたら、仮想ディスクの大きさが4GBから1GBに縮小されていた。

そりゃ、ディスクの余裕がだいぶ異なりますね。

というわけで、vol0の容量を増やしましょう

状況の確認

まず、aggregate の空き容量を確認
「storage aggregate show」か「df -A -h」を実行します。

ontap97-sub::> storage aggregate show


Aggregate     Size Available Used% State   #Vols  Nodes            RAID Status
--------- -------- --------- ----- ------- ------ ---------------- ------------
aggr0_ontap97_sub_01 855MB 41.41MB 95% online   1 ontap97-sub-01   raid_dp,
                                                                   normal
aggr1      14.06GB   14.00GB    0% online       3 ontap97-sub-01   raid_dp,
                                                                   normal
2 entries were displayed.

ontap97-sub::> df -A -h
Aggregate                total       used      avail capacity
aggr0_ontap97_sub_01     855MB      812MB       42MB      95%
aggr0_ontap97_sub_01/.snapshot 45MB    0B       45MB       0%
aggr1                     14GB       61MB       14GB       0%
aggr1/.snapshot             0B         0B         0B       0%
4 entries were displayed.

ontap97-sub::>

空きディスクの確認

現状、aggr0の空き容量がないため、ディスクを追加します。

追加できるディスクがあるかを「storage disk show -container-type spare」を実行して確認

ontap97-sub::> storage disk show -container-type spare
                     Usable           Disk    Container   Container
Disk                   Size Shelf Bay Type    Type        Name      Owner
---------------- ---------- ----- --- ------- ----------- --------- --------
NET-1.19             1020MB     -  27 FCAL    spare       Pool0     ontap97-sub-01
NET-1.20             1020MB     -  28 FCAL    spare       Pool0     ontap97-sub-01
NET-1.21             1020MB     -  29 FCAL    spare       Pool0     ontap97-sub-01
NET-1.27             1020MB     -  32 FCAL    spare       Pool0     ontap97-sub-01
NET-1.28             1020MB     -  32 FCAL    spare       Pool0     ontap97-sub-01
5 entries were displayed.

ontap97-sub::>

現在5本のスペアがあります。スペアが0本だと問題が発生します。

その場合はディスクを追加します。

シミュレータへのディスク追加

ONTAPシミュレータが認識しているディスクを追加することはできます。

追加はシミュレータ仮想マシンの仮想ディスクとして追加するのではなく、シミュレータOS内部でディスクファイルを作成する形で行います。

ちなみに、security loginコマンドでshellにログインできるような権限を付与してパスワードも設定する、的なことを書いている手順もありますが、それは必要が無い手法を使います。

まずは、diagモードに切り替えてコマンドを実行する必要があるので「set diag」を実行します。

ontap97-sub::> set diag

Warning: These diagnostic commands are for use by NetApp personnel only.
Do you want to continue? {y|n}: y

ontap97-sub::*>

現在使われているディスクタイプを確認するため、「systemshell local “ls -l /sim/dev/,disks”」を実行します。(disksの前に「,」が入っています)

(最近のONTAPではdiagアカウントがlockされていて実行できない。その場合はロックを解除する)

ontap97-sub::*> systemshell local "ls -l /sim/dev/,disks"
  (system node systemshell)
total 1849640
-rwxr-xr-x  1 root  wheel         912 Mar 10 16:07 ,reservations
-rw-r--r--  1 root  wheel        1372 Mar 10 16:07 Shelf:DiskShelf14
-rw-r--r--  1 root  wheel  1094312960 Mar 10 16:45 v0.16:NETAPP__:VD-1000MB-FZ-520:13511800:2104448
-rw-r--r--  1 root  wheel  1094312960 Mar 10 16:45 v0.17:NETAPP__:VD-1000MB-FZ-520:13511901:2104448
<略>
-rw-r--r--  1 root  wheel  1094312960 Mar 10 16:23 v1.29:NETAPP__:VD-1000MB-FZ-520:15901912:2104448
-rw-r--r--  1 root  wheel  1094312960 Mar 10 16:23 v1.32:NETAPP__:VD-1000MB-FZ-520:15901913:2104448

ontap97-sub::*>

上記の場合「NETAPP__:VD-1000MB-FZ-520」というディスクを使っています。

このディスクを追加するために該当するdisk type IDを「systemshell local “vsim_makedisks -h”」を実行して確認します。

ontap97-sub::*> systemshell local "vsim_makedisks -h"
  (system node systemshell)
Usage: /usr/sbin/vsim_makedisks [ -n <additional number of disks to create> ]
          [ -t <disk type ID> ]
          [ -e <additional sectors> ]
          [ -a <adapter on which to start populating disks ]
          [ -h ]

By default 5 disks will be added. The <disk type ID> can be one
of the following: (NOTE, 0 is the default)
                                                               Fast
Type Vendor ID Product ID       Usable Size[B] Actual Size[B]  Zero  BPS   RPM
  0  NETAPP__  VD-16MB_________     16,777,216     38,273,024   No   512  10000
  1  NETAPP__  VD-35MB_________     35,913,728     57,409,536   No   512  10000
  2  NETAPP__  VD-50MB_________     52,428,800     73,924,608   No   512  10000
  3  NETAPP__  VD-100MB________    104,857,600    126,353,408   No   512  10000
  4  NETAPP__  VD-500MB________    524,288,000    545,783,808   No   512  10000
  5  NETAPP__  VD-1000MB_______  1,048,576,000  1,070,071,808   No   512  10000
  6  NETAPP__  VD-16MB-FZ______     16,777,216     38,273,024   Yes  512  15000
  7  NETAPP__  VD-35MB-FZ______     35,913,728     57,409,536   Yes  512  15000
  8  NETAPP__  VD-50MB-FZ______     52,428,800     73,924,608   Yes  512  15000
  9  NETAPP__  VD-100MB-FZ_____    104,857,600    126,353,408   Yes  512  15000
 10  NETAPP__  VD-500MB-FZ_____    524,288,000    545,783,808   Yes  512  15000
 11  NETAPP__  VD-1000MB-FZ____  1,048,576,000  1,070,071,808   Yes  512  15000
 12  NETAPP__  VD-16MB-520_____     16,777,216     38,273,024   No   520  10000
 13  NETAPP__  VD-35MB-520_____     35,913,728     57,409,536   No   520  10000
 14  NETAPP__  VD-50MB-520_____     52,428,800     73,924,608   No   520  10000
 15  NETAPP__  VD-100MB-520____    104,857,600    126,353,408   No   520  10000
 16  NETAPP__  VD-500MB-520____    524,288,000    545,783,808   No   520  10000
 17  NETAPP__  VD-1000MB-520___  1,048,576,000  1,070,071,808   No   520  10000
 18  NETAPP__  VD-16MB-FZ-520__     16,777,216     38,273,024   Yes  520  15000
 19  NETAPP__  VD-35MB-FZ-520__     35,913,728     57,409,536   Yes  520  15000
 20  NETAPP__  VD-50MB-FZ-520__     52,428,800     73,924,608   Yes  520  15000
 21  NETAPP__  VD-100MB-FZ-520_    104,857,600    126,353,408   Yes  520  15000
 22  NETAPP__  VD-500MB-FZ-520_    524,288,000    545,783,808   Yes  520  15000
 23  NETAPP__  VD-1000MB-FZ-520  1,048,576,000  1,070,071,808   Yes  520  15000
 24  NETAPP__  VD-16MB-FZ-ATA__     16,777,216     51,388,416   Yes  512   7200
 25  NETAPP__  VD-35MB-FZ-ATA__     36,700,160     73,801,728   Yes  512   7200
 26  NETAPP__  VD-50MB-FZ-ATA__     52,428,800     91,496,448   Yes  512   7200
 27  NETAPP__  VD-100MB-FZ-ATA_    104,857,600    150,478,848   Yes  512   7200
 28  NETAPP__  VD-500MB-FZ-ATA_    524,288,000    622,338,048   Yes  512   7200
 29  NETAPP__  VD-1000MB-FZ-ATA  1,048,576,000  1,212,162,048   Yes  512   7200
 30  NETAPP__  VD-2000MB-FZ-520  2,097,512,000  2,119,007,808   Yes  520  15000
 31  NETAPP__  VD-4000MB-FZ-520  4,194,304,000  4,215,799,808   Yes  520  15000
 32  NETAPP__  VD-2000MB-FZ-ATA  2,097,512,000  2,391,810,048   Yes  512   7200
 33  NETAPP__  VD-4000MB-FZ-ATA  4,194,304,000  4,751,106,048   Yes  512   7200
 34  NETAPP__  VD-100MB-SS-512_    104,857,600    126,353,408   Yes  512  15000
 35  NETAPP__  VD-500MB-SS-520_    524,288,000    545,783,808   Yes  520  15000
 36  NETAPP__  VD-9000MB-FZ-520  9,437,184,000  9,458,679,808   Yes  520  15000
 37  NETAPP__  VD-9000MB-FZ-ATA  9,437,184,000 10,649,346,048   Yes  512   7200

ontap97-sub::*>

上記結果より「23」でした。

ディスク追加は「systemshell localhost “cd /sim/dev;sudo vsim_makedisks -t タイプ -n 追加本数”」を実行して行います。

“sudo”コマンドを使用することでsecurity loginコマンドによる設定変更を省略しています。

今回、使用しているディスクはタイプ23であるため、これを10本追加するのであれは「systemshell localhost “cd /sim/dev;sudo vsim_makedisks -t 23 -n 10″」を実行します。

ontap97-sub::*> systemshell localhost "cd /sim/dev;sudo vsim_makedisks -t 23 -n 10"
  (system node systemshell)
Creating ,disks/v0.33:NETAPP__:VD-1000MB-FZ-520:66781814:2104448
Creating ,disks/v0.34:NETAPP__:VD-1000MB-FZ-520:66781815:2104448
Creating ,disks/v0.35:NETAPP__:VD-1000MB-FZ-520:66781816:2104448
Creating ,disks/v0.36:NETAPP__:VD-1000MB-FZ-520:66781817:2104448
Creating ,disks/v0.37:NETAPP__:VD-1000MB-FZ-520:66781818:2104448
Creating ,disks/v0.38:NETAPP__:VD-1000MB-FZ-520:66781819:2104448
Creating ,disks/v0.39:NETAPP__:VD-1000MB-FZ-520:66781820:2104448
Creating ,disks/v0.40:NETAPP__:VD-1000MB-FZ-520:66781821:2104448
Creating ,disks/v0.41:NETAPP__:VD-1000MB-FZ-520:66781822:2104448
Creating ,disks/v0.42:NETAPP__:VD-1000MB-FZ-520:66781823:2104448
Shelf file Shelf:DiskShelf14 updated

ontap97-sub::*>

ディスクを追加すると、まず未割り当てとして登録されます。

未割り当てディスクは「storage disk show -container-type unassigned」で確認します。

ontap97-sub::*> storage disk show -container-type unassigned
There are no entries matching your query.

ontap97-sub::*>

また「storage disk show -container-type spare」を実行してスペアディスクが増えていないことを確認します。

シミュレータ環境では追加したディスクがオンラインで認識されず、シミュレータの再起動が必要なようです。

再起動後、「storage disk show -container-type spare」を実行するとスペアディスクが増えていることがわかります。

ontap97-sub::> storage disk show -container-type spare
                     Usable           Disk    Container   Container
Disk                   Size Shelf Bay Type    Type        Name      Owner
---------------- ---------- ----- --- ------- ----------- --------- --------
NET-1.19             1020MB     -  27 FCAL    spare       Pool0     ontap97-sub-01
NET-1.20             1020MB     -  28 FCAL    spare       Pool0     ontap97-sub-01
NET-1.21             1020MB     -  29 FCAL    spare       Pool0     ontap97-sub-01
NET-1.27             1020MB     -  32 FCAL    spare       Pool0     ontap97-sub-01
NET-1.28             1020MB     -  32 FCAL    spare       Pool0     ontap97-sub-01
NET-1.29             1020MB     -  33 FCAL    spare       Pool0     ontap97-sub-01
NET-1.30             1020MB     -  34 FCAL    spare       Pool0     ontap97-sub-01
NET-1.31             1020MB     -  35 FCAL    spare       Pool0     ontap97-sub-01
NET-1.32             1020MB     -  36 FCAL    spare       Pool0     ontap97-sub-01
NET-1.33             1020MB     -  37 FCAL    spare       Pool0     ontap97-sub-01
NET-1.34             1020MB     -  38 FCAL    spare       Pool0     ontap97-sub-01
NET-1.35             1020MB     -  39 FCAL    spare       Pool0     ontap97-sub-01
NET-1.36             1020MB     -  40 FCAL    spare       Pool0     ontap97-sub-01
NET-1.37             1020MB     -  41 FCAL    spare       Pool0     ontap97-sub-01
NET-1.38             1020MB     -  42 FCAL    spare       Pool0     ontap97-sub-01
15 entries were displayed.

ontap97-sub::>

システムaggregateへのディスク追加

システムaggregateにディスクを追加します。

とりあえずディスクを3本追加します。
「storage aggregate add-disks -aggregate システムaggr名 -diskcount ディスク本数」

ontap97-sub::> storage aggregate add-disks -aggregate aggr0_ontap97_sub_01 -diskcount 3

Warning: Aggregate "aggr0_ontap97_sub_01" is a root aggregate. Adding disks to
         the root aggregate is not recommended. Once added, disks cannot be
         removed without reinitializing the node.
Do you want to continue? {y|n}: y

Info: Disks would be added to aggregate "aggr0_ontap97_sub_01" on node
      "ontap97-sub-01" in the following manner:

      First Plex

        RAID Group rg0, 6 disks (block checksum, raid_dp)
                                                            Usable Physical
          Position   Disk                      Type           Size     Size
          ---------- ------------------------- ---------- -------- --------
          data       NET-1.19                  FCAL         1000MB   1.00GB
          data       NET-1.27                  FCAL         1000MB   1.00GB
          data       NET-1.20                  FCAL         1000MB   1.00GB

      Aggregate capacity available for volume use would be increased by 2.64GB.

Do you want to continue? {y|n}: y

ontap97-sub::>

aggregateの容量が増えたことを確認します

ontap97-sub::> storage aggregate show


Aggregate     Size Available Used% State   #Vols  Nodes            RAID Status
--------- -------- --------- ----- ------- ------ ---------------- ------------
aggr0_ontap97_sub_01 3.34GB 2.55GB 24% online   1 ontap97-sub-01   raid_dp,
                                                                   normal
aggr1      14.06GB   14.00GB    0% online       3 ontap97-sub-01   raid_dp,
                                                                   normal
2 entries were displayed.

ontap97-sub::> df -A -h
Aggregate                total       used      avail capacity
aggr0_ontap97_sub_01    3420MB      812MB     2607MB      24%
aggr0_ontap97_sub_01/.snapshot 180MB   0B      180MB       0%
aggr1                     14GB       61MB       14GB       0%
aggr1/.snapshot             0B         0B         0B       0%
4 entries were displayed.

ontap97-sub::>

システムボリュームの拡張

まずは現状のvol0のサイズを確認します

ontap97-sub::> volume show
Vserver   Volume       Aggregate    State      Type       Size  Available Used%
--------- ------------ ------------ ---------- ---- ---------- ---------- -----
ontap97-sub-01 vol0    aggr0_ontap97_sub_01 online RW  807.3MB    230.4MB   69%
1 entries were displayed.

ontap97-sub::> df -h
Filesystem               total       used      avail capacity  Mounted on                 Vserver
/vol/vol0/               766MB      536MB      230MB      69%  ---                        ontap97-sub-01
/vol/vol0/.snapshot       40MB       32MB     7824KB      81%  ---                        ontap97-sub-01
2 entries were displayed.

ontap97-sub::>

「system node run -node ノード名 df -h」という手法でもボリューム容量を確認することができます。

ontap97-sub::> system node run -node ontap97-sub-01 df -h
Filesystem               total       used      avail capacity  Mounted on
/vol/vol0/               766MB      544MB      222MB      71%  /vol/vol0/
/vol/vol0/.snapshot       40MB       32MB     7768KB      81%  /vol/vol0/.snapshot

ontap97-sub::>

現状のvol0サイズを確認するため「system node run -node ノード名 vol size vol0」を実行します。

ontap97-sub::> system node run -node ontap97-sub-01 vol size vol0
vol size: Flexible volume 'vol0' has size 826656k.

ontap97-sub::>

vol0のサイズを2GBに設定します。

ontap97-sub::> system node run -node ontap97-sub-01 vol size vol0 2g
vol size: Flexible volume 'vol0' size set to 2g.

ontap97-sub::>

容量が変わったことを確認します。

ontap97-sub::> volume show
Vserver   Volume       Aggregate    State      Type       Size  Available Used%
--------- ------------ ------------ ---------- ---- ---------- ---------- -----
ontap97-sub-01 vol0    aggr0_ontap97_sub_01 online RW      2GB     1.38GB   27%
1 entries were displayed.

ontap97-sub::> df -h
Filesystem               total       used      avail capacity  Mounted on                 Vserver
/vol/vol0/              1945MB      536MB     1409MB      27%  ---                        ontap97-sub-01
/vol/vol0/.snapshot      102MB       32MB       69MB      32%  ---                        ontap97-sub-01
2 entries were displayed.

ontap97-sub::> system node run -node ontap97-sub-01 df -h
Filesystem               total       used      avail capacity  Mounted on
/vol/vol0/              1945MB      543MB     1402MB      28%  /vol/vol0/
/vol/vol0/.snapshot      102MB       32MB       69MB      32%  /vol/vol0/.snapshot
ontap97-sub::>

これで、vol0に余裕ができました。

NetApp ONTAP シミュレータ 9.7で起動時にFailed to backup /var to mroot と出力されている


NetApp ONTAP シミュレータ 9.7で起動時にFailed to backup /var to mroot と出力されている。

boot.varfs.backup.issuse : EMERGENCY
Backup of the /var file system failed (cp: /mroot/etc/tmpvarfs.tgz: No space left on device
varfs_backup_restore: Failed to backup /var to mroot (copy old)

/usr/bin/plxcoeff_log: cannot create /mroot/etc/log/plxcoeff/plxcoeff.log.tmp: No space left on device
stat: /mroot/etc/log/plxcoeff/plxcoeff.log.tmp: stat: No such file or directory [: -gt: unexprected operator

参考記事:All SSD based vsim

ログインして確認してみると、/vol/vol0 の空き容量がほぼ無い

とりあえず「system node run -node ノード名 vol size vol0」で現在の容量を確認して、「system node run -node ノード名 vol size vol0 1g」を実行して少し拡張

もうちょっと増やして1500MBにした(ほんとはontap 9.1と同じく3GBにしようかと思ったけど、aggr容量が足らなかった

たぶん、そのままでも大丈夫かな?と思ったのもの、ONTAPシミュレータを再起動して、問題なく起動することを確認して終了。

なお、ONTAPシミュレータのaggregateに余裕がない場合や、空きディスクがなくaggregate拡張ができない場合は「ONTAP 9.7シミュレータのシステムボリュームを拡張する」を実施することで拡張ができる。

DELL PowerEdge R420/ESXi環境でiDRACのアップデートを行う


ESXi7.0がインストールされているDELL PowerEdge R420のiDRACが更新されていないことに気がついたのでアップデートを試みた

[root@esxi70:/vmfs/volumes/5ec1e973-8ca56b7a-bafa-90b11c536183/.locker/tmp] ./Network_Firmware_7CM1N_LN_21.60.16.BIN -c
Invalid option: --packagepath=/scratch/tmp/Network_Firmware_7CM1N_LN_21.60.16.BIN
Try -h or --help for help.
[root@esxi70:/vmfs/volumes/5ec1e973-8ca56b7a-bafa-90b11c536183/.locker/tmp]

エラー。とりあえずオプションを確認してみる。

[root@esxi70:/vmfs/volumes/5ec1e973-8ca56b7a-bafa-90b11c536183/.locker/tmp] ./Network_Firmware_7CM1N_LN_21.60.16.BIN -h
Command-line options for the Update Package

Usage: <package name> [options...]

Options:

-h,--help     : Display command-line usage help
-c            : Determine if the update can be applied to the system (1)
-f            : Force a downgrade to an older version. (1)(2)
-q            : Execute the update package silently without user intervention
-n            : Execute the update package without security verification
-r            : Reboot if necessary after the update (2)
-v,--version  : Display version information
--list        : Display contents of package (3)
--installpath=<path>    : Install the update package in the specified path only if options (2) and (8)  are supported.

--extract <path> : Extract files to specified path (3)(4)
-qi, --queryinventory   : Inventory if selective update is supported. (2) (5)
-su=<device list> or --selectiveupdate=<device list>    :  give the list of devices to update.(2) (6) (7)
--bmcpath=<value>       : Chooses Inventory/Update path (value specified will be : ipmi - use KCS path or usbnic - use OS-BMC passthrough)

(1) Can NOT use -f with the -c option
(2) Only takes effect if used with -q
(3) Can be used only before extracting the package
(4) Can NOT use --extract with any other option
(5) Can use only with -q option. Can NOT be used with -f, -c, -h, -n, -r, -v, --list, --extract, -su
(6) Can NOT be used with -c, -h, -n, -v, --list, --extract, -qi
(7) Device list should not contain any space.
(8) Only Application DUP supports.
[root@esxi70:/vmfs/volumes/5ec1e973-8ca56b7a-bafa-90b11c536183/.locker/tmp]

とりあえずファイルを展開

[root@esxi70:/vmfs/volumes/5ec1e973-8ca56b7a-bafa-90b11c536183/.locker/tmp] ./iDRAC-with-Lifecycle-Controller_Firmware_0GHF4_LN_2.65.65.65_A00.BIN --extract
 ./idrac
Successfully extracted to ./idrac
[root@esxi70:/vmfs/volumes/5ec1e973-8ca56b7a-bafa-90b11c536183/.locker/tmp] cd idrac/
[root@esxi70:/vmfs/volumes/5ec1e973-8ca56b7a-bafa-90b11c536183/.locker/tmp/idrac] ls
00-secupd-dell.rules      buildVer.sh               package.xml
98-secupdusb.rules        dellIPMI.sh               package.xml.sign
HashOfHashFileList.txt    dellIPMI_msgs.sh          payload
LinuxDepWrapperLinux.bin  disneyinstall.sh          prereqcheck
OSFlavourUtils.sh         dupdisneyinstall.sh       smbiosHelp.txt
PIEConfig.sh              duppmdatacollector.bin    spUtilityHelp.txt
PIEInfo.txt               duputil.sh                spconfig.xml
UdevHal.sh                en.prop                   sphelp.txt
Version.txt               getSystemId               spsetup.sh
bmccfg.def                hapi                      sputility.bin
bmcfwu.cfg                lxhapi.ini                svmExeMsg.xsl
bmcfwul                   mc.txt                    uni-eol.txt
bmcie.sh                  os_mapping.xml
[root@esxi70:/vmfs/volumes/5ec1e973-8ca56b7a-bafa-90b11c536183/.locker/tmp/idrac]

とりあえずduputil.shを実行してみる

[root@esxi70:/vmfs/volumes/5ec1e973-8ca56b7a-bafa-90b11c536183/.locker/tmp/idrac] sh duputil.sh
duputil.sh: line 53: rpm: not found
duputil.sh: line 53: rpm: not found
duputil.sh: line 53: rpm: not found
duputil.sh: line 53: rpm: not found
duputil.sh: line 53: rpm: not found
duputil.sh: line 64: rpm: not found
[root@esxu70:/vmfs/volumes/5ec1e973-8ca56b7a-bafa-90b11c536183/.locker/tmp/idrac]

rpmコマンドを実行しようとして失敗している。

動かないのも当然そうだ。

というわけでおとなしくiDRACのWeb UIからファームウェアアップデート

iDRAC-with-Lifecycle-Controller_Firmware_0GHF4_LN_2.65.65.65_A00.BIN を7zipで開いてpayload/firmimg.d7 を読み込ませるとアップデートできます。

NetBackupのバックアップポリシー名を変更する


Veritas NetBackupでバックアップポリシー名を変更しようと思ったら、GUIにそういった操作が見当たらない。

調べるとコマンド bppolicynew コマンド の-renameto オプションを使うと変更できる、とのこと。

bppolicynew 元のポリシー名 -renameto 新しいポリシー名

という単純なものではあるのですが、複数をいっぺんに変更するとなるとポシリー名を間違わずに入力するのが非常に面倒となる。

バックアップポリシー一覧はbppllist コマンドで出力できるのだが、こいつには検索機能がなく、全部出力か、指定した1つ出力しかなく非常に使いにくい。

特定のバックアップタイプとか、特定のクライアントとかの検索をしやすいようにPowerShellを使って成形することとした。

「bppllist -allpolicies」は人には読みにくい形式ですが、出力される各行についてマニュアル内に解説があるのでそれに従って情報を取得することとした。

今回使用するのは

・CLASS行「フィールド1:ポリシー名」
・INFO行「フィールド1:ポリシータイプ」13=Windows,19=NDMPなど
・INFO行「フィールド11:ポリシーの有効無効」0=有効,1=無効
・INFO行「フィールド19:ポリシーを有効にする日付」(マニュアルは18となってるけど)
・INFO行「フィールド20:クラスID」ポリシー固有のID(マニュアルは19となってるけど)
・CLIENT行「フィールド1:クライアント名」

1つのポリシーに複数のクライアントが設定されている場合、CLIENT行は複数出力されるが、今回の環境ではそのような設定をしていないため考慮していない。

$tempfile = New-TemporaryFile
Start-Process -FilePath "C:\Program Files\Veritas\NetBackup\bin\admincmd\bppllist.exe" -ArgumentList "-allpolicies" -Wait -PassThru -NoNewWindow -RedirectStandardOutput $tempfile

$policyname=""
$policyname2=""

Get-Content $tempfile |ForEach-Object {
    $linetext=$_
    if($linetext.Contains("CLASS ")){
        $policyname2=$policyname
        $policyname=$linetext.Split(" ")[1]
        if($policyname2 -ne ""){
            #Write-Host $policyname2 " " $policytype " " $policyactive " " $policyclassid " " $policyactivedate
            Write-Host $policyclient "`t" "bppolicynew" $policyname2 "-renameto" $policyname2
        }
    }elseif($linetext.Contains("INFO ")){
        $policytype=$linetext.Split(" ")[1]
        $policyactive=$linetext.Split(" ")[11]
        $policyactivedate=$linetext.Split(" ")[19]
        $policyclassid=$linetext.Split(" ")[20]
    }elseif($linetext.Contains("CLIENT ")){
        $policyclient=$linetext.Split(" ")[1]
    }
}
$policyname2=$policyname
#Write-Host $policyname2 " " $policytype " " $policyactive " " $policyclassid " " $policyactivedate
Write-Host "bppolicynew" $policyname2 "-renameto" $policyname2

# New-tempfileを使用している場合は削除を忘れない
Remove-Item -Path $tempfile

なお、powershell上でDOSコマンドを実行するにあたり、ファイル出力をしないで直接PowerShellのパイプ連携を実施しようとしたのだが、実現できなかった。

このため、「-RedirectStandardOutput」で一時ファイルに出力してから処理という形を取っている。

NetAppでvolume snapmirrorを設定する手順


ONTAP9.1からONTAP9.7に転送するための手順例

参考になる日本語資料「ETERNUS AX series、ETERNUS HX series ONTAP 9 用SnapMirror 構成およびベストプラクティスガイド
↑の元となっているTR-4015「SnapMirror configuration and best practices guide for ONTAP 9

修正履歴
 2021/07/29-1 ボリュームの言語が異なっているとsnapmirror initializeが失敗する
 2021/07/29-2 ONTAP9.8だとnetwork interface createで-roleオプションがない

注:ONTAP 9.1からONTAP 9.7へのsnapmirrorは公式ではできないことになっている組み合わせだが、検証した限りではONTAP 8.3.2からONTAP 9.8とかもできた。ただ、過去に7-mode 8.2.4からONTAP 9.7へのtransission snapmirror時に有る場所で必ずsnapmirrorが止まりそれ以上進まない、という事象が発生して解決できなかったこともあるので、お薦めはできない。

(1) ONTAP9.1で送り元SVM作成

まず、ONTAP9.1側で送り元となるSVMとボリュームを作成する。

今回はガワだけ作成しており、NFSやCIFS設定などは省略している

ontap91::> vserver create -vserver share206 -aggregate aggr1 -language ja_v1.UTF-8 -subtype default -rootvolume share206_root -rootvolume-security-style mixed
[Job 21] Job succeeded:
Vserver creation completed

ontap91::> vserver show
                               Admin      Operational Root
Vserver     Type    Subtype    State      State       Volume     Aggregate
----------- ------- ---------- ---------- ----------- ---------- ----------
ontap91     admin   -          -          -           -          -
ontap91-01  node    -          -          -           -          -
share206    data    default    running    running     share206_  aggr1
                                                      root
3 entries were displayed.

ontap91::> 

続いてボリューム割り当て

ontap91::> volume create -volume sharevol -aggregate aggr1 -size 10G  -vserver share206

Warning: The export-policy "default" has no rules in it. The volume will
         therefore be inaccessible.
Do you want to continue? {y|n}: y
[Job 24] Job succeeded: Successful

ontap91::> volume show
Vserver   Volume       Aggregate    State      Type       Size  Available Used%
--------- ------------ ------------ ---------- ---- ---------- ---------- -----
ontap91-01 vol0        aggr0        online     RW       3.16GB     2.27GB   28%
share206  share206_root aggr1       online     RW         20MB    18.75MB    6%
share206  sharevol      aggr1       online     RW         10GB    10.00GB    0%
3 entries were displayed.

ontap91::>

(2) ONTAP9.7で受け側SVM作成

受け側となるSVMとボリュームを作成する。

注: ボリュームの言語は送り側/受け側で同じとする必要があるため「volume language -volume ボリューム名」で確認すること。異なっているとsnapmirror initializeで失敗する。

受け側のボリュームは「type:DP」で作成する必要がある。

ontap97::> vserver create -vserver share207 -language ja_v1.UTF-8 -aggregate aggr1 -rootvolume share207_root -rootvolume-security-style mixed
[Job 20] Job succeeded:
Vserver creation completed.

ontap97::> vserver show
                               Admin      Operational Root
Vserver     Type    Subtype    State      State       Volume     Aggregate
----------- ------- ---------- ---------- ----------- ---------- ----------
ontap97     admin   -          -          -           -          -
ontap97-01  node    -          -          -           -          -
share207    data    default    running    running     share207_  aggr1
                                                      root
3 entries were displayed.

ontap97::>

type:DPでボリュームを作成する

ontap97::> volume create -volume sharevol_repl -aggregate aggr1 -size 10g -type DP -state online
[Job 23] Job succeeded: Successful

ontap97::> volume show
Vserver   Volume       Aggregate    State      Type       Size  Available Used%
--------- ------------ ------------ ---------- ---- ---------- ---------- -----
ontap97-01 vol0        aggr0_ontap97_01 online RW      807.3MB    430.5MB   43%
share207  share207_root aggr1       online     RW         20MB    18.70MB    1%
share207  sharevol_repl aggr1       online     DP         10GB    10.00GB    0%
3 entries were displayed.

ontap97::>

(3) snapmirror用にrole:interclusterのIPアドレスを割り当て

snapmirrorのrole:interclusterのLIF/IPアドレスを使用するため、送り側/受け側の双方で作成する必要がある。

まず、「network interface show -role intercluster」 もしくは「network interface show -service-policy default-intercluster」を実行してすでに設定されているかを確認する。

ontap91::> network interface show -role intercluster
There are no entries matching your query.

ontap91::>
ontap97::> network interface show -role intercluster
There are no entries matching your query.

ontap97::>

ないので作成する。

ontap91::> network interface create -vserver ontap91 -role intercluster -lif snapmirror_lif -home-node ontap91-01 -home-port e0a -address 172.17.44.222 -netmask 255.255.0.0 -status-admin up

ontap91::> network interface show -role intercluster
            Logical    Status     Network            Current       Current Is
Vserver     Interface  Admin/Oper Address/Mask       Node          Port    Home
----------- ---------- ---------- ------------------ ------------- ------- ----
ontap91
            snapmirror_lif up/up  172.17.44.222/16   ontap91-01    e0a     true

ontap91::>

ONTAP9.5ぐらいから「-service-policy default-intercluster」というオプションが増えている。

ontap97::> network interface create -vserver ontap97 -role intercluster -lif snapmirror_lif -service-policy default-intercluster -address 172.17.44.223 -netmask 255.255.0.0 -home-node ontap97-01 -home-port e0c

ontap97::> network interface show -role intercluster
            Logical    Status     Network            Current       Current Is
Vserver     Interface  Admin/Oper Address/Mask       Node          Port    Home
----------- ---------- ---------- ------------------ ------------- ------- ----
ontap97
            snapmirror_lif up/up  172.17.44.223/16   ontap97-01    e0c     true

ontap97::>

ONTAP 9.8だとnetwork interface createに-roleオプションがなくなっているが、「-service-policy default-intercluster」のみの指定でOKだった(マニュアル確認したらONTAP 9.5から-role interclusterから-service-policy default-intercluster に切り替わっていた)

ontap98::> network interface create -vserver ontap98 -lif snapmirror_lif -service-policy default-intercluster -address 172.17.44.235 -netmask 255.255.0.0 -home-node ontap98-01 -home-port e0c

ontap98::> network interface show -role intercluster
            Logical    Status     Network            Current       Current Is
Vserver     Interface  Admin/Oper Address/Mask       Node          Port    Home
----------- ---------- ---------- ------------------ ------------- ------- ----
ontap98
            snapmirror_lif
                         up/up    172.17.44.235/16   ontap98-01    e0c     true

ontap98::>

(4) cluster peerの作成

snapmirrorの前段階としてONTAP cluster同士を連携させるためのcluster peer(クラスタピア)を設定する。

どちらからやっても良いが「cluster peer create -peer-addrs 相手のinterclusterアドレス」を実行する。

ontap91::> cluster peer create -peer-addrs 172.17.44.223

Notice: Choose a passphrase of 8 or more characters. To ensure the authenticity
        of the peering relationship, use a phrase or sequence of characters
        that would be hard to guess.

Enter the passphrase:
Confirm the passphrase:

Notice: Now use the same passphrase in the "cluster peer create" command in the
        other cluster.

ontap91::>

ONTAP9.5以降では暗号化が標準設定されているため、ONTAP 9.1相手だと暗号化接続を試みるようで、下記の様にエラーとなる。

ontap97::> cluster peer create -peer-addrs 172.17.44.222

Notice: Use a generated passphrase or choose a passphrase of 8 or more
        characters. To ensure the authenticity of the peering relationship, use
        a phrase or sequence of characters that would be hard to guess.

Enter the passphrase:
Confirm the passphrase:

Error: command failed: Remote cluster would not use encryption for this
       relationship.

ontap97::>

これは、暗号化接続に関する設定オプションを明示的に指定することで回避できる。

ontap97::> cluster peer create -peer-addrs 172.17.44.222 -encryption-protocol-proposed none

Notice: Use a generated passphrase or choose a passphrase of 8 or more
        characters. To ensure the authenticity of the peering relationship, use
        a phrase or sequence of characters that would be hard to guess.

Enter the passphrase:
Confirm the passphrase:

ontap97::>

設定完了後「cluster peer show」コマンドで「Availability:Available」となっていることを確認する。

ontap91::> cluster peer show
Peer Cluster Name         Cluster Serial Number Availability   Authentication
------------------------- --------------------- -------------- --------------
ontap97                   1-80-000008           Available      ok
1 entries were displayed.

ontap91::> 
ontap97::> cluster peer show
Peer Cluster Name         Cluster Serial Number Availability   Authentication
------------------------- --------------------- -------------- --------------
ontap91                   1-80-000008           Available      ok

ontap97::>

なお、設定完了後すぐはCluster Serial Numberが空欄になっているが、しばらく経つと表示されるはず。

(5) SVM peerの作成

volumeはSVMの配下にあるため、volume snapmirrorを行う場合は、SVMについてもpeer(SVM ピア)を設定する必要がある。

片側から「vserver peer create 」コマンドを実行する。

ontap91::> vserver peer create -vserver share206 -peer-vserver share207 -applications snapmirror -peer-cluster ontap97

Info: [Job 27] 'vserver peer create' job queued

ontap91::> vserver peer show
            Peer        Peer                           Peering        Remote
Vserver     Vserver     State        Peer Cluster      Applications   Vserver
----------- ----------- ------------ ----------------- -------------- ---------
share206    share207    initializing ontap97           snapmirror     share207
1 entries were displayed.

ontap91::> vserver peer show
            Peer        Peer                           Peering        Remote
Vserver     Vserver     State        Peer Cluster      Applications   Vserver
----------- ----------- ------------ ----------------- -------------- ---------
share206    share207    initiated    ontap97           snapmirror     share207
1 entries were displayed.

ontap91::>

上記でvserver peer createを実行したあと、もう片側では、まず「vserver peer show」で「State:pending」というステータスになっていることを確認する。

ontap97::> vserver peer show
            Peer        Peer                           Peering        Remote
Vserver     Vserver     State        Peer Cluster      Applications   Vserver
----------- ----------- ------------ ----------------- -------------- ---------
share207    share206    pending      ontap91           snapmirror     share206

ontap97::> 

これをaccpetすることで、SVM peerが成立する。

ontap97::> vserver peer accept -vserver share207 -peer-vserver share206

Info: [Job 24] 'vserver peer accept' job queued

ontap97::> vserver peer show
            Peer        Peer                           Peering        Remote
Vserver     Vserver     State        Peer Cluster      Applications   Vserver
----------- ----------- ------------ ----------------- -------------- ---------
share207    share206    pending      ontap91           snapmirror     share206

ontap97::> vserver peer show
            Peer        Peer                           Peering        Remote
Vserver     Vserver     State        Peer Cluster      Applications   Vserver
----------- ----------- ------------ ----------------- -------------- ---------
share207    share206    peered       ontap91           snapmirror     share206

ontap97::>

成立後、ONTAP 9.1側でも確認すると「peer State:peered」に変化しているはず

ontap91::> vserver peer show
            Peer        Peer                           Peering        Remote
Vserver     Vserver     State        Peer Cluster      Applications   Vserver
----------- ----------- ------------ ----------------- -------------- ---------
share206    share207    peered       ontap97           snapmirror     share207
1 entries were displayed.

ontap91::>

(6) snapmirrorの作成

snapmirrorを作成する。

ontap97::> snapmirror create -source-path share206:sharevol -destination-path share207:sharevol_repl -vserver share207 -throttle unlimited -identity-preserve false -type DP -schedule daily
Operation succeeded: snapmirror create for the relationship with destination "share207:sharevol_repl".

ontap97::> snapmirror show
                                                                       Progress
Source            Destination Mirror  Relationship   Total             Last
Path        Type  Path        State   Status         Progress  Healthy Updated
----------- ---- ------------ ------- -------------- --------- ------- --------
share206:sharevol XDP share207:sharevol_repl Uninitialized Idle - true -

ontap97::>

ONTAP 9.7ではType:DPを指定してもType:XDPに変換されるようだ。

メモ:SVM DRの場合は「-identity-preserve true」とするが、ただのvolume snapmirrorの場合はfalseのままで良い(参考:SVM DRの場合の動作)

(7) snapmirrorの初期化/転送開始

snapmirrorは作成したあと、初期化操作を別途行う必要がある。

ontap97::> snapmirror initialize -destination-path share207:sharevol_repl
Operation is queued: snapmirror initialize of destination "share207:sharevol_repl".

ontap97::> snapmirror show
                                                                       Progress
Source            Destination Mirror  Relationship   Total             Last
Path        Type  Path        State   Status         Progress  Healthy Updated
----------- ---- ------------ ------- -------------- --------- ------- --------
share206:sharevol XDP share207:sharevol_repl Uninitialized Transferring 0B false 03/04 05:57:49

ontap97::>

初期化が終わると、「Mirror State:Snapmirrored」となり、データの転送が開始される「Relationship Status:Transferring」

ontap97::> snapmirror show
                                                                       Progress
Source            Destination Mirror  Relationship   Total             Last
Path        Type  Path        State   Status         Progress  Healthy Updated
----------- ---- ------------ ------- -------------- --------- ------- --------
share206:sharevol XDP share207:sharevol_repl Snapmirrored Transferring 0B true 03/04 05:58:57

ontap97::>

転送が終わると「Relationship Status:Idle」となる。

ontap97::> snapmirror show
                                                                       Progress
Source            Destination Mirror  Relationship   Total             Last
Path        Type  Path        State   Status         Progress  Healthy Updated
----------- ---- ------------ ------- -------------- --------- ------- --------
share206:sharevol XDP share207:sharevol_repl Snapmirrored Idle - true -

ontap97::>


いろいろな追加情報

・3拠点ある時のsnapmirrorネットワークの作り方に注意が必要

NetApp ONTAPドキュメント: カスタム IPspace を使用してレプリケーショントラフィックを分離します

IPspace を使用して、指定したクラスタ間 LIF とのクラスタピアリングを作成および設定する方法

「 Default 」 IPspace に動作しているローカルの IPv4 クラスタ間 LIF がない」というエラーでクラスタピアの作成が失敗する

LIFごとにIPネットワークが違う構成を取っている場合以下のようにIPSpaceを分ける必要がある

IPSpaceを分けた場合、LIF A1につくるインタークラスタLIFは「network interface create -vserver snapmirror1 -lif A1 -address ~」、LIF A2につくるやつは「network interface create -vserver snapmirror2 -lif A2 -address ~」という感じで作る。

-vserverで指定するのがクラスタ名やSVM名じゃなくて、IPSpace名となることに注意

既に作成済みのインタークラスタLIFのIPspaceを変更することはできないので、作成済みのLIFを削除→NICのIPSpaceとbroadcast domainを変更→インタークラスタLIFを作成、という手順を踏む必要がある。

IPspace インタークラスタLIFを作る際、間違って「network interface create -vserver クラスタ名 -lif A2 ~」で作ってしまった場合に、cluster peerのipspaceを変えようとすると、下記の様なエラーとなる。

netapp9101dr::> cluster peer modify -cluster netapp9101 -ipspace snapmirror2  

Error: command failed: No operational intercluster LIFs of the IPv4 address
       family and IPspace "snapmirror2" are available on this node.

netapp9101dr::>

この場合は、LIFを削除して、-vserver IPspace名でLIFを作成し直せばよい