iSCSIストレージ上のvSphere仮想マシンのSANバックアップを仮想マシン上で実験する

vSphere仮想環境でFC-SANやiSCSI-SANの共有ディスク上に作ったVMFSデータストアがあり、そこにあるvSphere仮想マシンのバックアップを行う場合の手法はいくつかある。

・SAN
・HotAdd
・NBD/NBDSSL

ここらを解説してる資料があるかなーと探してみると

vSphere 5時代の「Virtual Disk Transport Methods」だと絵付きで解説されてるんですが、現状のVMware公式記述はVMware Virtual Disk Development Kit Programming Guide 8.0の「Virtual Disk Transport Methods」で一覧としてのページには絵はないが個別ページ(SAN Transport)には絵がある。

じゃあ、とバックアップソフト側を探すといろいろでてくる

その中でも、Veritas NetBackup「VMware のトランスポートモード: ベストプラクティスとトラブルシューティング」が分かりやすいかなぁ、と感じた。

SAN Transport

SAN Transportについて、何の変哲もないiSCSIストレージを、ESXiサーバとWindowsサーバの両方につなげただけでも使えるのかな、と検証してみようとした。

(上記画像はVMwareから転載)

まあ、実機の環境がなかったので、vSphere仮想マシンのWindowsサーバからiSCSI接続して構築してみたところ、commvaultの場合は「SAN access is only supported for physical machines.」というメッセージでバックアップさせてくれなかった。

Event Code: 91:248
Severity: Minor
Program: vsbkp
Description:
Unable to open the disks for virtual machine [仮想マシン名] for SAN access. SAN access is only supported for physical machines.

なにを設定すればごまかせるかな?と試行錯誤・・・とりあえず以下の設定で仮想マシンを作ってみたものの駄目だった。

CPU:ハードウェア仮想化 ハードウェアアシストによる仮想化をゲストOSに公開
IOMMU:IOMMUをゲストOSに公開
パフォーマンスカウント:仮想CPUパフォーマンスカウンタの有効化
SCSIコントローラ:LSI Logic SAS
ネットワークアダプタ:E1000e
ゲストOS:その他 その他(64ビット)
VMware-toolsインストールなし

結局のところ、普通に作ってから、[構成パラメータ]で「smbios.reflecthost」を「TRUE」とするだけで成功した。以下は実際に使った設定。

SCSIコントローラ:LSI Logic SAS
ネットワークアダプタ:E1000e
ゲストOS:Windows Windows Server 2016以降
VMware-toolsインストールあり
構成パラメータ: smbios.reflecthost 「TRUE」

どうやらBIOS stringにVMwareの文字列が入っているかどうかで判定していた模様。

今回はCommvaultバックアップでの事例だったけど、NetBackupなど他のバックアップソフトウェアでもvSphere環境へのアクセスはVDDK経由で行っているので、おそらく同じような制限がかかっているのではないかと想定している。

2023/11/22追記: NetBackup 8.1.1環境があったので試してみたら、こちらは偽装しなくてもそのまま動いた

ONTAP 9.6以前からONTAP 9.7以降にアップデートする際に容量の問題が発生する可能性

ONTAP 9.5P5シミュレータ環境をONTAP 9.7にアップデートした場合には問題なかったのに、運用中のONTAP 9.5P10環境をアップデートしようとしたところ、firmwareアップロードの段階で「THe request body must have content type multipart/form-data with a field named file」というエラーとなった。

確認すると、ONTAP 9.5P10, ONTAP9.6~ONTAP 9.6P6で発生するというえらくピンポイントな仕様問題だった。(System Manager ONTAP 9.7 image upload fails with multipart/form-data error)

ファイルをアップロードする領域が2GBと設定されているが、ONTAP 9.7では2GBでは足らなくなったためエラーになる、という問題だった。

webのアップロード用パラメータを2GBから4GBに変更することで対処できるとのことで実施した。

まず、diagモードに切り替えて現在の設定確認

netappcluster::> set diag

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

netappcluster::*> system services web file-uploads config show
Node              Size
----------------- ------------
netappcluster-01  2GB
netappcluster-02  2GB
2 entries were displayed.

netappcluster::*>

