Openstack nova 冷迁移在 rocky 9 上因 sftp 子系统错误而失败

Openstack nova 冷迁移在 rocky 9 上因 sftp 子系统错误而失败

我已经在 2 台 rocky linux 9.1 机器上使用 kolla ansible(按照 openstack 部署指南进行部署)部署了 OpenStack 的多节点部署。尝试在节点之间迁移一个实例时,它会失败并且实例进入错误状态。我在日志中收到以下错误:

2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server   File "/var/lib/kolla/venv/lib/python3.9/site-packages/nova/virt/libvirt/driver.py", line 11467, in migrate_disk_and_power_off
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server     self._cleanup_remote_migration(dest, inst_base,
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server   File "/var/lib/kolla/venv/lib/python3.9/site-packages/oslo_utils/excutils.py", line 227, in __exit__
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server     self.force_reraise()
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server   File "/var/lib/kolla/venv/lib/python3.9/site-packages/oslo_utils/excutils.py", line 200, in force_reraise
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server     raise self.value
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server   File "/var/lib/kolla/venv/lib/python3.9/site-packages/nova/virt/libvirt/driver.py", line 11445, in migrate_disk_and_power_off
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server     libvirt_utils.copy_image(from_path, img_path, host=dest,
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server   File "/var/lib/kolla/venv/lib/python3.9/site-packages/nova/virt/libvirt/utils.py", line 243, in copy_image
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server     remote_filesystem_driver.copy_file(src, dest,
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server   File "/var/lib/kolla/venv/lib/python3.9/site-packages/nova/virt/libvirt/volume/remotefs.py", line 104, in copy_file
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server     self.driver.copy_file(src, dst, on_execute=on_execute,
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server   File "/var/lib/kolla/venv/lib/python3.9/site-packages/nova/virt/libvirt/volume/remotefs.py", line 196, in copy_file
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server     processutils.execute(
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server   File "/var/lib/kolla/venv/lib/python3.9/site-packages/oslo_concurrency/processutils.py", line 438, in execute
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server     raise ProcessExecutionError(exit_code=_returncode,
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server oslo_concurrency.processutils.ProcessExecutionError: Unexpected error while running command.
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server Command: scp -r /var/lib/nova/instances/d043223f-ab70-4f55-bd2b-897768681094_resize/disk 10.0.102.1:/var/lib/nova/instances/d043223f-ab70-4f55-bd2b-897768681094/disk
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server Exit code: 255
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server Stdout: ''
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server Stderr: "Warning: Permanently added '[10.0.102.1]:8022' (ED25519) to the list of known hosts.\r\nsubsystem request failed on channel 0\r\nConnection closed\r\n"
2023-01-30 14:52:49.767 7 ERROR oslo_messaging.rpc.server

我的假设是服务器和客户端之间存在一些不匹配,一个使用传统的 scp,另一个使用 sftp,但我不确定如何纠正这个问题。

答案1

追加

Subsystem       sftp    /usr/libexec/openssh/sftp-server

/etc/kolla/nova-ssh/sshd_config重新启动 nova_ssh 容器即可解决这个问题。

相关内容