Quantcast
Channel: OSAKANA TAROのメモ帳
Viewing all 1106 articles
Browse latest View live

Oracle RMANメモ

$
0
0

OracleデータベースのバックアップをRMAN使ってとる、という話が久しぶりに回ってきたけど、すっかり忘却していたのでメモ書き

とりあえずWindows Server 2019にOracle 18c XEをインストールして確認

各種コマンド例

LISTNERの状態確認

「lsnrctl status」でLISTNERの状態を確認

C:\Users\administrator.VM2>lsnrctl status

LSNRCTL for 64-bit Windows: Version 18.0.0.0.0 - Production on 25-6月 -2021 10:32:12

Copyright (c) 1991, 2018, Oracle.  All rights reserved.

(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracledb.adosakana.local(PORT=1521)))に接続中
リスナーのステータス
------------------------
別名                      LISTENER
バージョン                TNSLSNR for 64-bit Windows: Version 18.0.0.0.0 - Production
開始日                    22-6月 -2021 16:42:40
稼働時間                  2 日 17 時間 49 分 32 秒
トレース・レベル          off
セキュリティ              ON: Local OS Authentication
SNMP                      OFF
デフォルト・サービス           XE
パラメータ・ファイル      D:\app\administrator\product\18.0.0\dbhomeXE\network\admin\listener.ora
ログ・ファイル            D:\app\administrator\product\18.0.0\diag\tnslsnr\oracledb\listener\alert\log.xml
リスニング・エンドポイントのサマリー...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracledb.adosakana.local)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=127.0.0.1)(PORT=5500))(Security=(my_wallet_directory=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\admin\XE\xdb_wallet))(Presentation=HTTP)(Session=RAW))
サービスのサマリー...
サービス"3bba54f9890046b4b3f6a6c7a4e4e597"には、1件のインスタンスがあります。
  インスタンス"xe"、状態READYには、このサービスに対する1件のハンドラがあります...
サービス"CLRExtProc"には、1件のインスタンスがあります。
  インスタンス"CLRExtProc"、状態UNKNOWNには、このサービスに対する1件のハンドラがあります...
サービス"XE"には、1件のインスタンスがあります。
  インスタンス"xe"、状態READYには、このサービスに対する1件のハンドラがあります...
サービス"XEXDB"には、1件のインスタンスがあります。
  インスタンス"xe"、状態READYには、このサービスに対する1件のハンドラがあります...
サービス"xepdb1"には、1件のインスタンスがあります。
  インスタンス"xe"、状態READYには、このサービスに対する1件のハンドラがあります...
コマンドは正常に終了しました。

C:\Users\administrator.VM2>

アーカイブログの設定確認

Oracleデータベースのバックアップを行う場合、ARCHIVELOGモードが有効になっていないと、オンラインバックアップが行えないので、sqlplusコマンドを使ってデータベースに接続し、log_mode の値を確認する。

C:\Users\administrator.VM2>sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on 金 6月 25 10:35:11 2021
Version 18.4.0.0.0

Copyright (c) 1982, 2018, Oracle.  All rights reserved.



Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
Version 18.4.0.0.0
に接続されました。
SQL> select log_mode from v$database;

LOG_MODE
------------------------
ARCHIVELOG

SQL> exit
Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
Version 18.4.0.0.0との接続が切断されました。

C:\Users\administrator.VM2>

上記は「ARCHIVELOG」で有効になっている、ということ。

ここが「NOARCHIVELOG」だと有効になっていない、ということになる。

アーカイブログがどこに出力されるかを「archive log list」を実行して確認する。

SQL> archive log list
データベース・ログ・モード     アーカイブ・モード
自動アーカイブ                 有効
アーカイブ先                    D:\app\administrator\product\18.0.0\dbhomeXE\RDBMS
最も古いオンライン・ログ順序   47
アーカイブする次のログ順序    49
現行のログ順序               49
SQL> 

また、実際に出力される時にどういうファイル名となるかは「select * from v$logfile;」を実行して確認出来る。(こちらは最後に”;”を忘れない)

SQL> select * from v$logfile;

    GROUP# STATUS         TYPE
---------- -------------- --------------
MEMBER
--------------------------------------------------------------------------------
IS_REC     CON_ID
------ ----------
         3                ONLINE
D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\REDO03.LOG
NO              0

         2                ONLINE
D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\REDO02.LOG
NO              0

    GROUP# STATUS         TYPE
---------- -------------- --------------
MEMBER
--------------------------------------------------------------------------------
IS_REC     CON_ID
------ ----------

         1                ONLINE
D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\REDO01.LOG
NO              0


SQL>

RMANの既存設定確認

RMANに設定されている内容を確認するには「show all;」を実行して確認します。

C:\Users\administrator.VM2>rman target /

Recovery Manager: Release 18.0.0.0.0 - Production on 金 6月 25 15:40:36 2021
Version 18.4.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

ターゲット・データベース: XE (DBID=2957026582)に接続されました

RMAN> show all;

db_unique_name XEのデータベースにおけるRMAN構成パラメータ:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\DBHOMEXE\DATABASE\SNCFXE.ORA'; # default

RMAN>

コントロール/SPFILEの取り扱い

コントロールファイル/SPFILEの自動バックアップが設定されているかは、rmanコマンドで「show controlfile autobackup;」を実行することで確認出来る。

C:\Users\administrator.VM2>rman target /

Recovery Manager: Release 18.0.0.0.0 - Production on 金 6月 25 15:40:36 2021
Version 18.4.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

ターゲット・データベース: XE (DBID=2957026582)に接続されました

RMAN> SHOW CONTROLFILE AUTOBACKUP ;

db_unique_name XEのデータベースにおけるRMAN構成パラメータ:
CONFIGURE CONTROLFILE AUTOBACKUP ON;

RMAN> SHOW CONTROLFILE AUTOBACKUP FORMAT;

リカバリ・カタログのかわりにターゲット・データベース制御ファイルを使用しています
db_unique_name XEのデータベースにおけるRMAN構成パラメータ:
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default

RMAN> 

バックアップ一覧の確認

現在までにRMAN経由でバックアップした一覧は「list backup;」で確認できる。

RMAN> list backup;


バックアップ・セットのリスト
===================


BS Key  Type LV Size       Device Type Elapsed Time 終了時間
------- ---- -- ---------- ----------- ------------ --------
1       Incr 0  1.07G      SBT_TAPE    00:02:00     21-06-22
        BPキー: 1   ステータス: AVAILABLE  圧縮: NO  タグ: TAG20210622T165535
        ハンドル: 1163_XE_01022907_1_1   メディア: V_342_2322
  バックアップ・セット1のデータファイルのリスト
  File LV Type Ckp SCN    Ckp時間  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- -------- ----------- ------ ----
  1    0  Incr 1563429    21-06-22              NO    D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\SYSTEM01.DBF
  3    0  Incr 1563429    21-06-22              NO    D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\SYSAUX01.DBF
  4    0  Incr 1563429    21-06-22              NO    D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\UNDOTBS01.DBF
  7    0  Incr 1563429    21-06-22              NO    D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\USERS01.DBF

BS Key  Type LV Size       Device Type Elapsed Time 終了時間
------- ---- -- ---------- ----------- ------------ --------
2       Incr 0  522.00M    SBT_TAPE    00:00:04     21-06-22
        BPキー: 2   ステータス: AVAILABLE  圧縮: NO  タグ: TAG20210622T165535
        ハンドル: 1163_XE_02022944_1_1   メディア: V_342_2323
  バックアップ・セット2のデータファイルのリスト
  コンテナID: 3、PDB名: XEPDB1
  File LV Type Ckp SCN    Ckp時間  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- -------- ----------- ------ ----
  9    0  Incr 1563669    21-06-22              NO    D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\XEPDB1\SYSTEM01.DBF
  10   0  Incr 1563669    21-06-22              NO    D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\XEPDB1\SYSAUX01.DBF
  11   0  Incr 1563669    21-06-22              NO    D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\XEPDB1\UNDOTBS01.DBF
  12   0  Incr 1563669    21-06-22              NO    D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\XEPDB1\USERS01.DBF

BS Key  Type LV Size       Device Type Elapsed Time 終了時間
------- ---- -- ---------- ----------- ------------ --------
3       Incr 0  511.00M    SBT_TAPE    00:00:04     21-06-22
        BPキー: 3   ステータス: AVAILABLE  圧縮: NO  タグ: TAG20210622T165535
        ハンドル: 1163_XE_0302294c_1_1   メディア: V_342_2324
  バックアップ・セット3のデータファイルのリスト
  コンテナID: 2、PDB名: PDB$SEED
  File LV Type Ckp SCN    Ckp時間  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- -------- ----------- ------ ----
  5    0  Incr 1452518    21-06-22              NO    D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\PDBSEED\SYSTEM01.DBF
  6    0  Incr 1452518    21-06-22              NO    D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\PDBSEED\SYSAUX01.DBF
  8    0  Incr 1452518    21-06-22              NO    D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\PDBSEED\UNDOTBS01.DBF

BS Key  Type LV Size       Device Type Elapsed Time 終了時間
------- ---- -- ---------- ----------- ------------ --------
4       Incr 0  18.00M     SBT_TAPE    00:00:01     21-06-22
        BPキー: 4   ステータス: AVAILABLE  圧縮: NO  タグ: TAG20210622T165535
        ハンドル: 1163_XE_0402294j_1_1   メディア: V_342_2325
  含まれている制御ファイル: Ckp SCN: 1563678      Ckp時間: 21-06-22

BS Key  Type LV Size       Device Type Elapsed Time 終了時間
------- ---- -- ---------- ----------- ------------ --------
5       Full    18.00M     SBT_TAPE    00:00:00     21-06-22
        BPキー: 5   ステータス: AVAILABLE  圧縮: NO  タグ: TAG20210622T165757
        ハンドル: c-2957026582-20210622-00   メディア: V_342_2326
  SPFILEも含まれます: 修正時間: 21-06-22
  SPFILE db_unique_name: XE
  含まれている制御ファイル: Ckp SCN: 1563687      Ckp時間: 21-06-22

BSキー  サイズ       デバイス・タイプ経過時間終了時間
------- ---------- ----------- ------------ --------
6       88.00M     SBT_TAPE    00:01:06     21-06-22
        BPキー: 6   ステータス: AVAILABLE  圧縮: NO  タグ: TAG20210622T165921
        ハンドル: 1163_XE_06022979_1_1   メディア: V_342_2327

  バックアップ・セット6のアーカイブ・ログのリスト
  Thrd Seq     Low SCN    Low時間  Next SCN   Next Time
  ---- ------- ---------- -------- ---------- ---------
  1    2       1440543    21-06-22 1460361    21-06-22
  1    3       1460361    21-06-22 1562252    21-06-22
  1    4       1562252    21-06-22 1563792    21-06-22
  1    5       1563792    21-06-22 1563800    21-06-22

BS Key  Type LV Size       Device Type Elapsed Time 終了時間
------- ---- -- ---------- ----------- ------------ --------
7       Full    18.00M     SBT_TAPE    00:00:01     21-06-22
        BPキー: 7   ステータス: AVAILABLE  圧縮: NO  タグ: TAG20210622T170037
        ハンドル: c-2957026582-20210622-01   メディア: V_342_2328
  SPFILEも含まれます: 修正時間: 21-06-22
  SPFILE db_unique_name: XE
  含まれている制御ファイル: Ckp SCN: 1563859      Ckp時間: 21-06-22

<略>
BSキー  サイズ       デバイス・タイプ経過時間終了時間
------- ---------- ----------- ------------ --------
111     11.00M     SBT_TAPE    00:01:05     21-06-25
        BPキー: 111   ステータス: AVAILABLE  圧縮: NO  タグ: TAG20210625T135700
        ハンドル: 1420_XE_3j029rlc_1_1   メディア: V_342_2765

  バックアップ・セット111のアーカイブ・ログのリスト
  Thrd Seq     Low SCN    Low時間  Next SCN   Next Time
  ---- ------- ---------- -------- ---------- ---------
  1    52      1831218    21-06-25 1839292    21-06-25

BS Key  Type LV Size       Device Type Elapsed Time 終了時間
------- ---- -- ---------- ----------- ------------ --------
112     Full    19.00M     SBT_TAPE    00:00:01     21-06-25
        BPキー: 112   ステータス: AVAILABLE  圧縮: NO  タグ: TAG20210625T135805
        ハンドル: c-2957026582-20210625-0d   メディア: V_342_2766
  SPFILEも含まれます: 修正時間: 21-06-22
  SPFILE db_unique_name: XE
  含まれている制御ファイル: Ckp SCN: 1839334      Ckp時間: 21-06-25

BSキー  サイズ       デバイス・タイプ経過時間終了時間
------- ---------- ----------- ------------ --------
113     20.00M     SBT_TAPE    00:01:05     21-06-25
        BPキー: 113   ステータス: AVAILABLE  圧縮: NO  タグ: TAG20210625T145912
        ハンドル: 1426_XE_3l029va0_1_1   メディア: V_342_2772

  バックアップ・セット113のアーカイブ・ログのリスト
  Thrd Seq     Low SCN    Low時間  Next SCN   Next Time
  ---- ------- ---------- -------- ---------- ---------
  1    53      1839292    21-06-25 1845342    21-06-25

BS Key  Type LV Size       Device Type Elapsed Time 終了時間
------- ---- -- ---------- ----------- ------------ --------
114     Full    19.00M     SBT_TAPE    00:00:00     21-06-25
        BPキー: 114   ステータス: AVAILABLE  圧縮: NO  タグ: TAG20210625T150028
        ハンドル: c-2957026582-20210625-0e   メディア: V_342_2773
  SPFILEも含まれます: 修正時間: 21-06-22
  SPFILE db_unique_name: XE
  含まれている制御ファイル: Ckp SCN: 1845469      Ckp時間: 21-06-25

RMAN>

バックアップ手法について

Oracleデータベースをバックアップする時に気にするもの
・データベース本体
・アーカイブログ
・コントロールファイル/SPFILE


Oracle 19 [Backup and Recovery User’s Guide]
 [4 RMANクライアントの起動および操作]
 [5 RMAN環境の構成]
Oracle 19 [Real Application Clusters管理およびデプロイメント・ガイド]
 [7.4 制御ファイルおよびSPFILEを自動的にバックアップするようなRMANの構成]

手動で実行

[2.4.2 ARCHIVELOGモードでのデータベースのバックアップ]に記載されている「BACKUP DATABASE PLUS ARCHIVELOG;」を実行した例

デフォルトのRMAN設定では”CONFIGURE DEFAULT DEVICE TYPE TO DISK; “と設定さてており、何も指定がない場合はディスク上に保存されることになっている。

RMAN> backup database plus archivelog;


backupを21-06-25で開始しています
現在のログがアーカイブされました。
チャネル: ORA_DISK_1が割り当てられました
チャネルORA_DISK_1: SID=287 デバイス・タイプ=DISK
チャネルORA_DISK_1: アーカイブ・ログ・バックアップ・セットを開始しています
チャネルORA_DISK_1: バックアップ・セットにアーカイブ・ログを指定しています
入力アーカイブ・ログ・スレッド=1 順序=56 レコードID=55 スタンプ=1076174677
チャネルORA_DISK_1: ピース1 (21-06-25)を起動します
チャネルORA_DISK_1: ピース1 (21-06-25)が完了しました
ピース・ハンドル=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\DBHOMEXE\DATABASE\3R02A7QN_1_1 タグ=TAG20210625T172439 コメント=NONE
チャネルORA_DISK_1: バックアップ・セットが完了しました。経過時間: 00:00:01
backupを21-06-25で終了しました

backupを21-06-25で開始しています
チャネルORA_DISK_1の使用
チャネルORA_DISK_1: フル・データファイル・バックアップ・セットを開始しています
チャネルORA_DISK_1: バックアップ・セットにデータファイルを指定しています
入力データファイル ファイル番号=00001 名前=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\SYSTEM01.DBF
入力データファイル ファイル番号=00003 名前=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\SYSAUX01.DBF
入力データファイル ファイル番号=00004 名前=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\UNDOTBS01.DBF
入力データファイル ファイル番号=00007 名前=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\USERS01.DBF
チャネルORA_DISK_1: ピース1 (21-06-25)を起動します
チャネルORA_DISK_1: ピース1 (21-06-25)が完了しました
ピース・ハンドル=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\DBHOMEXE\DATABASE\3S02A7QO_1_1 タグ=TAG20210625T172440 コメント=NONE
チャネルORA_DISK_1: バックアップ・セットが完了しました。経過時間: 00:00:15
チャネルORA_DISK_1: フル・データファイル・バックアップ・セットを開始しています
チャネルORA_DISK_1: バックアップ・セットにデータファイルを指定しています
入力データファイル ファイル番号=00010 名前=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\XEPDB1\SYSAUX01.DBF
入力データファイル ファイル番号=00009 名前=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\XEPDB1\SYSTEM01.DBF
入力データファイル ファイル番号=00011 名前=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\XEPDB1\UNDOTBS01.DBF
入力データファイル ファイル番号=00012 名前=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\XEPDB1\USERS01.DBF
チャネルORA_DISK_1: ピース1 (21-06-25)を起動します
チャネルORA_DISK_1: ピース1 (21-06-25)が完了しました
ピース・ハンドル=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\DBHOMEXE\DATABASE\3T02A7R7_1_1 タグ=TAG20210625T172440 コメント=NONE
チャネルORA_DISK_1: バックアップ・セットが完了しました。経過時間: 00:00:07
チャネルORA_DISK_1: フル・データファイル・バックアップ・セットを開始しています
チャネルORA_DISK_1: バックアップ・セットにデータファイルを指定しています
入力データファイル ファイル番号=00006 名前=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\PDBSEED\SYSAUX01.DBF
入力データファイル ファイル番号=00005 名前=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\PDBSEED\SYSTEM01.DBF
入力データファイル ファイル番号=00008 名前=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\PDBSEED\UNDOTBS01.DBF
チャネルORA_DISK_1: ピース1 (21-06-25)を起動します
チャネルORA_DISK_1: ピース1 (21-06-25)が完了しました
ピース・ハンドル=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\DBHOMEXE\DATABASE\3U02A7RF_1_1 タグ=TAG20210625T172440 コメント=NONE
チャネルORA_DISK_1: バックアップ・セットが完了しました。経過時間: 00:00:07
backupを21-06-25で終了しました

backupを21-06-25で開始しています
現在のログがアーカイブされました。
チャネルORA_DISK_1の使用
チャネルORA_DISK_1: アーカイブ・ログ・バックアップ・セットを開始しています
チャネルORA_DISK_1: バックアップ・セットにアーカイブ・ログを指定しています
入力アーカイブ・ログ・スレッド=1 順序=57 レコードID=56 スタンプ=1076174710
チャネルORA_DISK_1: ピース1 (21-06-25)を起動します
チャネルORA_DISK_1: ピース1 (21-06-25)が完了しました
ピース・ハンドル=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\DBHOMEXE\DATABASE\3V02A7RM_1_1 タグ=TAG20210625T172510 コメント=NONE
チャネルORA_DISK_1: バックアップ・セットが完了しました。経過時間: 00:00:01
backupを21-06-25で終了しました

Control File and SPFILE Autobackupを21-06-25で開始しています
ピース・ハンドル=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\DBHOMEXE\DATABASE\C-2957026582-20210625-11 コメント=NONE
Control File and SPFILE Autobackupを21-06-25で終了しました

RMAN>

sbt_tapeに変える場合、以前だとallocate cahnnelしていたが[B 非推奨になったRMAN構文]に含まれている。

しかし、[5.1.2 バックアップ用のデフォルト・デバイスの構成: ディスクまたはSBT]から記述を見ていくと[5.1.4.1 チャネルの構成について]と[5.1.4.4 構成済チャネルの手動での変更]を見ると、一時的に変更する場合は「ALLOCATE CHANNEL」のままで良いようだ。

CommvaultのOralce Agentがセットアップされている環境で試すと、Commvaultに引き渡す場合のパラメータが適合していないようで、失敗する。

RMAN> run {
2> allocate channel ch1 device type 'SBT_TAPE';
3> backup database plus archivelog;
4> }

チャネル: ORA_DISK_1がリリースされました
チャネル: ch1が割り当てられました
チャネルch1: SID=287 デバイス・タイプ=SBT_TAPE
チャネルch1: CommVault Systems for Oracle: Version 11.0.0(BUILD80)


backupを21-06-25で開始しています
現在のログがアーカイブされました。
チャネルch1: アーカイブ・ログ・バックアップ・セットを開始しています
チャネルch1: バックアップ・セットにアーカイブ・ログを指定しています
入力アーカイブ・ログ・スレッド=1 順序=56 レコードID=55 スタンプ=1076174677
入力アーカイブ・ログ・スレッド=1 順序=57 レコードID=56 スタンプ=1076174710
入力アーカイブ・ログ・スレッド=1 順序=58 レコードID=57 スタンプ=1076175527
チャネルch1: ピース1 (21-06-25)を起動します
チャネル: ch1がリリースされました
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: backup plus archivelogコマンドが06/25/2021 17:39:23で失敗しました
ORA-19506: シーケンシャル・ファイルの作成に失敗しました。ファイル名="4102a8l8_1_1"、パラメータ=""
ORA-27028: skgfqcre: sbtbackupからエラーが戻されました。
ORA-19511: RMAN以外の、メディア・マネージャまたはベンダー固有の障害。エラー・テキスト:
   CreateOraObject20:

RMAN>

Commvaultマニュアルにある[RMAN Example: Performing Oracle Full Backups]のサンプル通りに実行してみる。