次に変更を実施

netappcluster::*> system services web file-uploads config modify -node * -size 4GB

Warning: Files already uploaded or are being uploaded will be lost. Starting a
         file upload before the resize operation is finished will cause the
         uploaded file to be unavailable.
Do you want to continue? {y|n}: y
[Job 14002] Job is queued: Web File Upload Resize Node Job.
[Job 14003] Job is queued: Web File Upload Resize Node Job.
2 entries were modified.

netappcluster::*> 

すぐに反映されないので、上記で出力されたジョブIDのステータスを確認する。


netappcluster::*> job show -id 14002
                            Owning
Job ID Name                 Vserver    Node           State
------ -------------------- ---------- -------------- ----------
14002  Web File Upload Resize Node Job netappcluster netappcluster-01 Success
       Description: Web File Upload Resize Node Job

netappcluster::*> job show -id 14003
                            Owning
Job ID Name                 Vserver    Node           State
------ -------------------- ---------- -------------- ----------
14003  Web File Upload Resize Node Job netappcluster netappcluster-02 Success
       Description: Web File Upload Resize Node Job

netappcluster::*>

「Success」が含まれていれば変更が完了している。(変更途中は Running )

ただ、変更が終わったあとの設定表記は4GBとならずに「0B」となるが、これで正常とのこと

netappcluster::*> system services web file-uploads config show
Node              Size
----------------- ------------
netappcluster-01  0B
netappcluster-02  0B
2 entries were displayed.

netappcluster::*>

KBには「system node systemshell -node * -command df -h /mroot/etc/upload」を実行して /mroot/etc/upload に割り当てられた容量を確認する、という記載がある。

ここで使っているsystemshellコマンドは最近のONTAP OSでは標準で使えない状態に変更されているため「Error: command failed: Error: Account currently locked. Contact the storage administrator to unlock it.」というエラーとなる場合がある。その場合は、ロックを解除する必要がある。手順については「NetApp ONTAPから他サーバに気軽にsshできる穴がふさがれてしまった」を参考のこと

で、ONTAP 9.13.1ぐらいになってくると状況によっては4GBより必要な可能性もあるようで、最近になって「System Manager fails to upload ONTAP image due to insufficient space」というKBが追加されていた。こちらは7GBに変更するとあるが、2023年11月時点ではこの問題が発生する状況が未公開となっているため、4GBのままで良さそうである。

CVE-2022-38023適用後 NetAppがActive Directoryに参加できない

いままでも「SMB2 Enabled for DC Connections設定に起因する接続できない問題」というのがあったが、先日話題になった「Active Directoryサーバのセキュリティ強化アップデート(CVE-2022-38023)に伴うONTAPファイルサーバへの影響」で、2023年7月以降のActive Directory環境ではONTAP をCIFSに新規作成しようとした場合にエラーがでる、という問題が出ていた。

Is AES Encryption Enabled設定」と「AES session key enabled for NetLogon channel設定」の2つの設定を変更する必要がある。

前者はONTAP 9.12.1から初期値変更、後者はONTAP 9.10.1から初期値変更となっているので、最近導入している場合は問題が発生しないのだが、以前のバージョンからアップデートしているような環境の場合は以前の値のままとなっているため注意が必要となっている。

その1: Is AES Encryption Enabled 設定

以前からONTAPを使っていてアップデートしているような環境では、SMB内部接続での暗号化形式でAESを使わない、という設定になっているせいで、下記の様なエラーとなる。

netapp9101::> vserver cifs create -vserver svm3 -cifs-server svm3 -domain adosakana.local

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
  [    47] Loaded the preliminary configuration.
  [   130] Created a machine account in the domain
  [   130] SID to name translations of Domain Users and Admins
           completed successfully
  [   131] Successfully connected to ip 172.17.44.49, port 88 using
           TCP
  [   142] Successfully connected to ip 172.17.44.49, port 464 using
           TCP
  [   233] Kerberos password set for 'SVM3$@ADOSAKANA.LOCAL' succeeded
  [   233] Set initial account password
  [   244] Successfully connected to ip 172.17.44.49, port 445 using
           TCP
  [   276] Successfully connected to ip 172.17.44.49, port 88 using
           TCP
  [   311] Successfully authenticated with DC
           adserver.adosakana.local
  [   324] Unable to connect to NetLogon service on
           adserver.adosakana.local (Error:
           RESULT_ERROR_GENERAL_FAILURE)
