0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ProxmoxクラスタでFC-SANのLUNをLVMとして利用する

Last updated at Posted at 2025-03-01

はじめに

クラスタ構成のProxmox環境で、FC-SANのLUNに直接LVMを作成する構成の検証を行います。
以前同じ検証を行った際には、2台目のホストで pv, vg が参照出来ない問題が発生しましたが、気分を一新して再検証してみました。

構成概要

本記事では、2台の Proxmox ホストをクラスタ構成で運用していることを前提としています。

  • ターゲット側 (SAN ストレージ)

    • Fedora Server 41 を使用
    • 2ポートの QLogic 2662 HBA を実装
    • 2台の Proxmox ノードが同じ LUN にアクセス
    • FC ターゲットの設定は別記事で説明(本記事では省略)
  • Proxmox クラスタ側

    • 2台の Proxmox ノード (Proxmox VE 8)
    • 1ポートの Emulex LPe12000 HBA を装備し、FC ターゲットに接続
    • 共有 LUN を LVM バックエンドとして使用

1. ProxmoxノードでFC LUNを確認

まず、FC経由でターゲットLUNが認識されているか確認します。

HBAのWWPNを確認

cat /sys/class/fc_host/host*/port_name
root@d-1697:~# cat /sys/class/fc_host/host*/port_name
0x10000090fad99630
root@d-1698:~# cat /sys/class/fc_host/host*/port_name
0x10000090fad995fe

FCリンクアップ状態確認:

cat /sys/class/fc_host/host*/port_state
root@d-1697:~# cat /sys/class/fc_host/host*/port_state
Online
root@d-1698:~# cat /sys/class/fc_host/host*/port_state
Online

LUNが検出されているか確認:

lsblk | grep sdb
root@d-1697:~# lsblk | grep sdb
sdb                  8:16   0   200G  0 disk
root@d-1698:~# lsblk | grep sdb
sdb                  8:16   0   200G  0 disk

sdb として 200GB のLUNが見えていることを確認。

2. LVM の設定

物理ボリュームの作成

一方のノードで、物理ボリュームを作成します。

pvcreate /dev/sdb
pvs
root@d-1697:~# pvcreate /dev/sdb
  Physical volume "/dev/sdb" successfully created.
root@d-1697:~# pvs
  PV         VG    Fmt  Attr PSize    PFree
  /dev/sda3  pve   lvm2 a--  <464.76g   16.00g
  /dev/sdb   fc_vg lvm2 a--  <200.00g <200.00g

ボリュームグループの作成

一方のノードでボリュームグループを作成します。

vgscreate fc_vg /dev/sdb
vgs
root@d-1697:~# vgcreate fc_vg /dev/sdb
  Volume group "fc_vg" successfully created
root@d-1697:~# vgs
  VG    #PV #LV #SN Attr   VSize    VFree
  fc_vg   1   0   0 wz--n- <200.00g <200.00g
  pve     1   3   0 wz--n- <464.76g   16.00g

ボリュームグループを反映

他方のノードで、ボリュームグループを反映します。
pvscan, vgscan を実行して反映されるまで 1 分程度時間がかかりました。
以前試みた際には、原因不明ですが、この時点で pvs, vgs に反映されませんでした。

root@d-1698:~# pvscan
  PV /dev/sdb    VG fc_vg           lvm2 [<200.00 GiB / <200.00 GiB free]
  PV /dev/sda3   VG pve             lvm2 [<464.76 GiB / 16.00 GiB free]
  Total: 2 [664.75 GiB] / in use: 2 [664.75 GiB] / in no VG: 0 [0   ]
root@d-1698:~# vgscan
  Found volume group "fc_vg" using metadata type lvm2
  Found volume group "pve" using metadata type lvm2
root@d-1698:~# vgchange -ay
  0 logical volume(s) in volume group "fc_vg" now active
  3 logical volume(s) in volume group "pve" now active
root@d-1698:~# pvs
  PV         VG    Fmt  Attr PSize    PFree
  /dev/sda3  pve   lvm2 a--  <464.76g   16.00g
  /dev/sdb   fc_vg lvm2 a--  <200.00g <200.00g
root@d-1698:~# vgs
  VG    #PV #LV #SN Attr   VSize    VFree
  fc_vg   1   0   0 wz--n- <200.00g <200.00g
  pve     1   3   0 wz--n- <464.76g   16.00g

3. Proxmox にLVMを登録