RMAN> run {
2> allocate channel ch1 type 'sbt_tape';
3> allocate channel ch2 type 'sbt_tape';
4> allocate channel ch3 type 'sbt_tape';
5> allocate channel ch4 type 'sbt_tape';
6>
7> setlimit channel ch1 maxopenfiles 8;
8> setlimit channel ch2 maxopenfiles 8;
9> setlimit channel ch3 maxopenfiles 8;
10> setlimit channel ch4 maxopenfiles 8;
11>
12> backup incremental level = 0
13> filesperset = 4 format '%d_%U_%t'
14> database include current controlfile;
15> }

チャネル: ch1が割り当てられました
チャネルch1: SID=287 デバイス・タイプ=SBT_TAPE
チャネルch1: CommVault Systems for Oracle: Version 11.0.0(BUILD80)

RMAN-06908: 警告: 操作は割り当てられたチャネルでパラレルに実行しません
RMAN-06909: 警告: パラレル化にはEnterprise Editionが必要です
チャネル: ch2が割り当てられました
チャネルch2: SID=41 デバイス・タイプ=SBT_TAPE
チャネルch2: CommVault Systems for Oracle: Version 11.0.0(BUILD80)

チャネル: ch3が割り当てられました
チャネルch3: SID=266 デバイス・タイプ=SBT_TAPE
チャネルch3: CommVault Systems for Oracle: Version 11.0.0(BUILD80)

チャネル: ch4が割り当てられました
チャネルch4: SID=40 デバイス・タイプ=SBT_TAPE
チャネルch4: CommVault Systems for Oracle: Version 11.0.0(BUILD80)





backupを21-06-25で開始しています
チャネルch1: 増分レベル0のデータファイル・バックアップ・セットを開始しています
チャネルch1: バックアップ・セットにデータファイルを指定しています
入力データファイル ファイル番号=00001 名前=D:\APP\ADMINISTRATOR\PRODUCT\18.0.0\ORADATA\XE\SYSTEM01.DBF
チャネルch1: ピース1 (21-06-25)を起動します
チャネル: ch1がリリースされました
チャネル: ch2がリリースされました
チャネル: ch3がリリースされました
チャネル: ch4がリリースされました
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: backupコマンド(ch1チャネル上)が06/25/2021 18:00:56で失敗しました
ORA-19506: シーケンシャル・ファイルの作成に失敗しました。ファイル名="XE_4502a9tl_1_1_1076176821"、パラメータ=""
ORA-27028: skgfqcre: sbtbackupからエラーが戻されました。
ORA-19511: RMAN以外の、メディア・マネージャまたはベンダー固有の障害。エラー・テキスト:
   CreateOraObject20:

RMAN>

駄目な模様。うーん???

NetBackup ver4.5/Oracle 8ぐらいの時のRMANスクリプト例

この時代はコントロールファイル/SPFILEの自動バックアップが無かった

Oracle 19の[バックアップおよびリカバリ・リファレンス]-[B 非推奨になったRMAN構文]を見ると、このスクリプトで使っている初期化は現状だと推奨されないようだ。

フルバックアップ

run{
  allocate channel ch00 type 'SBT_TAPE' maxopenfiles 100;
  allocate channel ch01 type 'SBT_TAPE' maxopenfiles 100;
  backup
    full
    skip inaccessible
     filesperset 64
    FORMAT 'bk_%s_%p_%t'
    database;
    sql 'alter system archive log current';
  release channel ch00;
  release channel ch01;

  allocate channel ch00 type 'SBT_TAPE' maxopenfiles 100;
  allocate channel ch01 type 'SBT_TAPE' maxopenfiles 100;
  sql 'alter system archive log current';
  backup
     filesperset 64
     FORMAT 'al_%s_%p_%t'
     archivelog all delete input;
  release channel ch00;
  release channel ch01;

  allocate channel ch00 type 'SBT_TAPE';
  copy current controlfile to '/出力フィル名';
  release channel ch00;
}

archivelogのみ

run{
  allocate channel ch00 type 'SBT_TAPE' maxopenfiles 100;
  allocate channel ch01 type 'SBT_TAPE' maxopenfiles 100;
  sql 'alter system archive log current';
  backup
     filesperset 64
     FORMAT 'al_%s_%p_%t'
     archivelog all delete input;
  release channel ch00;
  release channel ch01;

  allocate channel ch00 type 'SBT_TAPE';
  copy current controlfile to '/出力フィル名';
  release channel ch00;
}

Veeamのバックアップ

[Veeam plug-in for Oracle RMAN]-[Planning and Preparation]-[Oracle Environment Planning]


MariaDB 5.5から10.6にアップデートして死にかけた件(utf8が無くなった)

$
0
0

CentOS7上で動いているMariaDB 5.5サーバをMariaDB 10.6にアップデートして死にかけた。

データベースのアップデート自体は問題なかったのだが、アプリケーション側で問題発生。

/var/log/messages に下記の様なメッセージが多発

Jul 13 10:50:11 ホスト名 kernel: dict[23339]: segfault at a8 ip 00007f99c6fa9fa1 sp 00007ffc4641fe50 error 4 in libmysqlclient.so.18.0.0[7f99c6f4b000+320000]
Jul 13 10:50:11 ホスト名 mariadbd: 2021-07-13 10:50:11 7 [Warning] Aborted connection 7 to db: 'unconnected' user: 'unauthenticated' host: 'localhost' (This connection closed normally without authentication)
Jul 13 10:50:11 ホスト名 kernel: dict[23340]: segfault at a8 ip 00007f3950ee4fa1 sp 00007ffe8bec4f70 error 4 in libmysqlclient.so.18.0.0[7f3950e86000+320000]
Jul 13 10:50:11 ホスト名 kernel: dict[23341]: segfault at a8 ip 00007f89b3d8efa1 sp 00007ffed464d830 error 4 in libmysqlclient.so.18.0.0[7f89b3d30000+320000]
Jul 13 10:50:11 ホスト名 mariadbd: 2021-07-13 10:50:11 8 [Warning] Aborted connection 8 to db: 'unconnected' user: 'unauthenticated' host: 'localhost' (This connection closed normally without authentication)
Jul 13 10:50:33 ホスト名 kernel: auth[23362]: segfault at a8 ip 00007f197609dfa1 sp 00007ffe82dc98a0 error 4 in libmysqlclient.so.18.0.0[7f197603f000+320000]

authとdictでlibmysqlclient.so.18.0.0 のsegmentation faultが発生しているという・・・

で・・このauthとdictというのはdovecot/authとdovecot/dictで、そこで何か起こっているようだ

/var/log/dovecot/dovecot.log を見てみる

Jul 13 10:50:05 ホスト名1 dovecot: dict(23024): Error: mysql(127.0.0.1): Connect failed to database (vmail): Can't connect to MySQL s
erver on '127.0.0.1' (111 "Connection refused") - waiting for 5 seconds before retry
Jul 13 10:50:05 ホスト名1 dovecot: dict(23024): Error: mysql(127.0.0.1): Connect failed to database (vmail): Can't connect to MySQL s
erver on '127.0.0.1' (111 "Connection refused") - waiting for 5 seconds before retry
Jul 13 10:50:10 ホスト名1 dovecot: dict: Error: #007Character set 'utf8' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
Jul 13 10:50:10 ホスト名1 dovecot: dict(23024): Error: mysql(127.0.0.1): Connect failed to database (vmail): Can't initialize character set utf8 (path: /usr/share/mysql/charsets/) - waiting for 25 seconds before retry
Jul 13 10:50:10 ホスト名1 dovecot: dict: Error: #007Character set 'utf8' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
Jul 13 10:50:10 ホスト名1 dovecot: dict(23024): Error: mysql(127.0.0.1): Connect failed to database (vmail): Can't initialize character set utf8 (path: /usr/share/mysql/charsets/) - waiting for 25 seconds before retry
Jul 13 10:50:11 ホスト名1 dovecot: dict: Error: #007Character set 'utf8' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
Jul 13 10:50:11 ホスト名1 dovecot: dict(23338): Error: mysql(127.0.0.1): Connect failed to database (vmail): Can't initialize character set utf8 (path: /usr/share/mysql/charsets/) - waiting for 1 seconds before retry

mariadb 10.6で文字コード utf8の指定ができないというエラーなようだ。

/usr/share/mysql/charsets/ に utf8の定義があるか確認してみる

# ls -l /usr/share/mysql/charsets/
合計 236
-rw-r--r-- 1 root root 23531  7月  5 19:47 Index.xml
-rw-r--r-- 1 root root  1749  7月  5 19:47 README
-rw-r--r-- 1 root root  5526  7月  5 19:47 armscii8.xml
-rw-r--r-- 1 root root  5512  7月  5 19:47 ascii.xml
-rw-r--r-- 1 root root  8241  7月  5 19:47 cp1250.xml
-rw-r--r-- 1 root root  8365  7月  5 19:47 cp1251.xml
-rw-r--r-- 1 root root  5569  7月  5 19:47 cp1256.xml
-rw-r--r-- 1 root root  8902  7月  5 19:47 cp1257.xml
-rw-r--r-- 1 root root  5506  7月  5 19:47 cp850.xml
-rw-r--r-- 1 root root  5528  7月  5 19:47 cp852.xml
-rw-r--r-- 1 root root  5613  7月  5 19:47 cp866.xml
-rw-r--r-- 1 root root  6529  7月  5 19:47 dec8.xml
-rw-r--r-- 1 root root  5516  7月  5 19:47 geostd8.xml
-rw-r--r-- 1 root root  5728  7月  5 19:47 greek.xml
-rw-r--r-- 1 root root  5517  7月  5 19:47 hebrew.xml
-rw-r--r-- 1 root root  5502  7月  5 19:47 hp8.xml
-rw-r--r-- 1 root root  5529  7月  5 19:47 keybcs2.xml
-rw-r--r-- 1 root root  5510  7月  5 19:47 koi8r.xml
-rw-r--r-- 1 root root  6532  7月  5 19:47 koi8u.xml
-rw-r--r-- 1 root root  9816  7月  5 19:47 latin1.xml
-rw-r--r-- 1 root root  7238  7月  5 19:47 latin2.xml
-rw-r--r-- 1 root root  5515  7月  5 19:47 latin5.xml
-rw-r--r-- 1 root root  7438  7月  5 19:47 latin7.xml
-rw-r--r-- 1 root root  8047  7月  5 19:47 macce.xml
-rw-r--r-- 1 root root  8058  7月  5 19:47 macroman.xml
-rw-r--r-- 1 root root  6530  7月  5 19:47 swe7.xml
# grep utf8 /usr/share/mysql/charsets/Index.xml
<charset name="utf8mb3">
  <collation name="utf8mb3_general_ci"  id="33">
  <collation name="utf8mb3_bin"         id="83">
#

なんと無い。

/usr/share/mysql/charsets/Index.xml のutf8関連記述を見てみる

<charset name="utf8mb3">
  <family>Unicode</family>
  <description>UTF-8 Unicode</description>
  <alias>utf-8</alias>
  <collation name="utf8mb3_general_ci"  id="33">
   <flag>primary</flag>
   <flag>compiled</flag>
  </collation>
  <collation name="utf8mb3_bin"         id="83">
    <flag>binary</flag>
    <flag>compiled</flag>
  </collation>
</charset>

おやぁ???

以前mariadb 10.5にアップデートしたサーバの/usr/share/mysql/charsets/Index.xmlの該当箇所と比較すると、いままでは utf8だったエントリが utf8mb3 に置き換わっているようだ。

<charset name="utf8">
  <family>Unicode</family>
  <description>UTF-8 Unicode</description>
  <alias>utf-8</alias>
  <collation name="utf8_general_ci"     id="33">
   <flag>primary</flag>
   <flag>compiled</flag>
  </collation>
  <collation name="utf8_bin"            id="83">
    <flag>binary</flag>
    <flag>compiled</flag>
  </collation>
</charset>

で・・・ /etc/my.cnf の設定で言語に関する設定は下記の様になっていた

[mysqld]
<略>
# character-set-server に関する値は未設定
<略>
[client]
default-character-set=utf8

クライアントからのアクセス時のデフォルトがutf8と設定されていた。

そこで/etc/my.cnf の文字コード指定を utf8mb3 に変更

[mysqld]
<略>
character-set-server=utf8mb3
<略>
[client]
default-character-set=utf8mb3

これで接続できない、という事象はなくなった。

なくなったが、/var/log/messages には下記のメッセージが出続けている。

Jul 13 13:10:01 ホスト名 mariadbd: 2021-07-13 13:10:01 925 [Warning] Aborted connection 925 to db: 'unconnected' user: 'unauthenticated' host: 'localhost' (This connection closed normally without authentication)
Jul 13 13:10:02 ホスト名 mariadbd: 2021-07-13 13:10:02 934 [Warning] Aborted connection 934 to db: 'unconnected' user: 'unauthenticated' host: 'localhost' (This connection closed normally without authentication)
Jul 13 13:10:06 ホスト名 mariadbd: 2021-07-13 13:10:06 935 [Warning] Aborted connection 935 to db: 'unconnected' user: 'unauthenticated' host: 'localhost' (This connection closed normally without authentication)
Jul 13 13:10:06 ホスト名 mariadbd: 2021-07-13 13:10:06 936 [Warning] Aborted connection 936 to db: 'unconnected' user: 'unauthenticated' host: 'localhost' (This connection closed normally without authentication)
Jul 13 13:10:22 ホスト名 mariadbd: 2021-07-13 13:10:22 811 [Warning] Aborted connection 811 to db: 'amavisd' user: 'amavisd' host: 'localhost' (Got timeout reading communication packets)
Jul 13 13:11:01 ホスト名 mariadbd: 2021-07-13 13:11:01 786 [Warning] Aborted connection 786 to db: 'amavisd' user: 'amavisd' host: 'localhost' (Got timeout reading communication packets)
Jul 13 13:12:26 ホスト名 mariadbd: 2021-07-13 13:12:26 839 [Warning] Aborted connection 839 to db: 'amavisd' user: 'amavisd' host: 'localhost' (Got timeout reading communication packets)
Jul 13 13:12:26 ホスト名 mariadbd: 2021-07-13 13:12:26 828 [Warning] Aborted connection 828 to db: 'amavisd' user: 'amavisd' host: 'localhost' (Got timeout reading communication packets)

iRedMailフォーラム「mysqld [Warning] Aborted connection」によると、ログレベル下げろ、とのこと

mysqlを起動しようとしたら問題が・・・

# mysql -u root
ERROR 2019 (00000): Can't initialize character set utf8mb3 (path: compiled_in)
#

とりあえず /etc/my.cnf の最後に下記を追加

[mysql]
default-character-set=utf8

警告はでるのもの操作は可能(なお、default-character-set=utf8mb3 だと起動できなかった)

# mysql -u root
mysql: Warning: Charset id '33' csname 'utf8mb3' trying to replace existing csname 'utf8'
mysql: Warning: Charset id '83' csname 'utf8mb3' trying to replace existing csname 'utf8'
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1103
Server version: 10.6.3-MariaDB-log MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

起動したのでフォーラムにあった設定を入れる。

MariaDB [(none)]> show global variables like '%log_warnings%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| log_warnings  | 2     |
+---------------+-------+
1 row in set (0.002 sec)

MariaDB [(none)]> set global log_warnings=1;
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> show global variables like '%log_warnings%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| log_warnings  | 1     |
+---------------+-------+
1 row in set (0.002 sec)

MariaDB [(none)]> quit
Bye
#

しばらく放置・・・

Jul 13 13:40:01 ホスト名 mariadbd: 2021-07-13 13:40:01 313 [Warning] Aborted connection 313 to db: 'unconnected' user: 'unauthenticated' host: 'localhost' (This connection closed normally without authentication)
Jul 13 13:40:02 ホスト名 mariadbd: 2021-07-13 13:40:02 314 [Warning] Aborted connection 314 to db: 'unconnected' user: 'unauthenticated' host: 'localhost' (This connection closed normally without authentication)
Jul 13 13:40:04 ホスト名 mariadbd: 2021-07-13 13:40:04 315 [Warning] Aborted connection 315 to db: 'unconnected' user: 'unauthenticated' host: 'localhost' (This connection closed normally without authentication)
Jul 13 13:42:53 ホスト名 mariadbd: 2021-07-13 13:42:53 359 [Warning] Aborted connection 359 to db: 'vmail' user: 'vmail' host: 'localhost' (Got an error reading communication packets)
Jul 13 13:42:53 ホスト名 mariadbd: 2021-07-13 13:42:53 352 [Warning] Aborted connection 352 to db: 'vmail' user: 'vmail' host: 'localhost' (Got an error reading communication packets)
Jul 13 13:42:53 ホスト名 mariadbd: 2021-07-13 13:42:53 357 [Warning] Aborted connection 357 to db: 'vmail' user: 'vmail' host: 'localhost' (Got an error reading communication packets)
Jul 13 13:42:53 ホスト名 mariadbd: 2021-07-13 13:42:53 351 [Warning] Aborted connection 351 to db: 'vmail' user: 'vmail' host: 'localhost' (Got an error reading communication packets)

うーん?

あれ?反映されてない

# mysql -u root
mysql: Warning: Charset id '33' csname 'utf8mb3' trying to replace existing csname 'utf8'
mysql: Warning: Charset id '83' csname 'utf8mb3' trying to replace existing csname 'utf8'
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 474
Server version: 10.6.3-MariaDB-log MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show global variables like '%log_warnings%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| log_warnings  | 2     |
+---------------+-------+
1 row in set (0.002 sec)

MariaDB [(none)]> set global log_warnings=1;
Query OK, 0 rows aff
MariaDB [(none)]>

なんだろ?とりあえず再設定・・・

今度は大丈夫か?

…2時間経過

大丈夫そうだな

古いONTAPがActive Directoryに参加できない

$
0
0

古いONTAP、具体的にはONTAP 8.3.2環境の移行案件があったので、検証のためにONTAP simulatorのONTAP 8.3.2版を仮想環境上に作成して、Active Directoryに参加しようとしたところ下記のエラーとなった。(なお、接続先Active Direcrotyはsamba 4.14.5で構成している)

ontap832::> vserver cifs create -cifs-server share226 -domain adosakana.local -vserver share226

In order to create an Active Directory machine account for the CIFS server, you
must supply the name and password of a Windows account with sufficient
privileges to add computers to the "CN=Computers" container within the
ADOSAKANA.LOCAL domain.

Enter the user name: administrator

Enter the password:

Error: Machine account creation procedure failed
  [ 12154] Loaded the preliminary configuration.
  [ 12332] Created a machine account in the domain
  [ 12339] Successfully connected to 172.17.44.49:445 using TCP
  [ 12351] Unable to connect to LSA service on
           samba.adosakana.local (Error:
           RESULT_ERROR_GENERAL_FAILURE)
  [ 14357] TCP connection to 172.17.44.141:445 via interface
           172.17.44.236 failed: (Operation timed out).
  [ 14357] Could not open a socket to 'samba.adosakana.local'
  [ 14357] Unable to connect to LSA service on
           samba.adosakana.local (Error:
           RESULT_ERROR_SPINCLIENT_UNABLE_TO_RESOLVE_SERVER)
  [ 14357] No servers available for MS_LSA, vserver: 2, domain:
           adosakana.local.
**[ 14357] FAILURE: Unable to make a connection (LSA:adosakana.local),
**         result: 6940
  [ 14357] Could not find Windows SID
           'S-1-5-21-937304154-1581684492-536532533-512'
  [ 14381] Deleted existing account
           'CN=SHARE226,CN=Computers,DC=adosakana,DC=local'

Error: command failed: Failed to create the Active Directory machine account
       "SHARE226". Reason: SecD Error: no server available.

ontap832::>

これは暗号化の問題なので「vserver cifs security show」で設定項目を確認する。

ontap832::> vserver cifs security show -vserver share226

Vserver: share226

                    Kerberos Clock Skew:                   - minutes
                    Kerberos Ticket Age:                   - hours
                   Kerberos Renewal Age:                   - days
                   Kerberos KDC Timeout:                   - seconds
                    Is Signing Required:                   -
        Is Password Complexity Required:                   -
   Use start_tls For AD LDAP connection:               false
              Is AES Encryption Enabled:               false
                 LM Compatibility Level:  lm-ntlm-ntlmv2-krb
             Is SMB Encryption Required:                   -

ontap832::>

ONTAP 8.3.2無印では関連するオプション「SMB2 Enabled for DC Connections」を設定する項目が無い

ontap832::> version -node *

ontap832-01:
NetApp Release 8.3.2: Tue Feb 23 23:35:06 UTC 2016


ontap832::>

アップデータを探したところ、832P12_q_image.tgz があったので、「ONTAP 9.7シミュレータをアップデートする手法」と同じ手法でアップデートを行った。

ontap832::> version -node *

ontap832-01:
NetApp Release 8.3.2P12: Mon Aug 14 02:57:01 UTC 2017


ontap832::>

ONTAP 8.3.2P12であれば、「SMB2 Enabled for DC Connections」が存在していた。

ontap832::> vserver cifs security show -vserver share226

Vserver: share226

                    Kerberos Clock Skew:                   - minutes
                    Kerberos Ticket Age:                   - hours
                   Kerberos Renewal Age:                   - days
                   Kerberos KDC Timeout:                   - seconds
                    Is Signing Required:                   -
        Is Password Complexity Required:                   -
   Use start_tls For AD LDAP connection:               false
              Is AES Encryption Enabled:               false
                 LM Compatibility Level:  lm-ntlm-ntlmv2-krb
             Is SMB Encryption Required:                   -
        SMB1 Enabled for DC Connections:                   -
        SMB2 Enabled for DC Connections:                   -

ontap832::>

設定を変更

ontap832::> vserver cifs security modify -vserver share226 -smb1-enabled-for-dc-connections false -smb2-enabled-for-dc-connections true