**[   324] FAILURE: Unable to make a connection
**         (NetLogon:ADOSAKANA.LOCAL), result: 3
  [   324] Unable to make a NetLogon connection to
           adserver.adosakana.local using the new machine account
  [   346] Deleted existing account
           'CN=SVM3,CN=Computers,DC=adosakana,DC=local'

Error: command failed: Failed to create the Active Directory machine account "SVM3". Reason: general failure.

netapp9101::>

この問題はマニュアルの「Enable or disable AES encryption for Kerberos-based communication」に記載されているように「is-aes-encryption-enabled」設定をtrueに変更することで解決する。

netapp9101::> vserver cifs security modify -vserver svm3 -is-aes-encryption-enabled true
netapp9101::> vserver cifs security show -fields is-aes-encryption-enabled
vserver is-aes-encryption-enabled
------- -------------------------
Cluster -
Snapmirror-WAN
        -
netapp9101
        -
netapp9101-01
        -
svm0    true
svm2    false
svm3    true
7 entries were displayed.

netapp9101::>

その2: AES session key enabled for NetLogon channel 設定

上記を設定しても、下記の様なエラーとなった。

netapp9101::> vserver cifs create -vserver svm3 -cifs-server svm3 -domain vm2.adosakana.local

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
  [    43] Loaded the preliminary configuration.
  [   133] Created a machine account in the domain
  [   133] SID to name translations of Domain Users and Admins
           completed successfully
  [   134] Successfully connected to ip 172.17.44.49, port 88 using
           TCP
  [   144] Successfully connected to ip 172.17.44.49, port 464 using
           TCP
  [   226] Kerberos password set for 'SVM3$@ADOSAKANA.LOCAL' succeeded
  [   226] Set initial account password
  [   253] Successfully connected to ip 172.17.44.49, port 445 using
           TCP
  [   284] Successfully connected to ip 172.17.44.49, port 88 using
           TCP
  [   316] Successfully authenticated with DC
           adserver.adosakana.local
  [   323] Encountered NT error (NT_STATUS_PENDING) for SMB command
           Read
  [   327] Unable to connect to NetLogon service on
           adserver.adosakana.local (Error:
           RESULT_ERROR_GENERAL_FAILURE)
**[   327] FAILURE: Unable to make a connection
**         (NetLogon:ADOSAKANA.LOCAL), result: 3
  [   327] Unable to make a NetLogon connection to
           adserver.adosakana.local using the new machine account
  [   344] Deleted existing account
           'CN=SVM3,CN=Computers,DC=ADOSAKANA,DC=local'

Error: command failed: Failed to create the Active Directory machine account "SVM3". Reason: general failure.

netapp9101::>

この状況となった環境のActive Directoryサーバはsambaで作成しているため /usr/local/samba/var/log.samba を確認してみると下記のエラーがでていた。

[2023/10/20 14:48:22.301935,  0] ../../source4/rpc_server/netlogon/dcerpc_netlogon.c:281(dcesrv_netr_ServerAuthenticate3_check_downgrade)
  CVE-2022-38023: client_account[SVM3$] computer_name[SVM3] schannel_type[2] client_negotiate_flags[0x741ff] real_account[SVM3$] NT_STATUS_DOWNGRADE_DETECTED reject_des[0] reject_md5[1]
[2023/10/20 14:48:22.302215,  0] ../../source4/rpc_server/netlogon/dcerpc_netlogon.c:291(dcesrv_netr_ServerAuthenticate3_check_downgrade)
  CVE-2022-38023: Check if option 'server reject md5 schannel:SVM3$ = no' might be needed for a legacy client.
[2023/10/20 14:48:22.304539,  0] ../../source4/rpc_server/netlogon/dcerpc_netlogon.c:281(dcesrv_netr_ServerAuthenticate3_check_downgrade)
  CVE-2022-38023: client_account[SVM3$] computer_name[SVM3] schannel_type[2] client_negotiate_flags[0x701ff] real_account[SVM3$] NT_STATUS_DOWNGRADE_DETECTED reject_des[1] reject_md5[1]
