OpenStack手动迁移虚拟机

OpenStack手动迁移虚拟机

嚯嚯嚯www 59 2022-08-26

67429-drej4zxvewt.png
虚拟机实例目录进行转移

先将test虚拟机关机,然后将虚拟机目录整个移动到controller节点的/var/lib/nova/instances/目录下
[root@controller instances]# scp -r 2b8e5098-949d-48c2-8612-fdf39298d4ff/ root@
10.0.0.17:/var/lib/nova/instances/
[root@controller instances]# rm -rf 2b8e5098-949d-48c2-8612-fdf39298d4ff/
[root@compute instances]# chown nova:nova 2b8e5098-949d-48c2-8612-fdf39298d4ff/

修改数据库文件内容

[root@controller instances]# mysql -uroot -p000000
MariaDB [(none)]> use nova;
MariaDB [nova]> update instances set host='compute' ,node='compute' where uuid=
'2b8e5098-949d-48c2-8612-fdf39298d4ff';

验证

[root@controller instances]# nova list
[root@controller instances]# nova show vm1