ontap832::> vserver cifs security show -vserver share226

Vserver: share226

                    Kerberos Clock Skew:                   - minutes
                    Kerberos Ticket Age:                   - hours
                   Kerberos Renewal Age:                   - days
                   Kerberos KDC Timeout:                   - seconds
                    Is Signing Required:                   -
        Is Password Complexity Required:                   -
   Use start_tls For AD LDAP connection:               false
              Is AES Encryption Enabled:               false
                 LM Compatibility Level:  lm-ntlm-ntlmv2-krb
             Is SMB Encryption Required:                   -
        SMB1 Enabled for DC Connections:               false
        SMB2 Enabled for DC Connections:                true

ontap832::>

そして、Active Directoryへの参加

ontap832::> vserver cifs create -cifs-server share226 -domain adosakana.local -vserver share226

In order to create an Active Directory machine account for the CIFS server, you
must supply the name and password of a Windows account with sufficient
privileges to add computers to the "CN=Computers" container within the
ADOSAKANA.LOCAL domain.

Enter the user name: administrator

Enter the password:

Warning: An account by this name already exists in Active Directory at
         CN=SHARE226,CN=Computers,DC=adosakana,DC=local
         Ok to reuse this account? {y|n}: y

ontap832::>

今度は成功した。

Oracle Cloud上のOralce Linux 8インスタンスでOSアップデートがpython3-clickの競合で失敗していた

$
0
0

Oracle Cloud上に立てていたOracle Linux 8サーバにdnf automaticによるアップデート設定を書けてあったんだけど、いまみてみたらアップデートが途中から失敗していた模様。

