LVMスナップショットをコピーして同期することでXENVMをバックアップしたいと思います。 XENゲストの仮想ディスク(ext4)を含むスナップショットをマウントしようとしています。
以下は私が従うすべてのステップです。スナップショットをマウントできず、パーティションテーブルがないようです。
既存のボリュームグループは「VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a」のみです。
バックアップしようとしている仮想ディスクは、「/ dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/VHD-8c8064d2-0101-46d4-b1e5-607ad4a92621」です。
スナップショットLVの名前は「vmbackup」です。
Xenホストのmountコマンドのマニュアルページに、ext4がサポートされていると表示されません。したがって、ext3ディスクで同じテストを行いましたが、同じ結果が得られました。
[root@ ~]# vgdisplay
--- Volume group ---
VG Name VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 76
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 4
Open LV 3
Max PV 0
Cur PV 1
Act PV 1
VG Size 1.08 TB
PE Size 4.00 MB
Total PE 283852
Alloc PE / Size 5258 / 20.54 GB
Free PE / Size 278594 / 1.06 TB
VG UUID n4NO4a-fLFT-GCO0-PSye-oW06-UWYP-qryubC
[root@ ~]# lvdisplay
--- Logical volume ---
LV Name /dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/MGT
VG Name VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a
LV UUID uBsbF7-2O3B-S3S2-7t5M-wSCt-b8qu-2AufzM
LV Write Access read/write
LV Status available
# open 0
LV Size 4.00 MB
Current LE 1
Segments 1
Allocation inherit
Read ahead sectors auto
currently set to 1024
Block device 252:1
--- Logical volume ---
LV Name /dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-
438139457a4a/ISORepository
VG Name VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a
LV UUID Bw8KcC-vexj-WEHx-W3dh-lo8b-UpGu-y7qWB4
LV Write Access read/write
LV Status available
# open 1
LV Size 10.00 GB
Current LE 2560
Segments 1
Allocation inherit
Read ahead sectors auto
currently set to 1024
Block device 252:0
--- Logical volume ---
LV Name /dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/VHD-
8c8064d2-0101-46d4-b1e5-607ad4a92621
VG Name VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a
LV UUID rCtzAA-VFUZ-tHLP-oJ1D-EHtR-ilXW-RcXwFg
LV Write Access read/write
LV Status available
# open 1
LV Size 10.03 GB
Current LE 2567
Segments 1
Allocation inherit
Read ahead sectors auto
currently set to 1024
Block device 252:2
--- Logical volume ---
LV Name /dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/VHD-b1f9c38a-042e-4589-8ec5-6389aac8ee4d
VG Name VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a
LV UUID 1Ks1pR-MSbr-U4Q4-bq2T-Py2d-HtUX-0PZnbu
LV Write Access read/write
LV Status available
# open 1
LV Size 520.00 MB
Current LE 130
Segments 1
Allocation inherit
Read ahead sectors auto
currently set to 1024
Block device 252:3
[root@ ~]# lvcreate -L1G -s -n vmbackup /dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/VHD-8c8064d2-0101-46d4-b1e5-607ad4a92621
Logical volume "vmbackup" created
[root@ ~]# lvscan
ACTIVE '/dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/MGT' [4.00 MB] inherit
ACTIVE '/dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/ISORepository' [10.00 GB] inherit
ACTIVE Original '/dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/VHD-8c8064d2-0101-46d4-b1e5-607ad4a92621' [10.03 GB] inherit
ACTIVE '/dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/VHD-b1f9c38a-042e-4589-8ec5-6389aac8ee4d' [520.00 MB] inherit
ACTIVE Snapshot '/dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/vmbackup' [1.00 GB] inherit
[root@ ~]# kpartx -a -v /dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/vmbackup
[root@ ~]# ls /dev/mapper/
control
VG_XenStorage--2be5fe38--c04b--3277--4ce0--438139457a4a-VHD--8c8064d2--0101--46d4--b1e5--607ad4a92621-real
VG_XenStorage--2be5fe38--c04b--3277--4ce0--438139457a4a-ISORepository
VG_XenStorage--2be5fe38--c04b--3277--4ce0--438139457a4a-VHD--b1f9c38a--042e--4589--8ec5--6389aac8ee4d
VG_XenStorage--2be5fe38--c04b--3277--4ce0--438139457a4a-MGT
VG_XenStorage--2be5fe38--c04b--3277--4ce0--438139457a4a-vmbackup
VG_XenStorage--2be5fe38--c04b--3277--4ce0--438139457a4a-VHD--8c8064d2--0101--46d4--b1e5--607ad4a92621 VG_XenStorage--2be5fe38--c04b--3277--4ce0--438139457a4a-vmbackup-cow
[root@ ~]# mount /dev/mapper/VG_XenStorage--2be5fe38--c04b--3277--4ce0--438139457a4a-vmbackup /mnt
mount: you must specify the filesystem type
[root@ ~]# mount VG_XenStorage--2be5fe38--c04b--3277--4ce0--438139457a4a-vmbackup-cow /mnt
mount: you must specify the filesystem type
[root@ ~]# dmesg | tail
[1531258.118928] device vif7.0 entered promiscuous mode
[1531258.515365] blkback: event-channel 8
[1531258.515551] blkback: ring-ref 8
[1531258.515742] blkback: protocol 3 (x86_64-abi)
[1531258.517356] blkback: event-channel 9
[1531258.517446] blkback: ring-ref 9
[1531258.517480] blkback: protocol 3 (x86_64-abi)
[1531258.521059] /local/domain/7/device/vif/0: Connected
[1531265.156744] /local/domain/7/device/vif/0: Connected
[1531265.157147] /local/domain/7/device/vif/0: Closed
[root@ ~]# mount -t ext4 /dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/vmbackup /mnt
mount: wrong fs type, bad option, bad superblock on /dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/vmbackup,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
[root@ ~]# dmesg | tail
[1531258.515365] blkback: event-channel 8
[1531258.515551] blkback: ring-ref 8
[1531258.515742] blkback: protocol 3 (x86_64-abi)
[1531258.517356] blkback: event-channel 9
[1531258.517446] blkback: ring-ref 9
[1531258.517480] blkback: protocol 3 (x86_64-abi)
[1531258.521059] /local/domain/7/device/vif/0: Connected
[1531265.156744] /local/domain/7/device/vif/0: Connected
[1531265.157147] /local/domain/7/device/vif/0: Closed
[1534417.547412] EXT4-fs (dm-4): VFS: Can't find ext4 filesystem
[root@ ~]# fdisk -l /dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/vmbackup
Disk /dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/vmbackup: 10.7 GB, 10766778368 bytes
255 heads, 63 sectors/track, 1308 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/vmbackup doesn't contain a valid partition table
[root@ ~]# fdisk -l /dev/mapper/VG_XenStorage--2be5fe38--c04b--3277--4ce0--438139457a4a-vmbackup-cow
Disk /dev/mapper/VG_XenStorage--2be5fe38--c04b--3277--4ce0--438139457a4a-vmbackup-cow: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/mapper/VG_XenStorage--2be5fe38--c04b--3277--4ce0--438139457a4a-vmbackup-cow doesn't contain a valid partition table
[root@ ~]# lsmod | grep ext4
ext4 312546 0
jbd2 75354 1 ext4
これが私が従うステップの要約です:
lvcreate -L1G -s -n vmbackup/dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/VHD-8c8064d2-0101-46d4-b1e5-607ad4a92621
kpartx -a -v/dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/vmbackup
マウント/ dev/VG_XenStorage-2be5fe38-c04b-3277-4ce0-438139457a4a/vmbackup/mntマウント:ファイルシステムタイプを指定する必要があります
最後に、次のコマンドに基づいてスクリプトを作成しました。
xe vm-list is-control-domain = false is-a-snapshot = false
xevm-リスト内のVMのスナップショット
xe template-param-set is-a-template = false ha-always-run = false uuid = .. ..
xe vm-export vm = snap_uuid filename = | ssh ... REMOTE_Host "cat> /path/backup.xva"
xe vm-uuid = snap_uuid force = trueをアンインストールします
アドバイスありがとうございます。