NetApp ONTAP simulator 9.7がROOT VOLUME NOT WORKING PROPERLY: RECOVERY REQUIREDで起動する

NetApp ONTAP simulator 9.7をESXi上で動かしていたのだが、瞬電で死んだ。

再起動してみると、起動はするのだが「ROOT VOLUME NOT WORKING PROPERLY: RECOVERY REQUIRED」というメッセージでサービスが動作しない状態となっていた。

調べるとNetAppフォーラムに「Root volume is damaged」というのを発見。

ここでは、BOOTLOADERの環境変数で「bootarg.init.boot_recovery」が設定されているから、それを削除すれば大丈夫、とある。

しかし、確認してみると、そんな環境変数は設定されていない。

うーん、と同じ記事の次のページを開いてみると環境変数「bootarg.rdb_corrupt」を削除、という話が出てきた。

この環境変数ならあった。

「unsetenv bootarg.rdb_corrupt」を実行して、再起動することで正常に動作するようになった。

なお、bootarg.rdb_corruptがそもそも設定されていないけどおかしい場合は、vol0がsnapshotで埋まってしまっている場合が考えられる。

その際の対処方法については「ONTAP 9.7シミュレータをアップデートする手法」の「トラブル事例」に記載してある。

また、これらの対処を行って再起動してもまた「ROOT VOLUME NOT WORKING PROPERLY: RECOVERY REQUIRED」となる場合がある。
この場合はおそらくvol0領域が小さいためなので、vol0を拡張した上で、ONTAP再起動をかけ、BOOT> で止めて「unsetenv bootarg.rdb_corrupt」を実行して再起動することで対応できます。

NFSv4でマウントするとrootがnobodyになる

NetApp ONTAP 9.7ファイルサーバを作る時にNFS v3.0/v4.0/v4.1を有効にして、CentOS7からNFSマウントしてみた。

[root@centos7 ~]# mount 172.17.44.108:/ /mnt
[root@centos7 ~]# ls -l /mnt
合計 4
drwxr-xr-x. 11 nobody nobody 4096  8月 31 16:07 testvol
[root@centos7 ~]# ls -l /mnt/testvol/
合計 36
drwxrwxrwx. 2 nobody nobody 4096  8月 31 16:07 ntfs-test1
drwxrwxrwx. 4 nobody nobody 4096  7月 17 14:08 test
drwxr-xr-x. 3 nobody nobody 4096  8月 28 15:59 test1
drwxr-xr-x. 2 nobody nobody 4096  7月 17 14:08 test2
drwxr-xr-x. 2 nobody nobody 4096  8月 28 15:16 test3
drwxr-xr-x. 2 nobody nobody 4096  8月 28 15:16 test4
drwxr-xr-x. 2 nobody nobody 4096  8月 28 15:16 test5
drwxr-xr-x. 2 nobody nobody 4096  8月 28 15:08 testtere
drwxr-xr-x. 2 nobody nobody 4096  7月 31 17:46 testvm
[root@centos7 ~]# cat /proc/mounts |grep mnt
172.17.44.108:/ /mnt nfs4 rw,relatime,vers=4.1,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.17.44.103,local_lock=none,addr=172.17.44.108 0 0
172.17.44.108:/testvol /mnt/testvol nfs4 rw,relatime,vers=4.1,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.17.44.103,local_lock=none,addr=172.17.44.108 0 0
[root@centos7 ~]#

rootユーザで作成したはずの所有者が「nobody / nobody」で表示されている。

この時、/var/log/messages には以下のログが出ていた。

