VMware ESXi から ESXi への 仮想マシン移行は vCenter Serverの機能で移行します。
今回の環境は vCenter Server無いので 考慮事項と注意事項を参考に scp を使い仮想マシンを移動コピーします。
ということで、以前 ESXi 7へ作成した Oracle Real Application Clusters 19c (RAC), Oracle 11gR2 RAC と Oracle Database 9i R2(9.2) を 前回作成した ESXi 8へ scp移行してみてみます
■ 環境
ESXi 7, ESXi 8, Oracle RAC 19c, 11gR2 は以前作成した環境を使用します。
・ ESXi 7: VMware vSphere Hypervisor 7.0 (ESXi) をインストールしてみてみた
・ ESXi 8: VMware vSphere Hypervisor (ESXi) 8 を Intel NUC 13 へ インストールしてみてみた
・ Oracle RAC 19c: VMwareへOracle Real Application Clusters 19c (RAC)をインストールしてみてみた
・ Oracle RAC 11gR2: VMwareへOracle Real Application Clusters 11.2 (RAC) をインストールしてみてみた
■ 考慮事項と注意事項
次の VMware ドキュメントを参考に仮想マシンの移行方法を検討します。
・参考: VMware 環境内での仮想マシンの移動またはコピーに関する考慮事項と注意事項
■ SSH 設定
ESXi ホスト間で scp できるように ssh と ESXi Shell を有効化する設定をします。
⚫︎ ESXi 7: SSHの有効化 と ESXi Shellの有効化
ナビゲータの [ホスト]を選択し、 [アクション] > [サービス] > [SSHの有効化] と [ESXi Shellの有効化] をクリックして有効化します。
⚫︎ ESXi 8: SSHの有効化 と ESXi Shellの有効化
ナビゲータの [ホスト]を選択し、 [アクション] > [サービス] > [SSHの有効化] と [ESXi Shellの有効化] をクリックして有効化します。
⚫︎ sshClient firewall有効化
ESXCLIで sshClientファイアウォールを解放します。
1) ESXi 8 へ SSHログイン
shirok@macbook ~ % ssh root@192.168.0.8
(root@ 192.168.0.2) Password:
The time and date of this login have been sent to the system logs.
WARNING:
All commands run on the ESXi shell are logged and may be included in
support bundles. Do not provide passwords directly on the command line.
Most tools can prompt for secrets or accept them from standard input.
VMware offers powerful and supported automation tools. Please
see https://developer.vmware.com for details.
The ESXi Shell can be disabled by an administrative user. See the
vSphere Security documentation for more information.
[root@localhost:~]
2) sshClient firewall ruleset確認
[root@vSphere8:~] esxcli network firewall ruleset list | grep sshClient
sshClient false
3) sshClient firewall TRUE設定
[root@vSphere8:~] esxcli network firewall ruleset set --ruleset-id=sshClient --enabled=true
4) sshClient firewall TRUE設定確認
[root@vSphere8:~] esxcli network firewall ruleset list | grep sshClient
sshClient true
■ 仮想マシン移行
1) ESXi 7 ログイン
shirok@macbook ~ % ssh root@ 192.168.0.7
(root@ 192.168.0.7) Password:
The time and date of this login have been sent to the system logs.
WARNING:
All commands run on the ESXi shell are logged and may be included in
support bundles. Do not provide passwords directly on the command line.
Most tools can prompt for secrets or accept them from standard input.
VMware offers supported, powerful system administration tools. Please
see www.vmware.com/go/sysadmintools for details.
The ESXi Shell can be disabled by an administrative user. See the
vSphere Security documentation for more information.
[root@vSphere7:~]
2) DataStore確認
[root@vSphere7:~] cd vmfs/volumes/DataStore01/
[root@vSphere7:/vmfs/volumes/a9b1ac-ab14e4-6513-04d4c458bc] ls -l
total 2560
drwxr-xr-x 1 root root 77824 May 21 01:05 Oracle9iR2-x86_64
drwxr-xr-x 1 root root 86016 Aug 7 23:41 VMware vCenter Server Appliance
drwxr-xr-x 1 root root 81920 Apr 3 2021 rac11g1
drwxr-xr-x 1 root root 77824 Nov 24 2020 rac11g2
drwxr-xr-x 1 root root 77824 Apr 2 2021 rac19c-node1
drwxr-xr-x 1 root root 77824 Dec 4 2020 rac19c-node2
3) SCP実行
[root@vSphere7:/vmfs/volumes/a9b1ac-ab14e4-6513-04d4c458bc] scp -r rac19c-node1/ root@ 192.168.0.2:/vmfs/volumes/datastore1/
The authenticity of host ' 192.168.0.2 ( 192.168.0.2)' can't be established.
ECDSA key fingerprint is SHA256:SRgBq4qBMZ2c121TTUX0W2iPZfF1SgMrMRgDQ8U.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added ' 192.168.0.2' (ECDSA) to the list of known hosts.
Password:
rac19c-node1.vmx 100% 4479 401.2KB/s 00:00
rac19c-node1-flat.vmdk 1% 1000MB 85.3MB/s 12:36 ETArekeyed outbound cipher
rekeyed inbound cipher
rac19c-node1-flat.vmdk 3% 2035MB 96.8MB/s 10:56 ETArekeyed outbound cipher
rekeyed inbound cipher
rac19c-node1-flat.vmdk 4% 2994MB 89.9MB/s 11:35 ETArekeyed outbound cipher
rekeyed inbound cipher
rac19c-node1-flat.vmdk 6% 4067MB 92.2MB/s 11:06 ETArekeyed outbound cipher
rekeyed inbound cipher
rac19c-node1-flat.vmdk 7% 5111MB 76.5MB/s 13:10 ETArekeyed outbound cipher
rekeyed inbound cipher
rac19c-node1-flat.vmdk 9%
・・・
rac19c-node1_3-flat.vmdk 100% 20GB 62.0MB/s 05:30
rac19c-node1_3.vmdk 100% 454 273.3KB/s 00:00
■ Network ポートグループ追加
Oracle RACに必要なInter Connect用ネットワークを追加します。
設定内容は既存と同じ名前とVLAN IDで作成します。
1) ESXi Host Client画面
ナビゲータ[ネットワーク]を選択し、[ポートグループの追加]をクリック
■ 仮想マシンの登録
⚫︎ 仮想マシンの登録
Oracle RACを構成する仮想マシンを登録します。
1) ESXi Host Client画面
ナビゲータの [仮想マシン]を選択し、[仮想マシンの作成/登録] をクリック
5) 登録のための仮想マシンの選択
Oracle Databsae 19c と 11gR2 の RAC Nodes 仮想マシンを選択します。
■ 仮想マシンの互換性のアップグレード
1) 仮想マシン画面
対象仮想マシンの [アクション] > [仮想マシンの互換性のアップグレード]をクリック
2) 仮想マシンの互換性の構成画面
[ESXi 8.0 仮想マシン]を選択し、[アップグレード]をクリック
3) 仮想マシンの互換性のアップグレード確認画面
内容を確認し、問題なければ[はい]をクリック
4) 仮想マシン画面
アップグレードされていることを互換性の項目で確認
■ Thin Provision から Thick Provision(Eager zeroed) ディスク変換
複製したRACの共有ディスクは、Thin Diskへ変換されて共有Diskとして利用できなくなるため、
RACの共有ディスク(OCR,Voting,ASM)を複数ノードで共有接続できるように Thick Eager zeroed ディスクへ変換します。
⚫︎ RAC仮想マシンの共有ディスクを一旦削除
1) 設定の編集画面
RACの共有ディスクを一旦削除します。
⚫︎ Oracle RAC仮想マシンの共有ディスクを eagerzeroedthickへ変換
・参考: vmkfstools を使用した仮想マシン ディスクのクローン作成および変換
1) eagerzeroedthickへ変換
今回は以下RACの共有ディスクをeagerzeroedthickへ変換します。
rac19c-node1_1.vmdk
rac19c-node1_2.vmdk
rac19c-node1_3.vmdk
[root@vSphere8:rac19c-node1] cd /vmfs/volumes/datastore1/rac11g1
[root@vSphere8:rac19c-node1] vmkfstools -i rac19c-node1_1.vmdk -d eagerzeroedthick rac19c-node1_1-thick.vmdk
Destination disk format: VMFS eagerzeroedthick
Cloning disk 'rac19c-node1_1.vmdk'...
Clone: 100% done.
[root@vSphere8:rac19c-node1] vmkfstools -i rac19c-node1_2.vmdk -d eagerzeroedthick rac19c-node1_2-thick.vmdk
Destination disk format: VMFS eagerzeroedthick
Cloning disk 'rac19c-node1_2.vmdk'...
Clone: 100% done.
[root@vSphere8:rac19c-node1] vmkfstools -i rac19c-node1_3.vmdk -d eagerzeroedthick rac19c-node1_3-thick.vmdk
Destination disk format: VMFS eagerzeroedthick
Cloning disk 'rac19c-node1_3.vmdk'...
Clone: 100% done.
⚫︎ RAC仮想マシンへ共有ディスクを追加
1) ESXi Host Client画面
対象の仮想マシンを選択し、[編集]をクリック
2) 設定の編集画面
「ハード ディスクの追加] > [既存のハードディスク]をクリック
4) 設定の編集画面
追加したRAC共有ディスクのタイプがシック プロビジョニング(Eager Zeroed) になっていることを確認
共有項目を[マルチライターの共有]へ設定
同様に他のRAC共有ディスクも同様に追加設定して、[保存]をクリック
■ Oracle Database 19c RAC仮想マシン起動
⚫︎ 仮想マシン起動
⚫︎ 仮想マシンssh接続
shirok@macbook ~ % ssh root@192.168.0.191
The authenticity of host '192.168.0.191 (192.168.0.191)' can't be established.
RSA key fingerprint is SHA256:IFuThFkz/+7bu+tRsZ2j+r2tL3Hv5PE+28hF.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.0.191' (RSA) to the list of known hosts.
root@192.168.0.191's password:
Last login: Fri Dec 4 09:12:32 2020 from 192.168.0.71
⚫︎ Oracle Grid Infrastructure 19c 起動確認
[root@rac19c-node1 ~]# su - grid
Last login: Thu Aug 10 04:02:11 JST 2023
[grid@rac19c-node1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
ONLINE ONLINE rac19c-node1 STABLE
ONLINE ONLINE rac19c-node2 STABLE
ora.chad
ONLINE ONLINE rac19c-node1 STABLE
ONLINE ONLINE rac19c-node2 STABLE
ora.net1.network
ONLINE ONLINE rac19c-node1 STABLE
ONLINE ONLINE rac19c-node2 STABLE
ora.ons
ONLINE ONLINE rac19c-node1 STABLE
ONLINE ONLINE rac19c-node2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
1 ONLINE ONLINE rac19c-node1 STABLE
2 ONLINE ONLINE rac19c-node2 STABLE
ora.CRS.dg(ora.asmgroup)
1 ONLINE ONLINE rac19c-node1 STABLE
2 ONLINE ONLINE rac19c-node2 STABLE
ora.DATA.dg(ora.asmgroup)
1 ONLINE ONLINE rac19c-node1 STABLE
2 ONLINE ONLINE rac19c-node2 STABLE
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac19c-node2 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE rac19c-node1 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE rac19c-node1 STABLE
ora.RECO.dg(ora.asmgroup)
1 ONLINE ONLINE rac19c-node1 STABLE
2 ONLINE ONLINE rac19c-node2 STABLE
ora.asm(ora.asmgroup)
1 ONLINE ONLINE rac19c-node1 Started,STABLE
2 ONLINE ONLINE rac19c-node2 Started,STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
1 ONLINE ONLINE rac19c-node1 STABLE
2 ONLINE ONLINE rac19c-node2 STABLE
ora.cvu
1 ONLINE ONLINE rac19c-node1 STABLE
ora.orcl.db
1 ONLINE ONLINE rac19c-node1 Open,HOME=/u01/app/o
racle/product/19.0.0
/dbhome_1,STABLE
2 ONLINE ONLINE rac19c-node2 Open,HOME=/u01/app/o
racle/product/19.0.0
/dbhome_1,STABLE
ora.qosmserver
1 ONLINE ONLINE rac19c-node1 STABLE
ora.rac19c-node1.vip
1 ONLINE ONLINE rac19c-node1 STABLE
ora.rac19c-node2.vip
1 ONLINE ONLINE rac19c-node2 STABLE
ora.scan1.vip
1 ONLINE ONLINE rac19c-node2 STABLE
ora.scan2.vip
1 ONLINE ONLINE rac19c-node1 STABLE
ora.scan3.vip
1 ONLINE ONLINE rac19c-node1 STABLE
--------------------------------------------------------------------------------
⚫︎ Oracle Database 19c 接続確認
[root@rac19c-node1 ~]# su - oracle
Last login: Thu Aug 10 03:25:16 JST 2023 on :0
[oracle@rac19c-node1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Aug 10 06:15:14 2023
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL> select INSTANCE_NAME, HOST_NAME, STATUS from gv$instance;
INSTANCE_NAME HOST_NAME STATUS
--------------- --------------- ------------------------------------
orcl1 rac19c-node1 OPEN
orcl2 rac19c-node2 OPEN
■ Oracle Database 11g RAC仮想マシン起動
⚫︎ 仮想マシン起動
⚫︎ 仮想マシンssh接続
shirok@macbook ~ % ssh root@192.168.0.11
The authenticity of host '192.168.0.11 (192.168.0.11)' can't be established.
DSA key fingerprint is SHA256:IXp4q2snelLNApevGO4YapeBA.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.0.11' (DSA) to the list of known hosts.
root@192.168.0.11's password:
Last login: Sat Apr 3 19:14:33 2021 from 192.168.0.0
⚫︎ Oracle Grid Infrastructure 11gR2 起動確認
[root@rac11g1 ~]# su - grid
[grid@rac11g1 ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.CRS.dg
ONLINE ONLINE rac11g1
ONLINE ONLINE rac11g2
ora.DATA.dg
ONLINE ONLINE rac11g1
ONLINE ONLINE rac11g2
ora.LISTENER.lsnr
ONLINE ONLINE rac11g1
ONLINE ONLINE rac11g2
ora.asm
ONLINE ONLINE rac11g1 Started
ONLINE ONLINE rac11g2 Started
ora.gsd
OFFLINE OFFLINE rac11g1
OFFLINE OFFLINE rac11g2
ora.net1.network
ONLINE ONLINE rac11g1
ONLINE ONLINE rac11g2
ora.ons
ONLINE ONLINE rac11g1
ONLINE ONLINE rac11g2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac11g1
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE rac11g2
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE rac11g2
ora.cvu
1 ONLINE ONLINE rac11g2
ora.oc4j
1 ONLINE ONLINE rac11g2
ora.orcl.db
1 ONLINE ONLINE rac11g1 Open
2 ONLINE ONLINE rac11g2 Open
ora.rac11g1.vip
1 ONLINE ONLINE rac11g1
ora.rac11g2.vip
1 ONLINE ONLINE rac11g2
ora.scan1.vip
1 ONLINE ONLINE rac11g1
ora.scan2.vip
1 ONLINE ONLINE rac11g2
ora.scan3.vip
1 ONLINE ONLINE rac11g2
⚫︎ Oracle Database 11gR2 接続確認
[root@rac11g1 ~]# su - oracle
[oracle@rac11g1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Sat Aug 12 09:05:40 2023
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> select INSTANCE_NAME, HOST_NAME, STATUS from gv$instance;
INSTANCE_NAME HOST_NAME STATUS
--------------- -------------------- ------------------------------------
orcl2 rac11g2 OPEN
orcl1 rac11g1 OPEN
■ Oracle Database 9i R2(9.2) 仮想マシン起動
⚫︎ 仮想マシン起動
⚫︎ 仮想マシンssh接続
shirok@macbook ~ % ssh root@192.168.0.9
The authenticity of host '192.168.0.9 (192.168.0.9)' can't be established.
DSA key fingerprint is SHA256:uyoj43f5s/SgS3GpIWH7xsU087ETCRcMc.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.100.9' (DSA) to the list of known hosts.
root@192.168.100.9's password:
Permission denied, please try again.
root@192.168.100.9's password:
Last login: Sat Aug 12 09:42:29 2023
⚫︎ Oracle Database 9i R2(9.2) 接続確認
[root@oracle9ir2 ~]# su - oracle
[oracle@oracle9ir2 ~]$ sqlplus /nolog
SQL*Plus: Release 9.2.0.8.0 - Production on 土 Aug 12 10:09:35 2023
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> conn / as sysdba
Connected.
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
PL/SQL Release 9.2.0.8.0 - Production
CORE 9.2.0.8.0 Production
TNS for Linux: Version 9.2.0.8.0 - Production
NLSRTL Version 9.2.0.8.0 - Production
■ 参考
・ ESXi/ESX ホストを vCenter Server の間で移動する方法 (1004775)
・ VMware 環境内での仮想マシンの移動またはコピー
・ 仮想ディスクのプロビジョニング ポリシーについて
・ Open Virtualization Format (OVF) Tool