ProxmoxのWeb UIから、

  1. DatacenterStorage
  2. AddLVM を選択
  3. 以下の設定を入力:
    • ID: fc_lvm
    • ベースストレージ: デフォルトのまま
    • ボリュームグループ: fc_vg
    • 共有済み: チェックを入れる

image.png
image.png

結果として、両方のノードに fc_lvm が追加されました。
image.png

4. OS インストール

fc_lvm に OS をインストールします。

image.png
image.png

5. マイグレーション

fc_lvm にインストールした VM をマイグレーションしてみます。

Web UI からマイグレーション

WebUI からマイグレートを実行します。

image.png

以下の通り成功しました。

Task viewer: VM 100 - マイグレート (d-1697 ---> d-1698)
 
2025-03-01 14:08:04 starting migration of VM 100 to node 'd-1698' (192.168.11.98)
2025-03-01 14:08:04 starting VM 100 on remote node 'd-1698'
2025-03-01 14:08:07 start remote tunnel
2025-03-01 14:08:08 ssh tunnel ver 1
2025-03-01 14:08:08 starting online/live migration on unix:/run/qemu-server/100.migrate
2025-03-01 14:08:08 set migration capabilities
2025-03-01 14:08:08 migration downtime limit: 100 ms
2025-03-01 14:08:08 migration cachesize: 256.0 MiB
2025-03-01 14:08:08 set migration parameters
2025-03-01 14:08:08 start migrate command to unix:/run/qemu-server/100.migrate
2025-03-01 14:08:09 migration active, transferred 105.9 MiB of 2.0 GiB VM-state, 113.7 MiB/s
2025-03-01 14:08:10 migration active, transferred 218.4 MiB of 2.0 GiB VM-state, 113.7 MiB/s
2025-03-01 14:08:11 migration active, transferred 330.4 MiB of 2.0 GiB VM-state, 111.4 MiB/s
2025-03-01 14:08:12 migration active, transferred 443.4 MiB of 2.0 GiB VM-state, 136.4 MiB/s
2025-03-01 14:08:13 migration active, transferred 555.5 MiB of 2.0 GiB VM-state, 112.7 MiB/s
2025-03-01 14:08:14 migration active, transferred 667.4 MiB of 2.0 GiB VM-state, 113.7 MiB/s
2025-03-01 14:08:15 migration active, transferred 780.3 MiB of 2.0 GiB VM-state, 113.7 MiB/s
2025-03-01 14:08:16 migration active, transferred 894.1 MiB of 2.0 GiB VM-state, 118.2 MiB/s
2025-03-01 14:08:17 migration active, transferred 1006.7 MiB of 2.0 GiB VM-state, 114.8 MiB/s
2025-03-01 14:08:18 migration active, transferred 1.1 GiB of 2.0 GiB VM-state, 135.2 MiB/s
2025-03-01 14:08:19 migration active, transferred 1.2 GiB of 2.0 GiB VM-state, 111.7 MiB/s
2025-03-01 14:08:20 migration active, transferred 1.3 GiB of 2.0 GiB VM-state, 118.2 MiB/s
2025-03-01 14:08:21 migration active, transferred 1.4 GiB of 2.0 GiB VM-state, 111.7 MiB/s
2025-03-01 14:08:22 migration active, transferred 1.5 GiB of 2.0 GiB VM-state, 113.7 MiB/s
2025-03-01 14:08:23 migration active, transferred 1.6 GiB of 2.0 GiB VM-state, 113.5 MiB/s
2025-03-01 14:08:24 migration active, transferred 1.8 GiB of 2.0 GiB VM-state, 112.7 MiB/s
2025-03-01 14:08:25 migration active, transferred 1.9 GiB of 2.0 GiB VM-state, 112.2 MiB/s
2025-03-01 14:08:26 average migration speed: 114.7 MiB/s - downtime 59 ms
2025-03-01 14:08:26 migration status: completed
2025-03-01 14:08:28 migration finished successfully (duration 00:00:24)

念のため、逆方向にもマイグレートします。

image.png

以下の通り、成功しました。