Aug 31 17:13:54 centos7 kernel: FS-Cache: Loaded
Aug 31 17:13:54 centos7 kernel: FS-Cache: Netfs 'nfs' registered for caching
Aug 31 17:13:54 centos7 kernel: Key type dns_resolver registered
Aug 31 17:13:55 centos7 kernel: NFS: Registering the id_resolver key type
Aug 31 17:13:55 centos7 kernel: Key type id_resolver registered
Aug 31 17:13:55 centos7 kernel: Key type id_legacy registered
Aug 31 17:13:55 centos7 nfsidmap[1748]: nss_getpwnam: name 'root@defaultv4iddomain.com' does not map into domain 'adosakana.local'
Aug 31 17:13:55 centos7 nfsidmap[1750]: nss_name_to_gid: name 'root@defaultv4iddomain.com' does not map into domain 'adosakana.local'
Aug 31 17:13:55 centos7 kernel: nfs4filelayout_init: NFSv4 File Layout Driver Registering...

関連する用語は「idmapd」

RedHat NFSv4 マウントで、すべてのファイルの所有者が nobody:nobody と誤って表示される
SUSE NFS4 mount shows all ownership as “nobody” or 4294967294
Solaris10 nfsmapid デーモン でNFS v4マウント時のいろいろについて詳細解説されている
Solaris11 nfsmapidデーモン

上記資料だとNFSサーバとして動作させる話も入っている。

CentOS7でNFSクライアントとして使う場合に気にする必要があるのは、/etc/idmapd.conf の「[General]」セクションに「Domain = NFS V4 IDドメイン」の設定を行う、ということのみ。

rpcidmapd.service / nfs-idmapd.service / nfs-idmap.service の起動状態について気にする必要は無く、ただたんに/etc/idmapd.conf を編集してからマウントすればOKだった。

ただし、試した限りでは、一度NFS v4でマウントし、nobodyとして認識されてしまうとキャッシュか何かが残っているようで、OS再起動する必要があった。

Linuxの場合、nfsidmapコマンドを実行すると現状認識しているドメイン名の確認ができ、また、キャッシュの削除を行うことができた。

現状のNFS v4デフォルトドメイン確認が「nfsidmap -d」で、キャシュクリアが「nfsidmap -c」となる。

# nfsidmap -d
adosakana.local
# nfsidmap -c
#

今回は、NetAppのデフォルトNFS V4 IDドメイン「defaultv4iddomain.com」を使用しているので、/etc/idmapd.conf には「Domain = defaultv4iddomain.com」と設定した

この状態でマウントしてみると下記の様になり、期待通りにrootユーザが認識された。

[root@centos7 ~]# mount 172.17.44.108:/ /mnt
[root@centos7 ~]# ls -l /mnt/
合計 4
drwxr-xr-x. 11 root root 4096  8月 31 16:07 testvol
[root@centos7 ~]# ls -l /mnt/testvol/
合計 36
drwxrwxrwx. 2 root root 4096  8月 31 16:07 ntfs-test1
drwxrwxrwx. 4 root root 4096  7月 17 14:08 test
drwxr-xr-x. 3 root root 4096  8月 28 15:59 test1
drwxr-xr-x. 2 root root 4096  7月 17 14:08 test2
drwxr-xr-x. 2 root root 4096  8月 28 15:16 test3
drwxr-xr-x. 2 root root 4096  8月 28 15:16 test4
drwxr-xr-x. 2 root root 4096  8月 28 15:16 test5
drwxr-xr-x. 2 root root 4096  8月 28 15:08 testtere
drwxr-xr-x. 2 root root 4096  7月 31 17:46 testvm
[root@centos7 ~]# tail /var/log/messages
Aug 31 17:19:06 centos7 systemd: Created slice User Slice of root.
Aug 31 17:19:06 centos7 systemd-logind: New session 1 of user root.
Aug 31 17:19:06 centos7 systemd: Started Session 1 of user root.
Aug 31 17:19:12 centos7 kernel: FS-Cache: Loaded
Aug 31 17:19:12 centos7 kernel: FS-Cache: Netfs 'nfs' registered for caching
Aug 31 17:19:12 centos7 kernel: Key type dns_resolver registered
Aug 31 17:19:12 centos7 kernel: NFS: Registering the id_resolver key type
Aug 31 17:19:12 centos7 kernel: Key type id_resolver registered
Aug 31 17:19:12 centos7 kernel: Key type id_legacy registered
Aug 31 17:19:12 centos7 kernel: nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[root@centos7 ~]#
[root@centos7 ~]# cat /proc/mounts |grep mnt
172.17.44.108:/ /mnt nfs4 rw,relatime,vers=4.1,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.17.44.103,local_lock=none,addr=172.17.44.108 0 0
172.17.44.108:/testvol /mnt/testvol nfs4 rw,relatime,vers=4.1,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.17.44.103,local_lock=none,addr=172.17.44.108 0 0
[root@centos7 ~]#