[2023/10/20 14:48:22.304600,  0] ../../source4/rpc_server/netlogon/dcerpc_netlogon.c:291(dcesrv_netr_ServerAuthenticate3_check_downgrade)
  CVE-2022-38023: Check if option 'server reject md5 schannel:SVM3$ = no' might be needed for a legacy client.
[2023/10/20 14:48:22.304638,  0] ../../source4/rpc_server/netlogon/dcerpc_netlogon.c:298(dcesrv_netr_ServerAuthenticate3_check_downgrade)
  CVE-2022-38023: Check if option 'allow nt4 crypto:SVM3$ = yes' might be needed for a legacy client.

もしやkerneberosではなくNTLMで接続されてたりする?と lm-compatibility-level をkrb に設定しても同じ結果となった。

netapp9101::> vserver cifs security modify -vserver svm3 -lm-compatibility-level krb

netapp9101::> vserver cifs security show -fields lm-compatibility-level
vserver lm-compatibility-level
------- ----------------------
Cluster -
Snapmirror-WAN -
netapp9101 -
netapp9101-01 -
svm0    lm-ntlm-ntlmv2-krb
svm2    lm-ntlm-ntlmv2-krb
svm3    krb
7 entries were displayed.

netapp9101::>

さらに調べると「Configure Active Directory domain controller access overview」に、Netlogon にAESを使いたい場合は「aes-enabled-for-netlogon-channel」をtrueに設定する、と書いてあった

netapp9101::> vserver cifs security show -fields aes-enabled-for-netlogon-channel
vserver aes-enabled-for-netlogon-channel
------- --------------------------------
Cluster -
Snapmirror-WAN -
netapp9101 -
netapp9101-01 -
svm0    false
svm2    false
svm3    false
7 entries were displayed.

netapp9101::> vserver cifs security modify -vserver svm3 -aes-enabled-for-netlogon-channel true

netapp9101::> vserver cifs security show -fields aes-enabled-for-netlogon-channel
vserver aes-enabled-for-netlogon-channel
------- --------------------------------
Cluster -
Snapmirror-WAN -
netapp9101 -
netapp9101-01 -
svm0    false
svm2    false
svm3    true
7 entries were displayed.

netapp9101::>

設定変更後に再実行したところ、Active Directory参加に成功した。

netapp9101::> vserver cifs create -vserver svm3 -cifs-server svm3 -domain adosakana.local

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:

Notice: SMB1 protocol version is obsolete and considered insecure. Therefore it is deprecated and disabled on this
CIFS server. Support for SMB1 might be removed in a future release. If required, use the (privilege: advanced)
"vserver cifs options modify -vserver svm3 -smb1-enabled true" to enable it.

netapp9101::>

↑のSMB1を有効にするかどうか、というところについては、複合機の出力先として指定されている、とか、LinuxサーバからCIFSでマウントしている、とか、Windowsワークグループからアクセスしている、という場合には有効にする、というような形となる。

Windows Updateしたらsamba ADへの接続がおかしくなった

sambaで作ったsamba AD環境がある。

最近、新しい仮想マシン作ってドメイン参加したあと、PowerShellで「Test-ComputerSecureChannel」を実行したら「False」と出た。

repairしても状況が変わらない

(ADサーバと該当マシン間の通信がセキュアチャネルを使って行われていないという状態)

いまつかっているsambaバージョンを確認すると4.18.2

# /usr/local/samba/sbin/smbd --version
Version 4.18.2
#

sambaのリリース履歴を見るとNetAppでも問題になったセキュリティ修正関連での修正が出ている。

CVE-2023-34967CVE-2022-2127CVE-2023-34968CVE-2023-34966 and CVE-2023-3347.

直接のバグとしては「Bug 15418 – secure channel faulty since Windows 10/11 update 07/2023」が該当している模様

バグであるならアップデートするしかないな、というわけで、samba 4.18.5へアップデート

展開して、make;make install; systemctl restart samba-ad-dc っと

# /usr/local/samba/sbin/smbd --version
Version 4.18.5
#