2025-03-01 14:10:21 starting migration of VM 100 to node 'd-1697' (192.168.11.97)
2025-03-01 14:10:21 starting VM 100 on remote node 'd-1697'
2025-03-01 14:10:24 start remote tunnel
2025-03-01 14:10:25 ssh tunnel ver 1
2025-03-01 14:10:25 starting online/live migration on unix:/run/qemu-server/100.migrate
2025-03-01 14:10:25 set migration capabilities
2025-03-01 14:10:25 migration downtime limit: 100 ms
2025-03-01 14:10:25 migration cachesize: 256.0 MiB
2025-03-01 14:10:25 set migration parameters
2025-03-01 14:10:25 start migrate command to unix:/run/qemu-server/100.migrate
2025-03-01 14:10:26 migration active, transferred 109.2 MiB of 2.0 GiB VM-state, 112.5 MiB/s
2025-03-01 14:10:27 migration active, transferred 221.6 MiB of 2.0 GiB VM-state, 112.7 MiB/s
2025-03-01 14:10:28 migration active, transferred 334.4 MiB of 2.0 GiB VM-state, 112.5 MiB/s
2025-03-01 14:10:29 migration active, transferred 446.6 MiB of 2.0 GiB VM-state, 135.2 MiB/s
2025-03-01 14:10:30 migration active, transferred 559.1 MiB of 2.0 GiB VM-state, 113.7 MiB/s
2025-03-01 14:10:31 migration active, transferred 671.3 MiB of 2.0 GiB VM-state, 115.8 MiB/s
2025-03-01 14:10:32 migration active, transferred 783.7 MiB of 2.0 GiB VM-state, 112.7 MiB/s
2025-03-01 14:10:33 migration active, transferred 896.0 MiB of 2.0 GiB VM-state, 166.7 MiB/s
2025-03-01 14:10:34 migration active, transferred 1008.6 MiB of 2.0 GiB VM-state, 114.8 MiB/s
2025-03-01 14:10:35 migration active, transferred 1.1 GiB of 2.0 GiB VM-state, 133.0 MiB/s
2025-03-01 14:10:36 migration active, transferred 1.2 GiB of 2.0 GiB VM-state, 113.7 MiB/s
2025-03-01 14:10:37 migration active, transferred 1.3 GiB of 2.0 GiB VM-state, 112.2 MiB/s
2025-03-01 14:10:38 migration active, transferred 1.4 GiB of 2.0 GiB VM-state, 112.2 MiB/s
2025-03-01 14:10:39 migration active, transferred 1.5 GiB of 2.0 GiB VM-state, 114.8 MiB/s
2025-03-01 14:10:40 migration active, transferred 1.6 GiB of 2.0 GiB VM-state, 111.7 MiB/s
2025-03-01 14:10:41 migration active, transferred 1.8 GiB of 2.0 GiB VM-state, 114.8 MiB/s
2025-03-01 14:10:42 migration active, transferred 1.9 GiB of 2.0 GiB VM-state, 113.3 MiB/s
2025-03-01 14:10:43 average migration speed: 114.7 MiB/s - downtime 26 ms
2025-03-01 14:10:43 migration status: completed
2025-03-01 14:10:46 migration finished successfully (duration 00:00:25)
TASK OK

マイグレート後も、仮想マシンの動作に異常は発生していませんでした。

image.png

root@d-1698:~# vgs
  VG    #PV #LV #SN Attr   VSize    VFree
  fc_vg   1   1   0 wz--n- <200.00g <168.00g
  pve     1   3   0 wz--n- <464.76g   16.00g
root@d-1698:~# pvs
  PV         VG    Fmt  Attr PSize    PFree
  /dev/sda3  pve   lvm2 a--  <464.76g   16.00g
  /dev/sdb   fc_vg lvm2 a--  <200.00g <168.00g
root@d-1698:~# lvs
  LV            VG    Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  vm-100-disk-0 fc_vg -wi-------  32.00g
  data          pve   twi-a-tz-- 338.27g             0.00   0.50
  root          pve   -wi-ao----  96.00g
  swap          pve   -wi-ao----   7.58g
root@d-1697:~# vgs
  VG    #PV #LV #SN Attr   VSize    VFree
  fc_vg   1   1   0 wz--n- <200.00g <168.00g
  pve     1   3   0 wz--n- <464.76g   16.00g
root@d-1697:~# pvs
  PV         VG    Fmt  Attr PSize    PFree
  /dev/sda3  pve   lvm2 a--  <464.76g   16.00g
  /dev/sdb   fc_vg lvm2 a--  <200.00g <168.00g
root@d-1697:~# lvs
  LV            VG    Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  vm-100-disk-0 fc_vg -wi-ao----  32.00g
  data          pve   twi-a-tz-- 338.27g             0.00   0.50
  root          pve   -wi-ao----  96.00g
  swap          pve   -wi-ao----   7.58g

まとめ

クラスタ構成の Proxmox において、FC-SAN ストレージを共有ストレージとして利用出来ることが確認できました。以前同じ確認を行った際には、他方のノードで pv, vg が参照出来なかった事象は今後要確認であると思いますが、まずは動きました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?