lsで該当領域を見た後、キャッシュが残っている間であれば「nfsidmap -l」(小文字L」を実行すると、その時点で使ったユーザ名認識を表示してくれる。

# nfsidmap -l
2 .id_resolver keys found:
  uid:root@adosakana.local
  gid:root@adosakana.local
#

CentOS5をNFSクライアントとしてマウントしてみたところ、CentOS5は「mount -t nfs4 ~」でマウントする必要があること、nfsidmapコマンドは存在しないことがわかりました。


CentOS7環境で、一般ユーザがNFS v3で書くとちゃんとNFSv4側でもユーザが認識されるけど、NFS v4で書くと認識されない、という現象が発生して悩んだ。

# grep /mnt /proc/mounts
172.17.44.82:/sharevol /mnt nfs4 rw,relatime,vers=4.1,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=null,clientaddr=172.17.44.103,local_lock=none,addr=172.17.44.82 0 0
172.17.44.82:/sharevol /mnt2 nfs rw,relatime,vers=3,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=172.17.44.82,mountvers=3,mountport=635,mountproto=udp,local_lock=none,addr=172.17.44.82 0 0
#

いろいろためした結果、上記の/proc/mounts から失敗が読み取れることが分かった。

NFS v4マウント側で「sec=null」となっている!

CentOS7でマウントオプション指定無しでマウントするとこの設定だった。

このため、「-o sec=sys」オプションを指定してマウントしたところ、期待通りに動作になった。

# mount -o sec=sys 172.17.44.82:/sharevol /mnt
# grep /mnt /proc/mounts
172.17.44.82:/sharevol /mnt2 nfs rw,relatime,vers=3,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=172.17.44.82,mountvers=3,mountport=635,mountproto=udp,local_lock=none,addr=172.17.44.82 0 0
172.17.44.82:/sharevol /mnt nfs4 rw,relatime,vers=4.1,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.17.44.103,local_lock=none,addr=172.17.44.82 0 0
#

標準設定でのマウントには注意が必要なようです


Solaris 11クライアントで確認する場合の例

「sharectl get nfs」か「sharectl get -p nfsmapid_domain nfs」でドメイン名を確認できる。

また、「/system/volatile/nfs4_domain」の値にも設定される(NFS Version 4 のドメインを確認する)

(Solaris 11.4側をNFSサーバにしてみた環境だと、”nfsmapid_domain=”は値設定なしだが、/system/volatile/nfs4_domain には値が入っている、という例があった。)

マウント状況は「nfsstat -m」で確認

root@solaris11:~# sharectl get nfs
servers=1024
lockd_listen_backlog=32
lockd_servers=1024
lockd_retransmit_timeout=5
grace_period=90
server_versmin=2
server_versmax=4
client_versmin=2
client_versmax=4
server_delegation=on
nfsmapid_domain=defaultv4iddomain.com
max_connections=-1
protocol=ALL
listen_backlog=32
device=
showmount_info=full
server_authz_cache_refresh=600
netgroup_refresh=600
resvport=false
root@solaris11:~# sharectl get -p nfsmapid_domain nfs
nfsmapid_domain=defaultv4iddomain.com
root@solaris11:~# cat /system/volatile/nfs4_domain
defaultv4iddomain.com
root@solaris11:~# nfsstat -m
/mnt from 172.17.44.226:/
 Flags:         vers=4,proto=tcp,sec=sys,hard,intr,link,symlink,rsize=65536,wsize=65536,retrans=5,timeo=600
 Attr cache:    acregmin=3,acregmax=60,acdirmin=30,acdirmax=60

root@solaris11:~#

vSphere ESXiでNetApp ONTAP9のNFS4.1を使う

NetApp ONTAP 9.7環境にてNFS4.1を有効にして、vSphere ESXi 6.7のNFSデータストアにしてみた。

NetApp ONTAP9側

NFS 4.1有効化

ONTAP 9.7管理画面でNFSを有効にした場合、NFS v3.0のみが有効化されている。

プロトコルの「NFS」から編集を選ぶと以下の様に設定変更ができる。

とりあえず「バージョン4のサポートを有効にする」と「バージョン4.1のサポートを有効にする」にチェックを入れると下記のようになる。

「pNFS」にもチェックが入っている状態になるが、このまま設定する。

設定後のプロトコル表示は下記の様になる。

通常のNFSと同じくエクスポートルールの設定などはちゃんと行うこと。

ONTAPでNFS経由のVAAIを許可するエクスポート ポリシーの設定

NFS vStorage Support有効化

NetAppのStorage VM(SVM)に対してNFS vStorage Support(VAAI連携)を有効化する。

現在値の確認は「vserver nfs show -ins」で「NFS vStorage Support」の値を確認する。

ontap-select-cluster::> vserver nfs show -ins

                                        Vserver: svm0
                             General NFS Access: true
                                         NFS v3: enabled
                                       NFS v4.0: enabled
                                   UDP Protocol: enabled
                                   TCP Protocol: enabled
                           Default Windows User: -
                            NFSv4.0 ACL Support: disabled
                NFSv4.0 Read Delegation Support: disabled
               NFSv4.0 Write Delegation Support: disabled
                        NFSv4 ID Mapping Domain: defaultv4iddomain.com
            NFSv4 Grace Timeout Value (in secs): 45
Preserves and Modifies NFSv4 ACL (and NTFS File Permissions in Unified Security Style): enabled
                  NFSv4.1 Minor Version Support: enabled
                                  Rquota Enable: disabled
                   NFSv4.1 Parallel NFS Support: enabled
                            NFSv4.1 ACL Support: disabled
                           NFS vStorage Support: disabled
            NFSv4 Support for Numeric Owner IDs: enabled
                          Default Windows Group: -
                NFSv4.1 Read Delegation Support: disabled
               NFSv4.1 Write Delegation Support: disabled
                            NFS Mount Root Only: enabled
                                  NFS Root Only: disabled
            Permitted Kerberos Encryption Types: des, des3, aes-128, aes-256
                              Showmount Enabled: enabled
Set the Protocol Used for Name Services Lookups for Exports: udp
                    NFSv3 MS-DOS Client Support: disabled
     Idle Connection Timeout Value (in seconds): 360
             Are Idle NFS Connections Supported: disabled
Hide Snapshot Directory under NFSv3 Mount Point: disabled
           Provide Root Path as Showmount State: disabled

ontap-select-cluster::> 

vStorage Supportの項目だけ確認する場合は「vserver nfs show -fields vstorage」でも良い。

ontap-select-cluster::> vserver nfs show -fields vstorage
vserver vstorage
------- --------
svm0    disabled

ontap-select-cluster::>

有効にする場合は「vserver nfs modify -vserver SVM名 -vstorage enabled」を実行する。

ontap-select-cluster::> vserver nfs modify -vserver svm0 -vstorage enabled

ontap-select-cluster::> vserver nfs show

変更後は以下のような出力結果となる。

ontap-select-cluster::> vserver nfs show -ins

                                        Vserver: svm0
                             General NFS Access: true
                                         NFS v3: enabled
                                       NFS v4.0: enabled
                                   UDP Protocol: enabled
                                   TCP Protocol: enabled
                           Default Windows User: -
                            NFSv4.0 ACL Support: disabled
                NFSv4.0 Read Delegation Support: disabled
               NFSv4.0 Write Delegation Support: disabled
                        NFSv4 ID Mapping Domain: defaultv4iddomain.com
            NFSv4 Grace Timeout Value (in secs): 45
Preserves and Modifies NFSv4 ACL (and NTFS File Permissions in Unified Security Style): enabled
                  NFSv4.1 Minor Version Support: enabled
                                  Rquota Enable: disabled
                   NFSv4.1 Parallel NFS Support: enabled
                            NFSv4.1 ACL Support: disabled
                           NFS vStorage Support: enabled
            NFSv4 Support for Numeric Owner IDs: enabled
                          Default Windows Group: -
                NFSv4.1 Read Delegation Support: disabled
               NFSv4.1 Write Delegation Support: disabled
                            NFS Mount Root Only: enabled
                                  NFS Root Only: disabled
            Permitted Kerberos Encryption Types: des, des3, aes-128, aes-256
                              Showmount Enabled: enabled
Set the Protocol Used for Name Services Lookups for Exports: udp
                    NFSv3 MS-DOS Client Support: disabled
     Idle Connection Timeout Value (in seconds): 360
             Are Idle NFS Connections Supported: disabled
Hide Snapshot Directory under NFSv3 Mount Point: disabled
           Provide Root Path as Showmount State: disabled

ontap-select-cluster::> vserver nfs show -fields vstorage
vserver vstorage
------- --------
svm0    enabled

ontap-select-cluster::>

vSphere側

データストアの追加から「NFS」の「NFS 4.1」を追加する

VAAIプラグインを追加

ESXiに「NetApp NFS Plug-in for VMware VAAI」をインストールすることで、VAAI機能が有効になる。

すでにNFSマウントされているデータストアがVAAIでアクセスされているか確認するにはESXi shellでコマンドを実行する。

[root@esxiserver:~] esxcli storage nfs41 list
Volume Name  Host(s)        Share     Accessible  Mounted  Read-Only  Security   isPE  Hardware Acceleration
-----------  -------------  --------  ----------  -------  ---------  --------  -----  ---------------------
nfsv4test    172.17.44.108  /testvol        true     true      false  AUTH_SYS  false  Not Supported
[root@esxiserver:~]

「Hardware Acceleration」が「Not Supported」となっている場合、VAAIが有効な状態ではない。

また「vmkfstools -Ph /vmfs/volumes/<データストア名>」を実行した結果内の「NAS VAAI Supported」でも確認できる。

[root@esxiserver:~] vmkfstools -Ph /vmfs/volumes/nfsv4test
NFS41-4.01 (Raw Major Version: 0) file system spanning 1 partitions.
File system label (if any): nfsv4test
Mode: public
Capacity 50 GB, 48.0 GB available, file block size 4 KB, max supported file size 16.0 TB
Disk Block Size: 512/512/0
UUID: a135f63e-34806068-0000-000000000000
Partitions spanned (on "notDCS"):
        NFS41:a135f63e-34806068-0000-000000000000
NAS VAAI Supported: NO
Is Native Snapshot Capable: NO
[root@esxiserver:~]

ESXi shellからVAAIプラグインをインストールする。

[root@esxiserver:~] esxcli software vib install -d /vmfs/volumes/software/netapp
/nfs_plugin_VAAI/1.1.2/NetAppNasPlugin.v23.zip
Installation Result
   Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
   Reboot Required: true
   VIBs Installed: NetApp_bootbank_NetAppNasPlugin_1.1.2-3
   VIBs Removed:
   VIBs Skipped:
[root@esxiserver:~]

「Reboot Required: true」と再起動が要求されたので、ESXiを再起動します。

再起動後、「esxcli storage nfs41 list」で確認すると「Hardware Acceleration Supported」。

[root@esxiserver:~] esxcli storage nfs41 list
Volume Name  Host(s)        Share     Accessible  Mounted  Read-Only  Security   isPE  Hardware Acceleration
-----------  -------------  --------  ----------  -------  ---------  --------  -----  ---------------------
nfsv4test    172.17.44.108  /testvol        true     true      false  AUTH_SYS  false  Supported
[root@esxiserver:~]

「vmkfstools -Ph /vmfs/volumes/<データストア名>」は「NAS VAAI Supported: YES」に変わります。

[root@esxiserver:~] vmkfstools -Ph /vmfs/volumes/nfsv4test
NFS41-4.01 (Raw Major Version: 0) file system spanning 1 partitions.
File system label (if any): nfsv4test
Mode: public
Capacity 50 GB, 48.0 GB available, file block size 4 KB, max supported file size 16.0 TB
Disk Block Size: 512/512/0
UUID: a135f63e-34806068-0000-000000000000
Partitions spanned (on "notDCS"):
        NFS41:a135f63e-34806068-0000-000000000000
NAS VAAI Supported: YES
Is Native Snapshot Capable: YES
[root@esxiserver:~]

2020/08/04追記

export policy関連設定

svmのrootボリュームのexport policyをread onlyの0.0.0.0/0にして、vSphere用NFS共有のexport policyをread/write 0.0.0.0/0にしておいたところ、ESXi 7.0からのNFS4.1データストア登録に失敗。

svmのrootボリュームへの書き込み権限も必要だった。

ONTAP 9.5でsambaドメインに参加できない & ONTAP 9.7で失敗

samba 4.11.6で作ったActive DirectoryにONTAP 9.5を参加させようとするとエラーになる。

ONTAP API が失敗しました: Failed to create the Active Directory machine account "ファイルサーバ名". Reason: LDAP Error: Strong authentication is required Details: Error: Machine account creation procedure failed [ 136] Loaded the preliminary configuration. [ 215] Successfully connected to ip ADサーバIP, port 88 using TCP [ 284] Successfully connected to ip ADサーバIP, port 389 using TCP [ 308] Unable to connect to LDAP (Active Directory) service on ADサーバホスト名 (Error: Strong(er) authentication required) **[ 308] FAILURE: Unable to make a connection (LDAP (Active ** Directory):AD名), result: 7609 . (エラー:13001)

調べたところ、sambaのglobal設定で「ldap server require strong auth = no」を設定する、とのこと。

これを設定し、sambaを再起動したところ、参加できた。


ONTAP 9.7にて、上記手順を実施した上で参加を試みたところ「Unable to connect to NetLogon service on」というエラーになった。

netapp::> vserver cifs create -vserver ファイルサーバ名 -cifs-server ファイルサーバ名 -domain AD名 -ou CN=Computers -default-site "" -status-admin up -comment "" -netbios-aliases ファイルサーバ名

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
"AD名" domain.

Enter the user name: administrator

Enter the password:

Warning: An account by this name already exists in Active Directory at
         CN=ファイルサーバ名,CN=Computers,DC=xx,DC=xx.
         If there is an existing DNS entry for the name ファイルサーバ名, it must be
         removed. Data ONTAP cannot remove such an entry.
         Use an external tool to remove it after this command completes.
         Ok to reuse this account? {y|n}: y

Error: Machine account creation procedure failed
  [    31] Loaded the preliminary configuration.
  [   107] Created a machine account in the domain
  [   108] SID to name translations of Domain Users and Admins
           completed successfully
  [   113] Modified account 'cn=ファイルサーバ名,CN=Computers,dc=xx
           =CO,dc=JP'
  [   114] Successfully connected to ip xx.xx.xx.xx, port 88 using
           TCP
  [   129] Successfully connected to ip xx.xx.xx.xx, port 464
           using TCP
  [   216] Kerberos password set for 'ファイルサーバ名$@AD名'
           succeeded
  [   216] Set initial account password
  [   223] Successfully connected to ip xx.xx.xx.xx, port 445
           using TCP
  [   274] Successfully connected to ip xx.xx.xx.xx, port 88 using
           TCP
  [   297] Successfully authenticated with DC
           adserver.AD名
  [   322] Unable to connect to NetLogon service on
           adserver.AD名 (Error:
           RESULT_ERROR_GENERAL_FAILURE)
**[   322] FAILURE: Unable to make a connection
**         (NetLogon:AD名), result: 3
  [   322] Unable to make a NetLogon connection to
           adserver.AD名 using the new machine account

Error: command failed: Failed to create the Active Directory machine account
       "ファイルサーバ名". Reason: general failure.

netapp::>

このとき「vserver cifs security show -vserver ファイルサーバ名」で確認する「SMB? Enabled for DC Connections」は下記の通り。

netapp::> vserver cifs security show -vserver ファイルサーバ名

Vserver: ファイルサーバ名

                            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:                   -
                        Client Session Security:                none
                SMB1 Enabled for DC Connections:               false
                SMB2 Enabled for DC Connections:      system-default
  LDAP Referral Enabled For AD LDAP connections:               false
               Use LDAPS for AD LDAP connection:               false

netapp::>

「SMB1 Enabled for DC Connections」をtrueに変更しても状況は変わらず。

Sambaサーバの /usr/local/samba/var/log.samba を確認すると、以下の出力があった。

[2020/08/07 14:26:55.226653,  0] ../../source4/rpc_server/netlogon/dcerpc_netlogon.c:284(dcesrv_netr_ServerAuthenticate3_helper)
  dcesrv_netr_ServerAuthenticate3_helper: schannel required but client failed to offer it. Client was ファイルサーバ名$

「schannel」というオプションが必要らしい。

Netlogon Issue “schannel required”」を参考に設定してみたところ、schannelというオプションはないというエラー…「Bug 13464 – smb.conf-configuration “server schannel = auto” needed in future versions」を見ると「server schannel = auto」が正しい模様。

/usr/local/samba/etc/smb.conf を下記の様に修正して、sambaを再起動したところ、ONTAP 9.7でのActive Directoryの参加が可能になった。

# Global parameters
[global]
        netbios name = ADサーバ名
        realm = AD名
        server role = active directory domain controller
        workgroup = AD名
        idmap_ldb:use rfc2307 = yes
        ldap server require strong auth = no
        server schannel = auto

[netlogon]
        path = /usr/local/samba/var/locks/sysvol/AD名/scripts
        read only = No

[sysvol]
        path = /usr/local/samba/var/locks/sysvol
        read only = No

samba 4で構築したドメインにNetApp 9.5が登録できない

注:この記事での事象はsamba 4で使用していた証明書の期限切れが原因でした。
「LDAP Error: Strong authentication is required Details」もしくは「「Unable to connect to NetLogon service on」」というエラーがでる場合については別途「ONTAP 9.5でsambaドメインに参加できない & ONTAP 9.7で失敗」という記事にしています。


テスト環境作成のためNetAppシミュレータの9.5P6を作ってsamba 4で構築したActive Directory環境に登録しようとした・・・

netapp95sim::*> vserver cifs create -cifs-server netappcifs -domain ad.osakana.net -ou CN=Computers -vserver netappcifs -netbios-aliases netappcifs

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 "AD.OSAKANA.NET"
domain.

Enter the user name: administrator

Enter the password:

Error: Machine account creation procedure failed
  [   215] Loaded the preliminary configuration.
  [   267] Successfully connected to ip 172.17.44.49, port 88 using
           TCP
  [   342] Successfully connected to ip 172.17.44.49, port 636 using
           TCP
  [   379] Required certificate with CA ADSERVER.ad.osakana.net is
           not installed
  [   381] Unable to start LDAPS: Can't contact LDAP server
  [   381] Additional info: error:14090086:SSL
           routines:ssl3_get_server_certificate:certificate verify
           failed
  [   381] Unable to connect to LDAP (Active Directory) service on
           adserver.ad.osakana.net (Error: Can't contact LDAP
           server)
**[   381] FAILURE: Unable to make a connection (LDAP (Active
**         Directory):AD.OSAKANA.NET), result: 7642

Error: command failed: Failed to create the Active Directory machine account "netappcifs". Reason: LDAP Error: Cannot
       contact the LDAP server.

netapp95sim::*>

エラー発生。

なんか調べたところ、active-directoryというコマンドでも登録できるらしいのでそれでもテストしてみる。

netapp95sim::*> active-directory create -vserver netappcifs -account-name adserver -domain ad.osakana.net
  (vserver active-directory create)

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

Enter the user name: administrator

Enter the password:

Error: Machine account creation procedure failed
  [   179] Loaded the preliminary configuration.
  [   230] Successfully connected to ip 172.17.44.49, port 88 using
           TCP
  [   298] Successfully connected to ip 172.17.44.49, port 636 using
           TCP
  [   333] Required certificate with CA ADSERVER.ad.osakana.net is
           not installed
  [   335] Unable to start LDAPS: Can't contact LDAP server
  [   335] Additional info: error:14090086:SSL
           routines:ssl3_get_server_certificate:certificate verify
           failed
  [   336] Unable to connect to LDAP (Active Directory) service on
           adserver.ad.osakana.net (Error: Can't contact LDAP
           server)
**[   336] FAILURE: Unable to make a connection (LDAP (Active
**         Directory):AD.OSAKANA.NET), result: 7642

Error: command failed: Failed to create the Active Directory machine account "ADSERVER". Reason: LDAP Error: Cannot
       contact the LDAP server.

netapp95sim::*>

同じようにエラー。

この後いろいろ試行錯誤した結果、自己証明CAをNetAppに入れればいいのでは?とやってみた。(「クラスタまたはSVMがクライアントであるSSLサーバを認証するためのサーバCA証明書のインストール」)

netapp95sim::*> security certificate install -vserver netappcifs -type server-ca

Please enter Certificate: Press <Enter> when done
-----BEGIN CERTIFICATE-----
<sambaの/usr/local/samba/private/tls/ca.pemの内容を張り付け>
-----END CERTIFICATE-----


Error: command failed: The certificate has expired.

netapp95sim::*>

ん?「The certificate has expired.」???

samba公式「Configuring LDAP over SSL (LDAPS) on a Samba AD DC」の「Verifying the certificate」に書いてある手法で確認してみます。

# ls -l  /usr/local/samba/private/tls
合計 12
-rw-r--r--. 1 root root 2041  3月 27  2018 ca.pem
-rw-r--r--. 1 root root 2045  3月 27  2018 cert.pem
-rw-------. 1 root root 3243  3月 27  2018 key.pem
#

# openssl verify /usr/local/samba/private/tls/cert.pem -CApath /usr/local/samba/private/tls/ca.pem
/usr/local/samba/private/tls/cert.pem: O = Samba Administration, OU = Samba - temporary autogenerated HOST certificate, CN = ADSERVER.AD.OSAKANA.NET
error 20 at 0 depth lookup:unable to get local issuer certificate
Error opening certificate file -CApath
140285523859344:error:02001002:system library:fopen:No such file or directory:bss_file.c:402:fopen('-CApath','r')
140285523859344:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:404:
unable to load certificate
/usr/local/samba/private/tls/ca.pem: O = Samba Administration, OU = Samba - temporary autogenerated CA certificate, CN = ADSERVER.AD.OSAKANA.NET
error 18 at 0 depth lookup:self signed certificate
O = Samba Administration, OU = Samba - temporary autogenerated CA certificate, CN = ADSERVER.AD.OSAKANA.NET
error 10 at 0 depth lookup:certificate has expired
OK
#

はい。証明書の有効期限切れでした。

手順がめんどいので、/usr/local/samba/private/tlsにあるファイルをリネームしてから「systemctl stop samba-ad-dc.service」「systemctl start samba-ad-dc.service」で強制再作成させました。