で、repairすると、今度は成功しました

NetApp ONTAPから他サーバに気軽にsshできる穴がふさがれてしまった

NetApp ONTAP 9.xに長らく存在していた diagアカウントをロックしていても、lsなどのコマンドを実行できる、という技があった。

ontap98::> set diag

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

ontap98::*> systemshell -node localhost -command ls /
  (system node systemshell)
BUILD                           mroot_late
COMPAT.TXT                      mroot_late.tgz
COPYRIGHT                       netapp_nodar_build_check
INSTALL                         nfsroot
README.TXT                      ontap
VERSION                         ovl
bin                             partner
boot                            platform
cap.xml                         proc
cfcard                          root
clus                            sbin
dev                             sim
etc                             sldiag
fw                              tmp
kmip                            usr
lib                             var
libexec                         varfs.tgz
mnt                             vs_conf_files.tgz
mroot                           webjail
mroot.tgz

ontap98::*>

ONTAP 9.10.1でも使えていたのだが、Active Directory暗号化問題パッチを適用したONTAP 9.10.1P12で試したところ、実行できなくなっていた。

netapp9101::> set diag

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

netapp9101::*> systemshell -node localhost -command ls /
  (system node systemshell)

Error: command failed: Error: Account currently locked. Contact the storage
       administrator to unlock it.

netapp9101::*>

え!?と調べたら ONTAP 9.12.1リリースのころからのパッチバージョンから使えなくなっていた模様。

diagアカウントがロックされている場合は、systemshellを禁止します

以降のバージョンが対象
9.7P22
9.8P15
9.9.1P13
9.10.1P9
9.11.1P5.
9.12.1.
9.13.0
9.13.1.

ということで、いまのONTAPだとdiag モードのロックを解除しないと実行できなくなっていました。

公式の解除手順 SystemShell diagユーザアカウントのロックを解除する方法

上記手順だと、diagユーザアカウントにパスワードを設定していますが、「systemshell -node localhost -command コマンド」で実行する場合はパスワード設定は必須ではありません。

現在のdiagユーザのロック状況を確認「security login show -username diag」(バージョンによっては security login show -user-or-group-name diag)

netapp9101::> security login show -username diag

Vserver: netapp9101
                                                                 Second
User/Group                 Authentication                 Acct   Authentication
Name           Application Method        Role Name        Locked Method
-------------- ----------- ------------- ---------------- ------ --------------
diag           console     password      admin            yes    none

netapp9101::>

「Acct Locked: yes」だとロックされている

「security login unlock -username diag」を実行して、ロック解除する

netapp9101::> security login unlock -username diag

netapp9101::> security login show -username diag

Vserver: netapp9101
                                                                 Second
User/Group                 Authentication                 Acct   Authentication
Name           Application Method        Role Name        Locked Method
-------------- ----------- ------------- ---------------- ------ --------------
diag           console     password      admin            no     none

netapp9101::>

ロック解除したあとであれば従来通り実行できた

netapp9101::> set diag

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

netapp9101::*> systemshell -node localhost -command ls /
  (system node systemshell)
BUILD                           mroot_late
COMPAT.TXT                      mroot_late.tgz
COPYRIGHT                       netapp_nodar_build_check
INSTALL                         nfsroot
README.TXT                      ontap
VERSION                         ovl
bin                             partner
boot                            platform
cap.xml                         proc
cfcard                          root
clus                            sbin
dev                             sim
etc                             sldiag
fw                              tmp
kmip                            usr
lib                             var
libexec                         varfs.tgz
mnt                             vs_conf_files.tgz
mroot                           webjail
mroot.tgz

netapp9101::*>

なお、ONTAP OSの標準値が変わっていますので、利用が終わったら「security login lock -username diag」を実行してロック状態を戻しておきましょう

netapp9101::*> set admin

netapp9101::> security login lock -username diag

netapp9101::> security login show -username diag

Vserver: netapp9101
                                                                 Second
User/Group                 Authentication                 Acct   Authentication
Name           Application Method        Role Name        Locked Method
-------------- ----------- ------------- ---------------- ------ --------------
diag           console     password      admin            yes    none

netapp9101::>
モバイルバージョンを終了