-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2fb2f4
commit 35a75fc
Showing
18 changed files
with
231 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
source/ceph/rbd/ceph_extend_rbd_drive_with_libvirt_xfs/migrate_containerd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# 原始目录重命名,创建空目录方便后在运行主机挂载 /dev/vdb1 | ||
mv /vdb2/var/lib/containerd /vdb2/var/lib/containerd.old | ||
mkdir /vdb2/var/lib/containerd | ||
|
||
# 使用 tar 命令同步数据 | ||
# (cd /vdb2/var/lib/containerd.old && tar cf .)|(cd /vdc1 && tar xf -) | ||
|
||
#使用 rsync 同步数据 | ||
rsync -a /vdb2/var/lib/containerd.old/ /vdc1 | ||
|
3 changes: 3 additions & 0 deletions
3
source/ceph/rbd/ceph_extend_rbd_drive_with_libvirt_xfs/mount_vdb_vdc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mkdir /vdb2 /vdc1 | ||
mount /dev/vdb2 /vdb2 | ||
mount /dev/vdc1 /vdc1 |
26 changes: 26 additions & 0 deletions
26
source/ceph/rbd/ceph_extend_rbd_drive_with_libvirt_xfs/rbd.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<disk type='network' device='disk'> | ||
<driver name='qemu' type='raw' cache='none' io='native'/> | ||
<auth username='libvirt'> | ||
<secret type='ceph' uuid='3f203352-fcfc-4329-b870-34783e13493a'/> | ||
</auth> | ||
<source protocol='rbd' name='libvirt-pool/z-k8s-n-9'> | ||
<host name='192.168.6.204' port='6789'/> | ||
<host name='192.168.6.205' port='6789'/> | ||
<host name='192.168.6.206' port='6789'/> | ||
</source> | ||
<target dev='vda' bus='virtio'/> | ||
<address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> | ||
</disk> | ||
<disk type='network' device='disk'> | ||
<driver name='qemu' type='raw' cache='none' io='native'/> | ||
<auth username='libvirt'> | ||
<secret type='ceph' uuid='3f203352-fcfc-4329-b870-34783e13493a'/> | ||
</auth> | ||
<source protocol='rbd' name='libvirt-pool/z-k8s-n-9.docker'> | ||
<host name='192.168.6.204' port='6789'/> | ||
<host name='192.168.6.205' port='6789'/> | ||
<host name='192.168.6.206' port='6789'/> | ||
</source> | ||
<target dev='vdb' bus='virtio'/> | ||
<address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/> | ||
</disk> |
4 changes: 4 additions & 0 deletions
4
source/ceph/rbd/ceph_extend_rbd_drive_with_libvirt_xfs/rbd_ls_output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
NAME SIZE PARENT FMT PROT LOCK | ||
... | ||
z-k8s-n-9 32 GiB 2 | ||
z-k8s-n-9.docker 50 GiB 2 |
2 changes: 2 additions & 0 deletions
2
source/ceph/rbd/ceph_extend_rbd_drive_with_libvirt_xfs/rbd_resize_virsh_blockresize_100g
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
rbd resize --size 102400 libvirt-pool/z-k8s-n-9.docker | ||
virsh blockresize --domain z-dev --path vdc --size 100G |
21 changes: 21 additions & 0 deletions
21
source/ceph/rbd/ceph_extend_rbd_drive_with_libvirt_xfs/vdb_vdc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Disk /dev/vdb: 32 GiB, 34359738368 bytes, 67108864 sectors | ||
Units: sectors of 1 * 512 = 512 bytes | ||
Sector size (logical/physical): 512 bytes / 512 bytes | ||
I/O size (minimum/optimal): 512 bytes / 512 bytes | ||
Disklabel type: gpt | ||
Disk identifier: D9ADB788-0FE1-45C3-80C5-B412A3C4AB19 | ||
|
||
Device Start End Sectors Size Type | ||
/dev/vdb1 2048 499711 497664 243M EFI System | ||
/dev/vdb2 499712 67108830 66609119 31.8G Linux filesystem | ||
|
||
|
||
Disk /dev/vdc: 50 GiB, 53687091200 bytes, 104857600 sectors | ||
Units: sectors of 1 * 512 = 512 bytes | ||
Sector size (logical/physical): 512 bytes / 512 bytes | ||
I/O size (minimum/optimal): 512 bytes / 512 bytes | ||
Disklabel type: gpt | ||
Disk identifier: 7B582F7C-AC2D-4D04-B600-35743C17BD96 | ||
|
||
Device Start End Sectors Size Type | ||
/dev/vdc1 2048 104857566 104855519 50G Linux filesystem |
9 changes: 9 additions & 0 deletions
9
source/ceph/rbd/ceph_extend_rbd_drive_with_libvirt_xfs/vdc_100g
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Disk /dev/vdc: 100 GiB, 107374182400 bytes, 209715200 sectors | ||
Units: sectors of 1 * 512 = 512 bytes | ||
Sector size (logical/physical): 512 bytes / 512 bytes | ||
I/O size (minimum/optimal): 512 bytes / 512 bytes | ||
Disklabel type: gpt | ||
Disk identifier: 7B582F7C-AC2D-4D04-B600-35743C17BD96 | ||
|
||
Device Start End Sectors Size Type | ||
/dev/vdc1 2048 104857566 104855519 50G Linux filesystem |
4 changes: 4 additions & 0 deletions
4
source/ceph/rbd/ceph_extend_rbd_drive_with_libvirt_xfs/vdc_xfs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
parted -s /dev/vdc mklabel gpt | ||
parted -s -a optimal /dev/vdc mkpart primary 0% 100% | ||
parted -s /dev/vdc name 1 data | ||
mkfs.xfs -n ftype=1 /dev/vdc1 -f |
6 changes: 6 additions & 0 deletions
6
source/ceph/rbd/ceph_extend_rbd_drive_with_libvirt_xfs/z-dev_vda.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<disk type='block' device='disk'> | ||
<driver name='qemu' type='raw' cache='none' io='native'/> | ||
<source dev='/dev/vg-libvirt/z-dev'/> | ||
<target dev='vda' bus='virtio'/> | ||
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> | ||
</disk> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ kubelet 使用各种参数来做出驱逐决定: | |
- 监控间隔 | ||
|
||
|
||
|
||
参考 | ||
====== | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
.. _qemu_vfio_connect_timeout: | ||
|
||
========================== | ||
虚拟机启动访问vfio设备超时 | ||
========================== | ||
|
||
今天在解决 :ref:`ceph_extend_rbd_drive_with_libvirt_xfs` 采用了将两个 :ref:`ceph_rbd` 设备连接到另外一个用于维护的虚拟机中处理磁盘扩容。但是,非常意外地发现,当我关闭了维护的虚拟机 ``z-dev`` 之后,想要恢复原先使用 :ref:`ceph_rbd` 的 ``y-k8s-n-1`` 却出现vfio设备连接超时: | ||
|
||
.. literalinclude:: qemu_vfio_connect_timeout/vfio_used_error | ||
:caption: 启动虚拟机时vfio设备报告已被使用,连接超时 | ||
|
||
这里的报错繁忙设备 ``3eb9d560-0b31-11ee-91a9-bb28039c61eb`` 在 ``virsh dumpxml y-k8s-n-1`` 可以看到其实就是 :ref:`vgpu_quickstart` 配置的2个 :ref:`vgpu` 设置之一: | ||
|
||
.. literalinclude:: ../vgpu/vgpu_quickstart/vgpu_create_output_1 | ||
:language: bash | ||
:caption: 执行 ``vgpu_create`` 脚本创建2个 ``P40-12C`` :ref:`vgpu` 输出信息第 **一** 个vgpu设备 | ||
|
||
这是一个 ``mdev`` 设备 ( `VFIO Mediated devices <https://docs.kernel.org/driver-api/vfio-mediated-device.html>`_ 设备) | ||
|
||
回顾 :ref:`install_vgpu_manager` 笔记可以看到,需要首先确保 ``nvidia-vgpu-mgr.service`` 正常运行,也就是说,必须先 :ref:`vgpu_unlock` | ||
|
||
- 检查 ``nvidia-vgpu-mgr.service`` 状态: | ||
|
||
.. literalinclude:: ../vgpu/install_vgpu_manager/systemctl_staus_nvidia-vgpu-mgr | ||
:language: bash | ||
:caption: 检查 ``nvidia-vgpu-mgr`` 服务状态 | ||
|
||
果然,再次发现这个服务启动失败...回到了老问题: :ref:`vgpu_unlock` 失效了: | ||
|
||
查询 ``vgpu`` : | ||
|
||
.. literalinclude:: ../vgpu/install_vgpu_manager/nvidia-smi_vgpu_q | ||
:language: bash | ||
:caption: ``nvidia-smi vgpu -q`` 查询vGPU | ||
|
||
输出显示只激活了 ``0`` 个vGPU: | ||
|
||
.. literalinclude:: ../vgpu/install_vgpu_manager/nvidia-smi_vgpu_q_output | ||
:language: bash | ||
:caption: ``nvidia-smi vgpu -q`` 查询vGPU显示只有 ``0`` 个vGPU | ||
|
||
我想起来了, :ref:`vgpu_unlock` 需要使用 :ref:`dkms` 模块方式安装 :ref:`vgpu` 驱动。最近依次我升级了内核,内核升级时会重新编译安装 :ref:`vgpu` 模块。我重新检查一遍流程,发现原先修订的过程都正确,但是会不会最近升级的内核支持不稳定呢? | ||
|
||
我重新编译了一次 :ref:`vgpu_unlock` (似乎不必),重启服务器 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
error: Failed to start domain 'y-k8s-n-1' | ||
error: internal error: qemu unexpectedly closed the monitor: 2023-08-31T13:35:04.132854Z qemu-system-x86_64: | ||
-device vfio-pci,id=hostdev0,sysfsdev=/sys/bus/mdev/devices/3eb9d560-0b31-11ee-91a9-bb28039c61eb,display=off,bus=pci.7,addr=0x0: | ||
vfio 3eb9d560-0b31-11ee-91a9-bb28039c61eb: error getting device from group 123: Connection timed out | ||
Verify all devices in group 123 are bound to vfio-<bus> or pci-stub and not already in use |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<hostdev mode='subsystem' type='mdev' managed='no' model='vfio-pci' display='off'> | ||
<source> | ||
<address uuid='3eb9d718-0b31-11ee-91aa-2b17f51ee12d'/> | ||
</source> | ||
</hostdev> |