# dnf check-update
Ksplice for Oracle Linux 8 (x86_64)             2.7 MB/s | 418 kB     00:00
MySQL 8.0 for Oracle Linux 8 (x86_64)           7.6 MB/s | 1.6 MB     00:00
MySQL 8.0 Tools Community for Oracle Linux 8 (x 653 kB/s | 106 kB     00:00
MySQL 8.0 Connectors Community for Oracle Linux 109 kB/s |  14 kB     00:00
Oracle Software for OCI users on Oracle Linux 8  31 MB/s | 8.0 MB     00:00
Oracle Linux 8 EPEL Packages for Development (x  39 MB/s |  19 MB     00:00
Oracle Linux 8 BaseOS Latest (x86_64)            42 MB/s |  37 MB     00:00
Oracle Linux 8 Application Stream (x86_64)       42 MB/s |  29 MB     00:00
Latest Unbreakable Enterprise Kernel Release 6   44 MB/s |  22 MB     00:00

iwl100-firmware.noarch     999:39.31.5.1-999.8.el8                 ol8_baseos_latest
iwl1000-firmware.noarch    999:39.31.5.1-999.8.el8                 ol8_baseos_latest
iwl105-firmware.noarch     999:18.168.6.1-999.8.el8                ol8_baseos_latest
iwl135-firmware.noarch     999:18.168.6.1-999.8.el8                ol8_baseos_latest
iwl2000-firmware.noarch    999:18.168.6.1-999.8.el8                ol8_baseos_latest
iwl2030-firmware.noarch    999:18.168.6.1-999.8.el8                ol8_baseos_latest
iwl3160-firmware.noarch    999:25.30.13.0-999.8.el8                ol8_baseos_latest
iwl3945-firmware.noarch    999:15.32.2.9-999.8.el8                 ol8_baseos_latest
iwl4965-firmware.noarch    999:228.61.2.24-999.8.el8               ol8_baseos_latest
iwl5000-firmware.noarch    999:8.83.5.1_1-999.8.el8                ol8_baseos_latest
iwl5150-firmware.noarch    999:8.24.2.2-999.8.el8                  ol8_baseos_latest
iwl6000-firmware.noarch    999:9.221.4.1-999.8.el8                 ol8_baseos_latest
iwl6000g2a-firmware.noarch 999:18.168.6.1-999.8.el8                ol8_baseos_latest
iwl6050-firmware.noarch    999:41.28.5.1-999.8.el8                 ol8_baseos_latest
iwl7260-firmware.noarch    999:25.30.13.0-999.8.el8                ol8_baseos_latest
kernel-uek.x86_64          5.4.17-2102.203.5.el8uek                ol8_UEKR6
kernel-uek-devel.x86_64    5.4.17-2102.203.5.el8uek                ol8_UEKR6
ksplice.x86_64             1.0.55-1.el8                            ol8_ksplice
ksplice-core0.x86_64       1.0.55-1.el8                            ol8_ksplice
ksplice-tools.x86_64       1.0.55-1.el8                            ol8_ksplice
linux-firmware.noarch      999:20210617-999.8.git0f66b74b.el8      ol8_baseos_latest
linux-firmware.src         999:20210617-999.8.git0f66b74b.el8      ol8_baseos_latest
perl-Algorithm-Diff.src    1.1903-10.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-Archive-Tar.src       2.32-440.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Archive-Zip.src       1.67-1.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-CPAN.src              2.27-2.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-CPAN-Meta.src         2.150010-397.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-CPAN-Meta-Requirements.src
                           2.140-397.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-CPAN-Meta-YAML.src    0.018-1001.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Carp.src              1.50-439.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Config-Perl-V.src     0.32-441.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Data-OptList.src      0.110-7.module+el8.3.0+7729+86a74f64    ol8_appstream
perl-Data-Section.src      0.200007-8.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Digest.src            1.17-396.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Env.src               1.04-396.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Exporter.src          5.73-440.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-ExtUtils-CBuilder.src 1:0.280231-439.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-ExtUtils-Install.src  2.14-440.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-ExtUtils-MakeMaker.src
                           2:7.42-1.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-ExtUtils-Manifest.src 1:1.72-438.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-ExtUtils-ParseXS.src  1:3.40-439.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-File-Fetch.src        0.56-3.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-File-HomeDir.src      1.004-6.module+el8.3.0+7729+86a74f64    ol8_appstream
perl-File-Path.src         2.16-439.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-File-Temp.src         1:0.230.900-439.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-File-Which.src        1.23-4.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-Filter-Simple.src     0.95-439.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Getopt-Long.src       1:2.51-1.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-HTTP-Tiny.src         0.076-439.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-IO-Compress.src       2.093-1.module+el8.3.0+7729+86a74f64    ol8_appstream
perl-IO-Socket-IP.src      0.39-6.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-IPC-Cmd.src           2:1.04-2.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-IPC-System-Simple.src 1.25-18.module+el8.3.0+7729+86a74f64    ol8_appstream
perl-JSON-PP.src           1:4.04-2.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Locale-Maketext.src   1.29-440.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-MRO-Compat.src        0.13-5.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-Math-BigInt.src       1:1.9998.18-1.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-Math-BigRat.src       0.2614-2.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Module-Build.src      2:0.42.29-4.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-Module-CoreList.src   1:5.20191220-1.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-Module-Load.src       1:0.34-439.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Module-Load-Conditional.src
                           0.70-1.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-Module-Metadata.src   1.000037-1.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Package-Generator.src 1.106-12.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Params-Check.src      1:0.38-396.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Perl-OSType.src       1.010-397.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-PerlIO-via-QuotedPrint.src
                           0.08-396.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Pod-Checker.src       4:1.73-396.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Pod-Escapes.src       1:1.07-396.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Pod-Parser.src        1.63-1001.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-Pod-Perldoc.src       3.28.01-442.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-Pod-Simple.src        1:3.40-1.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Pod-Usage.src         4:1.69-396.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Software-License.src  0.103014-5.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Sub-Exporter.src      0.987-16.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Sub-Install.src       0.928-15.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Term-ANSIColor.src    4.06-397.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Term-Cap.src          1.17-396.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Test-Harness.src      1:3.42-2.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Test-Simple.src       3:1.302170-1.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-Text-Balanced.src     2.03-396.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Text-Diff.src         1.45-7.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-Text-Glob.src         0.11-5.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-Text-ParseWords.src   3.30-396.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Text-Tabs+Wrap.src    2013.0523-396.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-Text-Template.src     1.58-1.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-Thread-Queue.src      3.13-2.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-Time-Local.src        1:1.280-2.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-URI.src               1.76-5.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-autodie.src           2.29-1001.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-bignum.src            0.51-439.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-constant.src          1.33-1001.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-experimental.src      0.020-439.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-inc-latest.src        2:0.500-10.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-libnet.src            3.11-4.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-local-lib.src         2.000024-7.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-parent.src            1:0.237-2.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-perlfaq.src           5.20191102-1.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-podlators.src         1:4.12-2.module+el8.3.0+7729+86a74f64   ol8_appstream
python3-asn1crypto.noarch  1.3.0-4.el8                             ol8_developer_EPEL
python3-click.noarch       7.1.2-3.el8                             ol8_developer_EPEL
python3-oauthlib.noarch    3.0.2-8.el8                             ol8_developer_EPEL
python36-oci-cli.noarch    2.26.2-1.el8                            ol8_oci_included
python36-oci-sdk.x86_64    2.42.0-1.el8                            ol8_oci_included
Security: kernel-uek-5.4.17-2102.202.5.el8uek.x86_64 is an installed security update
Security: kernel-uek-5.4.17-2102.201.3.el8uek.x86_64 is the currently running version
# dnf update -y
Last metadata expiration check: 0:07:28 ago on Mon 19 Jul 2021 09:41:55 AM JST.
Error:
 Problem: package python36-oci-cli-2.26.2-1.el8.noarch requires python3-click = 6.7, but none of the providers can be installed
  - cannot install both python3-click-7.1.2-3.el8.noarch and python3-click-6.7-8.el8.noarch
  - cannot install both python3-click-6.7-8.el8.noarch and python3-click-7.1.2-3.el8.noarch
  - cannot install the best update candidate for package python36-oci-cli-2.26.1-1.el8.noarch
  - cannot install the best update candidate for package python3-click-6.7-8.el8.noarch
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
#

ol8_developer_EPELレポジトリからpython3-click-7.1.2-3のアップデートがきたけど、python36-oci-cliはpython3-clock-6.7要求だから、失敗、というもの。

現状を確認するために「dnf repolist –all」を実行

]# dnf repolist --all
repo id                          repo name                              status
ol8_MySQL80                      MySQL 8.0 for Oracle Linux 8 (x86_64)  enabled
ol8_MySQL80_connectors_community MySQL 8.0 Connectors Community for Ora enabled
ol8_MySQL80_tools_community      MySQL 8.0 Tools Community for Oracle L enabled
ol8_UEKR6                        Latest Unbreakable Enterprise Kernel R enabled
ol8_UEKR6_RDMA                   Oracle Linux 8 UEK6 RDMA (x86_64)      disabled
ol8_addons                       Oracle Linux 8 Addons (x86_64)         disabled
ol8_appstream                    Oracle Linux 8 Application Stream (x86 enabled
ol8_baseos_latest                Oracle Linux 8 BaseOS Latest (x86_64)  enabled
ol8_codeready_builder            Oracle Linux 8 CodeReady Builder (x86_ disabled
ol8_developer                    Oracle Linux 8 Development Packages (x disabled
ol8_developer_EPEL               Oracle Linux 8 EPEL Packages for Devel enabled
ol8_developer_UEKR6              Developer Preview of UEK Release 6 (x8 disabled
ol8_distro_builder               Oracle Linux 8 Distro Builder (x86_64) disabled
ol8_ksplice                      Ksplice for Oracle Linux 8 (x86_64)    enabled
ol8_kvm_appstream                Oracle Linux 8 KVM Application Stream  disabled
ol8_oci_included                 Oracle Software for OCI users on Oracl enabled
ol8_u0_baseos_base               Oracle Linux 8 BaseOS GA (x86_64)      disabled
ol8_u1_baseos_base               Oracle Linux 8.1 BaseOS (x86_64)       disabled
ol8_u2_baseos_base               Oracle Linux 8.2 BaseOS (x86_64)       disabled
ol8_u3_baseos_base               Oracle Linux 8.3 BaseOS (x86_64)       disabled
ol8_u4_baseos_base               Oracle Linux 8.4 BaseOS (x86_64)       disabled
ol8_x86_64_userspace_ksplice     Ksplice aware userspace packages for O disabled
#

これはEPELからパッケージを持ってこないようにするしかないかな・・・というところ

# cat /etc/yum.repos.d/oracle-epel-ol8.repo
[ol8_developer_EPEL]
name=Oracle Linux $releasever EPEL Packages for Development ($basearch)
baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL8/developer/EPEL/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
#

これに「exclude=python3-click」を追加して対象外に設定

# cat /etc/yum.repos.d/oracle-epel-ol8.repo
[ol8_developer_EPEL]
name=Oracle Linux $releasever EPEL Packages for Development ($basearch)
baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL8/developer/EPEL/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
exclude=python3-click
#

アップデート成功

# dnf check-update
Oracle Linux 8 EPEL Packages for Development (x  62 kB/s | 2.5 kB     00:00

iwl100-firmware.noarch     999:39.31.5.1-999.8.el8                 ol8_baseos_latest
iwl1000-firmware.noarch    999:39.31.5.1-999.8.el8                 ol8_baseos_latest
iwl105-firmware.noarch     999:18.168.6.1-999.8.el8                ol8_baseos_latest
iwl135-firmware.noarch     999:18.168.6.1-999.8.el8                ol8_baseos_latest
iwl2000-firmware.noarch    999:18.168.6.1-999.8.el8                ol8_baseos_latest
iwl2030-firmware.noarch    999:18.168.6.1-999.8.el8                ol8_baseos_latest
iwl3160-firmware.noarch    999:25.30.13.0-999.8.el8                ol8_baseos_latest
iwl3945-firmware.noarch    999:15.32.2.9-999.8.el8                 ol8_baseos_latest
iwl4965-firmware.noarch    999:228.61.2.24-999.8.el8               ol8_baseos_latest
iwl5000-firmware.noarch    999:8.83.5.1_1-999.8.el8                ol8_baseos_latest
iwl5150-firmware.noarch    999:8.24.2.2-999.8.el8                  ol8_baseos_latest
iwl6000-firmware.noarch    999:9.221.4.1-999.8.el8                 ol8_baseos_latest
iwl6000g2a-firmware.noarch 999:18.168.6.1-999.8.el8                ol8_baseos_latest
iwl6050-firmware.noarch    999:41.28.5.1-999.8.el8                 ol8_baseos_latest
iwl7260-firmware.noarch    999:25.30.13.0-999.8.el8                ol8_baseos_latest
kernel-uek.x86_64          5.4.17-2102.203.5.el8uek                ol8_UEKR6
kernel-uek-devel.x86_64    5.4.17-2102.203.5.el8uek                ol8_UEKR6
ksplice.x86_64             1.0.55-1.el8                            ol8_ksplice
ksplice-core0.x86_64       1.0.55-1.el8                            ol8_ksplice
ksplice-tools.x86_64       1.0.55-1.el8                            ol8_ksplice
linux-firmware.noarch      999:20210617-999.8.git0f66b74b.el8      ol8_baseos_latest
linux-firmware.src         999:20210617-999.8.git0f66b74b.el8      ol8_baseos_latest
perl-Algorithm-Diff.src    1.1903-10.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-Archive-Tar.src       2.32-440.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Archive-Zip.src       1.67-1.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-CPAN.src              2.27-2.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-CPAN-Meta.src         2.150010-397.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-CPAN-Meta-Requirements.src
                           2.140-397.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-CPAN-Meta-YAML.src    0.018-1001.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Carp.src              1.50-439.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Config-Perl-V.src     0.32-441.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Data-OptList.src      0.110-7.module+el8.3.0+7729+86a74f64    ol8_appstream
perl-Data-Section.src      0.200007-8.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Digest.src            1.17-396.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Env.src               1.04-396.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Exporter.src          5.73-440.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-ExtUtils-CBuilder.src 1:0.280231-439.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-ExtUtils-Install.src  2.14-440.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-ExtUtils-MakeMaker.src
                           2:7.42-1.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-ExtUtils-Manifest.src 1:1.72-438.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-ExtUtils-ParseXS.src  1:3.40-439.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-File-Fetch.src        0.56-3.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-File-HomeDir.src      1.004-6.module+el8.3.0+7729+86a74f64    ol8_appstream
perl-File-Path.src         2.16-439.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-File-Temp.src         1:0.230.900-439.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-File-Which.src        1.23-4.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-Filter-Simple.src     0.95-439.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Getopt-Long.src       1:2.51-1.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-HTTP-Tiny.src         0.076-439.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-IO-Compress.src       2.093-1.module+el8.3.0+7729+86a74f64    ol8_appstream
perl-IO-Socket-IP.src      0.39-6.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-IPC-Cmd.src           2:1.04-2.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-IPC-System-Simple.src 1.25-18.module+el8.3.0+7729+86a74f64    ol8_appstream
perl-JSON-PP.src           1:4.04-2.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Locale-Maketext.src   1.29-440.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-MRO-Compat.src        0.13-5.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-Math-BigInt.src       1:1.9998.18-1.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-Math-BigRat.src       0.2614-2.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Module-Build.src      2:0.42.29-4.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-Module-CoreList.src   1:5.20191220-1.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-Module-Load.src       1:0.34-439.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Module-Load-Conditional.src
                           0.70-1.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-Module-Metadata.src   1.000037-1.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Package-Generator.src 1.106-12.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Params-Check.src      1:0.38-396.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Perl-OSType.src       1.010-397.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-PerlIO-via-QuotedPrint.src
                           0.08-396.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Pod-Checker.src       4:1.73-396.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Pod-Escapes.src       1:1.07-396.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Pod-Parser.src        1.63-1001.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-Pod-Perldoc.src       3.28.01-442.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-Pod-Simple.src        1:3.40-1.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Pod-Usage.src         4:1.69-396.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Software-License.src  0.103014-5.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-Sub-Exporter.src      0.987-16.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Sub-Install.src       0.928-15.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Term-ANSIColor.src    4.06-397.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Term-Cap.src          1.17-396.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Test-Harness.src      1:3.42-2.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Test-Simple.src       3:1.302170-1.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-Text-Balanced.src     2.03-396.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Text-Diff.src         1.45-7.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-Text-Glob.src         0.11-5.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-Text-ParseWords.src   3.30-396.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-Text-Tabs+Wrap.src    2013.0523-396.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-Text-Template.src     1.58-1.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-Thread-Queue.src      3.13-2.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-Time-Local.src        1:1.280-2.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-URI.src               1.76-5.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-autodie.src           2.29-1001.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-bignum.src            0.51-439.module+el8.3.0+7729+86a74f64   ol8_appstream
perl-constant.src          1.33-1001.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-experimental.src      0.020-439.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-inc-latest.src        2:0.500-10.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-libnet.src            3.11-4.module+el8.3.0+7729+86a74f64     ol8_appstream
perl-local-lib.src         2.000024-7.module+el8.3.0+7729+86a74f64 ol8_appstream
perl-parent.src            1:0.237-2.module+el8.3.0+7729+86a74f64  ol8_appstream
perl-perlfaq.src           5.20191102-1.module+el8.3.0+7729+86a74f64
                                                                   ol8_appstream
perl-podlators.src         1:4.12-2.module+el8.3.0+7729+86a74f64   ol8_appstream
python3-asn1crypto.noarch  1.3.0-4.el8                             ol8_developer_EPEL
python3-oauthlib.noarch    3.0.2-8.el8                             ol8_developer_EPEL
python36-oci-cli.noarch    2.26.2-1.el8                            ol8_oci_included
python36-oci-sdk.x86_64    2.42.0-1.el8                            ol8_oci_included
Security: kernel-uek-5.4.17-2102.202.5.el8uek.x86_64 is an installed security update
Security: kernel-uek-5.4.17-2102.201.3.el8uek.x86_64 is the currently running version
# dnf update -y
Last metadata expiration check: 0:00:29 ago on Mon 19 Jul 2021 09:57:01 AM JST.
Dependencies resolved.
================================================================================
 Package             Arch   Version                    Repository          Size
================================================================================
Installing:
 kernel-uek          x86_64 5.4.17-2102.203.5.el8uek   ol8_UEKR6           65 M
 kernel-uek-devel    x86_64 5.4.17-2102.203.5.el8uek   ol8_UEKR6           18 M
Upgrading:
 iwl100-firmware     noarch 999:39.31.5.1-999.8.el8    ol8_baseos_latest  154 k
 iwl1000-firmware    noarch 999:39.31.5.1-999.8.el8    ol8_baseos_latest  217 k
 iwl105-firmware     noarch 999:18.168.6.1-999.8.el8   ol8_baseos_latest  238 k
 iwl135-firmware     noarch 999:18.168.6.1-999.8.el8   ol8_baseos_latest  247 k
 iwl2000-firmware    noarch 999:18.168.6.1-999.8.el8   ol8_baseos_latest  241 k
 iwl2030-firmware    noarch 999:18.168.6.1-999.8.el8   ol8_baseos_latest  250 k
 iwl3160-firmware    noarch 999:25.30.13.0-999.8.el8   ol8_baseos_latest  1.7 M
 iwl3945-firmware    noarch 999:15.32.2.9-999.8.el8    ol8_baseos_latest   92 k
 iwl4965-firmware    noarch 999:228.61.2.24-999.8.el8  ol8_baseos_latest  105 k
 iwl5000-firmware    noarch 999:8.83.5.1_1-999.8.el8   ol8_baseos_latest  298 k
 iwl5150-firmware    noarch 999:8.24.2.2-999.8.el8     ol8_baseos_latest  151 k
 iwl6000-firmware    noarch 999:9.221.4.1-999.8.el8    ol8_baseos_latest  171 k
 iwl6000g2a-firmware noarch 999:18.168.6.1-999.8.el8   ol8_baseos_latest  314 k
 iwl6050-firmware    noarch 999:41.28.5.1-999.8.el8    ol8_baseos_latest  247 k
 iwl7260-firmware    noarch 999:25.30.13.0-999.8.el8   ol8_baseos_latest   18 M
 ksplice             x86_64 1.0.55-1.el8               ol8_ksplice         16 k
 ksplice-core0       x86_64 1.0.55-1.el8               ol8_ksplice        270 k
 ksplice-tools       x86_64 1.0.55-1.el8               ol8_ksplice         97 k
 linux-firmware      noarch 999:20210617-999.8.git0f66b74b.el8
                                                       ol8_baseos_latest  178 M
 python3-asn1crypto  noarch 1.3.0-4.el8                ol8_developer_EPEL 184 k
 python3-oauthlib    noarch 3.0.2-8.el8                ol8_developer_EPEL 182 k
 python36-oci-cli    noarch 2.26.2-1.el8               ol8_oci_included   7.4 M
 python36-oci-sdk    x86_64 2.42.0-1.el8               ol8_oci_included    16 M

Transaction Summary
================================================================================
Install   2 Packages
Upgrade  23 Packages

Total download size: 307 M
Downloading Packages:
<略>
Upgraded:
  iwl100-firmware-999:39.31.5.1-999.8.el8.noarch
  iwl1000-firmware-999:39.31.5.1-999.8.el8.noarch
  iwl105-firmware-999:18.168.6.1-999.8.el8.noarch
  iwl135-firmware-999:18.168.6.1-999.8.el8.noarch
  iwl2000-firmware-999:18.168.6.1-999.8.el8.noarch
  iwl2030-firmware-999:18.168.6.1-999.8.el8.noarch
  iwl3160-firmware-999:25.30.13.0-999.8.el8.noarch
  iwl3945-firmware-999:15.32.2.9-999.8.el8.noarch
  iwl4965-firmware-999:228.61.2.24-999.8.el8.noarch
  iwl5000-firmware-999:8.83.5.1_1-999.8.el8.noarch
  iwl5150-firmware-999:8.24.2.2-999.8.el8.noarch
  iwl6000-firmware-999:9.221.4.1-999.8.el8.noarch
  iwl6000g2a-firmware-999:18.168.6.1-999.8.el8.noarch
  iwl6050-firmware-999:41.28.5.1-999.8.el8.noarch
  iwl7260-firmware-999:25.30.13.0-999.8.el8.noarch
  ksplice-1.0.55-1.el8.x86_64
  ksplice-core0-1.0.55-1.el8.x86_64
  ksplice-tools-1.0.55-1.el8.x86_64
  linux-firmware-999:20210617-999.8.git0f66b74b.el8.noarch
  python3-asn1crypto-1.3.0-4.el8.noarch
  python3-oauthlib-3.0.2-8.el8.noarch
  python36-oci-cli-2.26.2-1.el8.noarch
  python36-oci-sdk-2.42.0-1.el8.x86_64
Installed:
  kernel-uek-5.4.17-2102.203.5.el8uek.x86_64
  kernel-uek-devel-5.4.17-2102.203.5.el8uek.x86_64

Complete!
#

Oralce Linux8上でHyper Estraier/QDBMがコアダンプし動作しない

$
0
0

RHEL8/CentOS8/Oralce Linux 8上で、Hyper Estraier および内部で使うQDBMをコンパイルしたところ、コアダンプが発生し、動作できなかった。

$ /usr/local/bin/estcmd gather -cl -il ja -sd casket3 ./draft
/usr/local/bin/estcmd: INFO: reading list from the directory: ./draft
/usr/local/bin/estcmd: ERROR: casket3: database problem
$

調べて見るとgcc7でQDBM 1.8.78をコンパイルすると発生する、とのこと

AmazonLinux2にgcc6をインストール(標準のgcc7と共存させる)

関連情報を探す

Debian Bug report logs – #853627 qdbm: ftbfs with GCC-7
gentoo linux package db qdbm

gentoo linuxのqdbmの内容をおっていくと「https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-db/qdbm/files」にパッチファイルが・・・

qdbm-1.8.78-r2.ebuild に下記の様な記載があるので、この順番でパッチをあててみればいいかと実行

PATCHES=(
	"${FILESDIR}"/${PN}-configure.patch
	"${FILESDIR}"/${PN}-perl.patch
	"${FILESDIR}"/${PN}-ruby19.patch
	"${FILESDIR}"/${PN}-runpath.patch
	"${FILESDIR}"/${PN}-1.8.78-darwin.patch
)

gentoo linuxのページから上記5つのパッチをダウンロードしてきて適用。

[root@pbw work]# tar xfz qdbm-1.8.78.tar.gz
[root@pbw work]# cd qdbm-1.8.78/
[root@pbw qdbm-1.8.78]# patch -p1 < ../qdbm-configure.patch
patching file cgi/configure.in
patching file configure.in
patching file java/configure.in
patching file perl/configure.in
patching file plus/configure.in
patching file ruby/configure.in
[root@pbw qdbm-1.8.78]# patch -p1 < ../qdbm-perl.patch
patching file perl/Makefile.in
[root@pbw qdbm-1.8.78]# patch -p1 < ../qdbm-ruby19.patch
patching file ruby/Makefile.in
patching file ruby/configure.in
Hunk #1 succeeded at 8 (offset -9 lines).
patching file ruby/curia/mod_curia.c
patching file ruby/curia/rbcrtest
patching file ruby/depot/mod_depot.c
patching file ruby/depot/rbdptest
patching file ruby/myrbdoc
patching file ruby/villa/mod_villa.c
patching file ruby/villa/rbvltest
[root@pbw qdbm-1.8.78]# patch -p1 < ../qdbm-runpath.patch
patching file Makefile.in
patching file cgi/Makefile.in
patching file plus/Makefile.in
[root@pbw qdbm-1.8.78]# patch -p1 < ../qdbm-1.8.78
patch: **** read error : Is a directory
[root@pbw qdbm-1.8.78]# patch -p1 < ../qdbm-1.8.78-darwin.patch
patching file Makefile.in
[root@pbw qdbm-1.8.78]#

そして、「./configure; make ; make install」を実行。

そのあとは、Hyper Estraier側は特に再コンパイル等は不要で、コマンドを再実行

$ rm -rf casket3/
$ /usr/local/bin/estcmd gather -cl -il ja -sd casket3 ./draft
/usr/local/bin/estcmd: INFO: reading list from the directory: ./draft
/usr/local/bin/estcmd: INFO: status: name=casket3 dnum=0 wnum=0 fsiz=6899171 crnum=0 csiz=0 dknum=0
/usr/local/bin/estcmd: INFO: 1 (/var/www/cl2/draft/1.html): registered
/usr/local/bin/estcmd: INFO: 2 (/var/www/cl2/draft/10.html): registered
/usr/local/bin/estcmd: INFO: 3 (/var/www/cl2/draft/100.html): registered
<略>
/usr/local/bin/estcmd: INFO: flushing index words: name=casket3 dnum=1663 wnum=238115 fsiz=88518147 crnum=7035 csiz=641234 dknum=0
/usr/local/bin/estcmd: INFO: closing: name=casket3 dnum=1663 wnum=238718 fsiz=88669699 crnum=0 csiz=0 dknum=0
/usr/local/bin/estcmd: INFO: finished successfully: elapsed time: 0h 1m 10s
#

gcc7環境でも問題無く実行できるようになりました。

ASUS VivoBook E203NAにWindows10とChromeOSを入れた

$
0
0

秋葉原のMLcomputerにいったら整理中の箱の中にASUSの薄いノートが入っていた。

電源ボタンおしてみたけど、電源は入らない、という状態だったけど、「これいくら?」と聞いて見た。

すると、「ASUS E203MA(あとで調べたらCPUがN4000とちょっとスペックが上)でキーボードが使えないジャンク品を3千円としている」ということだったので、3千円で購入した。

裏面みるとネジが1つなく、1つがセロテープで無理矢理とめられていた。

んー、と思いつつ電源ON

F2キーでBIOS/UEFI画面に入ることができた。

スペックを確認するとASUS VivoBook E203NA の下位モデルでCPU N3350、RAM 2GB、eMMC 32GBというものだった。

メインストレージが64GB未満なのは現状Windows10で使うにはキツイものでした。

Windows 10 21H1をインストールして一通りWindows Updateをかけるとデバイスは全て正常に認識しましたが、問題が・・・

そう、OSだけでほぼ全て使ってしまうのです。

あと、注意点として、Windows 10インストール直後のQualcomm Atheros QCA9377ドライバだとバッファローWSR-1800AX4の802.11ax Wi-Fi EasyMesh対応版に接続出来ないという不具合が・・・

Windows Updateを行って下記のv12.0.0.919にアップデートすると接続出来るようになります。

このほかWebブラウザでサイトを見たりしていたら空き容量が2GBを切っているという・・・

裏面のネジがおかしいのもあるので中を確認

増設の余地は全くない構造でした。

基板がどうなっているかは下記の動画をみてもらうと良さそうです。

なお、ネジがちゃんとついていなかったのは、ネジの長さが2種類あって、2本だけ長いものがあるんですが、その2本の使いどころを誤っていたせいでした。

正しくは下記の画像の赤丸の2箇所なんですが、分解した人は下側左右両サイドに使っていました。

さて、ストレージ増設なんてことはできそうにないので、ChromeOS+brunchで起動してみます。

まずはBIOSでSecurebootをdisableにかえてから、Boot ManagerからUSBメモリを選択して起動します。(電源ON後にいきなりBoot Managerを出す手法は分からなかった)

ChromeOSリカバリイメージはrammus、grubで設定するoptionsは「options=enable_updates,pwa」だけでいけるというなかなか素直な状態でした。

Ctrl+Alt+Tからshellを開いて「sudo chromeos-install -dst /dev/mmcblk0」で内蔵ストレージにChromeOSを書き込んで起動を確認。

expectでスクリプトを作った時のメモ書き

$
0
0

ssh経由の操作をexpectコマンドで自動化しようとした時に、expectで調べると、入出力関連に関しては出てくるが、文字列操作や制御構文周りがよくわからない。

ここら辺は、tclに関して調べるとわかるようになっている。

参考にしたサイト

LInux JM Home Page「expect (1)
FreeSoftNet 「Tcl>文法とコマンド
アプリコット PukiWiki「expectで自動化

if文の書き方

他の言語と同じように「if (条件){実行内容}」と書くと妙なエラーになる。

expectでは「if {条件} {実行内容}」というように、どちらも「{}」で囲む。
また、「if」と「{」の間、「条件の}」と「実行内容の{」の間のそれぞれにスペースを挟む必要がある。

文字列を比較して、異なる場合は「diff」、同じであれば「same」と出力するexpectは下記の様になる。

#!/usr/bin/expect -f
set hostnamenew "testhostnew"
set hostnamenow "testhost"

puts "hostnamenew: $hostnamenew"
puts "hostnamenow: $hostnamenow"

if { "$hostnamenew" != "$hostnamenow" } {
        puts "diff"
} else {
        puts "same"
}

誤って「if (条件) {実行内容}」とした場合、下記の様な「unbalanced open paren in expression」というエラーとなる。

unbalanced open paren
in expression "("
    (parsing expression "(")
    invoked from within
"if ( "$hostnamenew" != "$hostnamenow" ) {
        puts "diff"
} else {
        puts "same"
}"

「if(条件) {実行内容}」と「if{条件} {実行内容}」とifと{の間にスペースを入れない場合は下記のような「invalid command name」となる

invalid command name "if("
    while executing
"if( "$hostnamenew" != "$hostnamenow" ){"
invalid command name "if{"
    while executing
"if{ "$hostnamenew" != "$hostnamenow" }{"

面倒くさいことに「if {条件}{実行内容}」と、ifと条件の間にはスペース入れたけど、条件と実行内容の間にスペースがない場合は下記の「extra characters after close-brace while executing」というエラーになる。

extra characters after close-brace
    while executing
"if { "$hostnamenew" != "$hostnamenow" }{"

コマンド出力から文字列を取り出しと文字列の切り出し

expectを使う場合は、sshで他のホストに接続してコマンドを実行する、という用途で使うことが多い。

コマンドの実行結果によって、処理を変えたい場合、どうすればいいのか?

「expect -indices -re “条件式”」で条件式に該当した行を$expect_out(数字,string)で拾うみたいなんだけど、いまいち動作がよくわからない。

「ip a s ens160」を実行して、そのIPアドレスを取得したい場合の例として以下を作った

expect "\[#$] "
send -- "ip a s ens160\r"
expect -indices -re "inet (.*)\r"
puts "===buffer==="
puts "$expect_out(buffer)"
puts "===str0==="
puts "$expect_out(0,string)"
puts "===str1==="
puts "$expect_out(1,string)"
puts "===="

これの実行結果は下記となった。

2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:33:27:f8 brd ff:ff:ff:ff:ff:ff
    altname enp3s0
    inet 172.17.44.48/16 brd 172.17.255.255 scope global noprefixroute ens160
===buffer===
ip a s ens160
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:33:27:f8 brd ff:ff:ff:ff:ff:ff
    altname enp3s0
    inet 172.17.44.48/16 brd 172.17.255.255 scope global noprefixroute ens160
===str0===
inet 172.17.44.48/16 brd 172.17.255.255 scope global noprefixroute ens160
===str1===
172.17.44.48/16 brd 172.17.255.255 scope global noprefixroute ens160
====
       valid_lft forever preferred_lft forever
    inet6 fe80::cca7:388a:36e7:d688/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

条件を「inet (.*)\r」から「inet6 (.*)\r」に変更

2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:33:27:f8 brd ff:ff:ff:ff:ff:ff
    altname enp3s0
    inet 172.17.44.48/16 brd 172.17.255.255 scope global noprefixroute ens160
       valid_lft forever preferred_lft forever
    inet6 fe80::cca7:388a:36e7:d688/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
===buffer===
ip a s ens160
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:0c:29:33:27:f8 brd ff:ff:ff:ff:ff:ff
    altname enp3s0
    inet 172.17.44.48/16 brd 172.17.255.255 scope global noprefixroute ens160
       valid_lft forever preferred_lft forever
    inet6 fe80::cca7:388a:36e7:d688/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
===str0===
inet6 fe80::cca7:388a:36e7:d688/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
===str1===
fe80::cca7:388a:36e7:d688/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
====

ここからさらにIPアドレスの部分を取り出すには「string first ~」「string last ~」と「string range ~」を使って文字列を切り出す。

set str $expect_out(1,string)
set stred [string first "/" $str]
puts "[string range $str 0 $stred]"
set stred [expr $stred - 1]
puts "[string range $str 0 $stred]"

上記の実行結果としては下記のようになる。

172.17.44.48/
172.17.44.48

他の言語のsubstring系だと開始アドレスと、そこを起点に取り出す文字列の長さを指定するが、tclのstring range では、開始アドレスと終了アドレスの2つを指定する形になるので注意が必要になる。

Cisco UCSのCIMCにssh接続して設定を行う

$
0
0

Cisco UCSのCisco Integrated Management Controller (CIMC)はWeb管理画面とssh接続によるCLI管理がある。

CIMCについているホスト名は基本的に「サーバ機種名-シリアル番号」となっている。

ホスト名を確認する操作をCLIから行うには、scope:cimc/network以下でdetailを表示する操作になる。

ホスト名# scope cimc/network
ホスト名 /cimc/network # show detail
Network Setting:
    IPv4 Enabled: yes
    IPv4 Address: xxx.xxx.xxx.xxx
    IPv4 Netmask: 255.255.255.0
    IPv4 Gateway: xxx.xxx.xxx.xxx
    DHCP Enabled: no
    DDNS Enabled: yes
    DDNS Update Domain:
    DDNS Refresh Interval(0-8736 Hr): 0
    Obtain DNS Server by DHCP: no
    Preferred DNS: xxx.xxx.xxx.xxx
    Alternate DNS: 0.0.0.0
    IPv6 Enabled: yes
    IPv6 Address: ::
    IPv6 Prefix: 64
    IPv6 Gateway: ::
    IPv6 Link Local: fe80::86b8:xxxx:xxxx:xxxx
    IPv6 SLAAC Address: ::
    IPV6 DHCP Enabled: yes
    IPV6 Obtain DNS Server by DHCP: yes
    IPV6 Preferred DNS: ::
    IPV6 Alternate DNS: ::
    VLAN Enabled: no
    VLAN ID: 1
    VLAN Priority: 0
    Port Profile:
    Hostname: ホスト名
    MAC Address: XX:XX:XX:XX:XX:XX
    NIC Mode: dedicated
    NIC Redundancy: none
    VIC Slot: riser1
    Auto Negotiate: yes
    Admin Network Speed: auto
    Admin Duplex: auto
    Operational Network Speed: 1Gbps
    Operational Duplex: full
ホスト名 /cimc/network #

show detailだといろんな項目が表示されすぎるので、ホスト名だけを取り出すことができないか調べたところ「| grep キーワード」が使えた。

ホスト名 /cimc/network # show detail | grep Hostname
    Hostname: ホスト名
ホスト名 /cimc/network #

ホスト名変更操作は scope:cimc/network にて set hostnameを実行したあと、commitで確定する。

ホスト名 /cimc/network # set hostname 新ホスト名
Create new certificate with CN as new hostname? [y|N] y

ホスト名 /cimc/network *# commit
Changes to the network settings will be applied immediately.
You may lose connectivity to the Cisco IMC and may have to log in again.
Do you wish to continue? [y/N] y

注意点として、ホスト名変更に伴い、Web管理GUIおよびssh接続で使用するSSL証明書で使用するCN(common name)が変更されるため証明書が作成されるということがある。

また、再作成に伴いCIMC自体も再起動されるため、commit後、再起動完了までの数分間CIMCに接続できなくなる。

このため、CIMCホスト名変更処理を行ったあとは、再起動待ちと証明書再発行にともなうssh接続時のキー変更に対応する処理を入れる必要がある。

ssh接続時のknown_hostsファイルから該当するエントリを削除したい場合は、 ssh-keygenコマンドの-Rオプションを使うことで行える。

osakanataro@ubuntu2004:~/imc$ ssh-keygen -R xxx.xxx.xxx.xxx
# Host xxx.xxx.xxx.xxx found: line 1
/home/osakanataro/.ssh/known_hosts updated.
Original contents retained as /home/osakanataro/.ssh/known_hosts.old
osakanataro@ubuntu2004:~/imc$

これで材料が揃ったので、スクリプトを作成する。

最初は Ciscoのcimc-ansible , cimcsdk を使用できないか検討したのですが、どちらもCIMCのホスト名変更に関する処理が実装されていないようだったので、expectコマンドによる処理を採用しました。

作成するにあたり下記を参考にしています。
How to programmatically enable redfish on Cisco CIMC?
Automate the UCS CLI with expect

今回作成したスクリプトは下記の様になりました。

#!/usr/bin/expect -f

# CIMCへの接続に時間がかかるようで
# 標準設定のtimeout値だとコマンド実行前にプロセスが進んでしまう 
# -1 を設定すると応答があるまで待つが
# ホスト名変更処理後は再起動がかかり、-1だと再起動が終わるまで待つことになってしまい時間がかかるので20に設定
set timeout 20

set CIMCaddr "xxx.xxx.xxx.xxx"
set CIMCuser "admin"
set CIMCpass "パスワード"
set CIMChostname "新ホスト名"


spawn ssh -l $CIMCuser -t $CIMCaddr
expect_after eof {exit 1}
# ログイン処理
expect {
        "*?assword:*" {
                send -- "$CIMCpass\r"
        }
        "(yes/no*)*" {
                send -- "yes\r"
                expect "*?assword:*"
                send -- "$CIMCpass\r"
        }
	# ホスト名変更時にssl証明書再作成が行われるため
	# キーが変わることに対する対応
	# リトライ処理が面倒だったので、古いキーを削除するところまでしか行わない
	# 必要に応じて手動で再実行で対応
        "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED" {
                system ssh-keygen -R $CIMCaddr
                puts "\nplease re-exec this script\n"
                exit 2
        }
}

expect "# "
send -- "scope cimc/network\r"
expect "# "

# 現在のホスト名確認
send -- "show detail | grep Hostname \r"
expect -indices -re "Hostname: (.*)\r"
# 文字列検出に使った": "の2文字分を足す
set strst [string last ": " $expect_out(buffer)]
set strst [expr $strst + 2]
# 行の終わりの改行分を引く
set stred [string length $expect_out(buffer)]
set stred [expr $stred - 2]
set hostnamenow [string range $expect_out(buffer) $strst $stred]
puts "CIMChostname: $CIMChostname"
puts "hostname: $hostnamenow"

# ホスト名の変更が必要か?
if { "$CIMChostname" != "$hostnamenow" } {
        puts "change hostname"
} else {
        puts "no change"
        expect "# "
        send -- "top\r"
        expect "# "
        send -- "exit\r"
        exit 0
}

# ホスト名変更
expect "# "
send -- "set hostname $CIMChostname\r"
expect "*new hostname?*"
send -- "y\r"
expect "# "
send -- "show detail | grep Hostname \r"
expect "# "
send -- "commit\r"
expect "*\[y/N] "
send -- "y\r"

# ホスト名確認
#  ただし実際には再起動が掛かっているので実行できない
expect "# "
send -- "show detail | grep Hostname \r"

expect "# "
send -- "top\r"
expect "# "
send -- "exit\r"

exit 0

pythonのtwitterモジュールで特定ユーザの発言を取得する

$
0
0

twitterのspaceによる音声配信は、m3u8ファイルを使用してのhttpsによるaacファイルの配布という形で実現されている。

streamlinkにm3u8ファイルのURLを与えると音声ファイルが取得できるので、これを自動化できないか検討している。

まず第1歩として、指定したユーザのタイムラインでspace配信のURLがあった場合に検出できないかを確認。

単純にwgetやcurlで「curl -s https://twitter.com/niselog/」とやっても発言は拾えない。

python-twitterのマニュアルを見ながらpythonスクリプトを作成

#!/usr/bin/python

import os
import twitter

token='文字列'
token_secret='文字列'
consumer_key = '文字列'
consumer_secret='文字列'

t = twitter.Api(consumer_key=consumer_key,
        consumer_secret=consumer_secret,
        access_token_key=token,
        access_token_secret=token_secret)

for line in t.GetUserTimeline(screen_name="niselog"):
        print line

これを実行すると、下記の様な出力になる

-bash-4.2$ ./test3.py |tail -2
{"created_at": "Sat May 14 08:13:22 +0000 2016", "hashtags": [{"text": "\u30b1\u30eb\u30d9\u30ed\u30b9\u30d6\u30ec\u30a4\u30c9"}], "id": 731396977758339072, "id_str": "731396977758339072", "lang": "ja", "source": "<a href=\"https://about.twitter.com/products/tweetdeck\" rel=\"nofollow\">TweetDeck</a>", "text": "\u507d\u30ed\u30b0 for #\u30b1\u30eb\u30d9\u30ed\u30b9\u30d6\u30ec\u30a4\u30c9 \u306f\u30b1\u30eb\u30d9\u30ed\u30b9\u8d85\u4f1a\u8b70\u306e\u4e00\u89a7\u30da\u30fc\u30b8\u306b\u5bfe\u5fdc\u3057\u307e\u3057\u305f https://t.co/gDlRyiFWC3", "urls": [{"expanded_url": "http://tw5.niselog.jp/", "url": "https://t.co/gDlRyiFWC3"}], "user": {"created_at": "Mon Mar 01 05:51:23 +0000 2010", "default_profile": true, "default_profile_image": true, "description": "\u30c8\u30df\u30fc\u30a6\u30a9\u30fc\u30ab\u30fcPBW \u7121\u9650\u306e\u30d5\u30a1\u30f3\u30bf\u30b8\u30a2/\u30b7\u30eb\u30d0\u30fc\u30ec\u30a4\u30f3/\u30a8\u30f3\u30c9\u30d6\u30ec\u30a4\u30ab\u30fc\uff01/\u30b5\u30a4\u30ad\u30c3\u30af\u30cf\u30fc\u30c4\u3078\u306e\u643a\u5e2f\u5411\u3051\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u30b5\u30fc\u30d3\u30b9\u300c\u507d\u30ed\u30b0\u300d\u306e\u7ba1\u7406\u8005\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u3059\u3002 http://t.co/QMKlQjzjSI http://t.co/YEiNJUvGdU", "followers_count": 40, "id": 118604209, "id_str": "118604209", "listed_count": 5, "name": "niselog \u7ba1\u7406\u8005", "profile_background_color": "C0DEED", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png", "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png", "profile_link_color": "1DA1F2", "profile_sidebar_border_color": "C0DEED", "profile_sidebar_fill_color": "DDEEF6", "profile_text_color": "333333", "profile_use_background_image": true, "screen_name": "niselog", "statuses_count": 340, "url": "http://t.co/QMKlQjzjSI", "withheld_in_countries": []}, "user_mentions": []}
{"created_at": "Sat May 14 07:02:08 +0000 2016", "hashtags": [], "id": 731379051852505088, "id_str": "731379051852505088", "lang": "ja", "retweet_count": 2, "source": "<a href=\"https://about.twitter.com/products/tweetdeck\" rel=\"nofollow\">TweetDeck</a>", "text": "\u7121\u9650\u306e\u30d5\u30a1\u30f3\u30bf\u30b8\u30a2\u3001\u30b7\u30eb\u30d0\u30fc\u30ec\u30a4\u30f3\u3001\u30a8\u30f3\u30c9\u30d6\u30ec\u30a4\u30ab\u30fc\u5411\u3051\u306e\u507d\u30ed\u30b0 https://t.co/QMKlQjzjSI \u3067\u3059\u304c\u3001\u590f\u9803\u306b\u5b8c\u5168\u505c\u6b62\u3059\u308b\u4e88\u5b9a\u3067\u3059\u3002(URL\u306f\u6b8b\u308a\u307e\u3059\u304c)", "urls": [{"expanded_url": "http://niselog.jp/", "url": "https://t.co/QMKlQjzjSI"}], "user": {"created_at": "Mon Mar 01 05:51:23 +0000 2010", "default_profile": true, "default_profile_image": true, "description": "\u30c8\u30df\u30fc\u30a6\u30a9\u30fc\u30ab\u30fcPBW \u7121\u9650\u306e\u30d5\u30a1\u30f3\u30bf\u30b8\u30a2/\u30b7\u30eb\u30d0\u30fc\u30ec\u30a4\u30f3/\u30a8\u30f3\u30c9\u30d6\u30ec\u30a4\u30ab\u30fc\uff01/\u30b5\u30a4\u30ad\u30c3\u30af\u30cf\u30fc\u30c4\u3078\u306e\u643a\u5e2f\u5411\u3051\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u30b5\u30fc\u30d3\u30b9\u300c\u507d\u30ed\u30b0\u300d\u306e\u7ba1\u7406\u8005\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u3059\u3002 http://t.co/QMKlQjzjSI http://t.co/YEiNJUvGdU", "followers_count": 40, "id": 118604209, "id_str": "118604209", "listed_count": 5, "name": "niselog \u7ba1\u7406\u8005", "profile_background_color": "C0DEED", "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png", "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png", "profile_link_color": "1DA1F2", "profile_sidebar_border_color": "C0DEED", "profile_sidebar_fill_color": "DDEEF6", "profile_text_color": "333333", "profile_use_background_image": true, "screen_name": "niselog", "statuses_count": 340, "url": "http://t.co/QMKlQjzjSI", "withheld_in_countries": []}, "user_mentions": []}
-bash-4.2$

unicode escapeという形式で文字が表示されているので読めない。

全体的にみてみるとJSON形式のデータになっているのでjqコマンドを通して見た。

-bash-4.2$ ./test3.py |tail -2|jq .
{
  "created_at": "Sat May 14 08:13:22 +0000 2016",
  "hashtags": [
    {
      "text": "ケルベロスブレイド"
    }
  ],
  "id": 731396977758339100,
  "id_str": "731396977758339072",
  "lang": "ja",
  "source": "<a href=\"https://about.twitter.com/products/tweetdeck\" rel=\"nofollow\">TweetDeck</a>",
  "text": "偽ログ for #ケルベロスブレイド はケルベロス超会議の一覧ページに対応しました https://t.co/gDlRyiFWC3",
  "urls": [
    {
      "expanded_url": "http://tw5.niselog.jp/",
      "url": "https://t.co/gDlRyiFWC3"
    }
  ],
  "user": {
    "created_at": "Mon Mar 01 05:51:23 +0000 2010",
    "default_profile": true,
    "default_profile_image": true,
    "description": "トミーウォーカーPBW 無限のファンタジア/シルバーレイン/エンドブレイカー!/サイキックハーツへの携帯向けゲートウェイサービス「偽ログ」の管理者 アカウントです。 http://t.co/QMKlQjzjSI http://t.co/YEiNJUvGdU",
    "followers_count": 40,
    "id": 118604209,
    "id_str": "118604209",
    "listed_count": 5,
    "name": "niselog 管理者",
    "profile_background_color": "C0DEED",
    "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png",
    "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png",
    "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png",
    "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png",
    "profile_link_color": "1DA1F2",
    "profile_sidebar_border_color": "C0DEED",
    "profile_sidebar_fill_color": "DDEEF6",
    "profile_text_color": "333333",
    "profile_use_background_image": true,
    "screen_name": "niselog",
    "statuses_count": 340,
    "url": "http://t.co/QMKlQjzjSI",
    "withheld_in_countries": []
  },
  "user_mentions": []
}
{
  "created_at": "Sat May 14 07:02:08 +0000 2016",
  "hashtags": [],
  "id": 731379051852505100,
  "id_str": "731379051852505088",
  "lang": "ja",
  "retweet_count": 2,
  "source": "<a href=\"https://about.twitter.com/products/tweetdeck\" rel=\"nofollow\">TweetDeck</a>",
  "text": "無限のファンタジア、シルバーレイン、エンドブレイカー向けの偽ログ https://t.co/QMKlQjzjSI ですが、夏頃に完全停止する予定です。(URLは残りますが)",
  "urls": [
    {
      "expanded_url": "http://niselog.jp/",
      "url": "https://t.co/QMKlQjzjSI"
    }
  ],
  "user": {
    "created_at": "Mon Mar 01 05:51:23 +0000 2010",
    "default_profile": true,
    "default_profile_image": true,
    "description": "トミーウォーカーPBW 無限のファンタジア/シルバーレイン/エンドブレイカー!/サイキックハーツへの携帯向けゲートウェイサービス「偽ログ」の管理者 アカウントです。 http://t.co/QMKlQjzjSI http://t.co/YEiNJUvGdU",
    "followers_count": 40,
    "id": 118604209,
    "id_str": "118604209",
    "listed_count": 5,
    "name": "niselog 管理者",
    "profile_background_color": "C0DEED",
    "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png",
    "profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png",
    "profile_image_url": "http://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png",
    "profile_image_url_https": "https://abs.twimg.com/sticky/default_profile_images/default_profile_normal.png",
    "profile_link_color": "1DA1F2",
    "profile_sidebar_border_color": "C0DEED",
    "profile_sidebar_fill_color": "DDEEF6",
    "profile_text_color": "333333",
    "profile_use_background_image": true,
    "screen_name": "niselog",
    "statuses_count": 340,
    "url": "http://t.co/QMKlQjzjSI",
    "withheld_in_countries": []
  },
  "user_mentions": []
}
-bash-4.2$

今度は可読できる状態になった。

で・・・twitter spaceの場合、次のような出力になっていた

{
  "created_at": "Fri Aug 13 02:11:56 +0000 2021",
  "hashtags": [],
  "id": ~,
  "id_str": "~",
  "lang": "ja",
  "source": "<a href=\"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</a>",
  "text": "スペース配信開始\nhttps://t.co/~",
  "urls": [
    {
      "expanded_url": "https://twitter.com/i/spaces/~",
      "url": "https://t.co/~"
    }
  ],
  "user": {
<略>
 }
}

urlsにexpanded_urlという項目があり、そこに /i/spaces/~ というtwitter spaceのURLが書かれているという状態であった。

とりあえず、これで、twitter spaceに参加するためのURLは取得できそう。

jqコマンドのオプションを変えて.urlsだけを抜き出して見る

-bash-4.2$ ./test3.py|jq '.urls'
[]
[]
[]
[]
[]
[]
[]
[]
[]
[]
[
  {
    "expanded_url": "https://twitter.com/i/spaces/~",
    "url": "https://t.co/~"
  }
]
[
  {
    "expanded_url": "https://~",
    "url": "https://t.co/~"
  }
]
[]
[]
[]
[]
[]
[]
[]
[]
-bash-4.

中身が入ってないものまで表示されてしまう。

jq コマンドを使う日常のご紹介」になかなかいい参考事例を発見

-bash-4.2$ ./test3.py|jq -r '.urls[] '
{
  "expanded_url": "https://twitter.com/i/spaces/~",
  "url": "https://t.co/~"
}
{
  "expanded_url": "https://~",
  "url": "https://t.co/~"
}
-bash-4.2$

これでURLがある場合だけ結果が出た。

もう1歩すすめてjqコマンドマニュアルみつつselectで完全一致だけ出力

-bash-4.2$ ./test3.py|jq -r '.urls[] |select(.expanded_url == "https://twitter.com/i/spaces/~")'
{
  "expanded_url": "https://twitter.com/i/spaces/~",
  "url": "https://t.co/~"
}
-bash-4.2$

部分一致を探すとstartswith,endswithで指定文字列で始まる場合/終わる場合を条件にできた

-bash-4.2$ ./test3.py|jq -r '.urls[] | select(.expanded_url | startswith("https://twitter.com/i/spaces/"))'
{
  "expanded_url": "https://twitter.com/i/spaces/~",
  "url": "https://t.co/~"
}
-bash-4.2$

含まれる場合は containsでいけた

-bash-4.2$ ./test3.py|jq -r '.urls[] | select(.expanded_url | contains("https://
twitter.com/i/spaces/"))'
{
  "expanded_url": "https://twitter.com/i/spaces/~",
  "url": "https://t.co/~"
}
-bash-4.2$

CHUWEI HiPad Proを買ったらがっかりペンタブレットだった件

$
0
0

スナドラ662で、メモリ8GB、ストレージ128GBというスペックにひかれてCHUWEI HiPad Proをペン付きで購入してみました。

8月5日に発送連絡があって、到着したのが8月17日でした。

追加送料払ってなかったのでもっと時間がかかるのかと思っていたら2週間かからないという予想外の到着でした。

ペン付きで買ったので2つ届きました。

裏面は綺麗な感じですね

添付のペンはHiPen H6とありました。

起動後の初期設定は普通のAndroidなので飛ばして、firmware updateを行います。

ここ、メッセージを読み飛ばしていたのですが、アップデート後の再起動でかならず下記の画面でブート失敗します。

画像

ボリュームの下ボタンを押して「Factory data Reset」を実行して初期化をする必要がある、ということです。

なので、ファームウェアアップデートが完了するまでGoogleアカウントの登録などの詳しい設定を行ってはいけない、ということですね。

さて、とりあえず原神を起動して様子見・・・

うーん・・・いまいち

次・・・ペンの動作がどうか確認。

手持ちにWacom Bamboo Inkペンがあったので、今回買ったHiPen H6を並べて見る。

だいたい同じサイズ。

画像

ペン先のサイズがちょっと違うっぽい(なお、Bamboo Inkのが斜めにみえるのは、曲げてしまってしまったため)

HiPad ProはMPP(Microsoft Pen Protocol)採用という話なので、Bamboo InkをMPPモードで電源を入れると使える様になる。

Bamboo Inkで書いた時と

HiPen H6で書いた時と比べると結構筆圧動作が違ってて興味深かったです。

・・・ここまではそんなに問題なさそうに見えますよね

ところが・・・

見ての通りに

ペンの動きに対して、描画が遅すぎる

この動作、CLIP STUDIOだけでなくKritaでも、筆圧検知自体は出来ているけど、遅延が酷い状態でした。

画像

よって、絵描き用途としてまったく向かない感じでした。

このCHUWEI HiPad Proですが、事前にAmazon PrimeがHDで見れる、というのもあったのですが、ChinaR「【CHUWI HiPad Proレビュー】WideVine L1認証済みのCHUWI HiPad ProはAmazonプライムビデオのHD再生に非対応(CHUWI HiPad Pro Don’t Support HD On Amazon Prime Video, Although Got WideVIne L1)」にあるように対応できてない、とかいう問題もあります。

とりあえず、うちのHiPad Proは2万円分のネタになってもらえるように、他の人に貸し出して楽しんでもらうつもりです

Xperia XZsにGSIイメージを書き込んだ

$
0
0

秋葉原でXperia XZs G8232を4400円で入手した。

調べて見るとGSIイメージを書き込むという手法があるようでFIRE & TECH「Xperia XZs の ROM 焼き」で紹介されていた。

ファイルの配布元はxda-forumの「[10.0] Project Treble for Xperia XZs [2020.03.18]」で、どういうことをやっているのかは「Fake Treble for Xperia XZ」に書かれている。

まずはXperia XZsのbootloader unlockをするために、設定画面から「OEMロック解除」を有効にする。

で、IMEI調べて、sonyの「Unlock Bootloader」でbootloader unlockのコードを申請して入手。

電源オフ状態でボリューム↑ボタンを押しながらUSBケーブルでパソコンに接続すると、fastbootモードで起動します。

起動するとXZs左上のランプが青く点灯し、パソコンから「fastboot devices」を実行するとデバイスが表示されます。

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot.exe devices
BH9011Gxxxx      fastboot

C:\Program Files (x86)\Android\android-sdk\platform-tools>

続いて申請して表示された文字列の先頭に0xを付け加えて「fastboot oem unlock 0x~」と入力します。

最初間違えて0xをつけないで実行してしまったのでエラーになっています。

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot oem unlock 570C856D14FAxxxx
                                                   FAILED (remote: 'Incorrect format for unlock data. Should be on the form "0x')
fastboot: error: Command failed

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot oem unlock 0x570C856D14FAxxxx
                                                   OKAY [  2.055s]
Finished. Total time: 2.059s

C:\Program Files (x86)\Android\android-sdk\platform-tools>

Treble-10.0-keyaki-4.9-sjll-V2.10.zipのHow-to-flash.txtは下記の様に書いてあります。

Format Data
fastboot flash oem vendor.img
fastboot flash boot boot.img
fastboot flash system <GSI Image>

GSI should be A/B type, Never use A-Only!

For XZs, you can use the twrp of X Performance or XZ's.

NEVER, NEVER flash Sony Open devices oem image!!!!!!

まずは「Format Data」ということで「fastboot -w」(Wipe)を実行します。

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot -w
Erasing 'userdata'                                 OKAY [  0.385s]
mke2fs 1.45.4 (23-Sep-2019)
Creating filesystem with 13089792 4k blocks and 3276800 inodes
Filesystem UUID: f9136b0e-0b12-11ec-a6fc-fda6154f283e
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424

Allocating group tables: done
Writing inode tables: done
Creating journal (65536 blocks): done
Writing superblocks and filesystem accounting information: done

Sending 'userdata' (4396 KB)                       OKAY [  0.144s]
Writing 'userdata'                                 OKAY [  0.059s]
Erasing 'cache'                                    OKAY [  0.026s]
mke2fs 1.45.4 (23-Sep-2019)
Creating filesystem with 65536 4k blocks and 65536 inodes
Filesystem UUID: f96341ce-0b12-11ec-b52e-2ff551a4869a
Superblock backups stored on blocks:
        32768

Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

Sending 'cache' (120 KB)                           OKAY [  0.025s]
Writing 'cache'                                    OKAY [  0.026s]
Finished. Total time: 1.213s

C:\Program Files (x86)\Android\android-sdk\platform-tools>

続いて Treble-10.0-keyaki-4.9-sjll-V2.10.zipの vendor.imgをOEM領域に書き込みます。

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot flash oem F:\download\android\xperia-xzs\vendor.img
Sending 'oem' (248608 KB)                          OKAY [  6.827s]
Writing 'oem'                                      OKAY [  1.871s]
Finished. Total time: 8.853s

C:\Program Files (x86)\Android\android-sdk\platform-tools>

Treble-10.0-keyaki-4.9-sjll-V2.10.zipのHow-to-flash.txt の boot.imgをboot領域に書き込みます。

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot flash boot F:\download\android\xperia-xzs\boot.img
Sending 'boot' (12368 KB)                          OKAY [  0.366s]
Writing 'boot'                                     OKAY [  0.110s]
Finished. Total time: 0.530s

C:\Program Files (x86)\Android\android-sdk\platform-tools>

最後にGSIイメージをsystem領域に書き込みます。

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot flash system F:\download\android\xperia-xzs\GSI-Android10\system-quack-arm64-ab-gapps_v222.img
Invalid sparse file format at header magic
error: write_sparse_skip_chunk: don't care size 480526784 is not a multiple of the block size 4096
error: write_sparse_skip_chunk: don't care size 212095424 is not a multiple of the block size 4096
Sending sparse 'system' 1/3 (262140 KB)            error: write_sparse_skip_chunk: don't care size 480526784 is not a multiple of the block size 4096
error: write_sparse_skip_chunk: don't care size 480526784 is not a multiple of the block size 4096
OKAY [  7.512s]
Writing 'system'                                   FAILED (remote: 'buffer overreads occured due to invalid sparse header')
fastboot: error: Command failed

C:\Program Files (x86)\Android\android-sdk\platform-tools>

エラーとなりました。

よく調べてみたところ、img.xzのはずなのですが、imgとしてファイルが保存されていたための問題でした。

xzファイルを展開して再チャレンジ

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot flash system F:\download\android\xperia-xzs\GSI-Android10\system-quack-arm64-ab-gapps_v222.img
Sending sparse 'system' 1/9 (262140 KB)            OKAY [  7.497s]
Writing 'system'                                   OKAY [  2.023s]
Sending sparse 'system' 2/9 (262140 KB)            OKAY [  7.572s]
Writing 'system'                                   OKAY [  2.050s]
Sending sparse 'system' 3/9 (262140 KB)            OKAY [  7.548s]
Writing 'system'                                   OKAY [  2.035s]
Sending sparse 'system' 4/9 (262140 KB)            OKAY [  7.650s]
Writing 'system'                                   OKAY [  2.101s]
Sending sparse 'system' 5/9 (262140 KB)            OKAY [  7.672s]
Writing 'system'                                   OKAY [  2.102s]
Sending sparse 'system' 6/9 (262140 KB)            OKAY [  7.673s]
Writing 'system'                                   OKAY [  2.060s]
Sending sparse 'system' 7/9 (262140 KB)            OKAY [  7.645s]
Writing 'system'                                   OKAY [  1.984s]
Sending sparse 'system' 8/9 (262140 KB)            OKAY [  7.641s]
Writing 'system'                                   OKAY [  2.068s]
Sending sparse 'system' 9/9 (183260 KB)            OKAY [  5.354s]
Writing 'system'                                   OKAY [  1.434s]
Finished. Total time: 91.779s

C:\Program Files (x86)\Android\android-sdk\platform-tools>

今度は成功です。

再起動します。

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot reboot
Rebooting                                          OKAY [  0.002s]
Finished. Total time: 0.003s

C:\Program Files (x86)\Android\android-sdk\platform-tools>

で・・・Android 10で起動しました。

続いて、Android 11のGSIが使えるのか確認。

「fastboot -w」でフォーマット

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot devices
BH9011Gxxx      fastboot

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot -w
Erasing 'userdata'                                 OKAY [  1.073s]
mke2fs 1.45.4 (23-Sep-2019)
Creating filesystem with 13089792 4k blocks and 3276800 inodes
Filesystem UUID: 4150c0de-0b17-11ec-9cae-af9c3c428626
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424

Allocating group tables: done
Writing inode tables: done
Creating journal (65536 blocks): done
Writing superblocks and filesystem accounting information: done

Sending 'userdata' (4396 KB)                       OKAY [  0.156s]
Writing 'userdata'                                 OKAY [  0.061s]
Erasing 'cache'                                    OKAY [  0.030s]
mke2fs 1.45.4 (23-Sep-2019)
Creating filesystem with 65536 4k blocks and 65536 inodes
Filesystem UUID: 41a1c326-0b17-11ec-a365-bd86ad12ab05
Superblock backups stored on blocks:
        32768

Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

Sending 'cache' (120 KB)                           OKAY [  0.022s]
Writing 'cache'                                    OKAY [  0.024s]
Finished. Total time: 1.819s

C:\Program Files (x86)\Android\android-sdk\platform-tools>

続いてGSIをsystem領域に書き込みます。

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot flash system F:\download\android\xperia-xzs\GSI-Android11\system-roar-arm-ab-gogapps_v312.img
Sending sparse 'system' 1/6 (262140 KB)            OKAY [  7.562s]
Writing 'system'                                   OKAY [  1.975s]
Sending sparse 'system' 2/6 (262140 KB)            OKAY [  7.591s]
Writing 'system'                                   OKAY [  2.083s]
Sending sparse 'system' 3/6 (262140 KB)            OKAY [  7.653s]
Writing 'system'                                   OKAY [  2.028s]
Sending sparse 'system' 4/6 (262140 KB)            OKAY [  7.713s]
Writing 'system'                                   OKAY [  2.085s]
Sending sparse 'system' 5/6 (262140 KB)            OKAY [  7.679s]
Writing 'system'                                   OKAY [  2.018s]
Sending sparse 'system' 6/6 (243672 KB)            OKAY [  7.158s]
Writing 'system'                                   OKAY [  1.923s]
Finished. Total time: 61.099s

C:\Program Files (x86)\Android\android-sdk\platform-tools>

再起動

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot reboot
Rebooting                                          OKAY [  0.010s]
Finished. Total time: 0.013s

C:\Program Files (x86)\Android\android-sdk\platform-tools>

Xperiaロゴが出たあと、電源が切れ、再びfastbootモードになってしまいました。

今度は省略したところも全て再実行

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot -w
Erasing ‘userdata’ OKAY [ 1.073s]
mke2fs 1.45.4 (23-Sep-2019)
Creating filesystem with 13089792 4k blocks and 3276800 inodes
Filesystem UUID: 4150c0de-0b17-11ec-9cae-af9c3c428626
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424

Allocating group tables: done
Writing inode tables: done
Creating journal (65536 blocks): done
Writing superblocks and filesystem accounting information: done

Sending ‘userdata’ (4396 KB) OKAY [ 0.156s]
Writing ‘userdata’ OKAY [ 0.061s]
Erasing ‘cache’ OKAY [ 0.030s]
mke2fs 1.45.4 (23-Sep-2019)
Creating filesystem with 65536 4k blocks and 65536 inodes
Filesystem UUID: 41a1c326-0b17-11ec-a365-bd86ad12ab05
Superblock backups stored on blocks:
32768

Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

Sending ‘cache’ (120 KB) OKAY [ 0.022s]
Writing ‘cache’ OKAY [ 0.024s]
Finished. Total time: 1.819s

C:\Program Files (x86)\Android\android-sdk\platform-tools>
C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot flash system F:\download\android\xperia-xzs\GSI-Android11\system-roar-arm-ab-gogapps_v312.img
Sending sparse ‘system’ 1/6 (262140 KB) OKAY [ 7.562s]
Writing ‘system’ OKAY [ 1.975s]
Sending sparse ‘system’ 2/6 (262140 KB) OKAY [ 7.591s]
Writing ‘system’ OKAY [ 2.083s]
Sending sparse ‘system’ 3/6 (262140 KB) OKAY [ 7.653s]
Writing ‘system’ OKAY [ 2.028s]
Sending sparse ‘system’ 4/6 (262140 KB) OKAY [ 7.713s]
Writing ‘system’ OKAY [ 2.085s]
Sending sparse ‘system’ 5/6 (262140 KB) OKAY [ 7.679s]
Writing ‘system’ OKAY [ 2.018s]
Sending sparse ‘system’ 6/6 (243672 KB) OKAY [ 7.158s]
Writing ‘system’ OKAY [ 1.923s]
Finished. Total time: 61.099s

C:\Program Files (x86)\Android\android-sdk\platform-tools>
C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot reboot
Rebooting OKAY [ 0.010s]
Finished. Total time: 0.013s

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot devices
BH9011G172 fastboot

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot -w
Erasing ‘userdata’ OKAY [ 0.722s]
mke2fs 1.45.4 (23-Sep-2019)
Creating filesystem with 13089792 4k blocks and 3276800 inodes
Filesystem UUID: e9ea269a-0b17-11ec-8cba-a17b44c778c4
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424

Allocating group tables: done
Writing inode tables: done
Creating journal (65536 blocks): done
Writing superblocks and filesystem accounting information: done

Sending ‘userdata’ (4396 KB) OKAY [ 0.145s]
Writing ‘userdata’ OKAY [ 0.061s]
Erasing ‘cache’ OKAY [ 0.026s]
mke2fs 1.45.4 (23-Sep-2019)
Creating filesystem with 65536 4k blocks and 65536 inodes
Filesystem UUID: ea381fe4-0b17-11ec-b1f1-f1b13df9e489
Superblock backups stored on blocks:
32768

Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

Sending ‘cache’ (120 KB) OKAY [ 0.023s]
Writing ‘cache’ OKAY [ 0.026s]
Finished. Total time: 1.443s

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot flash oem F:\download\android\xperia-xzs\vendor.img
Sending ‘oem’ (248608 KB) OKAY [ 6.746s]
Writing ‘oem’ OKAY [ 1.910s]
Finished. Total time: 8.825s

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot flash boot F:\download\android\xperia-xzs\boot.img
Sending ‘boot’ (12368 KB) OKAY [ 0.426s]
Writing ‘boot’ OKAY [ 0.116s]
Finished. Total time: 1.085s

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot flash system F:\download\android\xperia-xzs\GSI-Android11\system-roar-arm-ab-gogapps_v312.img
Sending sparse ‘system’ 1/6 (262140 KB) OKAY [ 7.523s]
Writing ‘system’ OKAY [ 2.121s]
Sending sparse ‘system’ 2/6 (262140 KB) OKAY [ 7.584s]
Writing ‘system’ OKAY [ 2.055s]
Sending sparse ‘system’ 3/6 (262140 KB) OKAY [ 7.543s]
Writing ‘system’ OKAY [ 2.071s]
Sending sparse ‘system’ 4/6 (262140 KB) OKAY [ 8.527s]
Writing ‘system’ OKAY [ 2.036s]
Sending sparse ‘system’ 5/6 (262140 KB) OKAY [ 7.556s]
Writing ‘system’ OKAY [ 2.058s]
Sending sparse ‘system’ 6/6 (243672 KB) OKAY [ 7.044s]
Writing ‘system’ OKAY [ 1.945s]
Finished. Total time: 61.023s

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot reboot
Rebooting OKAY [ 0.002s]
Finished. Total time: 0.005s

C:\Program Files (x86)\Android\android-sdk\platform-tools>

….やっぱりダメですね。

2021/09/04追記:よく見たらarmイメージを書き込んでいました。arm64じゃん・・・

Google配布のAndroid 12のGSIイメージを書き込めるかもチャレンジ

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot flash system F:\download\android\xperia-xzs\GSI-Android12\system.img
Invalid sparse file format at header magic
Sending sparse 'system' 1/10 (262104 KB)           OKAY [  7.717s]
Writing 'system'                                   OKAY [  2.124s]
Sending sparse 'system' 2/10 (262128 KB)           OKAY [  7.544s]
Writing 'system'                                   OKAY [  2.070s]
Sending sparse 'system' 3/10 (262112 KB)           OKAY [  7.527s]
Writing 'system'                                   OKAY [  2.053s]
Sending sparse 'system' 4/10 (262128 KB)           OKAY [  7.672s]
Writing 'system'                                   OKAY [  2.073s]
Sending sparse 'system' 5/10 (262124 KB)           OKAY [  7.563s]
Writing 'system'                                   OKAY [  2.073s]
Sending sparse 'system' 6/10 (262124 KB)           OKAY [  7.524s]
Writing 'system'                                   OKAY [  2.021s]
Sending sparse 'system' 7/10 (262116 KB)           OKAY [  7.516s]
Writing 'system'                                   OKAY [  2.044s]
Sending sparse 'system' 8/10 (262084 KB)           OKAY [  7.550s]
Writing 'system'                                   OKAY [  2.147s]
Sending sparse 'system' 9/10 (262128 KB)           OKAY [  7.798s]
Writing 'system'                                   OKAY [  2.051s]
Sending sparse 'system' 10/10 (126492 KB)          OKAY [  3.675s]
Writing 'system'                                   OKAY [  6.845s]
Finished. Total time: 104.423s

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot reboot
Rebooting                                          OKAY [  0.003s]
Finished. Total time: 0.007s

C:\Program Files (x86)\Android\android-sdk\platform-tools>

SONYロゴのままハングアップ。電源ボタン長押しでのoffも出来なくなりました。

ということで、Xperia XZsのfake GSIで使えるのはAndroid 10のみということですね。


TWRPを書き込めるか確認:twrp-q-V1.img

fastbootモードにしてからrecovery領域に書き込んだ。

C:\Program Files (x86)\Android\android-sdk\platform-tools>fastboot flash recovery F:\download\android\xperia-xzs\twrp-q-V1.img
Sending 'recovery' (20056 KB)                      OKAY [  0.706s]
Writing 'recovery'                                 OKAY [  0.158s]
Finished. Total time: 1.418s

C:\Program Files (x86)\Android\android-sdk\platform-tools>

Androidが起動してからadb reboot recoveryでTWRPが起動することを確認

C:\Program Files (x86)\Android\android-sdk\platform-tools>adb reboot recovery

C:\Program Files (x86)\Android\android-sdk\platform-tools>

なお、ボリューム↓+電源ボタンで起動してもTWRPが起動する。

Andy Yan’s personal builds // GSI にあるLineageOS 17.1のテストと、GAppが書き込めるか確認

きちんと書き込めて、TWRP経由でNikGAppsのNikGapps-stock-arm64-10-20210815-signed.zipを書き込み、Lineage OS 17.1上でGappsが使えることを確認しました。


Android 11 Custom Rom for the Xperia XZs に下記のAndroid11を試した、という話が書かれていた。
 Pixel Experience Plus and non-Plus
 Corvus OS
 Havoc OS

開発者向け資料のGeneric System Imageを確認すると、/system/etc/ld.config.数字.txt 内の[vendor]セクションで「namespace.default.isolated=true」となっていれば、いいらしい。

Vendor Native Development Kit(VNDK)のバージョンは 下記の様に26~29 で定義されていた。

keyaki:/ $ ls -l /system/etc/ld*
-rw-r--r-- 1 root root 34755 2020-08-06 05:16 /system/etc/ld.config.26.txt
-rw-r--r-- 1 root root 39324 2020-08-06 05:16 /system/etc/ld.config.27.txt
-rw-r--r-- 1 root root 39844 2020-08-06 05:16 /system/etc/ld.config.28.txt
-rw-r--r-- 1 root root 40252 2020-08-06 05:16 /system/etc/ld.config.29.txt
-rw-r--r-- 1 root root 27897 2020-08-06 05:16 /system/etc/ld.config.vndk_lite.txt
keyaki:/ $

一番新しい 29 というのはAndroid 10ということらしい。このため、少なくともAndroid 10のGSIは使える、ということになる。

それ以降のバージョンを使えるかを /system/etc/ld.config.29.txt の該当部分を確認すると下記のようになっていた。

<略>
[vendor]
additional.namespaces = runtime,system,vndk

###############################################################################
# "default" namespace
#
# This is the default linker namespace for a vendor process (a process started
# from /vendor/bin/*). The main executable and the libs under /vendor/lib[64]
# are loaded directly into this namespace. However, other libs under the system
# partition (VNDK and LLNDK libraries) are not loaded here but from the
# separate namespace 'system'. The delegation to the system namespace is done
# via the 'namespace.default.link.system.shared_libs' property below.
#
# '#VNDK27#' TAG is only for building ld.config.27.txt for backward
# compatibility. (TODO:b/123390078) Move them to a separate file.
###############################################################################
namespace.default.isolated = true
namespace.default.visible = true
<略>

namespace.default.isolated = true となっているので、使えてもおかしくはないはず、ということになりそうだ。

次に、こちらでは Phhusson’s AOSP で試したが、動いたとしているGSIは Pixel Experience Plus and non-Plus, Corvus OS, Havoc OSとの差を考察してみる。

Pixel Experience Plus and non-Plus はPhhusson’s AOSPをベースとしているが配布イメージに vndkliteとついているバージョンがある。


Corvus OS にもvndkliteバージョンがある。

Havoc OSにはvndkliteバージョンがない。そして2020/12/30と更新が古い。

違い?と想定されるVNDK Liteについて調べると、開発者向け資料に記載があった。

Android10については今回使用しているvendorイメージがAndroid 10向けに作成したものなのでVNDKイメージが使用できているが、それ以外については、元々はXperia XZsはAndroid 8.xデバイスなのでVNDK Lite構成でないと動かない、ということではないか、という仮説を立てた。

はたして?

Linksys E8450 AX3200はEasyMeshでバッファローの子機にもできるけど5GHzが4チャンネルしか使えない

$
0
0

LinksysのWi-Fiルータ E7350とE8450がEasyMeshに対応した、というニュースを見た

Amazonで見てみたら、Amazonアウトレット扱いでE7350が4791円、E8450が6204円だった。

というわけでLinksys E8450 AX3200を買って、firmwareを1.0.01.101415から1.1.00.180912へアップデートしてからいろいろやってみた。

W52周波数帯しか使えない問題

ウィザード形式の設定を飛ばして、設定画面を見てみると、なんと5GHzで使用できるチャネル設定が36,40,44,48chの4つしかない。

この4chはW52と呼ばれる周波数帯で、2021年現在の日本では他にW53の52,56,60,64ch、と、W56の100,104,108,112,116,120,124,128,132,136,140chが使えるのが普通である。

サポートに問い合わせて見たが、2021/09/10時点ではW52しか選択できない件について明確な回答は得られていない。

さて、今回このLinksys E8450はEasyMeshの子機として使うために購入した。

既存環境はバッファローのWSR-1800AX4で、2021年6月に「バッファローWSR-1800AX4をEasyMesh対応にしてみた」で書いたように構成したものとなる。

この環境にE8450を子機として設定する手順は「LinksysデュアルバンドEasyMeshWiFiルーターへの子ノードの追加方法」にある「WPSボタンを使用してEasyMesh子ノードを追加する方法」を使用した。

親機となるバッファローWSR-1800AX4の管理画面からWPSボタンを押した後、E7450背面のWPSボタン(物理)を3秒押して、電源ランプが点滅するのを確認して手を放します。

しばらくすると、子機の電源ランプとインターネットランプが青で点灯します。

そして、親機のWSR-1800AX4の管理画面上では「機器名:Other」として登録されているのが確認出来ます。

・・・接続帯域が「2.4G」となっていますね。

これは既存環境のWSR-1800AX4で使っている5GHz帯が140chチャンネルで、E8450がサポートしていないチャンネルであるから接続出来なかったようです。

試しにWSR-1800AX4のチャンネルを40chに変更してから再試行すると、ちゃんと「接続帯域:5G」となります。

念のためW53の60chでも試してみたところ2.4GHz接続となり、E8450ではW52以外のチャンネルは使用できないようです。

EasyMesh子機の管理画面にアクセスできない

結構な問題だと思うのですが、E8450をEasyMesh子機とした場合、そのE8450の管理画面にアクセスできなくなります。

英語のLivechatサポートに確認したところ、子機の管理画面は親機となるE8450から一括管理できる、という話で、メーカー違いの場合は管理できないようです。

このため、実は上記で親機のチャンネル変更を行った場合、E8450が設定をアップデートとかしてくれなかったので、毎回E8450を初期化して、1から設定をやり直していました。

Linksysメッシュルーターを工場出荷時のデフォルト設定にリセットする」にあるように、E8450が起動状態にあるときにリセットボタンを10秒ぐらい押しつづけ、赤点滅をしはじめて処理がはじまったところで、ボタンを放すと初期化が開始されます。

異機種混在はメーカ保証対象外なんでしょうけど、単体で設定出来る手法は用意してほしかったものです・・・

NanoPi R2S+OpenWRT 21.02.0でBIGLOBEのMAP-E接続

$
0
0

5月に「NanoPi R2S+openWRT 21.02.0RCでBIGLOBEのMAP-E接続」にてOpenWRT 21.02.0-RC版での手順を作成した。

しかし、OpenWRT 21.02.0リリース版になってみると、いろいろ設定画面が変更となり、この手順のままでは動作させることができなかった。

ぐぐってみたところ「OpenWrt(21.02)でIPv6インターネットを使う」に手順があったので、参考にしつつ手順を更新した。

前書き

OpenWRTルータを作成するにあたり、いろいろある選択肢からRockchip RK3328のNanoPi R2S と Rockchip RK3399のNanoPi R4S を候補にあげた。

Amazon日本の倉庫に在庫があるというのと、openWRTのページに「FriendlyARM NanoPi R2S」とデバイスに関する個別ページが作成されており、リリース版の提供がされていたので、NanoPi R2Sを買って設定を行った。

画像
画像

ちなみに置き換え対象となったGL-MV1000とのサイズ比較はこんな感じ

画像
画像

OpenWRT 21.02.0-RC版の時代はアップグレードしたら以前の設定を残しておくと起動しなくなるとか問題もありましたが、OpenWRT 21.02.0リリース版を書き込んだあと設定復旧で動作させることができました。

設定手順0: MicroSD作成

friendlyarm_nanopi-r2s-squashfs-sysupgrade.img.gz を展開したものをmicroSDに書き込んでNanoPi R2Sを起動。

設定手順1:パッケージの追加

mapパッケージと日本語UIパッケージ(luci-i18n-base-ja)をインストール

また、後述のニチバン対策を行う場合は iptables-mod-ipopt もインストールする。

GUIの場合、[システム]-[Software]にて、「Update lists」を実行してパッケージ一覧を取得した後に、「Filter」にパッケージ名を入れて、出てきたモジュールを「Install」する。

CLIでインストールする場合は以下を実行

# opkg update
# opkg install luci-i18n-base-ja
# opkg install map
# okpg install iptables-mod-ipopt

インストール後は再起動を行うこと。

再起動しないとluciのネットワーク設定で「プロトコル:MAP / LW4over6」が選択肢に現れません。

設定手順2:WAN6インタフェースの作成

WAN6インタフェースがなければ「プロトコル: DHCPv6クライアント」で作成する

最初はそのまま設定して、有効化し、WAN6インタフェースに割り当てられるIPv6アドレスを確認すること。

↑の画像は使い回しなので、この段階では無いはずの「MAP」インタフェースなどが入ってます

上記のようにWAN6インタフェースに「IPv6」アドレスが確認できたら、そのアドレスをコピーして、notepadにでも貼り付けておきます。

設定手順3:WAN6インタフェースにDHCPv6関連設定

openWRT 21.02.0のリリース版になったらWAN6インタフェースではDHCPv6関連設定がGUIできるようになりました。

[DHCPサーバー]を選択して、下記のようになっている場合は「DHCPサーバーをセットアップ」をクリックします。

クリックしたあと[一般設定]タブは下記のような感じで変更せず

[IPv6設定]タブで下記の設定を行います。

Designated master: チェックを入れる
RA-Service:リレーモード
DHCPv6-サービス: リレーモード
NDP-Proxy: リレーモード
(Learn routesは設定を変更していない)

設定手順4:LANインタフェースにDHCPv6関連設定

LANインタフェースの[DHCPサーバー]-[IPv6設定]で以下の設定を行います。

RA-Service:リレーモード
DHCPv6-サービス: サーバーモード
NDP-Proxy: リレーモード

(マスターにチェックは入れません)

設定手順5: IPv6 PD設定

OpenWRT 21.02.0-RC版だとIPv6 PD設定がWAN6にあったのですが、リリース版だと消えています。

これは別のインタフェースとして作成することで対応するようです。

[インタフェースを新規作成]から下記でインタフェースを作成します。

名前:WAN6PD
プロトコル:静的アドレス
デバイス: WAN6インタフェース(@wan6表記)

詳細設定では手順2で確認したIPv6アドレスを使います。

IPv6アドレスが「IPv6: wwww:xxxx:yyyy:zzzz:aaaa:bbbb:cccc:dddd/64」というようになっているとき、先頭の4カラム「wwww:xxxx:yyyy:zzzz」を使います。

まず、WAN6PDに割り当てる 「wwww:xxxx:yyyy:zzzz::1001」を「IPv6アドレス」に設定します。

「IPv6 ゲートウェイ」には「wwww:xxxx:yyyy:zzzz::1 」を指定します。このアドレスは設定完了後、WAN6PDインタフェースではなく、LANインタフェースに対して割り当てられます。

「IPv6ルートプレフィックス」には「wwww:xxxx:yyyy:zzzz::/56」と指定します。

設定すると上記のような感じです。

設定手順6: MAP-E接続設定

インタフェースの新規作成で「プロトコル:MAP / LW4over6」を作成して、必要な値を入れていきます。今回は「WAN_MAP」で作成しました。

[一般設定]では下記の様にしました。

プロトコル:MAP/LW4over6
タイプ:MAP-E
以後は環境に合わせた値

[詳細設定]では「従来のMAPを使用」にチェックを入れる

設定手順7: 各インタフェースのファイアウォールゾーン設定

wan系のゾーンに「wan_map」と「WAN6PD」を追加します。

設定完了

ひとまずこれで設定完了です。

うまく接続が始まらない場合は、再起動してみてください。

設定:ニチバン対策

ニチバンサイトなど一部でIPv4通信がおかしくなる件について、 https://paste.teknik.io/VeN9r にある手法を使った。

IP4,PSID, TUNDEVは自分の環境に合わせて変更すること
IP4, PSIDがわからない場合は http://ipv4.web.fc2.com/map-e.html で確認すること

TUNDEVは、GUIから設定した名前ではなく、アイコンの下に小さく書かれている方の名前を使う。↑の場合は「map-wan_map」になる。

また、units1とunits2は、BIGLOBEはV6plus相当であるため、数値を変更する。

units1=15 #V6plus:15 OCN:63
units2=4096 #V6plus 4096 OCN:1024
IP4='xxx.xxx.xxx.xxx'
PSID='x'
TUNDEV='map-wan_map'


iptables -t nat -F PREROUTING
iptables -t nat -F OUTPUT
iptables -t nat -F POSTROUTING

rule=1
while [ $rule -le $units1  ] ; do
  mark=`expr $rule + 16`
  pn=`expr $rule - 1`
  portl=`expr $rule \* $units2 + $PSID \* 16`
  portr=`expr $portl + 15`

  iptables -t nat -A PREROUTING -m statistic --mode nth --every $units1 --packet $pn -j MARK --set-mark $mark
  iptables -t nat -A OUTPUT -m statistic --mode nth --every $units1 --packet $pn -j MARK --set-mark $mark

  iptables -t nat -A POSTROUTING -p icmp -o $TUNDEV -m mark --mark $mark -j SNAT --to $IP4:$portl-$portr
  iptables -t nat -A POSTROUTING -p tcp -o $TUNDEV -m mark --mark $mark -j SNAT --to $IP4:$portl-$portr
  iptables -t nat -A POSTROUTING -p udp -o $TUNDEV -m mark --mark $mark -j SNAT --to $IP4:$portl-$portr
  rule=`expr $rule + 1`
done

上記をopenwrtの[ネットワーク]-[ファイヤーウォール]-[Custom Rules] (/etc/firewall.user) に記載する。

また、[システム]-[スタートアップ]-[ローカルスタートアップ] (/etc/rc.local)の exit 0よりも前に下記2行を追加する

sleep 30
sh /etc/firewall.user

なお、iptablesのstatisticモジュールはiptables-mod-ipoptに入っているが、標準では導入されていないため、冒頭でインストールしているが、まだの場合は下記のような感じでインストールする。

root@nanopi:~# opkg install iptables-mod-ipopt
Installing iptables-mod-ipopt (1.8.7-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.0-rc1/targets/rockchip/armv8/packages/iptables-mod-ipopt_1.8.7-1_aarch64_generic.ipk
Installing kmod-ipt-ipopt (5.4.111-1) to root...
Downloading https://downloads.openwrt.org/releases/21.02.0-rc1/targets/rockchip/armv8/packages/kmod-ipt-ipopt_5.4.111-1_aarch64_generic.ipk
Configuring kmod-ipt-ipopt.
Configuring iptables-mod-ipopt.
root@nanopi:~#

これで、とりあえずニチバンもスムースに開けるようになった。


参考資料

/etc/config/network

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fdaf:6014:6f21::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth1'

config device
        option name 'eth1'
        option macaddr '1a:e4:a4:73:0d:0c'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.1.1'

config device
        option name 'eth0'
        option macaddr '1a:e4:a4:73:0d:0b'

config interface 'wan'
        option device 'eth0'
        option proto 'dhcp'
        option auto '0'

config interface 'wan6'
        option device 'eth0'
        option proto 'dhcpv6'
        option reqaddress 'try'
        option reqprefix 'auto'

config interface 'wan_map'
        option proto 'map'
        option maptype 'map-e'
        option peeraddr '2404:9200:225:100::64'
        option ipaddr 'xxx.xxx.xxx.xxx'
        option ip4prefixlen '15'
        option ip6prefix 'wwww:xxxx::'
        option ip6prefixlen '31'
        option ealen '25'
        option psidlen '8'
        option offset '4'
        option legacymap '1'

config interface 'WAN6PD'
        option proto 'static'
        list ip6addr 'wwww:xxxx:yyyy:zzzz::1001'
        option ip6gw 'wwww:xxxx:yyyy:zzzz::1'
        option ip6prefix 'wwww:xxxx:yyyy:zzzz::/56'
        option device '@wan6'

/etc/config/dhcp

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'
        option ednspacket_max '1232'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option ra 'relay'
        option ndp 'relay'
        list ra_flags 'none'
        option dhcpv6 'server'

config dhcp 'wan6'
        option dhcpv6 'relay'
        option ra 'relay'
        option ndp 'relay'
        option master '1'
        option interface 'wan6'
        option ignore '1'
        list ra_flags 'none'

iptablesの結果

意図した分散が行われているかを「iptables -t nat -L -v」のPOSTROUTING tcp/udpのpkts/bytesカウントが分散して増加していっているかを確認する。

ちなみに、 /etc/rc.local にsleep 30とsh /etc/firewall.user を入れないと、システムが生成した分散ルールも残って表示される。

root@nanopi:~# iptables -t nat -L -v
Chain PREROUTING (policy ACCEPT 2756 packets, 474K bytes)
 pkts bytes target     prot opt in     out     source               destination
  185 32012 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 MARK set 0x11
  184 28575 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 1 MARK set 0x12
  184 31952 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 2 MARK set 0x13
  184 31323 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 3 MARK set 0x14
  184 33123 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 4 MARK set 0x15
  184 36047 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 5 MARK set 0x16
  184 32939 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 6 MARK set 0x17
  184 33412 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 7 MARK set 0x18
  184 29916 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 8 MARK set 0x19
  184 28526 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 9 MARK set 0x1a
  184 29308 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 10 MARK set 0x1b
  183 32364 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 11 MARK set 0x1c
  183 30150 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 12 MARK set 0x1d
  183 29944 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 13 MARK set 0x1e
  183 34100 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 14 MARK set 0x1f

Chain INPUT (policy ACCEPT 598 packets, 40818 bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain OUTPUT (policy ACCEPT 67 packets, 5056 bytes)
 pkts bytes target     prot opt in     out     source               destination
    5   372 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 MARK set 0x11
    5   372 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 1 MARK set 0x12
    5   372 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 2 MARK set 0x13
    5   372 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 3 MARK set 0x14
    5   380 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 4 MARK set 0x15
    5   380 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 5 MARK set 0x16
    5   380 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 6 MARK set 0x17
    4   300 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 7 MARK set 0x18
    4   304 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 8 MARK set 0x19
    4   304 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 9 MARK set 0x1a
    4   304 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 10 MARK set 0x1b
    4   304 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 11 MARK set 0x1c
    4   304 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 12 MARK set 0x1d
    4   304 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 13 MARK set 0x1e
    4   304 MARK       all  --  any    any     anywhere             anywhere             statistic mode nth every 15 packet 14 MARK set 0x1f

Chain POSTROUTING (policy ACCEPT 23 packets, 1064 bytes)
 pkts bytes target     prot opt in     out     source               destination
    2   168 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x11 to:xxx.xxx.xxx.xxx:5856-5871
   41  2607 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x11 to:xxx.xxx.xxx.xxx:5856-5871
    8   557 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x11 to:xxx.xxx.xxx.xxx:5856-5871
    4   336 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x12 to:xxx.xxx.xxx.xxx:9952-9967
   50  3503 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x12 to:xxx.xxx.xxx.xxx:9952-9967
   13   868 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x12 to:xxx.xxx.xxx.xxx:9952-9967
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x13 to:xxx.xxx.xxx.xxx:14048-14063
   46  2981 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x13 to:xxx.xxx.xxx.xxx:14048-14063
   11   771 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x13 to:xxx.xxx.xxx.xxx:14048-14063
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x14 to:xxx.xxx.xxx.xxx:18144-18159
   33  1991 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x14 to:xxx.xxx.xxx.xxx:18144-18159
   10   709 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x14 to:xxx.xxx.xxx.xxx:18144-18159
    2   168 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x15 to:xxx.xxx.xxx.xxx:22240-22255
   38  2280 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x15 to:xxx.xxx.xxx.xxx:22240-22255
   13   950 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x15 to:xxx.xxx.xxx.xxx:22240-22255
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x16 to:xxx.xxx.xxx.xxx:26336-26351
   42  3095 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x16 to:xxx.xxx.xxx.xxx:26336-26351
   11   831 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x16 to:xxx.xxx.xxx.xxx:26336-26351
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x17 to:xxx.xxx.xxx.xxx:30432-30447
   51  3838 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x17 to:xxx.xxx.xxx.xxx:30432-30447
   11   823 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x17 to:xxx.xxx.xxx.xxx:30432-30447
    1    84 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x18 to:xxx.xxx.xxx.xxx:34528-34543
   41  2564 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x18 to:xxx.xxx.xxx.xxx:34528-34543
    9   656 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x18 to:xxx.xxx.xxx.xxx:34528-34543
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x19 to:xxx.xxx.xxx.xxx:38624-38639
   44  2665 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x19 to:xxx.xxx.xxx.xxx:38624-38639
    9   629 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x19 to:xxx.xxx.xxx.xxx:38624-38639
    0     0 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1a to:xxx.xxx.xxx.xxx:42720-42735
   55  3841 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1a to:xxx.xxx.xxx.xxx:42720-42735
   11   762 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1a to:xxx.xxx.xxx.xxx:42720-42735
    1    84 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1b to:xxx.xxx.xxx.xxx:46816-46831
   53  3161 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1b to:xxx.xxx.xxx.xxx:46816-46831
   10   699 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1b to:xxx.xxx.xxx.xxx:46816-46831
    2   168 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1c to:xxx.xxx.xxx.xxx:50912-50927
   46  2965 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1c to:xxx.xxx.xxx.xxx:50912-50927
    9   632 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1c to:xxx.xxx.xxx.xxx:50912-50927
    1    84 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1d to:xxx.xxx.xxx.xxx:55008-55023
   45  2700 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1d to:xxx.xxx.xxx.xxx:55008-55023
   10   671 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1d to:xxx.xxx.xxx.xxx:55008-55023
    1    84 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1e to:xxx.xxx.xxx.xxx:59104-59119
   48  2992 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1e to:xxx.xxx.xxx.xxx:59104-59119
   15  1003 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1e to:xxx.xxx.xxx.xxx:59104-59119
    1    84 SNAT       icmp --  any    map-wan_map  anywhere             anywhere             mark match 0x1f to:xxx.xxx.xxx.xxx:63200-63215
   38  2280 SNAT       tcp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1f to:xxx.xxx.xxx.xxx:63200-63215
    9   615 SNAT       udp  --  any    map-wan_map  anywhere             anywhere             mark match 0x1f to:xxx.xxx.xxx.xxx:63200-63215

Chain postrouting_lan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain postrouting_rule (0 references)
 pkts bytes target     prot opt in     out     source               destination

Chain postrouting_wan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_lan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_rule (0 references)
 pkts bytes target     prot opt in     out     source               destination

Chain prerouting_wan_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain zone_lan_postrouting (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 postrouting_lan_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom lan postrouting rule chain */

Chain zone_lan_prerouting (0 references)
 pkts bytes target     prot opt in     out     source               destination
  389 44358 prerouting_lan_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom lan prerouting rule chain */

Chain zone_wan_postrouting (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 postrouting_wan_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom wan postrouting rule chain */
    0     0 MASQUERADE  all  --  any    any     anywhere             anywhere             /* !fw3 */

Chain zone_wan_prerouting (0 references)
 pkts bytes target     prot opt in     out     source               destination
    6   786 prerouting_wan_rule  all  --  any    any     anywhere             anywhere             /* !fw3: Custom wan prerouting rule chain */
root@nanopi:~#

Windows Serverでドメインの所属しているはずなのにドメインユーザでログインできない

$
0
0

Windows Server でドメインに所属しているはずなのにドメインユーザでログインできない場合は、まずはローカル管理者でログイン

PowerShellを起動して「Test-ComputerSecureChannel」を実行

ここで「False」と出る場合、修正する必要があります。

「Test-ComputerSecureChannel -Repair」を実行します。

結果が「True」と出れば、修正が完了しました。

再度、「Test-ComputerSecureChannel」を実行して、今度は「True」という結果になっていることを確認します

FortiGate環境で”This Connection is Invalid. SSL certificate expired.”を食らった

$
0
0

会社からアクセスしてみたようとしたら「This Connection is Invalid. SSL certificate expired.」というエラーがでてアクセスできなかった。

最初、サーバ側の問題なのかと思って調査を開始したところletsencrypt.orgにアクセスした場合にも同じエラーが・・・

さすがにこれはおかしいな、とスマホからLTE回線で確認してみたらどちらもアクセス可能。

これは???と思ってよくよくエラー内容を見直してみる…

FortiNetのアイコンじゃん

というわけで対処方法がFortiNetのページにありました「Fortinet and Expiring Let’s Encrypt Certificates

上記記載の内容を下記に引用する。

Workaround 1 – Prevent fallback to the expired Root CA

With the removal of the expired IdenTrust DST Root CA X3 in Certificate Bundle version 1.28, it is possible to prevent fallback to the expired root CA by blocking FortiGate access to apps.identrust.com, resulting in the correct root CA being used. This can be achieved by using either DNS blackholing or via an FQDN policy to block access to apps.identrust.com.

This will force the FortiGate device to rebuild the certificate chain and find the ISRC Root X1 Root CA Cert in the local certificate in the store.

config system dns-database
    edit "1"
        set domain "identrust.com"
        config dns-entry
            edit 1
                set hostname "apps"
                set ip 127.0.0.1
            next
        end
    next
end

Workaround 2 – Accept the expired certificates

For third-party sites outside of your control, customers can turn off this certificate expiration validation using the following CLI as a temporary workaround:

config firewall ssl-ssh-profile
  edit "certificate-inspection"
    config https
      set expired-server-cert allow 
      set untrusted-server-cert allow
end

FortiGateのコマンドで、期限切れとなっている証明書の取り扱い手法を変える、というものになっている。

今後のFortiGateの新firmwareで、もうちょっとスマートな回避方法の提供を計画しているとのこと。


単体ESXi環境でWindows 11仮想マシンを作る

$
0
0

Windows 11ではTPMが必須要件となる。

TPM無い場合、下記の様に表示されインストールが行えない。

vSphere 6.7 / vSphere 7.0環境では「仮想 Trusted Platform Module を使用する仮想マシンの保護」にあるようにvCenterの管轄下に置くことでESXiサーバ間での暗号化情報をやりとりできるようにした上でvTPMの設定を行うことができる。

しかし、ESXi単体の場合、vTPMの設定を行うことができない。

これを回避するためには、TPMがなくてもWindows 11をインストールできるように細工する必要がある。

とはいってもWindows 11のインストールISO/USBを修正する必要なく、普通にISO/USBから起動してから回避方法を実行することができる。

上記の画面やエディション選択などに来たら、Shiftキーを押しながらF10キーを押す(Shift+F10)、とコマンドプロンプトが開く。

コマンドプロンプトで「regedit」と入力し、レジストリエディッタを開く

「HKEY_LOCAL_MACHINE\SYSTEM\Setup」に、新規キー「LabConfig」を作成

その中に新規DWORD「BypassTPMCheck」を作成し、値を「1」とします。

また、SecureBoot非対応環境の場合は「BypassSecureBootCheck」を「1」、メモリの最低容量チェックを飛ばす場合は「BypassRAMCheck」を「1」とします。

設定後はレジストリエディッタを閉じて、あとは普通にインストールします。

また、マイクロソフトアカウントではなく、ローカルアカウントで設定したい場合、

「Homeエディション」の場合は、ネットワーク接続をしない状態で設定する必要があります。

上記の状態まで来たら、ネットワークケーブルを外してから、「←」で戻ると、下記のローカルユーザ名入力画面となります。

なお、パスワードは未入力で進めると、電源ON後、パスワード入力無しでデスクトップ画面が表示されます。

「Proエディション」の場合は、下記で「職場または学校用に設定する」を選択

「サインインオプション」を選択

「代わりにドメインに参加する」を選択

これで下記のローカルユーザ名入力画面となります。

Proでもパスワードは未入力で進めると、電源ON後、パスワード入力無しでデスクトップ画面が表示されます。

NetAppでファイルのアクセス監査ログを取る

$
0
0

ファイルサーバで、誰かがエクスプローラーの誤操作で変なところにファイルを移動させてしまうことがある。

その時に、アクセス監査ログから誰が移動(削除)操作を行ったかなどを特定できないか、ということで、NetAppのStorage VMに対するアクセス監査の設定を行った。

CIFSアクセスとNFS v4アクセスで利用できる。

公式ドキュメント:SVMでのNASイベントの監査

まずは監査ログの出力先ディレクトリを作成する。これは設定するStorage VM配下のボリュームのどこかに作成する。

今回はvolume:testvolの中に「audit」というディレクトリを作成した。

Storage VMへの監査有効化は「vserver audit create -vserver SVM名 -destination /出力先ディレクトリ」で行う。

ontap98::> vserver audit show
This table is currently empty.

ontap98::> vserver audit create -vserver share225 -destination /testvol/audit

ontap98::>

設定されたことを確認する。

ontap98::> vserver audit show
Vserver     State  Event Types        Log Format Target Directory
----------- ------ ------------------ ---------- ----------------------------
share225    false  file-ops,          evtx       /testvol/audit
                   cifs-logon-logoff,
                   audit-policy-
                   change

ontap98::> vserver audit show -ins

                           Vserver: share225
                    Auditing State: false
              Log Destination Path: /testvol/audit
     Categories of Events to Audit: file-ops, cifs-logon-logoff,
                                    audit-policy-change
                        Log Format: evtx
               Log File Size Limit: 100MB
      Log Rotation Schedule: Month: -
Log Rotation Schedule: Day of Week: -
        Log Rotation Schedule: Day: -
       Log Rotation Schedule: Hour: -
     Log Rotation Schedule: Minute: -
                Rotation Schedules: -
          Log Files Rotation Limit: 0
            Log Retention Duration: 0s

ontap98::>

次にディレクトリに監査を設定する。

CIFSの場合

volume:testvolの中にある「test1」というディレクトリに設定を行うため、プロパティから「詳細設定」を選択

「監査」タブで設定を行う

今回はファイルやディレクトリの削除について記録したいので、「プリンシパル」を「Everyone」と指定し、「高度なアクセス許可」で「サブフォルダーとファイルの削除」と「削除」で設定します。

下記のような表示になります。

これで設定は完了です。

該当するファイルアクセスを行うと、指定したディレクトリ内に「audit_<vserver名>_last.evtx」というファイルにログが出力されていきます。

上記は毎日2:00にファイルをローテートする設定を追加しているので複数のファイルが存在しています。

ちなみに設定は下記の様に行いました。(-rotate-limit 3で設定しているのでファイルが日時入りのファイルが3つある)

ontap98::> vserver audit modify -vserver share225 -rotate-schedule-month all -rotate-schedule-dayofweek all -rotate-schedule-hour 2 -rotate-schedule-minute 0 -rotate-limit 3 -rotate-size 1M

ontap98::> vserver audit show -ins

                           Vserver: share225
                    Auditing State: true
              Log Destination Path: /testvol/audit
     Categories of Events to Audit: file-ops
                        Log Format: evtx
               Log File Size Limit: 1MB
      Log Rotation Schedule: Month: January-December
Log Rotation Schedule: Day of Week: Sunday-Saturday
        Log Rotation Schedule: Day: -
       Log Rotation Schedule: Hour: 2
     Log Rotation Schedule: Minute: 0
                Rotation Schedules: @2:00
          Log Files Rotation Limit: 3
            Log Retention Duration: 0s

ontap98::>

(1回設定した値を消すには 「-rotate-schedule-dayofweek -」などを行う)

で、どんなログが出るか、というあたりですが、ファイルを削除した場合には、イベントID:4656とイベントID:9999が出力されました。

イベントIDの詳細については「監査できるSMBイベント」を参照のこと…ただ、載ってないのもあるんですよね…

NFSv4の場合

NFS v4の場合はLinux上から nfs4_getfacl, nfs4_setfaclコマンドを使って設定する。

NFS v4でマウントして、「test3」というディレクトリのACLを確認

[root@linux mnt]# nfs4_getfacl test3/

# file: test3/
A::OWNER@:rwaDxtTnNcCy
A:g:GROUP@:rxtncy
A::EVERYONE@:rxtncy
[root@linux mnt]#

上記には「U:」で始まるものがありません。

ファイルとディレクトリに関して成功した操作→「fdS」
対象は全ユーザ→「EVERYONE@」
ACLの変更と削除に関して記録→「Cd」

ということを行いたい場合は「nfs4_setfacl -R -a U:fdS:EVERYONE@:Cd 対象ディレクトリ」と実行します。

[root@linux mnt]# nfs4_setfacl -R -a U:fdS:EVERYONE@:Cd test3
[root@linux mnt]# nfs4_getfacl test3/

# file: test3/
A::OWNER@:rwaDxtTnNcCy
A:g:GROUP@:rxtncy
A::EVERYONE@:rxtncy
U:fdS:EVERYONE@:dC
[root@linux mnt]#

で、ファイルを削除した場合、イベントID:4663 とイベントID:4658 が記録されました。

NFSで監査できるイベントについては「監査できるNFSファイルおよびディレクトリのアクセス イベント」に記載があるのですが、evtx出力した時にどういうイベントIDになるのか、という対応表はないようです。

また、どちらの場合でも、下記の様なエラーっぽいものが表示されています。この説明が見つかりませんは仕様で回避方法は無いようです。

ソース "NetApp-Security-Auditing" からのイベント ID 4658 の説明が見つかりません。このイベントを発生させるコンポーネントがローカル コンピューターにインストールされていないか、インストールが壊れています。ローカル コンピューターにコンポーネントをインストールするか、コンポーネントを修復してください。

イベントが別のコンピューターから発生している場合、イベントと共に表示情報を保存する必要があります。

イベントには次の情報が含まれています: 

172.17.44.87
EV_RenderedValue_2.00
false
Not Present
Not Present
Security
File
00000000000406;00;0000064f;046d016e
(nfsshare);/test3/test2.txt

メッセージ リソースは存在しますが、メッセージがメッセージ テーブルに見つかりませんでした。
The description for Event ID 4658 from source NetApp-Security-Auditing cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

172.17.44.87
EV_RenderedValue_2.00
false
Not Present
Not Present
Security
File
00000000000406;00;0000064f;046d016e
(nfsshare);/test3/test2.txt

日本語メッセージリソースがないことが原因なのかと考え、英語UIに替えてみても表示は同じでした。

NetApp KB「The description for Event ID cannot be found in the EVTX logs generated by clustered Data ONTAP」があるので解決できるのかと思ったのですが、無理そうです。

Oracle Linux 8でリリースバージョン固定する方法

$
0
0

Oralce Linux 8.2で導入したい、という要請があった。

Oralce Linux 8.2メディアでインストールすればいい、とは言うものの、パッケージが足らない時にうっかり「dnf install xxxx」とかやってしまうと新しいバージョンを入れてしまう可能性が・・・

有限会社ルートリンクス「RHEL 8 リリースバージョンを指定してアップデート」という記事を見つけて試してみたが、なんか無視されて新しいバージョンを引っ張ってる気がする・・・RHEL8なら有効なのかな?

Oracle Linux 8のドキュメントを探してみる・・・

参考ドキュメント:Oracle® Linux 8 Oracle Linuxでのソフトウェアの管理の「第1章 Yum DNF

固定手法について直接の記述はないが「1.8 ISOイメージを使用したローカルYumリポジトリの作成」というものがあり、ISOイメージをメインレポジトリとして設定し、それ以外を無効化する、という手法が書かれている。

この手法をそのまま使えば、配置したISOのバージョンで固定できる。

8.2で提供された更新だけ適用できないかな?というもくろみもあって、ISOイメージを使わないで実現する手法がないか試してみた。

なお、結論としては無償でできる範囲には無いようだった。

2.1.2 ULNチャネルについて」の説明を読むとOracleのULNサブスクリプション購読者は「ol8_arch_u?_baseos_patch」というレポジトリでBaseOSに関してはリリースごとのパッチが適用できるようだ。AppStreamについては特に定義されていないようだ。


ここから参考記録

ISOメディアを使わず、ULNサブスクリプションも登録しない状態で何かできるかを試してみたものが、下記の記述となる。

[root@oraclelinux ~]# dnf repolist --all
repo id               repo name                                         status
ol8_UEKR6             Latest Unbreakable Enterprise Kernel Release 6 fo enabled
ol8_UEKR6_RDMA        Oracle Linux 8 UEK6 RDMA (x86_64)                 disabled
ol8_addons            Oracle Linux 8 Addons (x86_64)                    disabled
ol8_appstream         Oracle Linux 8 Application Stream (x86_64)        enabled
ol8_baseos_latest     Oracle Linux 8 BaseOS Latest (x86_64)             enabled
ol8_codeready_builder Oracle Linux 8 CodeReady Builder (x86_64) - Unsup disabled
ol8_u0_baseos_base    Oracle Linux 8 BaseOS GA (x86_64)                 disabled
ol8_u1_baseos_base    Oracle Linux 8.1 BaseOS (x86_64)                  disabled
ol8_u2_baseos_base    Oracle Linux 8.2 BaseOS (x86_64)                  disabled
[root@oraclelinux ~]#

レポジトリリストを見てみたところ「Oracle Linux 8.2 BaseOS (x86_64)」などというそれっぽいものがあるので、ISOイメージの手法にならってまずは「dnf config-manager –disable *」を実行して全レポジトリを無効化

[root@oraclelinux ~]# dnf config-manager --disable \*
[root@oraclelinux ~]# dnf repolist --all
repo id               repo name                                         status
ol8_UEKR6             Latest Unbreakable Enterprise Kernel Release 6 fo disabled
ol8_UEKR6_RDMA        Oracle Linux 8 UEK6 RDMA (x86_64)                 disabled
ol8_addons            Oracle Linux 8 Addons (x86_64)                    disabled
ol8_appstream         Oracle Linux 8 Application Stream (x86_64)        disabled
ol8_baseos_latest     Oracle Linux 8 BaseOS Latest (x86_64)             disabled
ol8_codeready_builder Oracle Linux 8 CodeReady Builder (x86_64) - Unsup disabled
ol8_u0_baseos_base    Oracle Linux 8 BaseOS GA (x86_64)                 disabled
ol8_u1_baseos_base    Oracle Linux 8.1 BaseOS (x86_64)                  disabled
ol8_u2_baseos_base    Oracle Linux 8.2 BaseOS (x86_64)                  disabled
[root@oraclelinux ~]#

続いてOracle Linux 8.2で固定したいので、「ol8_u2_baseos_base」だけを有効化するために「dnf config-manager –enable ol8_u2_baseos_base」を実行

[root@oraclelinux ~]# 
[root@oraclelinux ~]# dnf repolist --all
repo id               repo name                                         status
ol8_UEKR6             Latest Unbreakable Enterprise Kernel Release 6 fo disabled
ol8_UEKR6_RDMA        Oracle Linux 8 UEK6 RDMA (x86_64)                 disabled
ol8_addons            Oracle Linux 8 Addons (x86_64)                    disabled
ol8_appstream         Oracle Linux 8 Application Stream (x86_64)        disabled
ol8_baseos_latest     Oracle Linux 8 BaseOS Latest (x86_64)             disabled
ol8_codeready_builder Oracle Linux 8 CodeReady Builder (x86_64) - Unsup disabled
ol8_u0_baseos_base    Oracle Linux 8 BaseOS GA (x86_64)                 disabled
ol8_u1_baseos_base    Oracle Linux 8.1 BaseOS (x86_64)                  disabled
ol8_u2_baseos_base    Oracle Linux 8.2 BaseOS (x86_64)                  enabled
[root@oraclelinux ~]#

この状態で「dnf check-update」を実行してみる。

[root@oraclelinux ~]# dnf clean all
23 files removed
[root@oraclelinux ~]# dnf check-update
Oracle Linux 8.2 BaseOS (x86_64)                 10 MB/s | 3.3 MB     00:00
Last metadata expiration check: 0:00:01 ago on Wed Oct 20 19:01:10 2021.
[root@oraclelinux ~]#

アップデートは取りに行かない。

が・・・phpをインストールしようとしたら見つからない・・・

[root@oraclelinux ~]# dnf module list
Last metadata expiration check: 0:08:47 ago on Wed Oct 20 19:01:10 2021.
@modulefailsafe
Name                     Stream        Profiles         Summary
satellite-5-client       1.0 [e]       common, gui      ULN client packages

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
[root@oraclelinux ~]# dnf search php
Last metadata expiration check: 0:09:10 ago on Wed Oct 20 19:01:10 2021.
No matches found.
[root@oraclelinux ~]#

phpはAppStreamレポジトリに含まれるものであるため、BaseOSしか登録していない現状では表示されません。

この他、AppStreamに含まれるパッケージで必要なものがいろいろあるため、この手法を取るには無理がある、という形となった。

では、RHEL8みたいにreleaseverという指定ができるか、というところについて /etc/yum.repos.d/oracle-linux-ol8.repo の内容を確認すると、$releasever という定義が使われてない。

[root@oraclelinux ~]# cat /etc/yum.repos.d/oracle-linux-ol8.repo
[ol8_baseos_latest]
name=Oracle Linux 8 BaseOS Latest ($basearch)
baseurl=https://yum$ociregion.oracle.com/repo/OracleLinux/OL8/baseos/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0
[ol8_appstream]
name=Oracle Linux 8 Application Stream ($basearch)
baseurl=https://yum$ociregion.oracle.com/repo/OracleLinux/OL8/appstream/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0
[ol8_codeready_builder]
name=Oracle Linux 8 CodeReady Builder ($basearch) - Unsupported
baseurl=https://yum$ociregion.oracle.com/repo/OracleLinux/OL8/codeready/builder/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0
[ol8_u0_baseos_base]
name=Oracle Linux 8 BaseOS GA ($basearch)
baseurl=https://yum$ociregion.oracle.com/repo/OracleLinux/OL8/0/baseos/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0
[ol8_u1_baseos_base]
name=Oracle Linux 8.1 BaseOS ($basearch)
baseurl=https://yum$ociregion.oracle.com/repo/OracleLinux/OL8/1/baseos/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0
[ol8_u2_baseos_base]
name=Oracle Linux 8.2 BaseOS ($basearch)
baseurl=https://yum$ociregion.oracle.com/repo/OracleLinux/OL8/2/baseos/base/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
[ol8_addons]
name=Oracle Linux 8 Addons ($basearch)
baseurl=https://yum$ociregion.oracle.com/repo/OracleLinux/OL8/addons/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=0
[root@oraclelinux ~]#

yum.oracle.com にあるOracle Linux 8 RepositoriesでもAppStreamは1種類しか紹介されていない。Base OSアップデートされたパッケージについてはbaseos latest、AppStreamのアップデートされたパッケージはappstreamに配置されていた。

というわけで、Oracle Linux 8において、バージョン固定にする方法は、おとなしく 「1.8 ISOイメージを使用したローカルYumリポジトリの作成」 をつかっとけ、という話になるようだ。

NetApp ONTAP 9.xの設定取得用TeraTermマクロ

$
0
0

NetApp ONTAP 9.1環境から9.8環境に移行する案件があったので、現状の設定とステータスをだいたい取れるようなTera Termマクロを作ったので公開

githubにも置いた https://github.com/osakanataro/get-ontap-config


sendln 'rows 0'
wait '::> '
sendln 'date'
wait '::> '


;基本設定系
;システム構成
sendln 'vserver show'
wait '::> '

sendln 'vserver show -ins'
wait '::> '
sendln 'system node show'
wait '::> '
sendln 'system node show -ins'
wait '::> '
sendln 'options'
wait '::> '
sendln 'system license show'
wait '::> '
sendln 'system license show -ins'
wait '::> '
sendln 'system snmp show'
wait '::> '
sendln 'system node autosupport show'
wait '::> '
sendln 'system node autosupport show -ins'
wait '::> '
sendln 'system node autosupport history show'
wait '::> '
sendln 'cluster time-service ntp server show'
wait '::> '
sendln 'timezone'
wait '::> '
sendln 'system service-processor show'
wait '::> '
sendln 'system service-processor network show'
wait '::> '

;ネットワーク関連	
sendln 'network interface show'
wait '::> '
sendln 'network interface show -ins'
wait '::> '
sendln 'network interface show -failover'
wait '::> '
sendln 'network interface failover-groups show'
wait '::> '

sendln 'network port show'
wait '::> '
sendln 'network port show -ins'
wait '::> '
sendln 'network port ifgrp show'
wait '::> '
sendln 'network port ifgrp show -ins'
wait '::> '

sendln 'network ipspace show'
wait '::> '
sendln 'network port broadcast-domain show'
wait '::> '



sendln 'vserver services name-service ns-switch show'
wait '::> '
sendln 'vserver services name-service dns hosts show'
wait '::> '
sendln 'vserver services name-service dns hosts show -ins'
wait '::> '
sendln 'security login show'
wait '::> '
sendln 'security login show -ins'
wait '::> '

;名前解決関連	
sendln 'vserver services name-service dns show'
wait '::> '
sendln 'vserver services name-service nis-domain show'
wait '::> '

;ディスク構成	
sendln 'storage disk show'
wait '::> '
sendln 'storage disk show -ins'
wait '::> '
sendln 'storage disk show -partition-ownership'
wait '::> '

sendln 'df'
wait '::> '
sendln 'df -h'
wait '::> '
sendln 'df -A -h'
wait '::> '
sendln 'df -i'
wait '::> '

sendln 'storage aggregate show'
wait '::> '
sendln 'storage aggregate show -ins'
wait '::> '
sendln 'storage aggregate show-spare-disks'
wait '::> '

sendln 'volume show'
wait '::> '
sendln 'volume show -ins'
wait '::> '
sendln 'volume language'
wait '::> '
sendln 'volume show -fields junction-path,snapshot-policy,policy'
wait '::> '

sendln 'volume efficiency show'
wait '::> '
sendln 'volume efficiency policy show'
wait '::> '


;ファイル共有(NFS/CIFS)	
sendln 'vserver cifs show'
wait '::> '
sendln 'vserver cifs show -ins'
wait '::> '
sendln 'vserver cifs share show'
wait '::> '
sendln 'vserver cifs share show -ins'
wait '::> '
sendln 'vserver cifs share access-control show'
wait '::> '
sendln 'vserver cifs share access-control show -ins'
wait '::> '
sendln 'vserver nfs show'
wait '::> '
sendln 'vserver nfs show -ins'
wait '::> '
sendln 'vserver export-policy show'
wait '::> '
sendln 'vserver export-policy show -ins'
wait '::> '
sendln 'vserver export-policy rule show'
wait '::> '
sendln 'vserver export-policy rule show -ins'
wait '::> '
sendln 'volume qtree show'
wait '::> '
sendln 'volume qtree show -ins'
wait '::> '
sendln 'volume quota show'
wait '::> '
sendln 'volume quota show -ins'
wait '::> '
sendln 'volume quota policy show'
wait '::> '
sendln 'volume quota policy show -ins'
wait '::> '
sendln 'volume quota policy rule show'
wait '::> '
sendln 'volume quota policy rule show -ins'
wait '::> '
sendln 'volume quota report'
wait '::> '

;Snapshot運用	
sendln 'volume snapshot show'
wait '::> '
sendln 'volume snapshot policy show'
wait '::> '
sendln 'volume snapshot autodelete show'
wait '::> '
sendln 'volume show -fields snapshot-policy,policy'
wait '::> '
sendln 'volume show -fields percent-snapshot-space'
wait '::> '
sendln 'volume show -fields sched-snap-name'
wait '::> '

;Snapmirror	
sendln 'snapmirror show'
wait '::> '
sendln 'snapmirror show -ins'
wait '::> '
sendln 'snapmirror show-history'
wait '::> '
sendln 'snapmirror show-history -ins'
wait '::> '

;ストレージ間通信	
sendln 'storage shelf show'
wait '::> '
sendln 'storage shelf acp show'
wait '::> '

;クラスタ設定	
sendln 'cluster show'
wait '::> '
sendln 'cluster show -ins'
wait '::> '
sendln 'cluster peer show'
wait '::> '

sendln 'vserver peer show'
wait '::> '
sendln 'vserver peer show -ins'
wait '::> '

ONTAPでS3互換ストレージを提供する

$
0
0

ONTAP 9.7でTechnical Previewとして導入されたS3互換オブジェクトストレージ機能(【 2020年1月GA版リリース】ONTAP 9.7アップデート情報)は、ONTAP 9.8から正式提供となった(ONTAP 9でのS3のサポートについて)。

ただ、普通に提供されるライセンスコード一覧にはS3ライセンスが含まれていない

ONTAPシミュレータ9.8で提供されるライセンスにもS3ライセンスは含まれていない。

しかし、確認してみると、NetApp Supportページにある「Master License Keys」ページから「ONTAP S3」ライセンスが取得出来るらしい。

手続きを進めてみると、こんな感じでライセンスキーが表示された。

機種などが制限されていないようなので、ONTAPシミュレータ環境にライセンスを入れてみたところ、問題無く認識された。

ONTAP 9の[オブジェクトストレージのプロビジョニング]-[S3構成パワー ガイド]に従い設定を実施。

ただマニュアル上はCLIでしか設定できないような記載がされてるのだが、ONTAP 9.8 System Managerから設定ができそう

[ストレージ]-[バケット]にそれっぽい項目があったり

[ストレージ]-[Storage VM]の設定画面に「S3」が見える。

S3の設定を行ってみる。

「S3サーバ名」は、S3互換としてアクセスする場合に指定するホスト名を設定(DNS解決できるように設定しておくこと)

今回は既存のNFS/CIFS用に設定しているIPアドレス(LIF)に相乗りしてS3サービスを提供します。

作成すると、下記の表示があります。

標準で「sm_s3_user」というユーザが作成され、S3互換接続のアカウント設定で使用する「アクセスキー」と「シークレットキー」が表示されます。

シークレットキーはこの画面を閉じたら再確認する方法がなくなるので必ず記録しておきます。(失った場合はアクセスキー/シークレットキーの再発行が必要です)

これでSVMのサービス一覧でS3のステータスが有効となります。

標準で作られたsm_s3_userではなく、別のユーザを作る場合は[ストレージ]-[Storage VM]で「S3設定」を開きます

ここでユーザの追加を行います。

S3互換アクセスに使う「アクセスキー」と「シークレットキー」が表示されるので記録します。

次にユーザに権限を与えるためにグループを作成します。

ちょっと表示がわかりにくいですが、「名前」を入力したあと、「USERS」をクリックするとユーザ一覧が表示されますので、作成したユーザを選択します。

同様に「POLICIES」を選択するとポリシー一覧が表示されますので、FullAccessを選択します。

これでグループの作成が終わりました。

次に「バケット(bucket)」を作成します。[ストレージ]-[バケット]を表示します。

[追加]からバケットを作成します。なお、指定可能な最小容量は95GBです。

保存すると下記の様に一覧に表示されるようになります。

ちなみにこれを作成するとGUIの[ストレージ]-[ボリューム]には表示されない「ボリューム名:fg_oss_~」というものが追加されています。

ontap98::> volume show
Vserver   Volume       Aggregate    State      Type       Size  Available Used%
--------- ------------ ------------ ---------- ---- ---------- ---------- -----
ontap98   MDV_aud_6e2de4f0a96c4edbbf4c751a3f4626cc aggr0_ontap98_01 online RW 2GB 1.90GB  0%
ontap98   MDV_aud_b39196a1f11940519b4238a511f7c93d ontap98_01_FC_1 online RW 2GB 1.90GB  0%
ontap98-01 vol0        aggr0_ontap98_01 online RW       7.11GB     2.03GB   69%
share225  fg_oss_1635381690 -       online     RW      421.1GB    210.6GB    0%
share225  nfsshare     ontap98_01_FC_1 online  RW       5.26GB     5.00GB    0%
share225  share225_root ontap98_01_FC_1 online RW         20MB    17.50MB    7%
share225  share226_dr  ontap98_01_FC_1 online  DP        100GB   100.00GB    0%
share225  testvol      ontap98_01_FC_1 online  RW      105.3GB    99.99GB    0%
share228  share227_root ontap98_01_FC_1 online RW         20MB    17.57MB    7%
9 entries were displayed.

ontap98::>

95GBと指定しているのに400GBを取っている、とか、そのくせaggregateの空き容量は減っていないとかいろいろアレな感じではあります。

作成しただけでは先ほど作成したユーザのアクセス権限がついていないので[ストレージ]-[バケット]で作成したバケットを選択し「権限」タブで設定していきます。

[編集]ボタンをクリックすると下記の画面が開きます。

[権限]にて「追加」をクリック

初期の「ListBucket」のみだとオブジェクト一覧のみが表示出来ます。選択できるものを全て選択します。

これでバケットを保存します。

そうすると[権限]タブが下記の様になっています。

これで、S3互換アクセスが可能な状態となりました。

アクセス検証には「S3 Browser」というWindowsアプリを使用しました。

アカウント設定は下記の様に行います

Account Type: S3 Compatible Storage
REST Endpoint: Storage VMのS3設定にある「S3サーバ名」で指定したもの
Access Key ID: 作成したユーザのアクセスキー
Secret Access Key: 作成したユーザの シークレットキー
Use secure transfer (SSL/TLS)にチェックを入れる

ここまで設定したら「Advanced S3-compatible storage settings」をクリックします。

Signature versionを「Singnature V4」に設定します。(2021/10/28時点の初期値はSingnature V2でした)

これで保存するとS3 Browser上にバケットが表示され、使える様になります。

なお、S3 BrowserでSingnature V4に設定する必要がある、というのは storageexorcist「NetApp ONTAP 9.8 – S3 is GA!」の記事を見て知りました。

知ったあとに「TR-4814: S3 in ONTAP Best Practices」を見直してみたところ「Security」の項目に記載がありました。

Signature Version 4
S3 in ONTAP requires the use of Signature Version 4 (v4 signatures).
Note: Using v2 signatures result in a failure to connect. It is important to be aware of this because many client applications, including commonly used S3 browsers, use v2 signatures by default.
Configure client applications to use v4 signatures to avoid connectivity errors.

Viewing all 1106 articles
Browse latest View live